@highstate/designer 0.32.0 → 0.32.1

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 (120) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Xz3NF3WC.js → 05ZAo7fc.js} +1 -1
  3. package/.output/public/_nuxt/{CTkO6yS9.js → 2oj-U4iW.js} +1 -1
  4. package/.output/public/_nuxt/{C1-5g_Qv.js → 4ixytvLV.js} +1 -1
  5. package/.output/public/_nuxt/{CpjRFk6R.js → 96kQTf02.js} +1 -1
  6. package/.output/public/_nuxt/{DW3fpWuG.js → AP6ofMIl.js} +1 -1
  7. package/.output/public/_nuxt/{DzV7Jf8P.js → B4sso3Qi.js} +1 -1
  8. package/.output/public/_nuxt/{BPg7RDKJ.js → B8VZ6lPX.js} +1 -1
  9. package/.output/public/_nuxt/{ClSYLg4N.js → B8qYOkTO.js} +1 -1
  10. package/.output/public/_nuxt/{DYYv6Ju9.js → B8vRdJsS.js} +2 -2
  11. package/.output/public/_nuxt/{xdCyoE2x.js → BDRUMjWC.js} +1 -1
  12. package/.output/public/_nuxt/{DL1q6e3k.js → BDVLqVNl.js} +1 -1
  13. package/.output/public/_nuxt/{2ClViFgn.js → BF5H4dkt.js} +1 -1
  14. package/.output/public/_nuxt/{CxZgR8Mt.js → BFQPTP7z.js} +1 -1
  15. package/.output/public/_nuxt/{Ceck2_WG.js → BLNFaWRI.js} +1 -1
  16. package/.output/public/_nuxt/{Bb6QHRP-.js → BOKdp5uy.js} +1 -1
  17. package/.output/public/_nuxt/{CpbCkvPA.js → BQIuX-e8.js} +1 -1
  18. package/.output/public/_nuxt/{JCFuFBLB.js → BQn8TCpH.js} +1 -1
  19. package/.output/public/_nuxt/{D_YMaTD5.js → BR3j6sCq.js} +1 -1
  20. package/.output/public/_nuxt/{BF8a0XlF.js → BSDyDOUh.js} +1 -1
  21. package/.output/public/_nuxt/{D8dRU7nl.js → BUkiEZRS.js} +1 -1
  22. package/.output/public/_nuxt/{SZAmo-8w.js → BXMmAs0F.js} +1 -1
  23. package/.output/public/_nuxt/{DKOmQMkq.js → BZlwst7p.js} +1 -1
  24. package/.output/public/_nuxt/{DdtyE3Y5.js → B_-SqyPD.js} +1 -1
  25. package/.output/public/_nuxt/BhmLCeSc.js +14 -0
  26. package/.output/public/_nuxt/{BCQh32s5.js → Bme3Qqko.js} +1 -1
  27. package/.output/public/_nuxt/{n-szFsmh.js → BoU8AaDx.js} +1 -1
  28. package/.output/public/_nuxt/{DnNOOTKY.js → BrqPQtBH.js} +1 -1
  29. package/.output/public/_nuxt/{D0M3xEzp.js → Bsi7mtxo.js} +1 -1
  30. package/.output/public/_nuxt/{BG32vSW8.js → BtRiCtf6.js} +1 -1
  31. package/.output/public/_nuxt/{CoGQaz8N.js → BtaKz0Mo.js} +1 -1
  32. package/.output/public/_nuxt/{Dc-PHGbi.js → Btq1JU4p.js} +1 -1
  33. package/.output/public/_nuxt/{BjuaAObh.js → Bwb67i0N.js} +1 -1
  34. package/.output/public/_nuxt/BzjID9Cq.js +1 -0
  35. package/.output/public/_nuxt/{CiQ26sNy.js → C1l91at_.js} +1 -1
  36. package/.output/public/_nuxt/{BMvFv6jI.js → C2bV0W-5.js} +1 -1
  37. package/.output/public/_nuxt/{DttQ70UV.js → C3NuDuKi.js} +1 -1
  38. package/.output/public/_nuxt/{Bs-wwfdd.js → C4dTL9FW.js} +1 -1
  39. package/.output/public/_nuxt/{Dk9bQRO2.js → CD9IZzyL.js} +1 -1
  40. package/.output/public/_nuxt/{WGzqBhEG.js → CFZqHRXm.js} +1 -1
  41. package/.output/public/_nuxt/{DOPHuNj2.js → CGlo_kMv.js} +1 -1
  42. package/.output/public/_nuxt/{Dl8wxmO8.js → CITemtQf.js} +1 -1
  43. package/.output/public/_nuxt/{DVHc-zO_.js → CMJSUK-H.js} +1 -1
  44. package/.output/public/_nuxt/{G0qolO8B.js → CNZHVYcD.js} +1 -1
  45. package/.output/public/_nuxt/{zfwnkxT3.js → CQAev7YK.js} +1 -1
  46. package/.output/public/_nuxt/{BOtKQbTN.js → CWuIhYUV.js} +1 -1
  47. package/.output/public/_nuxt/{DORBRPXG.js → CXpmtNyA.js} +1 -1
  48. package/.output/public/_nuxt/{CtguGxHp.js → CegcRqck.js} +1 -1
  49. package/.output/public/_nuxt/{sOT1GCi-.js → Ch2Gy_Jq.js} +1 -1
  50. package/.output/public/_nuxt/{C92v3IW9.js → Ch6YNyRb.js} +1 -1
  51. package/.output/public/_nuxt/{igN4Qe67.js → CltdJCW3.js} +1 -1
  52. package/.output/public/_nuxt/{ftQbM3fg.js → Cn9OSQgD.js} +1 -1
  53. package/.output/public/_nuxt/{3qWXgFCD.js → Co6lpfLf.js} +1 -1
  54. package/.output/public/_nuxt/{DSSkXANV.js → CqPpACsD.js} +1 -1
  55. package/.output/public/_nuxt/{CTDKJDhG.js → CrE5okCm.js} +1 -1
  56. package/.output/public/_nuxt/{Dw4Cg7Nf.js → CrOrgbVb.js} +1 -1
  57. package/.output/public/_nuxt/{ooX9n-54.js → Cuw2bLWd.js} +1 -1
  58. package/.output/public/_nuxt/{C-RMEQ9Z.js → CwMykgI6.js} +1 -1
  59. package/.output/public/_nuxt/{BRO81Gh9.js → D-Kh5EX5.js} +1 -1
  60. package/.output/public/_nuxt/{ix1dx0up.js → D50quJR4.js} +1 -1
  61. package/.output/public/_nuxt/{jzdHQpVv.js → D6GHI16b.js} +1 -1
  62. package/.output/public/_nuxt/{DMTt8zZn.js → D6PbEaHW.js} +1 -1
  63. package/.output/public/_nuxt/{IQBJjCG8.js → DBje7PVL.js} +1 -1
  64. package/.output/public/_nuxt/{Cn9bba5D.js → DDKV2N_x.js} +1 -1
  65. package/.output/public/_nuxt/{DZSueAzq.js → DGoEMI0x.js} +1 -1
  66. package/.output/public/_nuxt/{cgHfLQv-.js → DMbE9tLB.js} +1 -1
  67. package/.output/public/_nuxt/{c2EdAFRI.js → DOO3m68g.js} +1 -1
  68. package/.output/public/_nuxt/{C4MBnvUO.js → DR2GUCqH.js} +1 -1
  69. package/.output/public/_nuxt/{D6DrLYm7.js → DU-GKTYY.js} +1 -1
  70. package/.output/public/_nuxt/{B4j9HAJX.js → DWbGXq4Q.js} +1 -1
  71. package/.output/public/_nuxt/{CtVqDXHG.js → DWqRK0NR.js} +1 -1
  72. package/.output/public/_nuxt/{BthfZtMx.js → DYMAo4nl.js} +1 -1
  73. package/.output/public/_nuxt/{YBDYc8lc.js → D_mxv-NW.js} +1 -1
  74. package/.output/public/_nuxt/{CYaxpVzZ.js → Dcdtlnln.js} +1 -1
  75. package/.output/public/_nuxt/{CsuxycK3.js → DfKsQ0_h.js} +1 -1
  76. package/.output/public/_nuxt/{DSJf9dJs.js → Dkt4PhLY.js} +69 -69
  77. package/.output/public/_nuxt/{BQhkXItu.js → DnXR4SG8.js} +1 -1
  78. package/.output/public/_nuxt/{BqXMlJ7D.js → DnmYE2hf.js} +1 -1
  79. package/.output/public/_nuxt/DrEWV2WJ.js +1 -0
  80. package/.output/public/_nuxt/{COEP9Jq2.js → Duykt1dX.js} +1 -1
  81. package/.output/public/_nuxt/{1p9U4j8j.js → DvOzJv-i.js} +1 -1
  82. package/.output/public/_nuxt/{CvXF1v08.js → DxIPlWEU.js} +1 -1
  83. package/.output/public/_nuxt/{jp5CTwjY.js → DxxzwePY.js} +1 -1
  84. package/.output/public/_nuxt/{BWPqy388.js → EmGx9W_F.js} +1 -1
  85. package/.output/public/_nuxt/{_WIkkhJ8.js → K3E_qicM.js} +1 -1
  86. package/.output/public/_nuxt/{CC4yodQy.js → MyTZFNw6.js} +1 -1
  87. package/.output/public/_nuxt/{C9SmO5m-.js → NNwhZZ4z.js} +1 -1
  88. package/.output/public/_nuxt/{pGWezSXB.js → RA0k-Q4I.js} +1 -1
  89. package/.output/public/_nuxt/{D_9XBU8V.js → RQ44M8RZ.js} +1 -1
  90. package/.output/public/_nuxt/{CDK5YcCn.js → ZqcSKg2e.js} +1 -1
  91. package/.output/public/_nuxt/{IQzC2XZ3.js → _3dvg993.js} +1 -1
  92. package/.output/public/_nuxt/{D_ZubeWp.js → _Sr4W3xW.js} +1 -1
  93. package/.output/public/_nuxt/{D4C51duU.js → _TRWl8-u.js} +1 -1
  94. package/.output/public/_nuxt/builds/latest.json +1 -1
  95. package/.output/public/_nuxt/builds/meta/5d3cf5e5-db2e-40bd-b427-023e7971fda6.json +1 -0
  96. package/.output/public/_nuxt/builds/meta/cc38984b-84f8-4937-af1b-13b64458d5ad.json +1 -0
  97. package/.output/public/_nuxt/builds/meta/e11bbb3c-952c-46c9-b642-72eef3ba9f20.json +1 -0
  98. package/.output/public/_nuxt/{Bql8Hogy.js → c3AKS-Ee.js} +1 -1
  99. package/.output/public/_nuxt/{Cl-cugS2.js → chz_nfvE.js} +1 -1
  100. package/.output/public/_nuxt/edge-router-CProgLJ1.js +1 -0
  101. package/.output/public/_nuxt/{entry.hgEPkmv8.css → entry.CpWDKWI4.css} +1 -1
  102. package/.output/public/_nuxt/{BlIU6Z4u.js → fILPAltm.js} +1 -1
  103. package/.output/public/_nuxt/{Be0j4D2z.js → fXN7TtPn.js} +1 -1
  104. package/.output/public/_nuxt/{CK9VabtY.js → g6XwbvFc.js} +1 -1
  105. package/.output/public/_nuxt/{h0qwTEic.js → la-p9_wj.js} +1 -1
  106. package/.output/public/_nuxt/{C7DMsgeV.js → mP3i2iAJ.js} +1 -1
  107. package/.output/public/_nuxt/{BHtmV7ym.js → pWOVCGZF.js} +1 -1
  108. package/.output/public/_nuxt/{BnTmh09t.js → rnKGjtV6.js} +1 -1
  109. package/.output/public/_nuxt/{Bawx1qcZ.js → vUjy9bZb.js} +1 -1
  110. package/.output/public/_nuxt/{CFLii-L2.js → wQOKtWNx.js} +1 -1
  111. package/.output/public/_nuxt/{BvmKIGhu.js → yrHNnoUa.js} +1 -1
  112. package/.output/public/libavoid.wasm +0 -0
  113. package/.output/server/index.mjs +1181 -1167
  114. package/.output/server/package.json +1 -1
  115. package/package.json +5 -4
  116. package/.output/public/_nuxt/5HvNzaKq.js +0 -1
  117. package/.output/public/_nuxt/DCken9xV.js +0 -14
  118. package/.output/public/_nuxt/DxJbSEBH.js +0 -1
  119. package/.output/public/_nuxt/builds/meta/2fb84624-3ce9-43ea-94fb-c5d537778bf1.json +0 -1
  120. package/.output/public/_nuxt/edge-router-BdPMCV6u.js +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/designer-prod",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@highstate/designer",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "bun scripts/dev.ts",
7
7
  "dev:server": "FORCE_COLOR=true NODE_OPTIONS=--trace-warnings nuxt dev --host | pino-pretty",
8
8
  "build": "nuxt build",
9
9
  "typecheck": "nuxt typecheck",
10
+ "test": "nuxt prepare && bun run --bun vitest --run",
10
11
  "biome": "biome check --write --unsafe --error-on-warnings app layers scripts server nuxt.config.ts --files-ignore-unknown=true",
11
12
  "biome:check": "biome check --error-on-warnings app layers scripts server nuxt.config.ts --files-ignore-unknown=true",
12
13
  "build-libavoid": "bash ./scripts/build-libavoid.sh"
@@ -96,9 +97,9 @@
96
97
  "zxcvbn-typescript": "^5.0.1"
97
98
  },
98
99
  "dependencies": {
99
- "@highstate/backend": "0.32.0",
100
- "@highstate/backend-api": "0.32.0",
101
- "@highstate/contract": "0.32.0",
100
+ "@highstate/backend": "0.32.1",
101
+ "@highstate/backend-api": "0.32.1",
102
+ "@highstate/contract": "0.32.1",
102
103
  "@paralleldrive/cuid2": "^2.2.2",
103
104
  "@prisma/internals": "^6.14.0",
104
105
  "@vue/shared": "^3.5.33",
@@ -1 +0,0 @@
1
- import{D as J,P as De,_ as be,bB as je,bC as Ae,i as pe,aR as Ve,n as ze,aI as Ge,b1 as ve,b7 as Re,bD as Ee,b8 as qe}from"#entry";import{_ as L,a as He}from"./DxJbSEBH.js";import{E as z,aG as _,V as l,Y as $,Z as we,_ as o,W as n,$ as ce,D as e,a0 as fe,aT as Te,aU as Oe,aV as ue,a8 as O,aY as ye,a as Y,aI as he,ag as R,aX as Pe,a9 as q,aJ as Ie,aK as ke,ah as re,ab as j,aO as ee,j as S,r as C,J as B,a5 as A,a6 as se,an as Fe,a3 as V,w as te,a1 as We,aW as Ye,af as de,b4 as Se,a4 as xe,ac as Me,a7 as ge,bi as Je,a_ as me,m as Ke,a2 as Qe,M as Xe,al as Ze}from"./DW3fpWuG.js";import{C as _e}from"./DnNOOTKY.js";import{I as et}from"./C9SmO5m-.js";import{P as tt}from"./igN4Qe67.js";import{I as nt,H as at}from"./DCken9xV.js";const st=[{key:"forceUpdateDependencies",label:"Force update dependencies",description:"Force update all dependencies regardless of their current state. Bypasses hash-based change detection for dependency chains.",showForOperations:["update"]},{key:"ignoreChangedDependencies",label:"Ignore changed dependencies",description:"Skip only changed dependencies. Failed or undeployed dependencies of selected instances are still included.",showForOperations:["update"]},{key:"ignoreDependencies",label:"Ignore dependencies",description:"Skip all dependencies of selected instances, including failed and undeployed prerequisites. Operate only on explicitly selected instances.",warning:"This is manual mode. The operation may fail unless every required prerequisite instance is selected explicitly.",showForOperations:["update"]},{key:"forceUpdateChildren",label:"Force update children instances",description:"Force update all children of composite instances regardless of their state. Overrides selective child inclusion logic.",showForOperations:["update"]},{key:"onlyDestroyGhosts",label:"Only destroy ghosts",description:"Skip update phase and run only ghost cleanup destroy phase for affected composite instances.",showForOperations:["update"],requiresCompositeTargets:!0},{key:"firstDestroyGhosts",label:"Destroy ghosts before update",description:"Run ghost cleanup destroy phase before update phase for affected composite instances.",showForOperations:["update"],requiresCompositeTargets:!0},{key:"ignoreGhosts",label:"Ignore ghosts",description:"Skip ghost cleanup destroy phase for update operations.",showForOperations:["update"],requiresCompositeTargets:!0},{key:"destroyDependentInstances",label:"Destroy dependent instances",description:"Include dependent instances when destroying instances. Traverses the dependency graph in reverse to prevent orphaned instances.",defaultValue:!0,showForOperations:["destroy","recreate"]},{key:"invokeDestroyTriggers",label:"Invoke destroy triggers",description:"Execute destroy triggers when destroying instances. Controls trigger execution during the destruction phase.",defaultValue:!0},{key:"deleteUnreachableResources",label:"Delete unreachable resources",description:"Delete Pulumi resources that are no longer referenced in the state. Deletes orphaned resources within individual instances.",warning:"All resources that will not be reachable at the moment of the destroy operation will be removed from the state. Only use when you are sure that these resources do not actually exist!"},{key:"forceDeleteState",label:"Force delete state",description:"Force deletion of instance state even if the destroy operation fails. Bypasses normal destroy procedures as emergency fallback.",warning:"This will delete the stack state and all resources in it even if the destroy operation failed. Use only when the stack is unrecoverable and you want to start from scratch.",showForOperations:["destroy","recreate"]},{key:"allowPartialCompositeInstanceUpdate",label:"Allow partial update of composite instances",description:"Allow update of individual composite children without requiring all siblings. When enabled, only necessary children are included.",showForOperations:["update","recreate"]},{key:"allowPartialCompositeInstanceDestruction",label:"Allow partial destruction of composite instances",description:"Allow partial destruction of composite instances during cascade operations. When enabled, cascade destruction includes only directly dependent children.",showForOperations:["destroy","recreate"]},{key:"refresh",label:"Refresh state before operation",description:"Also refresh the state of instances during the operation. Synchronizes state with actual infrastructure."},{key:"debug",label:"Enable debug logging",description:"Enable debug logging for Pulumi engine and resource providers. Sets TF_LOG=DEBUG for Terraform providers.",warning:"Debug mode may expose sensitive information including credentials in the logs. Use only when absolutely necessary for troubleshooting."}],Ue=(t,a)=>st.filter(y=>y.requiresCompositeTargets&&!a?.compositeTargetsOnly?!1:y.showForOperations?y.showForOperations.includes(t):!0),ot={class:"tree-scrollable"},it={class:"d-flex flex-column"},lt={class:"text-body-2 font-weight-regular"},rt={class:"text-caption text-medium-emphasis"},dt=z({__name:"ForgetInstanceStateDialog",props:ee({instances:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const a=_(t,"visible"),{stateStore:y,libraryStore:w}=J(),i=S(()=>t.instances.length>1),v=S(()=>t.instances[0]),r=C(!1),I=C(!1),p=C(!1),s=S(()=>t.instances.map(h=>{const g=w.library.components?.[h.type];return{id:h.id,title:g?`${g.meta.title} "${h.name}"`:`${h.type} "${h.name}"`,subtitle:h.id,icon:g?.meta.icon??"iconamoon:component",iconColor:g?.meta.iconColor}})),d=async()=>{r.value=!0;try{await y.forgetInstanceStates(t.instances.map(h=>h.id),I.value,p.value),a.value=!1}finally{r.value=!1}},c=S(()=>{if(t.instances.length===0)return"Forget state";if(!i.value){const h=v.value,g=w.library.components?.[h.type];return g?`Forget state of ${g.meta.title} "${h.name}"`:`Forget state of ${h.type} "${h.name}"`}return`Forget state of ${t.instances.length} instances`});return(h,g)=>(l(),$(we,{modelValue:a.value,"onUpdate:modelValue":g[3]||(g[3]=f=>a.value=f),"max-width":"1200px",class:"forget-dialog"},{default:o(()=>[n(ce,{title:e(c),color:"#2d2d2d",class:"forget-card"},{default:o(()=>[n(fe,{class:"forget-card-content"},{default:o(()=>[n(Te,{fluid:"",class:"pa-0 fill-height"},{default:o(()=>[n(Oe,{"no-gutters":"",class:"fill-height"},{default:o(()=>[n(ue,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:o(()=>[g[5]||(g[5]=O("div",{class:"text-overline mb-2"},"Options",-1)),n(ye,{modelValue:e(I),"onUpdate:modelValue":g[0]||(g[0]=f=>Y(I)?I.value=f:null),label:"Delete all secrets associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(ye,{modelValue:e(p),"onUpdate:modelValue":g[1]||(g[1]=f=>Y(p)?p.value=f:null),label:"Clear all terminal data associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(he,{density:"compact",type:"warning",variant:"outlined",class:"mt-4 alert-auto"},{default:o(()=>[...g[4]||(g[4]=[O("div",null," No destroy operation will be performed, so all resources will be left in place and unreachable by HighState. ",-1),O("div",null," You should only use this operation when the instance is unreachable/unrecoverable and you want to start from scratch. ",-1)])]),_:1})]),_:1}),n(R,{vertical:"",class:"d-none d-md-flex"}),n(ue,{cols:"12",md:"7",class:"pl-md-4 mt-4 mt-md-0 column-container"},{default:o(()=>[g[6]||(g[6]=O("div",{class:"text-overline mb-2"},"Instances",-1)),O("div",ot,[n(Pe,{items:e(s),"item-title":"title","item-value":"id",density:"compact","bg-color":"#2d2d2d",class:"forget-instance-tree"},{prepend:o(({item:f})=>[n(e(De),{icon:f.icon,color:f.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:o(({item:f})=>[O("div",it,[O("div",lt,q(f.title),1),O("div",rt,q(f.subtitle),1)])]),_:1},8,["items"])])]),_:1})]),_:1})]),_:1})]),_:1}),n(Ie,null,{default:o(()=>[n(ke),n(re,{onClick:g[2]||(g[2]=f=>a.value=!1)},{default:o(()=>[...g[7]||(g[7]=[j("Cancel",-1)])]),_:1}),n(re,{loading:e(r),onClick:d},{default:o(()=>[j(" Forget State"+q(e(i)?` (${t.instances.length})`:""),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),ct=be(dt,[["__scopeId","data-v-7881a32c"]]),ut={key:0},pt={class:"text-caption"},ft=z({__name:"OperationOptions",props:ee({operation:{},compositeTargetsOnly:{type:Boolean,default:!1}},{options:{default:{}},optionsModifiers:{}}),emits:["update:options"],setup(t){const a=_(t,"options"),y=S(()=>Ue(t.operation,{compositeTargetsOnly:t.compositeTargetsOnly})),w=(i,v)=>{const r=v??!1;i==="forceUpdateDependencies"&&r&&(a.value.ignoreChangedDependencies=!1,a.value.ignoreDependencies=!1),i==="ignoreChangedDependencies"&&r&&(a.value.forceUpdateDependencies=!1,a.value.ignoreDependencies=!1),i==="ignoreDependencies"&&r&&(a.value.forceUpdateDependencies=!1,a.value.ignoreChangedDependencies=!1),i==="onlyDestroyGhosts"&&r&&(a.value.firstDestroyGhosts=!1,a.value.ignoreGhosts=!1),i==="firstDestroyGhosts"&&r&&(a.value.onlyDestroyGhosts=!1,a.value.ignoreGhosts=!1),i==="ignoreGhosts"&&r&&(a.value.onlyDestroyGhosts=!1,a.value.firstDestroyGhosts=!1),a.value[i]=r};return(i,v)=>a.value?(l(),B("div",ut,[(l(!0),B(A,null,se(e(y),r=>(l(),B(A,{key:r.key},[n(ye,{"model-value":a.value[r.key],"onUpdate:modelValue":I=>w(r.key,I),class:Fe(r===e(y)[0]?"mt-2":""),label:r.label,density:"compact","hide-details":""},null,8,["model-value","onUpdate:modelValue","class","label"]),O("div",pt,q(r.description),1)],64))),128))])):V("",!0)}}),mt={key:0},vt={class:"d-flex flex-column"},gt={key:0,class:"text-caption text-medium-emphasis"},yt={key:1,class:"text-body-2 text-medium-emphasis pa-4"},ht=z({__name:"OperationPlanTree",props:{phases:{}},setup(t){const{instancesStore:a,libraryStore:y}=J(),w=S(()=>{const p=[];for(const s of t.phases){const d={id:`phase-${s.type}`,title:`${s.type.charAt(0).toUpperCase()+s.type.slice(1)} Phase`,subtitle:`${s.instances.length} instance${s.instances.length===1?"":"s"}`,icon:r(s.type),iconColor:I(s.type),phaseType:s.type,children:[]},c=i(s.instances);d.children=c,p.push(d)}return p}),i=p=>{const s=new Map;for(const c of p)s.has(c.id)||s.set(c.id,{...c,children:[]});for(const c of p)c.parentId&&s.has(c.parentId)&&s.get(c.parentId).children.push(c);return p.filter(c=>!c.parentId||!s.has(c.parentId)).map(c=>v(c,s))},v=(p,s)=>{const d=a.instances.get(p.id),c=d?y.library.components[d.type]:null,h={id:p.id,title:c&&d?`${c.meta.title} "${d.name}"`:p.id,subtitle:p.message,icon:c?.meta.icon??"iconamoon:component",iconColor:c?.meta.iconColor,phaseType:"instance"},g=s.get(p.id);return g&&g.children.length>0&&(h.children=g.children.map(f=>v(f,s))),h},r=p=>{switch(p){case"preview":return"mdi-eye";case"destroy":return"mdi-delete";case"update":return"mdi-update";case"refresh":return"mdi-refresh";default:return"mdi-cog"}},I=p=>{switch(p){case"preview":return"secondary";case"destroy":return"error";case"update":return"primary";case"refresh":return"info";default:return"secondary"}};return(p,s)=>t.phases.length>0?(l(),B("div",mt,[n(Pe,{items:e(w),"item-title":"title","item-value":"id",density:"compact","open-all":"","indent-lines":"","bg-color":"#2d2d2d"},{prepend:o(({item:d})=>[n(e(De),{icon:d.icon,color:d.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:o(({item:d})=>[O("div",vt,[O("div",{class:Fe(["text-body-2",d.phaseType==="instance"?"font-weight-regular":"font-weight-medium"])},q(d.title),3),d.subtitle?(l(),B("div",gt,q(d.subtitle),1)):V("",!0)])]),_:1},8,["items"])])):(l(),B("div",yt," No changes planned for this operation. "))}}),bt={class:"metadata-section"},wt={class:"options-header"},It={class:"text-body-2 text-medium-emphasis mb-4"},kt={class:"options-scrollable"},St={class:"plan-header"},xt={class:"plan-scrollable"},Ct={key:0,class:"plan-warnings"},$t=z({__name:"InstanceOperationDialog",props:ee({instances:{},component:{},operation:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const a=_(t,"visible"),{operationsStore:y,projectStore:w}=J(),i=S(()=>t.instances.length>1),v=S(()=>t.instances[0]),r=C({forceUpdateDependencies:!1,ignoreDependencies:!1,ignoreChangedDependencies:!1,forceUpdateChildren:!1,onlyDestroyGhosts:!1,firstDestroyGhosts:!1,ignoreGhosts:!1,destroyDependentInstances:!1,invokeDestroyTriggers:!0,deleteUnreachableResources:!1,forceDeleteState:!1,allowPartialCompositeInstanceUpdate:!1,allowPartialCompositeInstanceDestruction:!1,refresh:!1}),I=C([]),p=C(!1),s=C(null),d=C(""),c=C(""),h=S(()=>t.instances.every(b=>b.kind==="composite"));te([()=>t.operation,()=>t.instances],()=>{t.instances.length!==0&&(d.value=i.value?je(t.operation,t.instances):Ae(t.operation,v.value),r.value={...r.value,destroyDependentInstances:t.operation==="destroy"})},{immediate:!0}),te(()=>r.value,()=>{g()},{deep:!0}),te(()=>a.value,b=>{b&&g()});const g=async()=>{if(a.value){p.value=!0,s.value=null;try{const b=await y.planOperation({projectId:w.projectId,type:t.operation,instanceIds:t.instances.map(u=>u.id),options:r.value});I.value=b}catch(b){console.error("Failed to load operation plan:",b),s.value=b instanceof Error?b.message:"Unknown error"}finally{p.value=!1}}},f=S(()=>{const b=new Set,u=new Set,U=new Set,ne=new Set,k=new Set;for(const m of I.value)for(const x of m.instances){if(k.add(x.id),m.type==="update"){b.add(x.id);continue}if(m.type==="destroy"){u.add(x.id);continue}if(m.type==="refresh"){U.add(x.id);continue}m.type==="preview"&&ne.add(x.id)}return{update:b.size,destroy:u.size,refresh:U.size,preview:ne.size,unique:k.size}}),M=S(()=>{const b=Ue(t.operation,{compositeTargetsOnly:h.value}).filter(u=>!!u.warning&&!!r.value[u.key]).map(u=>u.warning);return[...new Set(b)]}),D=b=>`${b} instance${b===1?"":"s"}`,P=S(()=>{switch(t.operation){case"update":return"Update";case"preview":return"Preview";case"refresh":return"Refresh";case"destroy":return"Destroy";case"recreate":return"Recreate";default:return"Unknown operation"}}),H=S(()=>{const b=f.value;switch(t.operation){case"update":{const{update:u}=b;return u===0?P.value:`Update ${D(u)}`}case"recreate":return b.unique===0?P.value:`Recreate ${D(b.unique)}`;case"destroy":return b.destroy===0?P.value:`Destroy ${D(b.destroy)}`;case"refresh":return b.refresh===0?P.value:`Refresh ${D(b.refresh)}`;case"preview":return b.preview===0?P.value:`Preview ${D(b.preview)}`;default:return b.unique===0?P.value:`${P.value} ${D(b.unique)}`}}),E=S(()=>{switch(t.operation){case"update":return"primary";case"preview":return"secondary";case"refresh":return"info";case"destroy":return"error";case"recreate":return"warning";default:return"primary"}}),G=C(!1),W=async()=>{G.value=!0;try{await y.launchOperation({projectId:w.projectId,type:t.operation,instanceIds:t.instances.map(b=>b.id),options:r.value,meta:{title:d.value,description:c.value}}),a.value=!1}finally{G.value=!1}},K=S(()=>i.value?`${P.value} ${t.instances.length} instances`:t.component?`${P.value} ${t.component.meta.title} "${v.value.name}"`:`${P.value} "${v.value.name}"`);return(b,u)=>(l(),$(we,{modelValue:a.value,"onUpdate:modelValue":u[4]||(u[4]=U=>a.value=U),"max-width":"1200px",class:"operation-dialog"},{default:o(()=>[n(ce,{title:e(K),color:t.component?.meta.color??"#2d2d2d",class:"operation-card"},{prepend:o(()=>[t.component&&!e(i)?(l(),$(e(_e),{key:0,meta:t.component.meta},null,8,["meta"])):e(i)?(l(),$(de,{key:1},{default:o(()=>[...u[5]||(u[5]=[j("mdi-format-list-bulleted",-1)])]),_:1})):(l(),$(de,{key:2},{default:o(()=>[...u[6]||(u[6]=[j("mdi-cube-outline",-1)])]),_:1}))]),default:o(()=>[n(fe,{class:"operation-card-content"},{default:o(()=>[n(Te,{fluid:"",class:"pa-0 fill-height"},{default:o(()=>[n(Oe,{"no-gutters":"",class:"fill-height"},{default:o(()=>[n(ue,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:o(()=>[O("div",bt,[u[7]||(u[7]=O("div",{class:"text-overline mb-2"},"Metadata",-1)),n(We,{modelValue:e(d),"onUpdate:modelValue":u[0]||(u[0]=U=>Y(d)?d.value=U:null),label:"Title",variant:"outlined",density:"compact",class:"mb-3",hint:"A descriptive title for this operation (optional)","persistent-hint":""},null,8,["modelValue"]),n(Ye,{modelValue:e(c),"onUpdate:modelValue":u[1]||(u[1]=U=>Y(c)?c.value=U:null),label:"Description",variant:"outlined",density:"compact",rows:"2",hint:"Describe the purpose of this operation (optional)","persistent-hint":""},null,8,["modelValue"])]),n(R,{class:"my-4"}),O("div",wt,[u[10]||(u[10]=O("div",{class:"text-overline mb-2"},"Options",-1)),O("p",It,[u[8]||(u[8]=j(" Configure how the ",-1)),O("b",null,q(t.operation),1),u[9]||(u[9]=j(" operation should be executed. These options control the behavior and scope of the operation. ",-1))])]),O("div",kt,[n(ft,{options:e(r),"onUpdate:options":u[2]||(u[2]=U=>Y(r)?r.value=U:null),operation:t.operation,"composite-targets-only":e(h)},null,8,["options","operation","composite-targets-only"])])]),_:1}),n(R,{vertical:"",class:"d-none d-md-flex"}),n(ue,{cols:"12",md:"7",class:"pl-md-4 column-container"},{default:o(()=>[O("div",St,[u[11]||(u[11]=O("div",{class:"text-overline mb-2"},"Execution Plan",-1)),u[12]||(u[12]=O("p",{class:"text-body-2 text-medium-emphasis mb-4"}," Preview of instances that will be affected by this operation. The plan shows the execution phases and which instances will be processed. ",-1)),e(s)?(l(),$(he,{key:0,type:"error",variant:"outlined",density:"compact",class:"mb-3"},{default:o(()=>[j(" Failed to load operation plan: "+q(e(s)),1)]),_:1})):V("",!0)]),O("div",xt,[n(ht,{phases:e(I)},null,8,["phases"])]),e(M).length>0?(l(),B("div",Ct,[(l(!0),B(A,null,se(e(M),U=>(l(),$(he,{key:U,density:"compact",type:"warning",variant:"outlined"},{default:o(()=>[j(q(U),1)]),_:2},1024))),128))])):V("",!0)]),_:1})]),_:1})]),_:1})]),_:1}),n(Ie,null,{default:o(()=>[n(ke),n(re,{onClick:u[3]||(u[3]=U=>a.value=!1)},{default:o(()=>[...u[13]||(u[13]=[j("Cancel",-1)])]),_:1}),n(re,{color:e(E),loading:e(G),disabled:e(p),onClick:W},{default:o(()=>[j(q(e(H)),1)]),_:1},8,["color","loading","disabled"])]),_:1})]),_:1},8,["title","color"])]),_:1},8,["modelValue"]))}}),Dt=be($t,[["__scopeId","data-v-c3ce82ed"]]),Vt=z({__name:"PageListSubmenu",props:ee({pageIds:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const{projectStore:a,stateStore:y}=J(),w=pe(),i=C({}),v=C(!1),r=_(t,"visible");te(r,async p=>{if(p){v.value=!0;try{i.value=await y.getPages(t.pageIds)}finally{v.value=!1}}});const I=async p=>{await w.openPage(a.projectId,p)};return(p,s)=>(l(),$(e(L),{icon:"mdi-file-document",title:"Pages"},{append:o(()=>[n(de,{icon:"mdi-menu-right",size:"x-small"})]),default:o(()=>[n(Se,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=d=>r.value=d),"open-on-focus":!1,"open-on-hover":"","close-on-content-click":!1,submenu:"",activator:"parent"},{default:o(()=>[n(xe,{density:"compact",variant:"text"},{default:o(()=>[(l(!0),B(A,null,se(t.pageIds,d=>(l(),$(e(L),{key:d,title:e(i)[d]?.meta.title??d,subtitle:e(i)[d]?.meta.description,"custom-icon":e(i)[d]?.meta.icon,disabled:!e(i)[d],icon:"mdi-file-document",onClick:c=>I(d)},null,8,["title","subtitle","custom-icon","disabled","onClick"]))),128)),e(v)?(l(),$(Me,{key:0,title:"Loading pages..."})):V("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1}))}}),Tt=z({__name:"PanelListSubmenu",props:ee({panelIds:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const{projectStore:a,stateStore:y}=J(),w=pe(),i=C([]),v=C(!1),r=_(t,"visible");return te(r,async I=>{if(I){v.value=!0;try{i.value=await y.getPanels(t.panelIds)}finally{v.value=!1}}}),(I,p)=>(l(),$(e(L),{icon:"mdi-view-dashboard-outline",title:"Panels"},{append:o(()=>[n(de,{icon:"mdi-menu-right",size:"x-small"})]),default:o(()=>[n(Se,{modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=s=>r.value=s),"open-on-focus":!1,"open-on-hover":"","close-on-content-click":!1,submenu:"",activator:"parent"},{default:o(()=>[n(xe,{density:"compact",variant:"text"},{default:o(()=>[(l(!0),B(A,null,se(e(i),s=>(l(),$(e(L),{key:s.id,title:s.meta.title,subtitle:s.meta.description,"custom-icon":s.meta.icon,icon:"mdi-view-dashboard-outline",onClick:d=>e(w).openPanel(e(a).projectId,s.id)},null,8,["title","subtitle","custom-icon","onClick"]))),128)),e(v)?(l(),$(Me,{key:0,title:"Loading panels..."})):V("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1}))}}),Ot={class:"session-list-cointainer"},Pt=z({__name:"TerminalListSubmenu",props:ee({stateId:{},terminalIds:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const{instancesStore:a,stateStore:y}=J(),{state:w,execute:i,isLoading:v}=y.getTerminalsState(S(()=>t.terminalIds)),{state:r,execute:I,isLoading:p}=a.getTerminalSessionsState(S(()=>t.stateId)),s=_(t,"visible");te(s,f=>{f&&(I(),i())});const d=f=>f.finishedAt?`Finished at ${new Date(f.finishedAt).toLocaleString()}`:`Started at ${new Date(f.startedAt).toLocaleString()}`,c=f=>{const M=Je();return f.finishedAt?"#9E9E9E":M.current.value.colors.success},h=C(null),g=async f=>{h.value=f;try{await a.openTerminal(f,!0)}finally{h.value=null}};return(f,M)=>(l(),$(e(L),{icon:"mdi-console",title:"Terminals"},{append:o(()=>[n(de,{icon:"mdi-menu-right",size:"x-small"})]),default:o(()=>[n(Se,{modelValue:s.value,"onUpdate:modelValue":M[0]||(M[0]=D=>s.value=D),"open-on-focus":!1,"open-on-hover":"","close-on-content-click":!1,submenu:"",activator:"parent"},{default:o(()=>[n(xe,{density:"compact",variant:"text"},{default:o(()=>[n(ge,{class:"text-overline"},{default:o(()=>[...M[1]||(M[1]=[j("Available Terminals",-1)])]),_:1}),(l(!0),B(A,null,se(e(w),D=>(l(),$(e(L),{key:D.id,disabled:!!e(h),title:D.meta.title,subtitle:D.meta.description,"custom-icon":D.meta.icon,loading:e(h)===D.id,icon:"mdi-console",onClick:P=>g(D.id)},null,8,["disabled","title","subtitle","custom-icon","loading","onClick"]))),128)),n(R,{class:"mt-2 mb-2"}),n(ge,{class:"text-overline"},{default:o(()=>[...M[2]||(M[2]=[j("Sessions",-1)])]),_:1}),O("div",Ot,[(l(!0),B(A,null,se(e(r),D=>(l(),$(e(L),{key:D.id,title:D.meta.title,subtitle:d(D),"custom-icon":D.meta.icon,icon:"mdi-console",color:c(D),onClick:P=>e(a).openTerminalSession(D)},null,8,["title","subtitle","custom-icon","color","onClick"]))),128))]),e(r).length===0?(l(),$(ge,{key:0,class:"text-disabled"},{default:o(()=>[...M[3]||(M[3]=[j(" No sessions found ",-1)])]),_:1})):V("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1}))}}),Ft=be(Pt,[["__scopeId","data-v-7c86584d"]]),Mt=z({__name:"InstanceContextMenu",props:{instance:{},component:{},state:{},terminalIds:{},stores:{},operation:{},locked:{type:Boolean},editable:{type:Boolean},ghost:{type:Boolean,default:!1}},setup(t,{expose:a}){const y=S(()=>t.terminalIds??t.state?.terminalIds??[]),{projectStore:w,stateStore:i,operationsStore:v}=t.stores,r=pe(),{selection:I}=Ve(),p=C(!1),s=C(!1),d=C("update"),c=C([]),h=C(!1),g=C([]),f=S(()=>I.selectedInstances.length>1&&I.selectedInstances.some(m=>m.id===t.instance.id)?I.selectedInstances:[t.instance]),M=S(()=>f.value.length>1),D=(k,m,x)=>{if(x==="preview"&&(M.value||k.kind!=="unit"))return!1;const Q=Ge(m?.lastOperationState?.status);switch(x){case"update":return!Q;case"refresh":return ve(m)&&!Q;case"preview":return!Q;case"recreate":case"destroy":return ve(m)&&!Q;default:return!1}},P=k=>t.ghost&&k!=="destroy"?!1:f.value.some(m=>{const x=i.instanceStates.get(m.id);return D(m,x,k)}),H=k=>t.ghost&&k!=="destroy"?!1:f.value.every(m=>{const x=i.instanceStates.get(m.id);return D(m,x,k)}),E=S(()=>f.value.some(k=>{const m=i.instanceStates.get(k.id);return ve(m)})),G=k=>{const m=f.value.length;return m===1?k==="update"?E.value?"Update":"Create":k.charAt(0).toUpperCase()+k.slice(1):k==="update"?`${E.value?"Update":"Create"} selected (${m})`:`${k.charAt(0).toUpperCase()+k.slice(1)} selected (${m})`},W=k=>{if(M.value)return"mdi-format-list-bulleted";switch(k){case"update":return E.value?"mdi-play":"mdi-rocket-launch";case"refresh":return"mdi-reload";case"preview":return"mdi-eye";case"recreate":return"mdi-restart";case"destroy":return"mdi-stop";default:return"mdi-play"}},K=k=>{d.value=k,c.value=f.value,s.value=!0,p.value=!1,I.clearSelection()},b=()=>{g.value=f.value,h.value=!0,p.value=!1,I.clearSelection()},u=me("contextMenu"),U=async k=>{u.value&&await u.value.showContextMenu(k)},ne=async()=>{if(f.value.length!==1||t.instance.kind!=="unit"){p.value=!1;return}const k=await v.launchInstanceOperation("preview",t.instance);p.value=!1,t.state&&await r.openLogsPanel(w.projectId,k.id,t.state.id)};return a({showContextMenu:U}),(k,m)=>(l(),B(A,null,[n(e(Be),{ref_key:"contextMenu",ref:u,visible:e(p),"onUpdate:visible":m[6]||(m[6]=x=>Y(p)?p.value=x:null),title:"Instance",subtitle:t.instance.id,"is-deletable":x=>t.stores.stateStore.isNodeDeletable(x)},{default:o(()=>[P("update")?(l(),$(e(L),{key:0,title:G("update"),icon:W("update"),color:"primary",disabled:t.locked||!H("update"),onClick:m[0]||(m[0]=x=>K("update"))},null,8,["title","icon","disabled"])):V("",!0),P("refresh")?(l(),$(e(L),{key:1,title:G("refresh"),icon:W("refresh"),color:"primary",disabled:t.locked||!H("refresh"),onClick:m[1]||(m[1]=x=>K("refresh"))},null,8,["title","icon","disabled"])):V("",!0),P("preview")?(l(),$(e(L),{key:2,title:G("preview"),icon:W("preview"),color:"secondary",disabled:t.locked||!H("preview"),onClick:ne},null,8,["title","icon","disabled"])):V("",!0),t.state?.lastOperationState?(l(),B(A,{key:3},[n(R),n(e(L),{title:"Open Logs",icon:"mdi-text",color:"primary",onClick:m[2]||(m[2]=x=>e(i).openInstanceLogs(t.instance))})],64)):V("",!0),n(R),n(e(L),{title:"View in Settings",icon:"mdi-cog",color:"primary",onClick:m[3]||(m[3]=()=>{const x=e(i).getInstanceState(t.instance.id);x&&("navigateTo"in k?k.navigateTo:e(ze))({name:"settings.instance-details",params:{projectId:e(w).projectId,stateId:x.id}}),p.value=!1})}),t.state?.id&&e(y).length>0?(l(),B(A,{key:4},[n(R),n(Ft,{"state-id":t.state.id,"terminal-ids":e(y)},null,8,["state-id","terminal-ids"])],64)):V("",!0),t.state?.pageIds?.length?(l(),B(A,{key:5},[n(R),n(Vt,{"page-ids":t.state.pageIds},null,8,["page-ids"])],64)):V("",!0),t.state?.panelIds?.length?(l(),B(A,{key:6},[n(R),n(Tt,{"panel-ids":t.state.panelIds},null,8,["panel-ids"])],64)):V("",!0),e(E)||t.ghost?(l(),B(A,{key:7},[n(R),P("recreate")?(l(),$(e(L),{key:0,title:G("recreate"),icon:W("recreate"),color:"warning",disabled:t.locked||!H("recreate"),onClick:m[4]||(m[4]=x=>K("recreate"))},null,8,["title","icon","disabled"])):V("",!0),P("destroy")?(l(),$(e(L),{key:1,title:G("destroy"),icon:W("destroy"),color:"error",disabled:t.locked||!H("destroy"),onClick:m[5]||(m[5]=x=>K("destroy"))},null,8,["title","icon","disabled"])):V("",!0),n(e(L),{title:e(M)?`Forget State selected (${e(f).length})`:"Forget State",icon:"mdi-delete-forever",color:"error",disabled:t.locked,onClick:b},null,8,["title","disabled"])],64)):V("",!0)]),_:1},8,["visible","subtitle","is-deletable"]),n(Dt,{visible:e(s),"onUpdate:visible":m[7]||(m[7]=x=>Y(s)?s.value=x:null),operation:e(d),instances:e(c),component:t.component},null,8,["visible","operation","instances","component"]),n(ct,{visible:e(h),"onUpdate:visible":m[8]||(m[8]=x=>Y(h)?h.value=x:null),instances:e(g)},null,8,["visible","instances"])],64))}}),Ut=z({__name:"PageDialog",props:ee({meta:{},content:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const a=_(t,"visible");return(y,w)=>(l(),$(we,{modelValue:a.value,"onUpdate:modelValue":w[1]||(w[1]=i=>a.value=i),"max-width":"80vh","max-height":"60vh"},{default:o(()=>[n(ce,{title:t.meta.title,color:"#2d2d2d"},{default:o(()=>[n(fe,{style:{"overflow-y":"scroll"}},{default:o(()=>[n(tt,{content:t.content},null,8,["content"])]),_:1}),n(Ie,null,{default:o(()=>[n(ke),n(re,{onClick:w[0]||(w[0]=i=>a.value=!1)},{default:o(()=>[...w[2]||(w[2]=[j("Close",-1)])]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),Rt=z({__name:"InstanceNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const a=J(),y=pe(),{projectStore:w,stateStore:i,instancesStore:v,libraryStore:r,operationsStore:I,validationStore:p}=a,s=S(()=>t.data.instance),d=S(()=>{const F=v.getInstanceComponent(s.value);if(!F)throw new Error(`Component "${s.value.type}" for instance "${s.value.id}" not found in library`);return F}),c=S(()=>i.instanceStates.get(s.value.id)),h=S(()=>c.value&&i.instanceLocks.get(c.value.id)),g=S(()=>I.getLastInstanceOperation(s.value.id)),f=S(()=>v.isGhostInstance(s.value.id)),M=C(!1),D=C(!1),P=C(),H=C([]),E=C(!1),G=C(!1),W=C({}),K=async()=>{M.value=!0;try{if(!c.value?.pageIds)return;const F=c.value.pageIds;if(!F.length)return;const T=await i.getPage(F[0]);if(!T)return;P.value=T.meta,H.value=T.content,D.value=!0}finally{M.value=!1}},b=C(!1),u=C(!1),U=S(()=>{const F=c.value?.terminalIds??[];if(d.value.kind!=="composite")return F;const T=new Set,N=new Set,X=[],ae=Z=>{for(const le of Z??[])N.has(le)||(N.add(le),X.push(le))},Ce=Z=>{if(T.has(Z))return;T.add(Z);const le=i.instanceStates.get(Z);ae(le?.terminalIds);for(const Le of v.getInstanceChildren(Z))Ce(Le.id)};ae(F);for(const Z of v.getInstanceChildren(s.value.id))Ce(Z.id);return X}),ne=async()=>{b.value=!0;try{if(U.value.length===0)return;await v.openTerminal(U.value[0])}finally{b.value=!1}},k=async()=>{u.value=!0;try{const F=c.value?.panelIds?.[0];if(!F)return;await y.openPanel(w.projectId,F)}finally{u.value=!1}},m=async()=>{G.value=!0;try{if(!c.value)return;const F=await a.stateStore.getInstanceSecrets(c.value.id);W.value={...F},E.value=!0}finally{G.value=!1}},x=async()=>{const F=c.value?.id??s.value.id;await y.openCompositeInstancePanel(w.projectId,F)},Q=me("contextMenu"),oe=Re(),ie=C(null),Ne=F=>f.value?!1:Ee(oe,r.library,v.inputResolverOutputs,F);return te(()=>({ghost:f.value,initialized:oe.areNodesInitialized.value}),({ghost:F,initialized:T})=>{if(!T)return;const N=oe.findNode(t.id);if(N){if(!F){if(ie.value){const{connectable:X,draggable:ae}=ie.value;oe.updateNode(t.id,()=>({connectable:X,draggable:ae})),ie.value=null}return}ie.value||(ie.value={connectable:!!N.connectable,draggable:N.draggable??!0}),oe.updateNode(t.id,()=>({connectable:!1,draggable:!0}))}},{immediate:!0}),(F,T)=>(l(),$(nt,{"editing-secrets":e(E),"onUpdate:editingSecrets":T[1]||(T[1]=N=>Y(E)?E.value=N:null),"loading-secrets":e(G),"initial-secrets":e(W),"loading-page":e(M),instance:t.data.instance,component:e(d),entities:e(r).library.entities,"project-id":e(w).projectId,"input-resolver-outputs":e(v).inputResolverOutputs,"input-resolver-dependent-map":e(v).inputResolverDependentMap,"is-valid-connection":Ne,"instance-lock":e(h),state:e(c),"terminal-ids":e(U),"loading-panel":e(u),editable:t.data.editable&&!e(f),ghost:e(f),stores:("markRaw"in F?F.markRaw:e(Ke))(e(a)),"workspace-store":e(y),"all-instances":e(v).instances,"onSave:args":T[2]||(T[2]=(N,X,ae)=>e(v).updateInstance(N,X,ae)),"onSave:secrets":T[3]||(T[3]=(N,X)=>e(i).updateInstanceSecrets(N,X)),"onOpen:secrets":m,"onOpen:terminal":ne,"onOpen:panel":k,"onOperation:launch":T[4]||(T[4]=N=>e(I).launchQuickInstanceOperation(N,t.data.instance)),"onOperation:cancel":T[5]||(T[5]=N=>e(I).cancelInstanceOperation(e(c).lastOperationState.operationId,t.data.instance.id)),onContextmenu:T[6]||(T[6]=N=>e(Q)?.showContextMenu(N)),"onOpen:composite":x,"onOpen:page":K},{status:o(()=>[n(e(et),{state:e(c),operation:e(g),"expected-input-hash":e(i).inputHashOutputs.get(e(s).id)?.inputHash,"validation-output":e(p).validationOutputs.get(e(s).id)},null,8,["state","operation","expected-input-hash","validation-output"])]),default:o(()=>[n(e(Mt),{ref_key:"contextMenu",ref:Q,stores:e(a),instance:e(s),component:e(d),state:e(c),"terminal-ids":e(U),editable:t.data.editable&&!e(f),locked:!!e(h),ghost:e(f)},null,8,["stores","instance","component","state","terminal-ids","editable","locked","ghost"]),e(P)?(l(),$(e(Ut),{key:0,visible:e(D),"onUpdate:visible":T[0]||(T[0]=N=>Y(D)?D.value=N:null),meta:e(P),content:e(H)},null,8,["visible","meta","content"])):V("",!0)]),_:1},8,["editing-secrets","loading-secrets","initial-secrets","loading-page","instance","component","entities","project-id","input-resolver-outputs","input-resolver-dependent-map","instance-lock","state","terminal-ids","loading-panel","editable","ghost","stores","workspace-store","all-instances"]))}}),$e=z({__name:"EditorLoader",props:{text:{},value:{}},setup(t){const{instancesStore:a}=J(),y=S(()=>t.value===-1?t.text:`${t.text} ${t.value}/${a.totalInstanceCount}...`);return(w,i)=>t.text?(l(),$(ce,{key:0,variant:"tonal"},{default:o(()=>[n(fe,{class:"text-overline"},{default:o(()=>[j(q(e(y)),1)]),_:1}),n(Qe,{indeterminate:t.value===-1,"model-value":t.value,max:e(a).totalInstanceCount,height:4,color:"primary",class:"w-full"},null,8,["indeterminate","model-value","max"])]),_:1})):V("",!0)}}),Et=z({__name:"EditorLoaderPopup",setup(t){const{instancesStore:a,stateStore:y}=J(),w=S(()=>a.initializationPhase==="resolving"||y.initializationPhase==="calculating");return(i,v)=>e(w)?(l(),$(ce,{key:0,variant:"tonal"},{default:o(()=>[e(a).initializationPhase==="resolving"?(l(),$($e,{key:0,text:"Resolving instance inputs",value:e(a).resolvedInstanceCount},null,8,["value"])):V("",!0),e(y).initializationPhase==="calculating"?(l(),$($e,{key:1,text:"Detecting instance changes",value:e(y).calculatedInputHashCount},null,8,["value"])):V("",!0)]),_:1})):V("",!0)}}),qt=z({__name:"HubNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const{stateStore:a}=J(),y=me("contextMenu");return(w,i)=>(l(),$(at,{hub:t.data.hub,onContextmenu:i[0]||(i[0]=v=>e(y)?.showContextMenu(v))},{default:o(()=>[n(e(Be),{ref_key:"contextMenu",ref:y,title:"Hub",subtitle:t.data.hub.id,"is-deletable":v=>e(a).isNodeDeletable(v)},null,8,["subtitle","is-deletable"])]),_:1},8,["hub"]))}}),Be=z({__name:"NodeContextMenu",props:ee({title:{},subtitle:{},isDeletable:{type:Function}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t,{expose:a}){const{selection:y,vueFlowStore:w,deleteNodes:i}=Ve(),v=_(t,"visible"),r=qe(),I=me("contextMenu"),p=async h=>{I.value&&await I.value.showContextMenu(h)},{off:s}=w.onViewportChange(()=>{v.value=!1});Xe(()=>{s(),v.value=!1}),a({showContextMenu:p});const d=S(()=>t.isDeletable(r.node)?y.selectedNodeIds.has(r.id)?Array.from(y.selectedNodes).filter(t.isDeletable):[r.node]:[]),c=S(()=>d.value.length===1?"Delete":`Delete selected (${d.value.length})`);return(h,g)=>(l(),$(He,{ref_key:"contextMenu",ref:I,visible:v.value,"onUpdate:visible":g[1]||(g[1]=f=>v.value=f),title:t.title,subtitle:t.subtitle},{default:o(()=>[h.$slots.default?(l(),B(A,{key:0},[n(R),Ze(h.$slots,"default")],64)):V("",!0),e(d).length>0?(l(),B(A,{key:1},[n(R),n(L,{title:e(c),icon:"mdi-delete",color:"error",onClick:g[0]||(g[0]=f=>e(i)(e(d)))},null,8,["title"])],64)):V("",!0)]),_:3},8,["visible","title","subtitle"]))}});export{Et as _,qt as a,Rt as b,Mt as c};
@@ -1,14 +0,0 @@
1
- import{aW as Be,l as qe,aX as Rt,aY as Pi,aZ as Tn,aG as Hi,a_ as Fi,_ as se,a$ as ji,b0 as Li,b1 as Di,b2 as Rn,aI as Ui,b3 as Xi,a1 as zn,b4 as Bn,b5 as yt,b6 as Yi,b7 as Ct,aU as qi,aQ as Wi,aL as Pn,P as Hn,aR as Kt,b8 as Fn,b9 as Ft,ba as jn,bb as Ln,bc as Gi,bd as Ki,be as dt,bf as Le,bg as Ji,bh as Zi,bi as Qi,bj as _i,aT as eo,q as ln,bk as to,bl as zt}from"#entry";import{C as Vt}from"./DnNOOTKY.js";import{E as K,V as m,J as O,D as f,Y as C,b2 as Dn,_ as w,a3 as z,a8 as L,a9 as Z,r as ie,aG as tt,a1 as Un,af as ae,ab as G,b9 as no,ba as io,aN as Xn,aY as oo,aO as Ae,j as S,w as We,a5 as X,a6 as re,W as x,d as Yn,Z as qn,$ as Jt,ag as ke,a0 as Et,aH as ao,a as Te,aS as Wn,aJ as At,aK as Ge,ah as ee,n as pt,al as Q,aa as pe,a2 as ro,a_ as Zt,H as so,p as un,b4 as Gn,b8 as lo,aI as uo,b5 as co,b7 as fo,bb as ho,b6 as mo,u as Kn,av as Ve,aw as Ne,an as Me,am as he,bc as vo,bd as go,a$ as cn,be as Ie,au as Ee,ai as Jn,ac as yo,a4 as po,bf as wo,t as Ke,F as Zn,ao as bo,at as Qn,l as ko,i as xo,ak as Io,G as So,bg as $o,bh as Co}from"./DW3fpWuG.js";import{s as Vo,V as dn}from"./DzV7Jf8P.js";import{t as fn,a as Eo,_ as Ao}from"./Be0j4D2z.js";import{_ as Mo}from"./Dc-PHGbi.js";import{_ as _n}from"./D4C51duU.js";import{r as No,g as Oo}from"./BxAss8Tj.js";import{I as ei}from"./BvmKIGhu.js";function To(e,t){let n=t.length-e.length;if(n===1){let[i,...o]=t;return fn(i,{lazy:e,lazyArgs:o})}if(n===0){let i={lazy:e,lazyArgs:t};return Object.assign(o=>fn(o,i),i)}throw Error("Wrong number of arguments")}function ot(...e){return To(Ro,e)}function Ro(){let e=new Set;return t=>e.has(t)?Eo:(e.add(t),{done:!1,hasNext:!0,next:t})}function zo(e,t){const n={borderRadius:"4px",overflow:"visible"};switch(t){case"blueprint-valid":return{...n,opacity:"0.7",outline:"2px solid #4CAF50",backgroundColor:"rgba(76, 175, 80, 0.1)",boxShadow:"0 0 10px rgba(76, 175, 80, 0.3)"};case"blueprint-invalid":return{...n,opacity:"0.7",outline:"2px solid #F44336",backgroundColor:"rgba(244, 67, 54, 0.1)",boxShadow:"0 0 10px rgba(244, 67, 54, 0.3)"}}return e?{...n,outline:"2px solid #2196F3",boxShadow:"0 0 8px rgba(33, 150, 243, 0.4)"}:n}function ti(e,t){const n={...e};for(const i in t){const o=t[i];o.schema.default&&n[i]===void 0&&(n[i]=Be(o.schema.default))}return n}function ni(e,t){if(typeof e!="object"||e===null||t.type!=="object"||!t.properties)return e;const n={};for(const i in e){const o=t.properties[i],r=e[i];ii(r,o)||(n[i]=ni(r,o))}return n}function ii(e,t){const n=Tn.safeParse(e);if(n.success)return n.data.value.trim()==="";if(t.default!==void 0){if(e==null)return!0;const i=JSON.stringify(t.default),o=JSON.stringify(ni(e,t));if(i===o)return!0}return t.type==="boolean"?!1:Array.isArray(e)?e.length===0:typeof e=="object"?e===null||Object.keys(e).length===0:typeof e=="string"?e.trim()==="":typeof e=="number"?Number.isNaN(e)||e===0:typeof e>"u"}function oi(e,t){const n={};for(const i in e)t[i]&&(ii(e[i],t[i].schema)||(n[i]=e[i]));return n}function Qt(e){if(e.type==="string"||e.type==="number"||e.type==="integer")return e.type;const t=(Array.isArray(e.anyOf)?e.anyOf:void 0)??(Array.isArray(e.oneOf)?e.oneOf:void 0);if(!t)return;const n=t.map(o=>{if(typeof o=="object")return Qt(o)}),i=n[0];return i&&n.every(o=>o===i)?i:void 0}function Bo(e){return e.type!=="array"||typeof e.items!="object"||Array.isArray(e.items)?!1:Qt(e.items)==="string"}function Po(e,t){return e.type==="object"?e.complex===!0:e.type!=="array"?!1:e.complex===!0||t.treatStringArraysAsStructured&&Bo(e)}function ft(e,t,n,i,o){if(i.type==="boolean")return{name:e,title:t,description:n,kind:"checkbox",default:o??i.default??!1};if(i.type==="array"){if(typeof i.items!="object"||Array.isArray(i.items))return null;const r=Qt(i.items);if(r)return i.items.enum?{name:e,title:t,description:n,kind:"select",type:r,enum:i.items.enum,multiple:!0,default:o??i.default}:{name:e,title:t,description:n,kind:"combobox",type:r,default:o??i.default}}return i.type!=="string"&&i.type!=="number"&&i.type!=="integer"?null:i.enum?{name:e,title:t,description:n,kind:"select",type:i.type,enum:i.enum,multiple:!1,default:o??i.default}:{name:e,title:t,description:n,kind:"input",type:i.type,default:o??i.default}}function Ho(e){return e.type!=="object"?!1:!!(e.additionalProperties&&Object.keys(e.additionalProperties).length>0||e.propertyNames&&Object.keys(e.propertyNames).length>0||e.patternProperties&&Object.keys(e.patternProperties).length>0)}function Fo(e){const t=new Map;for(const n of e)if(!(n.type!=="object"||!n.properties))for(const[i,o]of Object.entries(n.properties)){if(typeof o!="object"||o.const===void 0)continue;const r=t.get(i)??0;t.set(i,r+1)}for(const[n,i]of t.entries()){if(!i||i<e.length)continue;const o=e[0].properties?.[n];if(o&&typeof o=="object"&&o.const!==void 0)return ft(n,o.title??qe(n),o.description,o)}return null}function ai(e,t,n={}){const i=[],o=[];for(const[r,a]of Object.entries(t)){const s=(Array.isArray(a.schema.anyOf)?a.schema.anyOf:void 0)??(Array.isArray(a.schema.oneOf)?a.schema.oneOf:void 0);if(s){const d=Fo(s);if(d){const l={};for(const c of s){if(typeof c!="object"||!c.properties)continue;const h=c.properties[d.name].const?.toString();if(h===void 0)continue;const b=[];for(const[V,P]of Object.entries(c.properties)){if(typeof P!="object"||V===d.name)continue;const A=ft(V,P.title??qe(V),P.description,P,c.default?.[V]);A&&b.push(A)}l[h]=b}Object.keys(l).length>0&&o.push({name:r,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"group",discriminator:d,fields:l,default:Be(a.schema.default)});continue}}if(Po(a.schema,n)){Rt(e,r,a.schema),o.push({name:r,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"structured",default:Be(a.schema.default)});continue}if(a.schema.type==="object"){if(Ho(a.schema))Rt(e,r,a.schema),o.push({name:r,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"structured",default:Be(a.schema.default)});else{const d=[];for(const[l,c]of Object.entries(a.schema.properties??{})){if(typeof c!="object")continue;const v=ft(l,c.title??qe(l),c.description,c,a.schema.default?.[l]);v&&d.push(v)}d.length>0&&o.push({name:r,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"group",discriminator:void 0,fields:{"":d},default:Be(a.schema.default)})}continue}if(a.schema.type==="string"&&(a.schema.language||a.schema.multiline)){o.push({name:r,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"code",language:Pi().optional().safeParse(a.schema.language).data,default:a.schema.default});continue}const u=ft(r,a.meta.title,a.meta.description??a.schema.description,a.schema);if(u){i.push(u);continue}Rt(e,r,a.schema),o.push({name:r,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"structured",default:Be(a.schema.default)})}return{plainArguments:i,expandableArguments:o}}const jo=["innerHTML"],Je=K({__name:"ArgumentDescription",props:{description:{}},setup(e){return(t,n)=>(m(),O("div",{class:"markdown-body pl-4 text-disabled",innerHTML:("renderMarkdown"in t?t.renderMarkdown:f(Hi))(e.description)},null,8,jo))}}),Lo={class:"editor"},Do=K({__name:"CodeArgumentInput",props:{modelValue:{},argument:{},instance:{},readonly:{type:Boolean}},emits:["update:model-value"],setup(e,{emit:t}){const n=ie("");if(typeof e.modelValue=="string")n.value=e.modelValue;else{const r=Tn.safeParse(e.modelValue)?.data?.value;n.value=r??(e.modelValue==null?"":Vo(e.modelValue))}const i=t,o=r=>{e.argument.kind==="code"?i("update:model-value",r):i("update:model-value",{[Fi.Yaml]:!0,value:r}),n.value=r};return(r,a)=>(m(),C(Dn,{title:e.argument.title,color:"#2d2d2d","bg-color":"#1e1e1e"},{title:w(()=>[L("div",null,Z(e.argument.title),1)]),text:w(()=>[e.argument.description?(m(),C(Je,{key:0,description:e.argument.description,class:"mb-4"},null,8,["description"])):z("",!0),L("div",Lo,[e.argument.kind==="code"?(m(),C(f(dn),{key:0,value:f(n),"onUpdate:value":o,theme:"dark-plus",class:"editor",language:e.argument.language??"text",options:{tabSize:2,readOnly:e.readonly}},null,8,["value","language","options"])):(m(),C(f(dn),{key:1,value:f(n),"onUpdate:value":o,theme:"dark-plus",language:"yaml",path:`${e.instance.type}.${e.argument.name}`,options:{tabSize:2,readOnly:e.readonly}},null,8,["value","path","options"]))])]),_:1},8,["title"]))}}),ri=se(Do,[["__scopeId","data-v-0fca51fc"]]),wt=K({__name:"PlainArgumentInput",props:Ae({argument:{},instance:{},isSecret:{type:Boolean},readonly:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=tt(e,"modelValue");t.value===void 0&&e.argument.default!==void 0&&(t.value=e.argument.default);const n=ie(!1),i=S(()=>e.isSecret?n.value?"text":"password":"text"),o=S(()=>e.argument.default!=null?String(e.argument.default):"");return(r,a)=>(m(),O("div",null,[e.argument.kind==="input"&&e.argument.type==="string"?(m(),C(Un,{key:0,modelValue:t.value,"onUpdate:modelValue":a[1]||(a[1]=s=>t.value=s),label:e.argument.title,placeholder:f(o),type:f(i),variant:"outlined",density:"compact","hide-details":"",readonly:e.readonly},{"append-inner":w(()=>[e.isSecret?(m(),C(ae,{key:0,onClick:a[0]||(a[0]=s=>n.value=!f(n))},{default:w(()=>[G(Z(f(n)?"mdi-eye-off":"mdi-eye"),1)]),_:1})):z("",!0)]),_:1},8,["modelValue","label","placeholder","type","readonly"])):e.argument.kind==="input"&&(e.argument.type==="number"||e.argument.type==="integer")?(m(),C(no,{key:1,modelValue:t.value,"onUpdate:modelValue":a[3]||(a[3]=s=>t.value=s),label:e.argument.title,placeholder:f(o),variant:"outlined",density:"compact","hide-details":"",readonly:e.readonly},{"append-inner":w(()=>[e.isSecret?(m(),C(ae,{key:0,onClick:a[2]||(a[2]=s=>n.value=!f(n))},{default:w(()=>[G(Z(f(n)?"mdi-eye-off":"mdi-eye"),1)]),_:1})):z("",!0)]),_:1},8,["modelValue","label","placeholder","readonly"])):e.argument.kind==="combobox"?(m(),C(io,{key:2,modelValue:t.value,"onUpdate:modelValue":a[4]||(a[4]=s=>t.value=s),label:e.argument.title,placeholder:f(o),variant:"outlined",density:"compact",multiple:"",chips:"","hide-details":"",disabled:e.readonly},null,8,["modelValue","label","placeholder","disabled"])):e.argument.kind==="select"?(m(),C(Xn,{key:3,modelValue:t.value,"onUpdate:modelValue":a[5]||(a[5]=s=>t.value=s),label:e.argument.title,placeholder:f(o),items:e.argument.enum,variant:"outlined",density:"compact",multiple:e.argument.multiple,"hide-details":"",disabled:e.readonly},null,8,["modelValue","label","placeholder","items","multiple","disabled"])):(m(),C(oo,{key:4,modelValue:t.value,"onUpdate:modelValue":a[6]||(a[6]=s=>t.value=s),label:e.argument.title,density:"compact","hide-details":"",disabled:e.readonly},null,8,["modelValue","label","disabled"])),e.argument.description?(m(),C(Je,{key:5,class:"mt-2",description:e.argument.description},null,8,["description"])):z("",!0)]))}}),Uo={class:"d-flex flex-column ga-4"},si=K({__name:"GroupArgumentInput",props:Ae({argument:{},instance:{},isSecret:{type:Boolean},readonly:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=tt(e,"modelValue");t.value===void 0&&(t.value=e.argument.default??{});const n=(o,r)=>{t.value={...t.value,[o]:r}},i=S(()=>e.argument.discriminator?t.value[e.argument.discriminator.name]??"":"");for(const o of e.argument.fields[i.value]??[])t.value[o.name]===void 0&&o.default!==void 0&&(t.value[o.name]=o.default);return We(i,o=>{if(!e.argument.discriminator)return;const r=e.argument.fields[o]??[],a={[e.argument.discriminator.name]:o};for(const s of r)a[s.name]=s.default;t.value=a}),(o,r)=>(m(),C(Dn,{color:"#2d2d2d","bg-color":"#2d2d2d"},{title:w(()=>[L("div",null,Z(e.argument.title),1)]),text:w(()=>[e.argument.description?(m(),C(Je,{key:0,description:e.argument.description,class:"mb-4"},null,8,["description"])):z("",!0),L("div",Uo,[e.argument.discriminator?(m(),O(X,{key:1},[L("div",null,[x(Xn,{"model-value":t.value[e.argument.discriminator.name],items:Object.keys(e.argument.fields),label:e.argument.discriminator.title,variant:"outlined",density:"compact","hide-details":"",disabled:e.readonly,"onUpdate:modelValue":r[0]||(r[0]=a=>n(e.argument.discriminator.name,a))},null,8,["model-value","items","label","disabled"]),e.argument.discriminator.description?(m(),C(Je,{key:0,class:"mt-2",description:e.argument.discriminator.description},null,8,["description"])):z("",!0)]),(m(!0),O(X,null,re(e.argument.fields[f(i)]??[],a=>(m(),C(wt,{"model-value":t.value[a.name],key:a.name,argument:a,instance:e.instance,"is-secret":e.isSecret,readonly:e.readonly,"onUpdate:modelValue":s=>n(a.name,s)},null,8,["model-value","argument","instance","is-secret","readonly","onUpdate:modelValue"]))),128))],64)):(m(!0),O(X,{key:0},re(e.argument.fields[""],a=>(m(),C(wt,{"model-value":t.value[a.name],key:a.name,argument:a,instance:e.instance,"is-secret":e.isSecret,readonly:e.readonly,"onUpdate:modelValue":s=>n(a.name,s)},null,8,["model-value","argument","instance","is-secret","readonly","onUpdate:modelValue"]))),128))])]),_:1}))}}),Xo="The name of the instance. It must be unique within the same type across the project.",Yo=K({__name:"InstanceArgumentEditor",props:Ae({instance:{},component:{},state:{},allInstances:{},readonly:{type:Boolean,default:!1}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:Ae(["save"],["update:modelValue"]),setup(e,{emit:t}){const n=tt(e,"modelValue"),i=ie(e.instance.name),o=Yn(ti(e.instance.args??{},e.component.args)),r=async()=>{n.value=!1,await pt(),Object.assign(o,e.instance.args)},a=t,s=async()=>{if(e.readonly){n.value=!1;return}const v=oi(o,e.component.args);a("save",e.instance.id,i.value,v),await pt(),n.value=!1},u=[v=>!!v||"Name is required",v=>v===e.instance.name||!e.allInstances.has(ji(e.instance.type,v))||"Instance with this name and type already exists",v=>{const h=Li.safeParse(v);return h.success||h.error.issues[0].message}],{plainArguments:d,expandableArguments:l}=ai(e.component.type,e.component.args),c=ie(!0);return(v,h)=>(m(),C(qn,{modelValue:n.value,"onUpdate:modelValue":h[2]||(h[2]=b=>n.value=b),class:"dialog",fullscreen:""},{default:w(()=>[x(Jt,{variant:"flat",color:e.component.meta.color??"#2d2d2d",title:e.component.meta.title,subtitle:e.component.meta.description},{prepend:w(()=>[x(f(Vt),{meta:e.component.meta},null,8,["meta"])]),default:w(()=>[x(ke),x(Et,{class:"d-flex flex-column pt-4 ga-4 dialog-scroll"},{default:w(()=>[x(ao,{modelValue:f(c),"onUpdate:modelValue":h[1]||(h[1]=b=>Te(c)?c.value=b:null)},{default:w(()=>[x(Un,{modelValue:f(i),"onUpdate:modelValue":h[0]||(h[0]=b=>Te(i)?i.value=b:null),label:"Name",variant:"outlined",density:"compact",readonly:e.readonly,rules:u},null,8,["modelValue","readonly"]),x(Je,{class:"mt-2",description:Xo})]),_:1},8,["modelValue"]),(m(!0),O(X,null,re(f(d),b=>(m(),C(wt,{key:b.name,modelValue:f(o)[b.name],"onUpdate:modelValue":V=>f(o)[b.name]=V,argument:b,instance:e.instance,readonly:e.readonly},null,8,["modelValue","onUpdate:modelValue","argument","instance","readonly"]))),128)),f(l).length>0?(m(),C(Wn,{key:0,elevation:0},{default:w(()=>[(m(!0),O(X,null,re(f(l),b=>(m(),O(X,{key:b.name},[b.kind==="group"?(m(),C(si,{key:0,modelValue:f(o)[b.name],"onUpdate:modelValue":V=>f(o)[b.name]=V,argument:b,instance:e.instance,readonly:e.readonly},null,8,["modelValue","onUpdate:modelValue","argument","instance","readonly"])):(m(),C(ri,{key:1,modelValue:f(o)[b.name],"onUpdate:modelValue":V=>f(o)[b.name]=V,argument:b,instance:e.instance,readonly:e.readonly},null,8,["modelValue","onUpdate:modelValue","argument","instance","readonly"]))],64))),128))]),_:1})):z("",!0)]),_:1}),x(ke),x(At,{class:"d-flex py-0"},{default:w(()=>[x(Ge),x(ee,{onClick:r},{default:w(()=>[...h[3]||(h[3]=[G("Cancel",-1)])]),_:1}),e.readonly?z("",!0):(m(),C(ee,{key:0,onClick:s,color:"primary",disabled:!f(c)},{default:w(()=>[...h[4]||(h[4]=[G("Save",-1)])]),_:1},8,["disabled"]))]),_:1})]),_:1},8,["color","title","subtitle"])]),_:1},8,["modelValue"]))}}),qo=se(Yo,[["__scopeId","data-v-2cdc85be"]]),Wo=K({__name:"InstanceSecretEditor",props:Ae({instance:{},state:{},component:{},initialSecrets:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:Ae(["save"],["update:modelValue"]),setup(e,{emit:t}){const n=tt(e,"modelValue"),i=Yn(ti(e.initialSecrets,e.component.secrets)),o=t,r=async()=>{n.value=!1,await pt(),Object.assign(i,e.initialSecrets)},a=async()=>{const d=oi(i,e.component.secrets);e.state&&o("save",e.state.id,d),await pt(),n.value=!1},{plainArguments:s,expandableArguments:u}=ai(e.component.type,e.component.secrets,{treatStringArraysAsStructured:!0});return(d,l)=>(m(),C(qn,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=c=>n.value=c),class:"dialog"},{default:w(()=>[x(Jt,{variant:"flat",color:e.component.meta.color??"#2d2d2d",title:e.component.meta.title,subtitle:e.component.meta.description},{prepend:w(()=>[x(f(Vt),{meta:e.component.meta},null,8,["meta"])]),default:w(()=>[x(ke),x(Et,{class:"d-flex flex-column pt-4 ga-4",style:{"max-height":"60vh",overflow:"scroll"}},{default:w(()=>[(m(!0),O(X,null,re(f(s),c=>(m(),C(wt,{key:c.name,modelValue:f(i)[c.name],"onUpdate:modelValue":v=>f(i)[c.name]=v,argument:c,instance:e.instance,"is-secret":""},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))),128)),f(u).length>0?(m(),C(Wn,{key:0,elevation:0},{default:w(()=>[(m(!0),O(X,null,re(f(u),c=>(m(),O(X,{key:c.name},[c.kind==="group"?(m(),C(si,{key:0,argument:c,instance:e.instance,modelValue:f(i)[c.name],"onUpdate:modelValue":v=>f(i)[c.name]=v,"is-secret":""},null,8,["argument","instance","modelValue","onUpdate:modelValue"])):(m(),C(ri,{key:1,modelValue:f(i)[c.name],"onUpdate:modelValue":v=>f(i)[c.name]=v,argument:c,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))],64))),128))]),_:1})):z("",!0)]),_:1}),x(ke),x(At,{class:"d-flex py-0"},{default:w(()=>[x(Ge),x(ee,{onClick:r},{default:w(()=>[...l[1]||(l[1]=[G("Cancel",-1)])]),_:1}),x(ee,{onClick:a,color:"primary"},{default:w(()=>[...l[2]||(l[2]=[G("Save",-1)])]),_:1})]),_:1})]),_:1},8,["color","title","subtitle"])]),_:1},8,["modelValue"]))}}),Go=se(Wo,[["__scopeId","data-v-21e34532"]]),Ko=K({__name:"InstanceNodeActions",props:{component:{},state:{},terminalIds:{},locked:{type:Boolean},editable:{type:Boolean},canOpenArgsEditor:{type:Boolean},canEditSecrets:{type:Boolean},hideShowComposite:{type:Boolean},loadingSecrets:{type:Boolean},loadingTerminal:{type:Boolean},loadingPage:{type:Boolean},loadingPanel:{type:Boolean},ghost:{type:Boolean,default:!1}},emits:["open:args","open:secrets","open:terminal","open:page","open:panel","open:composite","operation:launch","operation:cancel"],setup(e,{emit:t}){const n=S(()=>Rn(e.component)&&Object.keys(e.component.secrets).length>0),i=S(()=>Ui(e.state?.lastOperationState?.status)),o=S(()=>e.state?.evaluationState&&e.state.evaluationState.status==="evaluating"),r=S(()=>e.state&&(o.value||e.state.lastOperationState?.status==="pending"||e.state.lastOperationState?.totalResourceCount===0||e.state.lastOperationState?.currentResourceCount===0||e.state.lastOperationState?.currentResourceCount===e.state.lastOperationState?.totalResourceCount)),a=S(()=>{if(!e.state?.lastOperationState)return 0;const{currentResourceCount:v,totalResourceCount:h}=e.state.lastOperationState;return v&&h?v/h*100:0}),s=S(()=>(e.terminalIds??e.state?.terminalIds??[]).length>0),u=S(()=>e.state?.pageIds&&e.state.pageIds.length>0),d=S(()=>e.state?.panelIds&&e.state.panelIds.length>0),l=S(()=>e.state?.lastOperationState?.status==="pending"?"":e.state?.lastOperationState?.status==="destroying"?"error":"primary"),c=t;return(v,h)=>(m(),C(At,{class:"py-0 h-auto"},{default:w(()=>[Q(v.$slots,"status",{},()=>[x(pe,{color:""},{default:w(()=>[x(f(Mo),{size:20,icon:"mdi-circle-outline"})]),_:1})],!0),x(Ge),!e.ghost&&!f(Di)(e.state)&&!f(i)?(m(),C(ee,{key:0,size:"small",variant:"tonal",class:"toolbar-button",title:"Create",disabled:e.locked,onClick:h[0]||(h[0]=b=>c("operation:launch","update"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[9]||(h[9]=[G("mdi-rocket-launch",-1)])]),_:1})]),_:1},8,["disabled"])):!e.ghost&&!f(i)?(m(),C(ee,{key:1,size:"small",variant:"tonal",class:"toolbar-button",title:"Update",disabled:e.locked,onClick:h[1]||(h[1]=b=>c("operation:launch","update"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[10]||(h[10]=[G("mdi-play",-1)])]),_:1})]),_:1},8,["disabled"])):z("",!0),f(i)?(m(),C(ee,{key:2,size:"small",variant:"tonal",color:"error",class:"toolbar-button",title:"Cancel Operation",onClick:h[2]||(h[2]=b=>c("operation:cancel"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[11]||(h[11]=[G("mdi-cancel",-1)])]),_:1})]),_:1})):z("",!0),e.canOpenArgsEditor&&!e.ghost&&!f(i)?(m(),C(ee,{key:3,size:"small",variant:"tonal",class:"toolbar-button",title:"Edit Arguments",locked:e.locked,onClick:h[3]||(h[3]=b=>c("open:args"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[12]||(h[12]=[G("mdi-pencil",-1)])]),_:1})]),_:1},8,["locked"])):z("",!0),e.canEditSecrets&&!e.ghost&&!f(i)&&f(n)?(m(),C(ee,{key:4,size:"small",variant:"tonal",class:"toolbar-button",loading:e.loadingSecrets,locked:e.locked,title:"Edit Secrets",onClick:h[4]||(h[4]=b=>c("open:secrets"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[13]||(h[13]=[G("mdi-key",-1)])]),_:1})]),_:1},8,["loading","locked"])):z("",!0),!e.ghost&&f(s)?(m(),C(ee,{key:5,size:"small",variant:"tonal",class:"toolbar-button",loading:e.loadingTerminal,title:"Open Terminal",onClick:h[5]||(h[5]=b=>c("open:terminal"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[14]||(h[14]=[G("mdi-console",-1)])]),_:1})]),_:1},8,["loading"])):z("",!0),!e.ghost&&f(u)?(m(),C(ee,{key:6,size:"small",variant:"tonal",class:"toolbar-button",title:"Open Page",loading:e.loadingPage,onClick:h[6]||(h[6]=b=>c("open:page"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[15]||(h[15]=[G("mdi-file-document",-1)])]),_:1})]),_:1},8,["loading"])):z("",!0),!e.ghost&&f(d)?(m(),C(ee,{key:7,size:"small",variant:"tonal",class:"toolbar-button",title:"Open Panel",loading:e.loadingPanel,onClick:h[7]||(h[7]=b=>c("open:panel"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[16]||(h[16]=[G("mdi-view-dashboard-outline",-1)])]),_:1})]),_:1},8,["loading"])):z("",!0),e.component.kind==="composite"&&!e.hideShowComposite?(m(),C(ee,{key:8,size:"small",variant:"tonal",class:"toolbar-button",title:"Show Structure",onClick:h[8]||(h[8]=b=>c("open:composite"))},{default:w(()=>[x(ae,null,{default:w(()=>[...h[17]||(h[17]=[G("mdi-cube-outline",-1)])]),_:1})]),_:1})):z("",!0),f(o)||f(i)?(m(),C(ro,{key:9,size:"small",color:f(l),indeterminate:f(r),"model-value":f(a),absolute:"",location:"bottom"},null,8,["color","indeterminate","model-value"])):z("",!0)]),_:3}))}}),Jo=se(Ko,[["__scopeId","data-v-5693f9c8"]]);function Zo(e,t){return Array.isArray(e)?e.length===0?"[]":"[...]":typeof e=="object"?"{...}":typeof e=="string"&&t.language?"...":String(e)}const Qo={class:"d-flex text-disabled text-start text-no-wrap"},_o={key:0,class:"d-flex ml-auto text-error"},ea={key:1,class:"d-flex ml-auto text-truncate pl-4"},ta=K({__name:"InstanceNodeArgumentList",props:{instance:{},component:{}},setup(e){const t=S(()=>{const n=[];for(const[i,o]of Object.entries(e.component.args))!o.required&&(e.instance.args?.[i]==null||e.instance.args?.[i]===o.schema.default)||n.push({name:o.meta.title,value:Zo(e.instance.args?.[i],o.schema),requiredAndNotSet:o.required&&e.instance.args?.[i]==null});return n});return(n,i)=>f(t).length>0?(m(),O(X,{key:0},[x(ke),x(Et,{class:"d-flex flex-column gap-2 px-2 py-2"},{default:w(()=>[(m(!0),O(X,null,re(f(t),({name:o,value:r,requiredAndNotSet:a})=>(m(),O("div",{key:o,class:"d-flex flex-row"},[L("div",Qo,Z(o),1),a?(m(),O("div",_o,"not set")):(m(),O("div",ea,Z(r),1))]))),128))]),_:1})],64)):z("",!0)}}),na={key:0,class:"d-flex flex-column align-center justify-center",style:{width:"100%",height:"100%"}},ia={key:1,class:"d-flex flex-column align-center justify-center",style:{width:"100%",height:"100%"}},oa={class:"pa-3 text-center",style:{maxWidth:"720px"}},aa={key:2,class:"d-flex flex-column align-center justify-center",style:{width:"100%",height:"100%"}},ra={class:"d-flex flex-column",style:{width:"240px",height:"100%",overflow:"auto"}},sa={class:"d-flex flex-column",style:{gap:"2px",minWidth:0,width:"100%",alignItems:"flex-start"}},la={class:"d-flex",style:{gap:"8px",minWidth:0,width:"100%",alignItems:"center"}},ua={key:0,class:"d-flex"},ca={class:"d-flex flex-column",style:{gap:"2px",minWidth:0,width:"100%",alignItems:"flex-start"}},da={class:"text-truncate",style:{maxWidth:"220px"}},fa={key:0,class:"text-caption text-medium-emphasis text-truncate",style:{maxWidth:"220px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},ha={class:"d-flex flex-column",style:{flex:1,minWidth:0}},ma={class:"d-flex flex-column",style:{height:"480px"}},va={class:"flex-grow-1",style:{minHeight:0}},li=K({__name:"ReferencedEntitiesPopup",props:{canLoad:{type:Boolean},cacheKey:{},entities:{},load:{type:Function}},setup(e){const t=ie(!1),n=ie(!1),i=ie(!1),o=ie(null),r=ie([]),a=Zt("content"),s=ie(null),u=M=>{if(M&&typeof M=="object"&&"message"in M){const $=M.message;if(typeof $=="string"&&$.length>0)return $}if(typeof M=="string"&&M.length>0)return M;try{return JSON.stringify(M)}catch{return"Unknown error"}},d=()=>{n.value=!1,i.value=!1,o.value=null,r.value=[],s.value=null};We(()=>e.cacheKey,()=>{d()});async function l(){if(!(!e.canLoad||n.value||i.value)){o.value=null,n.value=!0;try{r.value=await e.load(),i.value=!0,!s.value&&r.value.length>0&&(s.value=r.value[0].snapshotId)}catch(M){o.value=u(M)}finally{n.value=!1}}}We(t,M=>{M?l():d()});const c=M=>{e.canLoad&&(M.preventDefault(),M.stopPropagation(),t.value=!0)},v=M=>{if(!t.value)return;const $=M.composedPath();if(a.value&&$.includes(a.value))return;if(!(M.target instanceof Node)){t.value=!1;return}t.value=!1};so(()=>{window.addEventListener("contextmenu",v,{capture:!0})}),un(()=>{window.removeEventListener("contextmenu",v,{capture:!0})});const h=Xi(M=>{M.kind==="openEntitySnapshot"&&(t.value=!1)});un(()=>{h()});const b=M=>e.entities[M]?.meta,V=M=>No({entityType:M.entityType,modelMeta:b(M.entityType),overrideMeta:Oo(M.content)}),P=M=>{const $=b(M.entityType),E=$?.color,j=V(M).metaForIcon?.iconColor??$?.iconColor;return E??j},A=S(()=>{const M=s.value;if(!M)return"primary";const $=r.value.find(E=>E.snapshotId===M);return $?P($)??"primary":"primary"});return(M,$)=>(m(),C(Gn,{modelValue:f(t),"onUpdate:modelValue":$[2]||($[2]=E=>Te(t)?t.value=E:null),"open-on-click":!1,"close-on-content-click":!1,location:"end",disabled:!e.canLoad},{activator:w(({props:E})=>[Q(M.$slots,"activator",{props:{...E,onContextmenu:c},opened:f(t)})]),default:w(()=>[x(lo,{ref:"content",color:"black",class:"hs-output-popup d-flex",style:{width:"800px",height:"480px"}},{default:w(()=>[e.canLoad?f(o)?(m(),O("div",ia,[L("div",oa,[$[4]||($[4]=L("div",{class:"text-medium-emphasis"},"Failed to load referenced entities",-1)),x(uo,{type:"error",density:"compact",class:"mt-2"},{default:w(()=>[G(Z(f(o)),1)]),_:1})])])):f(i)&&f(r).length===0?(m(),O("div",aa,[...$[5]||($[5]=[L("div",{class:"pa-3 text-center"},[L("div",{class:"text-medium-emphasis"},"No referenced entities")],-1)])])):(m(),O(X,{key:3},[L("div",ra,[x(co,{modelValue:f(s),"onUpdate:modelValue":$[0]||($[0]=E=>Te(s)?s.value=E:null),color:f(A),direction:"vertical"},{default:w(()=>[(m(!0),O(X,null,re(f(r),E=>(m(),C(fo,{key:E.snapshotId,value:E.snapshotId,class:"justify-start"},{default:w(()=>[L("div",sa,[L("div",la,[V(E).metaForIcon?(m(),O("div",ua,[x(f(Vt),{meta:V(E).metaForIcon,size:24},null,8,["meta"])])):z("",!0),L("div",ca,[L("span",da,Z(V(E).title),1),V(E).subtitle?(m(),O("div",fa,Z(V(E).subtitle),1)):z("",!0)])])])]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","color"])]),x(ke,{vertical:""}),L("div",ha,[x(ho,{modelValue:f(s),"onUpdate:modelValue":$[1]||($[1]=E=>Te(s)?s.value=E:null),style:{flex:1,minWidth:0}},{default:w(()=>[(m(!0),O(X,null,re(f(r),E=>(m(),C(mo,{key:E.snapshotId,value:E.snapshotId},{default:w(()=>[L("div",ma,[L("div",va,[Q(M.$slots,"content",{entity:E})])])]),_:2},1032,["value"]))),128))]),_:3},8,["modelValue"])])],64)):(m(),O("div",na,[...$[3]||($[3]=[L("div",{class:"pa-3 text-center"},[L("div",{class:"text-medium-emphasis"},"Unavailable"),L("div",{class:"text-medium-emphasis"},"Missing project/state context")],-1)])]))]),_:3},512)]),_:3},8,["modelValue","disabled"]))}}),hn=K({__name:"InstanceNodeInputChipPopup",props:{projectId:{},resolvedInputs:{},entities:{}},setup(e){const{$client:t}=Kn(),n=zn(e.projectId),i=S(()=>new Set(e.resolvedInputs.map(u=>u.type).filter(Boolean))),o=S(()=>{const u=[];for(const c of e.resolvedInputs){const v=c.input.instanceId,h=c.input.output,b=n.instanceStates.get(v)?.id;b&&u.push({stateId:b,output:h})}const d=new Set,l=[];for(const c of u){const v=`${c.stateId}:${c.output}`;d.has(v)||(d.add(v),l.push(c))}return l}),r=S(()=>o.value.length>0),a=S(()=>{if(!r.value)return"";const u=o.value.map(l=>`${l.stateId}:${l.output}`).sort().join("|"),d=Array.from(i.value).sort().join(",");return`${u}#${d}`}),s=async()=>{if(!r.value)return[];const u=await Promise.all(o.value.map(async c=>await t.state.getOutputReferencedEntities.query({projectId:e.projectId,stateId:c.stateId,output:c.output}))),d=[],l=new Set;for(const c of u)for(const v of c)l.has(v.snapshotId)||(l.add(v.snapshotId),d.push(v));return i.value.size===0?[]:d.filter(c=>i.value.has(c.entityType))};return(u,d)=>(m(),C(li,{"can-load":f(r),"cache-key":f(a),entities:e.entities,load:s},{activator:w(l=>[Q(u.$slots,"activator",Ve(Ne(l)))]),content:w(({entity:l})=>[x(_n,{entity:l,"project-id":e.projectId},null,8,["entity","project-id"])]),_:3},8,["can-load","cache-key","entities"]))}}),ga=K({__name:"InstanceNodeOutputChipPopup",props:{projectId:{},stateId:{},output:{},outputSources:{},entities:{}},setup(e){const{$client:t}=Kn(),n=e.projectId?zn(e.projectId):null,i=S(()=>{if(!e.projectId||!n)return[];if(e.outputSources&&e.outputSources.length>0){const s=[];for(const l of e.outputSources){const c=n.instanceStates.get(l.instanceId)?.id;c&&s.push({stateId:c,output:l.output})}const u=new Set,d=[];for(const l of s){const c=`${l.stateId}:${l.output}`;u.has(c)||(u.add(c),d.push(l))}return d}return e.stateId?[{stateId:e.stateId,output:e.output}]:[]}),o=S(()=>i.value.length>0),r=S(()=>o.value?i.value.map(s=>`${s.stateId}:${s.output}`).sort().join("|"):""),a=async()=>{if(!o.value)return[];const s=await Promise.all(i.value.map(async l=>await t.state.getOutputReferencedEntities.query({projectId:e.projectId,stateId:l.stateId,output:l.output}))),u=[],d=new Set;for(const l of s)for(const c of l)d.has(c.snapshotId)||(d.add(c.snapshotId),u.push(c));return u};return(s,u)=>(m(),C(li,{"can-load":f(o),"cache-key":f(r),entities:e.entities,load:a},{activator:w(d=>[Q(s.$slots,"activator",Ve(Ne(d)))]),content:w(({entity:d})=>[x(_n,{entity:d,"project-id":e.projectId},null,8,["entity","project-id"])]),_:3},8,["can-load","cache-key","entities"]))}}),ya=K({__name:"InstanceNodeIOSideHandle",props:{name:{},side:{},handleColor:{},isValidConnection:{type:Function},compact:{type:Boolean}},setup(e){return(t,n)=>(m(),O(X,null,[x(f(Bn),{id:e.name,type:e.side==="left"?"target":"source",position:e.side==="left"?f(yt).Left:f(yt).Right,class:Me(["handle",[e.side==="left"?"left-handle":"right-handle",e.compact?"handle-compact":""]]),"is-valid-connection":e.isValidConnection},null,8,["id","type","position","class","is-valid-connection"]),L("div",{class:Me(["handle-dot",[e.side==="left"?"handle-dot-left":"handle-dot-right"]]),style:he({backgroundColor:e.handleColor})},null,6)],64))}}),Pe=se(ya,[["__scopeId","data-v-9abcde6c"]]),pa={class:"rename-chip-content"},wa=["disabled","onKeydown"],ba={class:"rename-actions"},ka={class:"rename-label"},xa={class:"rename-actions"},Ia={key:0,class:"rename-error"},Sa=K({__name:"InstanceNodeEditableInputChip",props:{name:{},side:{},reservedLabelWidthCh:{},chipBackgroundColor:{},chipTextColor:{},isValidConnection:{type:Function},renameInput:{type:Function}},setup(e){const t=ie(!1),n=ie(""),i=ie(!1),o=ie(),r=S(()=>{const d=n.value.trim().length||e.name.length||8;return`${Math.max(d,6)}ch`}),a=()=>{t.value=!0,n.value=e.name,o.value=void 0},s=()=>{t.value=!1,n.value="",o.value=void 0},u=async()=>{const d=n.value.trim();i.value=!0;try{await e.renameInput(e.name,d),s()}catch(l){o.value=l instanceof Error?l.message:"Failed to rename input"}finally{i.value=!1}};return(d,l)=>(m(),O(X,null,[x(pe,{style:he({"--label-column-width":`${e.reservedLabelWidthCh}ch`,backgroundColor:e.chipBackgroundColor,color:e.chipTextColor}),"text-color":"white",class:"rounded handle-chip rename-chip"},{default:w(()=>[L("div",pa,[f(t)?(m(),O(X,{key:0},[vo(L("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>Te(n)?n.value=c:null),class:"rename-input",style:he({width:f(r)}),disabled:f(i),type:"text",onKeydown:[cn(Ie(u,["stop","prevent"]),["enter"]),cn(Ie(s,["stop","prevent"]),["esc"])]},null,44,wa),[[go,f(n)]]),L("div",ba,[x(ee,{variant:"text",icon:"mdi-check",size:"x-small",class:"rename-action-btn",loading:f(i),onMousedown:l[1]||(l[1]=Ie(()=>{},["stop"])),onClick:Ie(u,["stop"])},null,8,["loading"]),x(ee,{variant:"text",icon:"mdi-close",size:"x-small",class:"rename-action-btn",disabled:f(i),onMousedown:l[2]||(l[2]=Ie(()=>{},["stop"])),onClick:Ie(s,["stop"])},null,8,["disabled"])])],64)):(m(),O(X,{key:1},[L("span",ka,Z(f(qe)(e.name)),1),L("div",xa,[x(ee,{variant:"text",icon:"mdi-check",size:"x-small",class:"rename-action-btn rename-action-placeholder",tabindex:"-1","aria-hidden":"true",disabled:""}),x(ee,{variant:"text",icon:"mdi-pencil",size:"x-small",class:"rename-action-btn",onMousedown:l[3]||(l[3]=Ie(()=>{},["stop"])),onClick:Ie(a,["stop"])})])],64))]),x(Pe,{name:e.name,side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":e.chipBackgroundColor,compact:""},null,8,["name","side","is-valid-connection","handle-color"])]),_:1},8,["style"]),f(t)&&f(o)?(m(),O("div",Ia,Z(f(o)),1)):z("",!0)],64))}}),$a=se(Sa,[["__scopeId","data-v-9d98b5f4"]]);function Ca(e){const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,2),16),o=parseInt(t.substring(4,2),16);return(n*299+i*587+o*114)/1e3>=128?"#000":"#fff"}const Va={ref:"column",class:"d-flex flex-column gr-2 column"},Ea=K({__name:"InstanceNodeIOSide",props:{instance:{},component:{},entities:{},editable:{type:Boolean,default:!1},type:{},side:{},projectId:{},stateId:{},isValidConnection:{type:Function},resolvedInputs:{},resolvedInjectionInput:{},usedOutputs:{},forceShowAllHandles:{type:Boolean},preventShowAllHandles:{type:Boolean}},setup(e){const t=$=>{const E=Array.from(new Set((e.resolvedInputs?.[$]??[]).map(j=>j.type)));if(E.length===1)return E[0]},n=($,E)=>{const j=e.component[$][E];return $==="inputs"?t(E)??j.type:j.fromInput?t(j.fromInput)??j.type:j.type},i=($,E)=>e.entities[n($,E)]?.meta.color??"#607D8B",o=($,E)=>Ca(i($,E)),r=$=>{const E=e.instance.inputs&&!!e.instance.inputs[$]&&e.instance.inputs[$].length>0,j=e.instance.hubInputs&&!!e.instance.hubInputs[$]&&e.instance.hubInputs[$].length>0;return E||j},a=$=>e.component.inputs[$].required?!e.resolvedInputs?.[$]?.length:!1,s=Zt("column"),{isOutside:u}=Yi(s),d=S(()=>!u.value&&!e.preventShowAllHandles),l=S(()=>e.forceShowAllHandles||d.value),c=$=>e.type==="outputs"?!e.usedOutputs||e.usedOutputs.has($)||l.value:e.side==="right"||r($)||a($)||l.value,v=S(()=>e.resolvedInjectionInput?e.resolvedInjectionInput.length===1?"1 input":`${e.resolvedInjectionInput.length} inputs`:"no inputs"),h=S(()=>e.instance.injectionInputs&&e.instance.injectionInputs.length>0),b=S(()=>e.editable&&e.instance.type===Pn&&e.type==="inputs"&&e.side==="left"),V=Ct(),P=S(()=>b.value?!!V.connectionStartHandle.value:!1),A=S(()=>{if(!b.value)return 8;const $=Object.keys(e.component.inputs);if($.length===0)return 8;const E=Math.max(...$.map(j=>qe(j).length),8);return Math.min(E+1,28)}),M=async($,E)=>{if(!e.projectId)throw new Error("Project ID is required");const{instancesStore:j}=Wi(e.projectId);await j.renameEditableExportInput(e.instance,$,E)};return($,E)=>(m(),O("div",Va,[!f(b)&&e.type==="inputs"&&e.side==="left"&&Object.keys(e.component.inputs).length>0&&(f(h)||f(d))?(m(),C(pe,{key:0,style:{backgroundColor:"#3F51B5",color:"white"},"text-color":"white",class:"rounded handle-chip"},{default:w(()=>[x(ae,{class:"mr-1",style:{"margin-left":"-2px"}},{default:w(()=>[...E[0]||(E[0]=[G("mdi-router",-1)])]),_:1}),G(" "+Z(f(v))+" ",1),x(Pe,{name:"",side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":"#3F51B5"},null,8,["side","is-valid-connection"])]),_:1})):z("",!0),(m(!0),O(X,null,re(e.component[e.type],(j,B)=>(m(),O(X,{key:B},[e.type==="outputs"?(m(),C(f(ga),{key:0,"project-id":e.projectId,"state-id":e.stateId,output:B,"output-sources":e.instance.resolvedOutputs?.[B],entities:e.entities},{activator:w(({props:U,opened:W})=>[c(B)||W?(m(),C(pe,Ee({key:0,ref_for:!0},U,{style:{backgroundColor:i(e.type,B),color:o(e.type,B)},"text-color":"white",class:"rounded handle-chip"}),{default:w(()=>[G(Z(j.meta.title)+" ",1),x(Pe,{name:B,side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":i(e.type,B)},null,8,["name","side","is-valid-connection","handle-color"])]),_:2},1040,["style"])):z("",!0)]),_:2},1032,["project-id","state-id","output","output-sources","entities"])):f(b)&&e.projectId&&e.type==="inputs"?(m(),C(f(hn),{key:1,"project-id":e.projectId,"resolved-inputs":e.resolvedInputs?.[B]??[],entities:e.entities},{activator:w(({props:U,opened:W})=>[c(B)||W?(m(),O("div",Ee({key:0,ref_for:!0},U),[x($a,{name:B,side:e.side,"reserved-label-width-ch":f(A),"chip-background-color":i(e.type,B),"chip-text-color":o(e.type,B),"is-valid-connection":e.isValidConnection,"rename-input":M},null,8,["name","side","reserved-label-width-ch","chip-background-color","chip-text-color","is-valid-connection"])],16)):z("",!0)]),_:2},1032,["project-id","resolved-inputs","entities"])):!f(b)&&e.projectId&&e.type==="inputs"?(m(),C(f(hn),{key:2,"project-id":e.projectId,"resolved-inputs":e.resolvedInputs?.[B]??[],entities:e.entities},{activator:w(({props:U,opened:W})=>[c(B)||W?(m(),C(pe,Ee({key:0,ref_for:!0},U,{style:{backgroundColor:i(e.type,B),color:o(e.type,B)},"text-color":"white",class:"rounded handle-chip"}),{default:w(()=>[G(Z(j.meta.title)+" ",1),x(Pe,{name:B,side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":i(e.type,B)},null,8,["name","side","is-valid-connection","handle-color"])]),_:2},1040,["style"])):z("",!0)]),_:2},1032,["project-id","resolved-inputs","entities"])):!f(b)&&c(B)?(m(),C(pe,{key:3,style:he({backgroundColor:i(e.type,B),color:o(e.type,B)}),"text-color":"white",class:"rounded handle-chip"},{default:w(()=>[G(Z(j.meta.title)+" ",1),x(Pe,{name:B,side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":i(e.type,B)},null,8,["name","side","is-valid-connection","handle-color"])]),_:2},1032,["style"])):z("",!0)],64))),128)),f(P)?(m(),C(pe,{key:1,class:"rounded handle-chip create-input-chip",variant:"outlined"},{default:w(()=>[E[1]||(E[1]=G(" create input ",-1)),x(Pe,{name:f(qi),side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":"transparent",compact:""},null,8,["name","side","is-valid-connection"])]),_:1})):z("",!0)],512))}}),at=se(Ea,[["__scopeId","data-v-ddb783f3"]]),Aa=K({__name:"InstanceNodeIO",props:{instance:{},component:{},entities:{},editable:{type:Boolean},projectId:{},stateId:{},type:{default:"both"},mirror:{type:Boolean},isValidConnection:{type:Function},usedOutputs:{},resolvedInputs:{},resolvedInjectionInput:{},forceShowAllHandles:{type:Boolean},preventShowAllHandles:{type:Boolean}},setup(e){return(t,n)=>(m(),C(At,{class:"align-start align-stretch component-node-io"},{default:w(()=>[e.mirror?(m(),O(X,{key:1},[e.type==="both"||e.type==="outputs"?(m(),C(at,{key:0,instance:e.instance,component:e.component,entities:e.entities,editable:e.editable,"project-id":e.projectId,"state-id":e.stateId,"is-valid-connection":e.isValidConnection,type:"outputs","used-outputs":e.usedOutputs,"resolved-inputs":e.resolvedInputs,side:"left","force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","editable","project-id","state-id","is-valid-connection","used-outputs","resolved-inputs","force-show-all-handles","prevent-show-all-handles"])):z("",!0),x(Ge),e.type==="both"||e.type==="inputs"?(m(),C(at,{key:1,instance:e.instance,component:e.component,entities:e.entities,editable:e.editable,"project-id":e.projectId,"state-id":e.stateId,"is-valid-connection":e.isValidConnection,type:"inputs",side:"right","resolved-inputs":e.resolvedInputs,"force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","editable","project-id","state-id","is-valid-connection","resolved-inputs","force-show-all-handles","prevent-show-all-handles"])):z("",!0)],64)):(m(),O(X,{key:0},[e.type==="both"||e.type==="inputs"?(m(),C(at,{key:0,instance:e.instance,component:e.component,entities:e.entities,editable:e.editable,"project-id":e.projectId,"state-id":e.stateId,"is-valid-connection":e.isValidConnection,type:"inputs","resolved-inputs":e.resolvedInputs,"resolved-injection-input":e.resolvedInjectionInput,"force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles,side:"left"},null,8,["instance","component","entities","editable","project-id","state-id","is-valid-connection","resolved-inputs","resolved-injection-input","force-show-all-handles","prevent-show-all-handles"])):z("",!0),x(Ge),e.type==="both"||e.type==="outputs"?(m(),C(at,{key:1,instance:e.instance,component:e.component,entities:e.entities,editable:e.editable,"project-id":e.projectId,"state-id":e.stateId,"is-valid-connection":e.isValidConnection,type:"outputs","used-outputs":e.usedOutputs,"resolved-inputs":e.resolvedInputs,side:"right","force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","editable","project-id","state-id","is-valid-connection","used-outputs","resolved-inputs","force-show-all-handles","prevent-show-all-handles"])):z("",!0)],64))]),_:1}))}}),Ma=se(Aa,[["__scopeId","data-v-3f1ac0ea"]]),Na={key:0,class:"text-h6"},Oa={key:1},Ta=K({__name:"InstanceNodeLockBadge",props:{instanceLock:{}},setup(e){return(t,n)=>(m(),C(Jn,{disabled:!e.instanceLock.meta.title&&!e.instanceLock.meta.description},{activator:w(({props:i})=>[x(pe,Ve(Ne(i)),{default:w(()=>[x(ae,null,{default:w(()=>[...n[0]||(n[0]=[G("mdi-lock",-1)])]),_:1}),e.instanceLock.meta.icon?(m(),C(f(Hn),{key:0,class:"ml-1",icon:e.instanceLock.meta.icon,width:18,color:e.instanceLock.meta.iconColor},null,8,["icon","color"])):z("",!0)]),_:1},16)]),default:w(()=>[e.instanceLock.meta.title?(m(),O("div",Na,Z(e.instanceLock.meta.title),1)):z("",!0),e.instanceLock.meta.description?(m(),O("div",Oa,Z(e.instanceLock.meta.description),1)):z("",!0)]),_:1},8,["disabled"]))}}),Ra=K({__name:"InstanceStatusFieldItem",props:{item:{}},setup(e){return(t,n)=>(m(),C(yo,{title:e.item},{append:w(()=>[x(f(ei),{content:e.item},null,8,["content"])]),_:1},8,["title"]))}}),za={class:"d-flex flex-row"},Ba={class:"d-flex text-disabled text-start text-no-wrap text-secondary"},Pa=["title"],Ha=K({__name:"InstanceStatusField",props:{statusField:{}},setup(e){const t=S(()=>Array.isArray(e.statusField.value)?e.statusField.value.join(", "):String(e.statusField.value)),n=S(()=>Array.isArray(e.statusField.value)?e.statusField.value.length===0?"[]":e.statusField.value.length===1?e.statusField.value[0]:`${e.statusField.value.length} items`:String(e.statusField.value)),i=S(()=>Array.isArray(e.statusField.value)?e.statusField.value.length>1:!1);return(o,r)=>(m(),O("div",za,[L("div",Ba,[e.statusField.meta.icon?(m(),C(f(Hn),{key:0,icon:e.statusField.meta.icon,color:e.statusField.meta.iconColor,width:16,class:"mr-1"},null,8,["icon","color"])):z("",!0),G(" "+Z(e.statusField.meta.title),1)]),x(Gn,{"open-on-hover":"","close-on-content-click":!1,location:"end",disabled:!f(i)},{activator:w(({props:a})=>[L("div",Ee(a,{class:"d-flex ml-auto text-truncate pl-4",title:f(i)?"":f(t)}),[L("span",{class:Me(["text-truncate",{underline:f(i)}])},Z(f(n)),3)],16,Pa)]),default:w(()=>[x(po,{density:"compact",variant:"text"},{default:w(()=>[(m(!0),O(X,null,re(e.statusField.value,(a,s)=>(m(),C(Ra,{key:s,item:String(a)},null,8,["item"]))),128))]),_:1})]),_:1},8,["disabled"]),x(f(ei),{content:f(t)},null,8,["content"])]))}}),Fa=se(Ha,[["__scopeId","data-v-08b5fc86"]]),ja=K({__name:"InstanceStatusFieldList",props:{instance:{},state:{}},setup(e){const t=S(()=>e.state.statusFields?.filter(n=>n.value===void 0?!1:n.complementaryTo?!e.instance.args?.[n.complementaryTo]||JSON.stringify(e.instance.args[n.complementaryTo])!==JSON.stringify(n.value):!0)??[]);return(n,i)=>f(t).length>0?(m(),O(X,{key:0},[x(ke),x(Et,{class:"d-flex flex-column gap-2 px-2 py-2"},{default:w(()=>[(m(!0),O(X,null,re(f(t),o=>(m(),C(Fa,{key:o.name,"status-field":o},null,8,["status-field"]))),128))]),_:1})],64)):z("",!0)}}),La={class:"instance-node__badges"},Da=K({__name:"InstanceNode",props:Ae({instance:{},component:{},entities:{},inputResolverOutputs:{},inputResolverDependentMap:{},allInstances:{default:()=>new Map},state:{},terminalIds:{},projectId:{},instanceLock:{},loadingSecrets:{type:Boolean},loadingTerminal:{type:Boolean},loadingPage:{type:Boolean},loadingPanel:{type:Boolean},initialSecrets:{},editable:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},ioType:{default:"both"},ioMirror:{type:Boolean},hideShowComposite:{type:Boolean},isValidConnection:{type:Function}},{editingSecrets:{type:Boolean,default:!1},editingSecretsModifiers:{}}),emits:Ae(["open:secrets","open:terminal","open:page","open:panel","open:composite","operation:launch","operation:cancel","save:args","save:secrets","contextmenu"],["update:editingSecrets"]),setup(e,{emit:t}){const n=t,i=tt(e,"editingSecrets"),o=ie(!1),r=S(()=>!!e.instance.parentId),a=S(()=>e.editable||r.value),s=S(()=>!e.editable&&r.value),u=S(()=>e.editable||r.value),d=S(()=>Object.keys(e.component.inputs).length>0),l=S(()=>Object.keys(e.component.outputs).length>0),c=S(()=>e.editable&&e.instance.type===Pn),v=S(()=>d.value||l.value||c.value),h=S(()=>Ft(e.inputResolverOutputs,e.instance.id)),b=S(()=>jn(e.inputResolverOutputs,e.instance.id).map(W=>W.input)),V=S(()=>{const W=Object.values(e.instance.outputs??{}).flat(),H=new Set,F=e.inputResolverDependentMap.get(`instance:${e.instance.id}`)??[],ce=te=>{(te.instanceId===e.instance.id||W.some(oe=>oe.instanceId===te.instanceId))&&H.add(te.output)};for(const te of F){const oe=e.inputResolverOutputs.get(te);if(oe)if(oe.kind==="instance")for(const g of Object.values(oe.instance.inputs??{}))for(const T of g)ce(T);else for(const g of Object.values(oe.hub.inputs??{}))ce(g)}if(e.instance.parentId){const te=e.allInstances.get(e.instance.parentId),oe=Object.values(te?.outputs??{}).flat();for(const g of oe)g.instanceId===e.instance.id&&H.add(g.output)}return H});We(V,W=>{W.size!==0&&P.updateNodeInternals([M.node.id])});const{vueFlowStore:P,selection:A}=Kt(),M=Fn(),$=S(()=>Ln(M.node,P)),E=S(()=>P.connectionStartHandle.value?.nodeId===M.node.id),j=Zt("componentCard"),B=S(()=>P.viewport.value.zoom<.5),U=S(()=>j.value?Math.min(j.value.$el.clientWidth,j.value.$el.clientHeight)*.7:0);return(W,H)=>(m(),O(X,null,[x(f(Ao),{class:Me({"instance-card--ghost":e.ghost}),component:e.component,subtitle:e.instance.name,"blueprint-status":$.value,selected:f(A).isNodeSelected(f(M).node),style:{overflow:"visible"},onContextmenu:H[12]||(H[12]=F=>n("contextmenu",F)),ref:"componentCard"},{append:w(()=>[L("div",La,[e.ghost?(m(),C(Jn,{key:0,location:"top"},{activator:w(({props:F})=>[x(pe,Ee(F,{class:"instance-node__ghost-chip",color:"primary"}),{default:w(()=>[x(ae,{size:"16"},{default:w(()=>[...H[14]||(H[14]=[G("mdi-ghost",-1)])]),_:1})]),_:1},16)]),default:w(()=>[H[15]||(H[15]=L("span",null," This instance is a ghost. It is no longer a part of the project, but Highstate still tracks it. ",-1))]),_:1})):z("",!0),e.instanceLock?(m(),C(Ta,{key:1,"instance-lock":e.instanceLock},null,8,["instance-lock"])):z("",!0)])]),default:w(()=>[Q(W.$slots,"default",{},void 0,!0),f(o)?(m(),C(f(qo),{key:0,modelValue:f(o),"onUpdate:modelValue":H[0]||(H[0]=F=>Te(o)?o.value=F:null),instance:e.instance,component:e.component,state:e.state,"all-instances":e.allInstances,readonly:s.value,onSave:H[1]||(H[1]=(F,ce,te)=>n("save:args",F,ce,te))},null,8,["modelValue","instance","component","state","all-instances","readonly"])):z("",!0),f(Rn)(e.component)&&i.value?(m(),C(f(Go),{key:1,modelValue:i.value,"onUpdate:modelValue":H[2]||(H[2]=F=>i.value=F),instance:e.instance,state:e.state,component:e.component,"initial-secrets":e.initialSecrets??{},onSave:H[3]||(H[3]=(F,ce)=>n("save:secrets",F,ce))},null,8,["modelValue","instance","state","component","initial-secrets"])):z("",!0),x(ta,{instance:e.instance,component:e.component},null,8,["instance","component"]),v.value?(m(),O(X,{key:2},[x(ke),x(Ma,{component:e.component,instance:e.instance,entities:e.entities,editable:e.editable,"project-id":e.projectId,"state-id":e.state?.id,"is-valid-connection":e.isValidConnection,type:e.ioType,mirror:e.ioMirror,"used-outputs":V.value,"resolved-inputs":h.value,"resolved-injection-input":b.value,"force-show-all-handles":E.value,"prevent-show-all-handles":f(o)||i.value||!e.editable||B.value},null,8,["component","instance","entities","editable","project-id","state-id","is-valid-connection","type","mirror","used-outputs","resolved-inputs","resolved-injection-input","force-show-all-handles","prevent-show-all-handles"])],64)):z("",!0),e.state?(m(),C(ja,{key:3,instance:e.instance,state:e.state},null,8,["instance","state"])):z("",!0),x(ke),x(Jo,{"loading-secrets":e.loadingSecrets,"loading-terminal":e.loadingTerminal,"loading-page":e.loadingPage,"loading-panel":e.loadingPanel,instance:e.instance,component:e.component,state:e.state,"terminal-ids":e.terminalIds,locked:!!e.instanceLock,editable:e.editable,"can-open-args-editor":a.value,"can-edit-secrets":u.value,ghost:e.ghost,"hide-show-composite":e.hideShowComposite,"onOpen:args":H[4]||(H[4]=F=>o.value=!0),"onOpen:secrets":H[5]||(H[5]=F=>e.state?n("open:secrets"):i.value=!0),"onOpen:terminal":H[6]||(H[6]=F=>n("open:terminal")),"onOpen:page":H[7]||(H[7]=F=>n("open:page")),"onOpen:panel":H[8]||(H[8]=F=>n("open:panel")),"onOpen:composite":H[9]||(H[9]=F=>n("open:composite")),"onOperation:launch":H[10]||(H[10]=F=>n("operation:launch",F)),"onOperation:cancel":H[11]||(H[11]=F=>n("operation:cancel"))},{status:w(()=>[Q(W.$slots,"status",{},void 0,!0)]),_:3},8,["loading-secrets","loading-terminal","loading-page","loading-panel","instance","component","state","terminal-ids","locked","editable","can-open-args-editor","can-edit-secrets","ghost","hide-show-composite"])]),_:3},8,["class","component","subtitle","blueprint-status","selected"]),x(wo,{modelValue:B.value,"onUpdate:modelValue":H[13]||(H[13]=F=>B.value=F),scrim:"#1e1e1e",opacity:1,absolute:"",class:"align-center justify-center",style:he(`border: 3px solid ${e.component.meta.iconColor??"#3f51b5"}; border-radius: 8px`),contained:""},{default:w(()=>[x(f(Vt),{meta:e.component.meta,size:U.value},null,8,["meta","size"])]),_:1},8,["modelValue","style"])],64))}}),rc=se(Da,[["__scopeId","data-v-e61ea7fb"]]);var we=(e=>(e.Lines="lines",e.Dots="dots",e))(we||{});const ui=function({dimensions:e,size:t,color:n}){return Zn("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},ci=function({radius:e,color:t}){return Zn("circle",{cx:e,cy:e,r:e,fill:t})};we.Lines+"",we.Dots+"";const Ua={[we.Dots]:"#81818a",[we.Lines]:"#eee"},Xa=["id","x","y","width","height","patternTransform"],Ya={key:2,height:"100",width:"100"},qa=["fill"],Wa=["x","y","fill"],Ga={name:"Background",compatConfig:{MODE:3}},Ka=K({...Ga,props:{id:{},variant:{default:()=>we.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=Ct(),i=S(()=>{const a=n.value.zoom,[s,u]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],d=[s*a||1,u*a||1],l=e.size*a,[c,v]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],h=[c*a||1+d[0]/2,v*a||1+d[1]/2];return{scaledGap:d,offset:h,size:l}}),o=Ke(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=Ke(()=>e.color||e.patternColor||Ua[e.variant||we.Dots]);return(a,s)=>(m(),O("svg",{class:"vue-flow__background vue-flow__container",style:he({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[Q(a.$slots,"pattern-container",{id:o.value},()=>[L("pattern",{id:o.value,x:f(n).x%i.value.scaledGap[0],y:f(n).y%i.value.scaledGap[1],width:i.value.scaledGap[0],height:i.value.scaledGap[1],patternTransform:`translate(-${i.value.offset[0]},-${i.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Q(a.$slots,"pattern",{},()=>[a.variant===f(we).Lines?(m(),C(f(ui),{key:0,size:a.lineWidth,color:r.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===f(we).Dots?(m(),C(f(ci),{key:1,color:r.value,radius:i.value.size/2},null,8,["color","radius"])):z("",!0),a.bgColor?(m(),O("svg",Ya,[L("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,qa)])):z("",!0)])],8,Xa)]),L("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${o.value})`},null,8,Wa),Q(a.$slots,"default",{id:o.value})],4))}});var Ja={value:()=>{}};function _t(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ht(n)}function ht(e){this._=e}function Za(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",o=n.indexOf(".");if(o>=0&&(i=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ht.prototype=_t.prototype={constructor:ht,on:function(e,t){var n=this._,i=Za(e+"",n),o,r=-1,a=i.length;if(arguments.length<2){for(;++r<a;)if((o=(e=i[r]).type)&&(o=Qa(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<a;)if(o=(e=i[r]).type)n[o]=mn(n[o],e.name,t);else if(t==null)for(o in n)n[o]=mn(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 ht(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),i=0,o,r;i<o;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)}};function Qa(e,t){for(var n=0,i=e.length,o;n<i;++n)if((o=e[n]).name===t)return o.value}function mn(e,t,n){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=Ja,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var jt="http://www.w3.org/1999/xhtml";const vn={svg:"http://www.w3.org/2000/svg",xhtml:jt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Mt(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),vn.hasOwnProperty(t)?{space:vn[t],local:e}:e}function _a(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===jt&&t.documentElement.namespaceURI===jt?t.createElement(e):t.createElementNS(n,e)}}function er(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function di(e){var t=Mt(e);return(t.local?er:_a)(t)}function tr(){}function en(e){return e==null?tr:function(){return this.querySelector(e)}}function nr(e){typeof e!="function"&&(e=en(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var r=t[o],a=r.length,s=i[o]=new Array(a),u,d,l=0;l<a;++l)(u=r[l])&&(d=e.call(u,u.__data__,l,r))&&("__data__"in u&&(d.__data__=u.__data__),s[l]=d);return new ue(i,this._parents)}function ir(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function or(){return[]}function fi(e){return e==null?or:function(){return this.querySelectorAll(e)}}function ar(e){return function(){return ir(e.apply(this,arguments))}}function rr(e){typeof e=="function"?e=ar(e):e=fi(e);for(var t=this._groups,n=t.length,i=[],o=[],r=0;r<n;++r)for(var a=t[r],s=a.length,u,d=0;d<s;++d)(u=a[d])&&(i.push(e.call(u,u.__data__,d,a)),o.push(u));return new ue(i,o)}function hi(e){return function(){return this.matches(e)}}function mi(e){return function(t){return t.matches(e)}}var sr=Array.prototype.find;function lr(e){return function(){return sr.call(this.children,e)}}function ur(){return this.firstElementChild}function cr(e){return this.select(e==null?ur:lr(typeof e=="function"?e:mi(e)))}var dr=Array.prototype.filter;function fr(){return Array.from(this.children)}function hr(e){return function(){return dr.call(this.children,e)}}function mr(e){return this.selectAll(e==null?fr:hr(typeof e=="function"?e:mi(e)))}function vr(e){typeof e!="function"&&(e=hi(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var r=t[o],a=r.length,s=i[o]=[],u,d=0;d<a;++d)(u=r[d])&&e.call(u,u.__data__,d,r)&&s.push(u);return new ue(i,this._parents)}function vi(e){return new Array(e.length)}function gr(){return new ue(this._enter||this._groups.map(vi),this._parents)}function bt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bt.prototype={constructor:bt,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 yr(e){return function(){return e}}function pr(e,t,n,i,o,r){for(var a=0,s,u=t.length,d=r.length;a<d;++a)(s=t[a])?(s.__data__=r[a],i[a]=s):n[a]=new bt(e,r[a]);for(;a<u;++a)(s=t[a])&&(o[a]=s)}function wr(e,t,n,i,o,r,a){var s,u,d=new Map,l=t.length,c=r.length,v=new Array(l),h;for(s=0;s<l;++s)(u=t[s])&&(v[s]=h=a.call(u,u.__data__,s,t)+"",d.has(h)?o[s]=u:d.set(h,u));for(s=0;s<c;++s)h=a.call(e,r[s],s,r)+"",(u=d.get(h))?(i[s]=u,u.__data__=r[s],d.delete(h)):n[s]=new bt(e,r[s]);for(s=0;s<l;++s)(u=t[s])&&d.get(v[s])===u&&(o[s]=u)}function br(e){return e.__data__}function kr(e,t){if(!arguments.length)return Array.from(this,br);var n=t?wr:pr,i=this._parents,o=this._groups;typeof e!="function"&&(e=yr(e));for(var r=o.length,a=new Array(r),s=new Array(r),u=new Array(r),d=0;d<r;++d){var l=i[d],c=o[d],v=c.length,h=xr(e.call(l,l&&l.__data__,d,i)),b=h.length,V=s[d]=new Array(b),P=a[d]=new Array(b),A=u[d]=new Array(v);n(l,c,V,P,A,h,t);for(var M=0,$=0,E,j;M<b;++M)if(E=V[M]){for(M>=$&&($=M+1);!(j=P[$])&&++$<b;);E._next=j||null}}return a=new ue(a,i),a._enter=s,a._exit=u,a}function xr(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ir(){return new ue(this._exit||this._groups.map(vi),this._parents)}function Sr(e,t,n){var i=this.enter(),o=this,r=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?r.remove():n(r),i&&o?i.merge(o).order():o}function $r(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,o=n.length,r=i.length,a=Math.min(o,r),s=new Array(o),u=0;u<a;++u)for(var d=n[u],l=i[u],c=d.length,v=s[u]=new Array(c),h,b=0;b<c;++b)(h=d[b]||l[b])&&(v[b]=h);for(;u<o;++u)s[u]=n[u];return new ue(s,this._parents)}function Cr(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],o=i.length-1,r=i[o],a;--o>=0;)(a=i[o])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function Vr(e){e||(e=Er);function t(c,v){return c&&v?e(c.__data__,v.__data__):!c-!v}for(var n=this._groups,i=n.length,o=new Array(i),r=0;r<i;++r){for(var a=n[r],s=a.length,u=o[r]=new Array(s),d,l=0;l<s;++l)(d=a[l])&&(u[l]=d);u.sort(t)}return new ue(o,this._parents).order()}function Er(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ar(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Mr(){return Array.from(this)}function Nr(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],o=0,r=i.length;o<r;++o){var a=i[o];if(a)return a}return null}function Or(){let e=0;for(const t of this)++e;return e}function Tr(){return!this.node()}function Rr(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var o=t[n],r=0,a=o.length,s;r<a;++r)(s=o[r])&&e.call(s,s.__data__,r,o);return this}function zr(e){return function(){this.removeAttribute(e)}}function Br(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pr(e,t){return function(){this.setAttribute(e,t)}}function Hr(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Fr(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function jr(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 Lr(e,t){var n=Mt(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?Br:zr:typeof t=="function"?n.local?jr:Fr:n.local?Hr:Pr)(n,t))}function gi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Dr(e){return function(){this.style.removeProperty(e)}}function Ur(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Xr(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function Yr(e,t,n){return arguments.length>1?this.each((t==null?Dr:typeof t=="function"?Xr:Ur)(e,t,n??"")):Fe(this.node(),e)}function Fe(e,t){return e.style.getPropertyValue(t)||gi(e).getComputedStyle(e,null).getPropertyValue(t)}function qr(e){return function(){delete this[e]}}function Wr(e,t){return function(){this[e]=t}}function Gr(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Kr(e,t){return arguments.length>1?this.each((t==null?qr:typeof t=="function"?Gr:Wr)(e,t)):this.node()[e]}function yi(e){return e.trim().split(/^|\s+/)}function tn(e){return e.classList||new pi(e)}function pi(e){this._node=e,this._names=yi(e.getAttribute("class")||"")}pi.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 wi(e,t){for(var n=tn(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function bi(e,t){for(var n=tn(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function Jr(e){return function(){wi(this,e)}}function Zr(e){return function(){bi(this,e)}}function Qr(e,t){return function(){(t.apply(this,arguments)?wi:bi)(this,e)}}function _r(e,t){var n=yi(e+"");if(arguments.length<2){for(var i=tn(this.node()),o=-1,r=n.length;++o<r;)if(!i.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Qr:t?Jr:Zr)(n,t))}function es(){this.textContent=""}function ts(e){return function(){this.textContent=e}}function ns(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function is(e){return arguments.length?this.each(e==null?es:(typeof e=="function"?ns:ts)(e)):this.node().textContent}function os(){this.innerHTML=""}function as(e){return function(){this.innerHTML=e}}function rs(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ss(e){return arguments.length?this.each(e==null?os:(typeof e=="function"?rs:as)(e)):this.node().innerHTML}function ls(){this.nextSibling&&this.parentNode.appendChild(this)}function us(){return this.each(ls)}function cs(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ds(){return this.each(cs)}function fs(e){var t=typeof e=="function"?e:di(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function hs(){return null}function ms(e,t){var n=typeof e=="function"?e:di(e),i=t==null?hs:typeof t=="function"?t:en(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function vs(){var e=this.parentNode;e&&e.removeChild(this)}function gs(){return this.each(vs)}function ys(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ps(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ws(e){return this.select(e?ps:ys)}function bs(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ks(e){return function(t){e.call(this,t,this.__data__)}}function xs(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function Is(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,o=t.length,r;n<o;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++i]=r;++i?t.length=i:delete this.__on}}}function Ss(e,t,n){return function(){var i=this.__on,o,r=ks(t);if(i){for(var a=0,s=i.length;a<s;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=n),o.value=t;return}}this.addEventListener(e.type,r,n),o={type:e.type,name:e.name,value:t,listener:r,options:n},i?i.push(o):this.__on=[o]}}function $s(e,t,n){var i=xs(e+""),o,r=i.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,d=s.length,l;u<d;++u)for(o=0,l=s[u];o<r;++o)if((a=i[o]).type===l.type&&a.name===l.name)return l.value}return}for(s=t?Ss:Is,o=0;o<r;++o)this.each(s(i[o],t,n));return this}function ki(e,t,n){var i=gi(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,n):(o=i.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Cs(e,t){return function(){return ki(this,e,t)}}function Vs(e,t){return function(){return ki(this,e,t.apply(this,arguments))}}function Es(e,t){return this.each((typeof t=="function"?Vs:Cs)(e,t))}function*As(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],o=0,r=i.length,a;o<r;++o)(a=i[o])&&(yield a)}var xi=[null];function ue(e,t){this._groups=e,this._parents=t}function nt(){return new ue([[document.documentElement]],xi)}function Ms(){return this}ue.prototype=nt.prototype={constructor:ue,select:nr,selectAll:rr,selectChild:cr,selectChildren:mr,filter:vr,data:kr,enter:gr,exit:Ir,join:Sr,merge:$r,selection:Ms,order:Cr,sort:Vr,call:Ar,nodes:Mr,node:Nr,size:Or,empty:Tr,each:Rr,attr:Lr,style:Yr,property:Kr,classed:_r,text:is,html:ss,raise:us,lower:ds,append:fs,insert:ms,remove:gs,clone:ws,datum:bs,on:$s,dispatch:Es,[Symbol.iterator]:As};function Ce(e){return typeof e=="string"?new ue([[document.querySelector(e)]],[document.documentElement]):new ue([[e]],xi)}function Ns(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Se(e,t){if(e=Ns(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.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 Lt={capture:!0,passive:!1};function Dt(e){e.preventDefault(),e.stopImmediatePropagation()}function Os(e){var t=e.document.documentElement,n=Ce(e).on("dragstart.drag",Dt,Lt);"onselectstart"in t?n.on("selectstart.drag",Dt,Lt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ts(e,t){var n=e.document.documentElement,i=Ce(e).on("dragstart.drag",null);t&&(i.on("click.drag",Dt,Lt),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function nn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ii(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function it(){}var Ze=.7,kt=1/Ze,He="\\s*([+-]?\\d+)\\s*",Qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ve="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rs=/^#([0-9a-f]{3,8})$/,zs=new RegExp(`^rgb\\(${He},${He},${He}\\)$`),Bs=new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`),Ps=new RegExp(`^rgba\\(${He},${He},${He},${Qe}\\)$`),Hs=new RegExp(`^rgba\\(${ve},${ve},${ve},${Qe}\\)$`),Fs=new RegExp(`^hsl\\(${Qe},${ve},${ve}\\)$`),js=new RegExp(`^hsla\\(${Qe},${ve},${ve},${Qe}\\)$`),gn={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};nn(it,_e,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yn,formatHex:yn,formatHex8:Ls,formatHsl:Ds,formatRgb:pn,toString:pn});function yn(){return this.rgb().formatHex()}function Ls(){return this.rgb().formatHex8()}function Ds(){return Si(this).formatHsl()}function pn(){return this.rgb().formatRgb()}function _e(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Rs.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wn(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rt(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=zs.exec(e))?new le(t[1],t[2],t[3],1):(t=Bs.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ps.exec(e))?rt(t[1],t[2],t[3],t[4]):(t=Hs.exec(e))?rt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fs.exec(e))?xn(t[1],t[2]/100,t[3]/100,1):(t=js.exec(e))?xn(t[1],t[2]/100,t[3]/100,t[4]):gn.hasOwnProperty(e)?wn(gn[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function wn(e){return new le(e>>16&255,e>>8&255,e&255,1)}function rt(e,t,n,i){return i<=0&&(e=t=n=NaN),new le(e,t,n,i)}function Us(e){return e instanceof it||(e=_e(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Ut(e,t,n,i){return arguments.length===1?Us(e):new le(e,t,n,i??1)}function le(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}nn(le,Ut,Ii(it,{brighter(e){return e=e==null?kt:Math.pow(kt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ze:Math.pow(Ze,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(Re(this.r),Re(this.g),Re(this.b),xt(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:bn,formatHex:bn,formatHex8:Xs,formatRgb:kn,toString:kn}));function bn(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}`}function Xs(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}${Oe((isNaN(this.opacity)?1:this.opacity)*255)}`}function kn(){const e=xt(this.opacity);return`${e===1?"rgb(":"rgba("}${Re(this.r)}, ${Re(this.g)}, ${Re(this.b)}${e===1?")":`, ${e})`}`}function xt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Re(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oe(e){return e=Re(e),(e<16?"0":"")+e.toString(16)}function xn(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,i)}function Si(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof it||(e=_e(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),r=Math.max(t,n,i),a=NaN,s=r-o,u=(r+o)/2;return s?(t===r?a=(n-i)/s+(n<i)*6:n===r?a=(i-t)/s+2:a=(t-n)/s+4,s/=u<.5?r+o:2-r-o,a*=60):s=u>0&&u<1?0:a,new fe(a,s,u,e.opacity)}function Ys(e,t,n,i){return arguments.length===1?Si(e):new fe(e,t,n,i??1)}function fe(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}nn(fe,Ys,Ii(it,{brighter(e){return e=e==null?kt:Math.pow(kt,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ze:Math.pow(Ze,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,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new le(Bt(e>=240?e-240:e+120,o,i),Bt(e,o,i),Bt(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new fe(In(this.h),st(this.s),st(this.l),xt(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=xt(this.opacity);return`${e===1?"hsl(":"hsla("}${In(this.h)}, ${st(this.s)*100}%, ${st(this.l)*100}%${e===1?")":`, ${e})`}`}}));function In(e){return e=(e||0)%360,e<0?e+360:e}function st(e){return Math.max(0,Math.min(1,e||0))}function Bt(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 $i=e=>()=>e;function qs(e,t){return function(n){return e+n*t}}function Ws(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Gs(e){return(e=+e)==1?Ci:function(t,n){return n-t?Ws(t,n,e):$i(isNaN(t)?n:t)}}function Ci(e,t){var n=t-e;return n?qs(e,n):$i(isNaN(e)?t:e)}const Sn=(function e(t){var n=Gs(t);function i(o,r){var a=n((o=Ut(o)).r,(r=Ut(r)).r),s=n(o.g,r.g),u=n(o.b,r.b),d=Ci(o.opacity,r.opacity);return function(l){return o.r=a(l),o.g=s(l),o.b=u(l),o.opacity=d(l),o+""}}return i.gamma=e,i})(1);function $e(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Xt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pt=new RegExp(Xt.source,"g");function Ks(e){return function(){return e}}function Js(e){return function(t){return e(t)+""}}function Zs(e,t){var n=Xt.lastIndex=Pt.lastIndex=0,i,o,r,a=-1,s=[],u=[];for(e=e+"",t=t+"";(i=Xt.exec(e))&&(o=Pt.exec(t));)(r=o.index)>n&&(r=t.slice(n,r),s[a]?s[a]+=r:s[++a]=r),(i=i[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,u.push({i:a,x:$e(i,o)})),n=Pt.lastIndex;return n<t.length&&(r=t.slice(n),s[a]?s[a]+=r:s[++a]=r),s.length<2?u[0]?Js(u[0].x):Ks(t):(t=u.length,function(d){for(var l=0,c;l<t;++l)s[(c=u[l]).i]=c.x(d);return s.join("")})}var $n=180/Math.PI,Yt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vi(e,t,n,i,o,r){var a,s,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*i)&&(n-=e*u,i-=t*u),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,u/=s),e*i<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*$n,skewX:Math.atan(u)*$n,scaleX:a,scaleY:s}}var lt;function Qs(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Yt:Vi(t.a,t.b,t.c,t.d,t.e,t.f)}function _s(e){return e==null||(lt||(lt=document.createElementNS("http://www.w3.org/2000/svg","g")),lt.setAttribute("transform",e),!(e=lt.transform.baseVal.consolidate()))?Yt:(e=e.matrix,Vi(e.a,e.b,e.c,e.d,e.e,e.f))}function Ei(e,t,n,i){function o(d){return d.length?d.pop()+" ":""}function r(d,l,c,v,h,b){if(d!==c||l!==v){var V=h.push("translate(",null,t,null,n);b.push({i:V-4,x:$e(d,c)},{i:V-2,x:$e(l,v)})}else(c||v)&&h.push("translate("+c+t+v+n)}function a(d,l,c,v){d!==l?(d-l>180?l+=360:l-d>180&&(d+=360),v.push({i:c.push(o(c)+"rotate(",null,i)-2,x:$e(d,l)})):l&&c.push(o(c)+"rotate("+l+i)}function s(d,l,c,v){d!==l?v.push({i:c.push(o(c)+"skewX(",null,i)-2,x:$e(d,l)}):l&&c.push(o(c)+"skewX("+l+i)}function u(d,l,c,v,h,b){if(d!==c||l!==v){var V=h.push(o(h)+"scale(",null,",",null,")");b.push({i:V-4,x:$e(d,c)},{i:V-2,x:$e(l,v)})}else(c!==1||v!==1)&&h.push(o(h)+"scale("+c+","+v+")")}return function(d,l){var c=[],v=[];return d=e(d),l=e(l),r(d.translateX,d.translateY,l.translateX,l.translateY,c,v),a(d.rotate,l.rotate,c,v),s(d.skewX,l.skewX,c,v),u(d.scaleX,d.scaleY,l.scaleX,l.scaleY,c,v),d=l=null,function(h){for(var b=-1,V=v.length,P;++b<V;)c[(P=v[b]).i]=P.x(h);return c.join("")}}}var el=Ei(Qs,"px, ","px)","deg)"),tl=Ei(_s,", ",")",")"),nl=1e-12;function Cn(e){return((e=Math.exp(e))+1/e)/2}function il(e){return((e=Math.exp(e))-1/e)/2}function ol(e){return((e=Math.exp(2*e))-1)/(e+1)}const al=(function e(t,n,i){function o(r,a){var s=r[0],u=r[1],d=r[2],l=a[0],c=a[1],v=a[2],h=l-s,b=c-u,V=h*h+b*b,P,A;if(V<nl)A=Math.log(v/d)/t,P=function(U){return[s+U*h,u+U*b,d*Math.exp(t*U*A)]};else{var M=Math.sqrt(V),$=(v*v-d*d+i*V)/(2*d*n*M),E=(v*v-d*d-i*V)/(2*v*n*M),j=Math.log(Math.sqrt($*$+1)-$),B=Math.log(Math.sqrt(E*E+1)-E);A=(B-j)/t,P=function(U){var W=U*A,H=Cn(j),F=d/(n*M)*(H*ol(t*W+j)-il(j));return[s+F*h,u+F*b,d*H/Cn(t*W+j)]}}return P.duration=A*1e3*t/Math.SQRT2,P}return o.rho=function(r){var a=Math.max(.001,+r),s=a*a,u=s*s;return e(a,s,u)},o})(Math.SQRT2,2,4);var je=0,Xe=0,De=0,Ai=1e3,It,Ye,St=0,ze=0,Nt=0,et=typeof performance=="object"&&performance.now?performance:Date,Mi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function on(){return ze||(Mi(rl),ze=et.now()+Nt)}function rl(){ze=0}function $t(){this._call=this._time=this._next=null}$t.prototype=Ni.prototype={constructor:$t,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?on():+n)+(t==null?0:+t),!this._next&&Ye!==this&&(Ye?Ye._next=this:It=this,Ye=this),this._call=e,this._time=n,qt()},stop:function(){this._call&&(this._call=null,this._time=1/0,qt())}};function Ni(e,t,n){var i=new $t;return i.restart(e,t,n),i}function sl(){on(),++je;for(var e=It,t;e;)(t=ze-e._time)>=0&&e._call.call(void 0,t),e=e._next;--je}function Vn(){ze=(St=et.now())+Nt,je=Xe=0;try{sl()}finally{je=0,ul(),ze=0}}function ll(){var e=et.now(),t=e-St;t>Ai&&(Nt-=t,St=e)}function ul(){for(var e,t=It,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:It=n);Ye=e,qt(i)}function qt(e){if(!je){Xe&&(Xe=clearTimeout(Xe));var t=e-ze;t>24?(e<1/0&&(Xe=setTimeout(Vn,e-et.now()-Nt)),De&&(De=clearInterval(De))):(De||(St=et.now(),De=setInterval(ll,Ai)),je=1,Mi(Vn))}}function En(e,t,n){var i=new $t;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,n),i}var cl=_t("start","end","cancel","interrupt"),dl=[],Oi=0,An=1,Wt=2,mt=3,Mn=4,Gt=5,vt=6;function Ot(e,t,n,i,o,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;fl(e,n,{name:t,index:i,group:o,on:cl,tween:dl,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Oi})}function an(e,t){var n=me(e,t);if(n.state>Oi)throw new Error("too late; already scheduled");return n}function ge(e,t){var n=me(e,t);if(n.state>mt)throw new Error("too late; already running");return n}function me(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function fl(e,t,n){var i=e.__transition,o;i[t]=n,n.timer=Ni(r,0,n.time);function r(d){n.state=An,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var l,c,v,h;if(n.state!==An)return u();for(l in i)if(h=i[l],h.name===n.name){if(h.state===mt)return En(a);h.state===Mn?(h.state=vt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete i[l]):+l<t&&(h.state=vt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete i[l])}if(En(function(){n.state===mt&&(n.state=Mn,n.timer.restart(s,n.delay,n.time),s(d))}),n.state=Wt,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Wt){for(n.state=mt,o=new Array(v=n.tween.length),l=0,c=-1;l<v;++l)(h=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=h);o.length=c+1}}function s(d){for(var l=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=Gt,1),c=-1,v=o.length;++c<v;)o[c].call(e,l);n.state===Gt&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=vt,n.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function gt(e,t){var n=e.__transition,i,o,r=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){r=!1;continue}o=i.state>Wt&&i.state<Gt,i.state=vt,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}r&&delete e.__transition}}function hl(e){return this.each(function(){gt(this,e)})}function ml(e,t){var n,i;return function(){var o=ge(this,e),r=o.tween;if(r!==n){i=n=r;for(var a=0,s=i.length;a<s;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function vl(e,t,n){var i,o;if(typeof n!="function")throw new Error;return function(){var r=ge(this,e),a=r.tween;if(a!==i){o=(i=a).slice();for(var s={name:t,value:n},u=0,d=o.length;u<d;++u)if(o[u].name===t){o[u]=s;break}u===d&&o.push(s)}r.tween=o}}function gl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=me(this.node(),n).tween,o=0,r=i.length,a;o<r;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?ml:vl)(n,e,t))}function rn(e,t,n){var i=e._id;return e.each(function(){var o=ge(this,i);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return me(o,i).value[t]}}function Ti(e,t){var n;return(typeof t=="number"?$e:t instanceof _e?Sn:(n=_e(t))?(t=n,Sn):Zs)(e,t)}function yl(e){return function(){this.removeAttribute(e)}}function pl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wl(e,t,n){var i,o=n+"",r;return function(){var a=this.getAttribute(e);return a===o?null:a===i?r:r=t(i=a,n)}}function bl(e,t,n){var i,o=n+"",r;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?r:r=t(i=a,n)}}function kl(e,t,n){var i,o,r;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=s+"",a===u?null:a===i&&u===o?r:(o=u,r=t(i=a,s)))}}function xl(e,t,n){var i,o,r;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=s+"",a===u?null:a===i&&u===o?r:(o=u,r=t(i=a,s)))}}function Il(e,t){var n=Mt(e),i=n==="transform"?tl:Ti;return this.attrTween(e,typeof t=="function"?(n.local?xl:kl)(n,i,rn(this,"attr."+e,t)):t==null?(n.local?pl:yl)(n):(n.local?bl:wl)(n,i,t))}function Sl(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function $l(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Cl(e,t){var n,i;function o(){var r=t.apply(this,arguments);return r!==i&&(n=(i=r)&&$l(e,r)),n}return o._value=t,o}function Vl(e,t){var n,i;function o(){var r=t.apply(this,arguments);return r!==i&&(n=(i=r)&&Sl(e,r)),n}return o._value=t,o}function El(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 i=Mt(e);return this.tween(n,(i.local?Cl:Vl)(i,t))}function Al(e,t){return function(){an(this,e).delay=+t.apply(this,arguments)}}function Ml(e,t){return t=+t,function(){an(this,e).delay=t}}function Nl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Al:Ml)(t,e)):me(this.node(),t).delay}function Ol(e,t){return function(){ge(this,e).duration=+t.apply(this,arguments)}}function Tl(e,t){return t=+t,function(){ge(this,e).duration=t}}function Rl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ol:Tl)(t,e)):me(this.node(),t).duration}function zl(e,t){if(typeof t!="function")throw new Error;return function(){ge(this,e).ease=t}}function Bl(e){var t=this._id;return arguments.length?this.each(zl(t,e)):me(this.node(),t).ease}function Pl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ge(this,e).ease=n}}function Hl(e){if(typeof e!="function")throw new Error;return this.each(Pl(this._id,e))}function Fl(e){typeof e!="function"&&(e=hi(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var r=t[o],a=r.length,s=i[o]=[],u,d=0;d<a;++d)(u=r[d])&&e.call(u,u.__data__,d,r)&&s.push(u);return new xe(i,this._parents,this._name,this._id)}function jl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,o=n.length,r=Math.min(i,o),a=new Array(i),s=0;s<r;++s)for(var u=t[s],d=n[s],l=u.length,c=a[s]=new Array(l),v,h=0;h<l;++h)(v=u[h]||d[h])&&(c[h]=v);for(;s<i;++s)a[s]=t[s];return new xe(a,this._parents,this._name,this._id)}function Ll(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 Dl(e,t,n){var i,o,r=Ll(t)?an:ge;return function(){var a=r(this,e),s=a.on;s!==i&&(o=(i=s).copy()).on(t,n),a.on=o}}function Ul(e,t){var n=this._id;return arguments.length<2?me(this.node(),n).on.on(e):this.each(Dl(n,e,t))}function Xl(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Yl(){return this.on("end.remove",Xl(this._id))}function ql(e){var t=this._name,n=this._id;typeof e!="function"&&(e=en(e));for(var i=this._groups,o=i.length,r=new Array(o),a=0;a<o;++a)for(var s=i[a],u=s.length,d=r[a]=new Array(u),l,c,v=0;v<u;++v)(l=s[v])&&(c=e.call(l,l.__data__,v,s))&&("__data__"in l&&(c.__data__=l.__data__),d[v]=c,Ot(d[v],t,n,v,d,me(l,n)));return new xe(r,this._parents,t,n)}function Wl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fi(e));for(var i=this._groups,o=i.length,r=[],a=[],s=0;s<o;++s)for(var u=i[s],d=u.length,l,c=0;c<d;++c)if(l=u[c]){for(var v=e.call(l,l.__data__,c,u),h,b=me(l,n),V=0,P=v.length;V<P;++V)(h=v[V])&&Ot(h,t,n,V,v,b);r.push(v),a.push(l)}return new xe(r,a,t,n)}var Gl=nt.prototype.constructor;function Kl(){return new Gl(this._groups,this._parents)}function Jl(e,t){var n,i,o;return function(){var r=Fe(this,e),a=(this.style.removeProperty(e),Fe(this,e));return r===a?null:r===n&&a===i?o:o=t(n=r,i=a)}}function Ri(e){return function(){this.style.removeProperty(e)}}function Zl(e,t,n){var i,o=n+"",r;return function(){var a=Fe(this,e);return a===o?null:a===i?r:r=t(i=a,n)}}function Ql(e,t,n){var i,o,r;return function(){var a=Fe(this,e),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(e),Fe(this,e))),a===u?null:a===i&&u===o?r:(o=u,r=t(i=a,s))}}function _l(e,t){var n,i,o,r="style."+t,a="end."+r,s;return function(){var u=ge(this,e),d=u.on,l=u.value[r]==null?s||(s=Ri(t)):void 0;(d!==n||o!==l)&&(i=(n=d).copy()).on(a,o=l),u.on=i}}function eu(e,t,n){var i=(e+="")=="transform"?el:Ti;return t==null?this.styleTween(e,Jl(e,i)).on("end.style."+e,Ri(e)):typeof t=="function"?this.styleTween(e,Ql(e,i,rn(this,"style."+e,t))).each(_l(this._id,e)):this.styleTween(e,Zl(e,i,t),n).on("end.style."+e,null)}function tu(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function nu(e,t,n){var i,o;function r(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&tu(e,a,n)),i}return r._value=t,r}function iu(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,nu(e,t,n??""))}function ou(e){return function(){this.textContent=e}}function au(e){return function(){var t=e(this);this.textContent=t??""}}function ru(e){return this.tween("text",typeof e=="function"?au(rn(this,"text",e)):ou(e==null?"":e+""))}function su(e){return function(t){this.textContent=e.call(this,t)}}function lu(e){var t,n;function i(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&su(o)),t}return i._value=e,i}function uu(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,lu(e))}function cu(){for(var e=this._name,t=this._id,n=zi(),i=this._groups,o=i.length,r=0;r<o;++r)for(var a=i[r],s=a.length,u,d=0;d<s;++d)if(u=a[d]){var l=me(u,t);Ot(u,e,n,d,a,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new xe(i,this._parents,e,n)}function du(){var e,t,n=this,i=n._id,o=n.size();return new Promise(function(r,a){var s={value:a},u={value:function(){--o===0&&r()}};n.each(function(){var d=ge(this,i),l=d.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(u)),d.on=t}),o===0&&r()})}var fu=0;function xe(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function zi(){return++fu}var ye=nt.prototype;xe.prototype={constructor:xe,select:ql,selectAll:Wl,selectChild:ye.selectChild,selectChildren:ye.selectChildren,filter:Fl,merge:jl,selection:Kl,transition:cu,call:ye.call,nodes:ye.nodes,node:ye.node,size:ye.size,empty:ye.empty,each:ye.each,on:Ul,attr:Il,attrTween:El,style:eu,styleTween:iu,text:ru,textTween:uu,remove:Yl,tween:gl,delay:Nl,duration:Rl,ease:Bl,easeVarying:Hl,end:du,[Symbol.iterator]:ye[Symbol.iterator]};function hu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mu={time:null,delay:0,duration:250,ease:hu};function vu(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 gu(e){var t,n;e instanceof xe?(t=e._id,e=e._name):(t=zi(),(n=mu).time=on(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,r=0;r<o;++r)for(var a=i[r],s=a.length,u,d=0;d<s;++d)(u=a[d])&&Ot(u,e,t,d,a,n||vu(u,t));return new xe(i,this._parents,e,t)}nt.prototype.interrupt=hl;nt.prototype.transition=gu;const ut=e=>()=>e;function yu(e,{sourceEvent:t,target:n,transform:i,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:i,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 sn=new be(1,0,0);be.prototype;function Ht(e){e.stopImmediatePropagation()}function Ue(e){e.preventDefault(),e.stopImmediatePropagation()}function pu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function wu(){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 Nn(){return this.__zoom||sn}function bu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ku(){return navigator.maxTouchPoints||"ontouchstart"in this}function xu(e,t,n){var i=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function Iu(){var e=pu,t=wu,n=xu,i=bu,o=ku,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,u=al,d=_t("start","zoom","end"),l,c,v,h=500,b=150,V=0,P=10;function A(g){g.property("__zoom",Nn).on("wheel.zoom",W,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",ce).on("touchmove.zoom",te).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(g,T,k,R){var I=g.selection?g.selection():g;I.property("__zoom",Nn),g!==I?j(g,T,k,R):I.interrupt().each(function(){B(this,arguments).event(R).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},A.scaleBy=function(g,T,k,R){A.scaleTo(g,function(){var I=this.__zoom.k,y=typeof T=="function"?T.apply(this,arguments):T;return I*y},k,R)},A.scaleTo=function(g,T,k,R){A.transform(g,function(){var I=t.apply(this,arguments),y=this.__zoom,p=k==null?E(I):typeof k=="function"?k.apply(this,arguments):k,N=y.invert(p),D=typeof T=="function"?T.apply(this,arguments):T;return n($(M(y,D),p,N),I,a)},k,R)},A.translateBy=function(g,T,k,R){A.transform(g,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),a)},null,R)},A.translateTo=function(g,T,k,R,I){A.transform(g,function(){var y=t.apply(this,arguments),p=this.__zoom,N=R==null?E(y):typeof R=="function"?R.apply(this,arguments):R;return n(sn.translate(N[0],N[1]).scale(p.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof k=="function"?-k.apply(this,arguments):-k),y,a)},R,I)};function M(g,T){return T=Math.max(r[0],Math.min(r[1],T)),T===g.k?g:new be(T,g.x,g.y)}function $(g,T,k){var R=T[0]-k[0]*g.k,I=T[1]-k[1]*g.k;return R===g.x&&I===g.y?g:new be(g.k,R,I)}function E(g){return[(+g[0][0]+ +g[1][0])/2,(+g[0][1]+ +g[1][1])/2]}function j(g,T,k,R){g.on("start.zoom",function(){B(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event(R).end()}).tween("zoom",function(){var I=this,y=arguments,p=B(I,y).event(R),N=t.apply(I,y),D=k==null?E(N):typeof k=="function"?k.apply(I,y):k,Y=Math.max(N[1][0]-N[0][0],N[1][1]-N[0][1]),q=I.__zoom,J=typeof T=="function"?T.apply(I,y):T,_=u(q.invert(D).concat(Y/q.k),J.invert(D).concat(Y/J.k));return function(ne){if(ne===1)ne=J;else{var de=_(ne),Tt=Y/de[2];ne=new be(Tt,D[0]-de[0]*Tt,D[1]-de[1]*Tt)}p.zoom(null,ne)}})}function B(g,T,k){return!k&&g.__zooming||new U(g,T)}function U(g,T){this.that=g,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(g,T),this.taps=0}U.prototype={event:function(g){return g&&(this.sourceEvent=g),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(g,T){return this.mouse&&g!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&g!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&g!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(g){var T=Ce(this.that).datum();d.call(g,this.that,new yu(g,{sourceEvent:this.sourceEvent,target:A,transform:this.that.__zoom,dispatch:d}),T)}};function W(g,...T){if(!e.apply(this,arguments))return;var k=B(this,T).event(g),R=this.__zoom,I=Math.max(r[0],Math.min(r[1],R.k*Math.pow(2,i.apply(this,arguments)))),y=Se(g);if(k.wheel)(k.mouse[0][0]!==y[0]||k.mouse[0][1]!==y[1])&&(k.mouse[1]=R.invert(k.mouse[0]=y)),clearTimeout(k.wheel);else{if(R.k===I)return;k.mouse=[y,R.invert(y)],gt(this),k.start()}Ue(g),k.wheel=setTimeout(p,b),k.zoom("mouse",n($(M(R,I),k.mouse[0],k.mouse[1]),k.extent,a));function p(){k.wheel=null,k.end()}}function H(g,...T){if(v||!e.apply(this,arguments))return;var k=g.currentTarget,R=B(this,T,!0).event(g),I=Ce(g.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",Y,!0),y=Se(g,k),p=g.clientX,N=g.clientY;Os(g.view),Ht(g),R.mouse=[y,this.__zoom.invert(y)],gt(this),R.start();function D(q){if(Ue(q),!R.moved){var J=q.clientX-p,_=q.clientY-N;R.moved=J*J+_*_>V}R.event(q).zoom("mouse",n($(R.that.__zoom,R.mouse[0]=Se(q,k),R.mouse[1]),R.extent,a))}function Y(q){I.on("mousemove.zoom mouseup.zoom",null),Ts(q.view,R.moved),Ue(q),R.event(q).end()}}function F(g,...T){if(e.apply(this,arguments)){var k=this.__zoom,R=Se(g.changedTouches?g.changedTouches[0]:g,this),I=k.invert(R),y=k.k*(g.shiftKey?.5:2),p=n($(M(k,y),R,I),t.apply(this,T),a);Ue(g),s>0?Ce(this).transition().duration(s).call(j,p,R,g):Ce(this).call(A.transform,p,R,g)}}function ce(g,...T){if(e.apply(this,arguments)){var k=g.touches,R=k.length,I=B(this,T,g.changedTouches.length===R).event(g),y,p,N,D;for(Ht(g),p=0;p<R;++p)N=k[p],D=Se(N,this),D=[D,this.__zoom.invert(D),N.identifier],I.touch0?!I.touch1&&I.touch0[2]!==D[2]&&(I.touch1=D,I.taps=0):(I.touch0=D,y=!0,I.taps=1+!!l);l&&(l=clearTimeout(l)),y&&(I.taps<2&&(c=D[0],l=setTimeout(function(){l=null},h)),gt(this),I.start())}}function te(g,...T){if(this.__zooming){var k=B(this,T).event(g),R=g.changedTouches,I=R.length,y,p,N,D;for(Ue(g),y=0;y<I;++y)p=R[y],N=Se(p,this),k.touch0&&k.touch0[2]===p.identifier?k.touch0[0]=N:k.touch1&&k.touch1[2]===p.identifier&&(k.touch1[0]=N);if(p=k.that.__zoom,k.touch1){var Y=k.touch0[0],q=k.touch0[1],J=k.touch1[0],_=k.touch1[1],ne=(ne=J[0]-Y[0])*ne+(ne=J[1]-Y[1])*ne,de=(de=_[0]-q[0])*de+(de=_[1]-q[1])*de;p=M(p,Math.sqrt(ne/de)),N=[(Y[0]+J[0])/2,(Y[1]+J[1])/2],D=[(q[0]+_[0])/2,(q[1]+_[1])/2]}else if(k.touch0)N=k.touch0[0],D=k.touch0[1];else return;k.zoom("touch",n($(p,N,D),k.extent,a))}}function oe(g,...T){if(this.__zooming){var k=B(this,T).event(g),R=g.changedTouches,I=R.length,y,p;for(Ht(g),v&&clearTimeout(v),v=setTimeout(function(){v=null},h),y=0;y<I;++y)p=R[y],k.touch0&&k.touch0[2]===p.identifier?delete k.touch0:k.touch1&&k.touch1[2]===p.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(p=Se(p,this),Math.hypot(c[0]-p[0],c[1]-p[1])<P)){var N=Ce(this).on("dblclick.zoom");N&&N.apply(this,arguments)}}}return A.wheelDelta=function(g){return arguments.length?(i=typeof g=="function"?g:ut(+g),A):i},A.filter=function(g){return arguments.length?(e=typeof g=="function"?g:ut(!!g),A):e},A.touchable=function(g){return arguments.length?(o=typeof g=="function"?g:ut(!!g),A):o},A.extent=function(g){return arguments.length?(t=typeof g=="function"?g:ut([[+g[0][0],+g[0][1]],[+g[1][0],+g[1][1]]]),A):t},A.scaleExtent=function(g){return arguments.length?(r[0]=+g[0],r[1]=+g[1],A):[r[0],r[1]]},A.translateExtent=function(g){return arguments.length?(a[0][0]=+g[0][0],a[1][0]=+g[1][0],a[0][1]=+g[0][1],a[1][1]=+g[1][1],A):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},A.constrain=function(g){return arguments.length?(n=g,A):n},A.duration=function(g){return arguments.length?(s=+g,A):s},A.interpolate=function(g){return arguments.length?(u=g,A):u},A.on=function(){var g=d.on.apply(d,arguments);return g===d?A:g},A.clickDistance=function(g){return arguments.length?(V=(g=+g)*g,A):Math.sqrt(V)},A.tapDistance=function(g){return arguments.length?(P=+g,A):P},A}const Bi=Symbol("MiniMapSlots"),Su=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],$u={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},Cu=K({...$u,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:t}){const n=e,i=xo(Bi),o=Qn(),r=Ke(()=>o.style??{});function a(c){t("click",c)}function s(c){t("dblclick",c)}function u(c){t("mouseenter",c)}function d(c){t("mousemove",c)}function l(c){t("mouseleave",c)}return(c,v)=>!c.hidden&&c.dimensions.width!==0&&c.dimensions.height!==0?(m(),O(X,{key:0},[f(i)[`node-${n.type}`]?(m(),C(Io(f(i)[`node-${n.type}`]),Ve(Ee({key:0},{...n,...c.$attrs})),null,16)):(m(),O("rect",Ee({key:1,id:c.id},c.$attrs,{class:["vue-flow__minimap-node",{selected:c.selected,dragging:c.dragging}],x:c.position.x,y:c.position.y,rx:c.borderRadius,ry:c.borderRadius,width:c.dimensions.width,height:c.dimensions.height,fill:c.color||r.value.background||r.value.backgroundColor,stroke:c.strokeColor,"stroke-width":c.strokeWidth,"shape-rendering":c.shapeRendering,onClick:a,onDblclick:s,onMouseenter:u,onMousemove:d,onMouseleave:l}),null,16,Su))],64)):z("",!0)}}),Vu=["width","height","viewBox","aria-labelledby"],Eu=["id"],Au=["d","fill","stroke","stroke-width"],Mu={name:"MiniMap",compatConfig:{MODE:3}},Nu=K({...Mu,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:t}){const n=bo(),i=Qn(),o=200,r=150,{id:a,edges:s,viewport:u,translateExtent:d,dimensions:l,emits:c,d3Selection:v,d3Zoom:h,getNodesInitialized:b}=Ct(),V=ie();So(Bi,n);const P=Ke(()=>{var I;return e.width??((I=i.style)==null?void 0:I.width)??o}),A=Ke(()=>{var I;return e.height??((I=i.style)==null?void 0:I.height)??r}),M=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",$=S(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),E=S(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),j=S(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),B=S(()=>Zi(b.value.filter(I=>!I.hidden))),U=S(()=>({x:-u.value.x/u.value.zoom,y:-u.value.y/u.value.zoom,width:l.value.width/u.value.zoom,height:l.value.height/u.value.zoom})),W=S(()=>b.value&&b.value.length?Ji(B.value,U.value):U.value),H=S(()=>{const I=W.value.width/P.value,y=W.value.height/A.value;return Math.max(I,y)}),F=S(()=>{const I=H.value*P.value,y=H.value*A.value,p=e.offsetScale*H.value;return{offset:p,x:W.value.x-(I-W.value.width)/2-p,y:W.value.y-(y-W.value.height)/2-p,width:I+p*2,height:y+p*2}}),ce=S(()=>!F.value.x||!F.value.y?"":`
2
- M${F.value.x-F.value.offset},${F.value.y-F.value.offset}
3
- h${F.value.width+F.value.offset*2}
4
- v${F.value.height+F.value.offset*2}
5
- h${-F.value.width-F.value.offset*2}z
6
- M${U.value.x+e.maskBorderRadius},${U.value.y}
7
- h${U.value.width-2*e.maskBorderRadius}
8
- a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
9
- v${U.value.height-2*e.maskBorderRadius}
10
- a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
11
- h${-(U.value.width-2*e.maskBorderRadius)}
12
- a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
13
- v${-(U.value.height-2*e.maskBorderRadius)}
14
- a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);ko(I=>{if(V.value){const y=Ce(V.value),p=Y=>{if(Y.sourceEvent.type!=="wheel"||!v.value||!h.value)return;const q=Y.sourceEvent.ctrlKey&&Ki()?10:1,J=-Y.sourceEvent.deltaY*(Y.sourceEvent.deltaMode===1?.05:Y.sourceEvent.deltaMode?1:.002)*e.zoomStep,_=u.value.zoom*2**(J*q);h.value.scaleTo(v.value,_)},N=Y=>{if(Y.sourceEvent.type!=="mousemove"||!v.value||!h.value)return;const q=H.value*Math.max(1,u.value.zoom)*(e.inversePan?-1:1),J={x:u.value.x-Y.sourceEvent.movementX*q,y:u.value.y-Y.sourceEvent.movementY*q},_=[[0,0],[l.value.width,l.value.height]],ne=sn.translate(J.x,J.y).scale(u.value.zoom),de=h.value.constrain()(ne,_,d.value);h.value.transform(v.value,de)},D=Iu().wheelDelta(Y=>Gi(Y)*(e.zoomStep/10)).on("zoom",e.pannable?N:()=>{}).on("zoom.wheel",e.zoomable?p:()=>{});y.call(D),I(()=>{y.on("zoom",null)})}},{flush:"post"});function te(I){const[y,p]=Se(I);t("click",{event:I,position:{x:y,y:p}})}function oe(I,y){const p={event:I,node:y,connectedEdges:Le([y],s.value)};c.miniMapNodeClick(p),t("nodeClick",p)}function g(I,y){const p={event:I,node:y,connectedEdges:Le([y],s.value)};c.miniMapNodeDoubleClick(p),t("nodeDblclick",p)}function T(I,y){const p={event:I,node:y,connectedEdges:Le([y],s.value)};c.miniMapNodeMouseEnter(p),t("nodeMouseenter",p)}function k(I,y){const p={event:I,node:y,connectedEdges:Le([y],s.value)};c.miniMapNodeMouseMove(p),t("nodeMousemove",p)}function R(I,y){const p={event:I,node:y,connectedEdges:Le([y],s.value)};c.miniMapNodeMouseLeave(p),t("nodeMouseleave",p)}return(I,y)=>(m(),C(f(dt),{position:I.position,class:Me(["vue-flow__minimap",{pannable:I.pannable,zoomable:I.zoomable}])},{default:w(()=>[(m(),O("svg",{ref_key:"el",ref:V,width:P.value,height:A.value,viewBox:[F.value.x,F.value.y,F.value.width,F.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${f(a)}`,onClick:te},[I.ariaLabel?(m(),O("title",{key:0,id:`vue-flow__minimap-${f(a)}`},Z(I.ariaLabel),9,Eu)):z("",!0),(m(!0),O(X,null,re(f(b),p=>(m(),C(Cu,{id:p.id,key:p.id,f:"",position:p.computedPosition,dimensions:p.dimensions,selected:p.selected,dragging:p.dragging,style:he(p.style),class:Me(j.value(p)),color:$.value(p),"border-radius":I.nodeBorderRadius,"stroke-color":E.value(p),"stroke-width":I.nodeStrokeWidth,"shape-rendering":f(M),type:p.type,hidden:p.hidden,onClick:N=>oe(N,p),onDblclick:N=>g(N,p),onMouseenter:N=>T(N,p),onMousemove:N=>k(N,p),onMouseleave:N=>R(N,p)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),L("path",{class:"vue-flow__minimap-mask",d:ce.value,fill:I.maskColor,stroke:I.maskStrokeColor,"stroke-width":I.maskStrokeWidth,"fill-rule":"evenodd"},null,8,Au)],8,Vu))]),_:1},8,["position","class"]))}}),Ou={class:"vue-flow-container"},Tu={key:0},Ru={key:0},zu={key:1},Bu=K({__name:"GenericCanvas",props:{canvasId:{},inputResolverOutputs:{},components:{},entities:{},interactive:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},minimap:{type:Boolean,default:!0}},emits:["dragover","init"],setup(e,{emit:t}){const n=t,i=Kt.ensureCreated(...e.canvasId);return We(()=>e.inputResolverOutputs,o=>{i.edgeEndpointOffsets.setInputResolverOutputs(o)},{immediate:!0}),n("init",i),(o,r)=>{const a=Qi;return m(),C(a,null,{default:w(()=>[L("div",Ou,[x(f(_i),{"min-zoom":.1,"max-zoom":1,"snap-to-grid":!0,onDragover:r[1]||(r[1]=s=>n("dragover",s))},{"node-instance":w(s=>[Q(o.$slots,"node-instance",Ve(Ne(s)),void 0,!0)]),"node-inputs":w(s=>[Q(o.$slots,"node-inputs",Ve(Ne(s)),void 0,!0)]),"node-outputs":w(s=>[Q(o.$slots,"node-outputs",Ve(Ne(s)),void 0,!0)]),"node-hub":w(s=>[Q(o.$slots,"node-hub",Ve(Ne(s)),void 0,!0)]),"edge-custom":w(s=>[x(f(Gu),Ee(s,{"input-resolver-outputs":e.inputResolverOutputs,components:e.components,entities:e.entities}),null,16,["input-resolver-outputs","components","entities"])]),default:w(()=>[x(f(Ka),{"pattern-color":"#aaa",gap:32}),e.minimap?(m(),C(f(Nu),{key:0,position:"top-right"})):z("",!0),x(f(dt),{position:"top-left"},{default:w(()=>[e.interactive?(m(),O("div",Tu,[r[6]||(r[6]=G(" Hold Control to add nodes to selection and Alt to remove them ",-1)),r[7]||(r[7]=L("br",null,null,-1)),e.editable?(m(),O("div",Ru,"Press Ctrl+V to paste blueprint from clipboard")):z("",!0),f(i).selection.selectedNodeIds.size>0?(m(),O("div",zu,[G(" Selected "+Z(f(i).selection.selectedNodeIds.size)+" nodes ",1),r[2]||(r[2]=L("br",null,null,-1)),r[3]||(r[3]=G(" Press Escape to clear selection ",-1)),r[4]||(r[4]=L("br",null,null,-1)),r[5]||(r[5]=G(" Press Ctrl+C to copy selected nodes to clipboard ",-1))])):z("",!0)])):z("",!0)]),_:1}),x(f(dt),{position:"bottom-right"},{default:w(()=>[Q(o.$slots,"panel-bottom-right",{},void 0,!0)]),_:3}),x(f(dt),{position:"bottom-left"},{default:w(()=>[Q(o.$slots,"panel-bottom-left",{},void 0,!0)]),_:3}),Q(o.$slots,"overlay",{},void 0,!0),x(f(Ju),{"selection-mode":f(i).selection.selectionMode,"selection-area":f(i).selection.selectionArea},null,8,["selection-mode","selection-area"]),x($o,{modelValue:f(i).blueprintCopied,"onUpdate:modelValue":r[0]||(r[0]=s=>f(i).blueprintCopied=s),location:"top center",color:"info"},{default:w(()=>[...r[8]||(r[8]=[G(" Blueprint copied to clipboard ",-1)])]),_:1},8,["modelValue"])]),_:3})])]),_:3})}}}),sc=se(Bu,[["__scopeId","data-v-374afcf7"]]),Pu=K({__name:"HubCard",props:{selected:{type:Boolean},blueprintStatus:{}},setup(e){return(t,n)=>(m(),C(Jt,{variant:"flat",style:he(f(zo)(e.selected,e.blueprintStatus)),color:"#2d2d2d"},{default:w(()=>[x(ae,{class:"ma-2",size:74},{default:w(()=>[...n[0]||(n[0]=[G("mdi-router",-1)])]),_:1}),Q(t.$slots,"default")]),_:3},8,["style"]))}}),Hu=K({__name:"HubNodeHandle",props:{side:{},handleColor:{},isValidConnection:{type:Function}},setup(e){return(t,n)=>(m(),O(X,null,[x(f(Bn),{id:"",type:e.side==="left"?"target":"source",position:e.side==="left"?f(yt).Left:f(yt).Right,class:Me(["handle",[e.side==="left"?"left-handle":"right-handle"]]),"is-valid-connection":e.isValidConnection},null,8,["type","position","class","is-valid-connection"]),L("div",{class:Me(["handle-dot",[e.side==="left"?"handle-dot-left":"handle-dot-right"]]),style:he({backgroundColor:e.handleColor})},null,6)],64))}}),On=se(Hu,[["__scopeId","data-v-dc6563a5"]]),Fu={class:"handles"},ju=K({__name:"HubNode",props:{hub:{},isValidConnection:{type:Function}},emits:["contextmenu"],setup(e,{emit:t}){const n=t,{vueFlowStore:i,selection:o}=Kt(),r=Fn(),a=S(()=>Ln(r.node,i));return(s,u)=>(m(),C(Pu,{class:"hub-card",selected:f(o).isNodeSelected(f(r).node),"blueprint-status":f(a),onContextmenu:u[0]||(u[0]=d=>n("contextmenu",d))},{default:w(()=>[Q(s.$slots,"default",{},void 0,!0),L("div",Fu,[x(On,{"handle-color":"#3F51B5",side:"left","is-valid-connection":e.isValidConnection},null,8,["is-valid-connection"]),x(On,{"handle-color":"#3F51B5",side:"right","is-valid-connection":e.isValidConnection},null,8,["is-valid-connection"])])]),_:3},8,["selected","blueprint-status"]))}}),lc=se(ju,[["__scopeId","data-v-b12999b6"]]);function Lu(e,t,n){const i=Array.from({length:n},()=>[]),o=t,a=-(o*(n-1))/2,s=Array.from({length:n},(l,c)=>a+c*o),u=[];for(let l=0;l<e.length-1;l++){const c=e[l],v=e[l+1],h=v[0]-c[0],b=v[1]-c[1],V=Math.sqrt(h*h+b*b);let P=-b,A=h;V!==0&&(P/=V,A/=V),u.push({x:P,y:A})}function d(l,c,v,h){const b=l[0],V=l[1],P=c[0],A=c[1],M=v[0],$=v[1],E=h[0],j=h[1],B=(b-P)*($-j)-(V-A)*(M-E);if(B===0)return null;const U=((b-M)*($-j)-(V-$)*(M-E))/B;return[b+U*(P-b),V+U*(A-V)]}for(let l=0;l<n;l++)for(let c=0;c<e.length;c++){const v=e[c];let h=0,b=0;if(c===0)h=u[0].x*s[l],b=u[0].y*s[l];else if(c===e.length-1)h=u[u.length-1].x*s[l],b=u[u.length-1].y*s[l];else{const V=u[c-1],P=u[c],A=e[c-1],M=e[c+1],$=[A[0]+V.x*s[l],A[1]+V.y*s[l]],E=[v[0]+V.x*s[l],v[1]+V.y*s[l]],j=[v[0]+P.x*s[l],v[1]+P.y*s[l]],B=[M[0]+P.x*s[l],M[1]+P.y*s[l]],U=d($,E,j,B);U?(h=U[0]-v[0],b=U[1]-v[1]):(h=(V.x+P.x)/2*s[l],b=(V.y+P.y)/2*s[l])}i[l].push(`${v[0]+h},${v[1]+b}`)}return i}const Du=["points","stroke"],Uu=["points"],Xu={key:0},Yu=["x","y","width"],qu=["x","y"],ct=3,Wu=K({__name:"CustomEdge",props:{id:{},sourceNode:{},targetNode:{},source:{},target:{},type:{},label:{type:[String,Object,Function]},style:{},selected:{type:Boolean},sourcePosition:{},targetPosition:{},sourceHandleId:{},targetHandleId:{},animated:{type:Boolean},updatable:{type:Boolean},markerStart:{},markerEnd:{},curvature:{},interactionWidth:{},data:{},events:{},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{},sourceX:{},sourceY:{},targetX:{},targetY:{},inputResolverOutputs:{},components:{},entities:{}},setup(e){Co(y=>({ac5b568c:ct}));const t=Ct(),{inputInstance:n,outputInstance:i,inputHub:o,outputHub:r,outputKey:a,inputKey:s,inputNodeType:u}=eo(t,{source:e.source,target:e.target,sourceHandle:e.sourceHandleId,targetHandle:e.targetHandleId}),d=y=>{if(!y)return;const p=e.inputResolverOutputs.get(`instance:${y.id}`);return p?.kind==="instance"?p.component:e.components[y.type]},l=S(()=>{if(u==="outputs"){const y=d(n);if(!y)return{all:[]};const p=y.outputs[s];return{all:p?[p.type]:[]}}if(i&&n){const y=Ft(e.inputResolverOutputs,n.id),p=ot((y[s]??[]).map(Y=>Y.type)),N=d(n);if(!N)return{all:[],visible:p};const D=N.inputs[s];return p.length>0?{all:p,visible:p}:{all:D?[D.type]:[],visible:p}}if(r&&n&&s)return{all:(Ft(e.inputResolverOutputs,n.id)[s]??[]).map(p=>p.type)};if(r&&n)return{all:jn(e.inputResolverOutputs,n.id).map(y=>y.type),visible:to(e.inputResolverOutputs,n.id).map(y=>y.type)};if(i&&o){const y=zt(e.inputResolverOutputs,o.id).filter(D=>D.input.instanceId===i.id&&D.input.output===a).map(D=>D.type);if(y.length>0)return{all:ot(y)};const p=d(i);if(!p)return{all:[]};const N=p.outputs[a];return{all:N?[N.type]:[]}}if(r&&o)return{all:zt(e.inputResolverOutputs,r.id).flat().map(y=>y.type)};throw ln.error({msg:"unexpected connection in CustomEdge",inputInstance:n,outputInstance:i,inputHub:o,outputHub:r,outputKey:a,inputKey:s}),new Error("Invalid connection")}),c=S(()=>ot(l.value.all).map(y=>e.entities[y])),v=S(()=>{if(!r)return[];const y=zt(e.inputResolverOutputs,r.id).map(p=>p.type);return ot(y).sort()}),h=S(()=>!!r&&e.data.hubReservedGhostLane),b=S(()=>!!r&&e.data.isPendingHubTyped),V=S(()=>!!r&&!!n&&!!s),P=S(()=>{if(!V.value)return;const y=d(n);if(y)return y.inputs[s]?.type}),A=S(()=>{if(!r||!V.value)return!1;const y=P.value;return y?!v.value.includes(y):!1}),M=S(()=>b.value||A.value),$=S(()=>r?M.value?!0:h.value:!1);e.data.isOutputProjection&&ln.debug({source:e.source,target:e.target,sourceHandleId:e.sourceHandleId,targetHandleId:e.targetHandleId,isOutputProjection:e.data.isOutputProjection,isOutputProjectionUnresolved:e.data.isOutputProjectionUnresolved},"rendering projection edge in CustomEdge");const E=S(()=>$.value&&v.value.length>0),j=S(()=>l.value.visible?l.value.visible.length===0:r?l.value.all.length===0:!1),B=S(()=>!!r&&!!n&&!!s),U=S(()=>{if(!r)return j.value?1:c.value.length;if(B.value)return 1;const p=v.value.length+(E.value?1:0);return Math.max(1,p)}),W=y=>r?v.value.length===0?!0:E.value&&y===U.value-1:j.value,H=()=>B.value?e.components[n.type].inputs[s]?.type:void 0,F=S(()=>{if(!B.value)return!1;const y=H();return y?!v.value.includes(y):!1}),ce=y=>{if(e.data.isOutputProjection&&e.data.isOutputProjectionUnresolved)return"#9E9E9E";if(B.value){if(F.value)return"#9E9E9E";const p=H();return(p?e.entities[p]:void 0)?.meta.color??"#607D8B"}if(W(y))return"#9E9E9E";if(r){const p=v.value[y];return e.entities[p]?.meta.color??"#607D8B"}return c.value[y%c.value.length].meta.color??"#607D8B"},te=y=>r?B.value?y===0:j.value?W(y):l.value.visible?W(y)?!1:l.value.visible.includes(v.value[y]):!W(y):j.value?!0:l.value.visible?l.value.visible.includes(c.value[y].type):!0,oe=(y,p)=>y[0]===p[0]&&y[1]===p[1],g=S(()=>{if(!e.data.points)return[];const y=[e.sourceX,e.data.routedSourceY??e.sourceY],p=[e.targetX,e.data.routedTargetY??e.targetY],N=[...e.data.points];return(!N[0]||!oe(N[0],y))&&N.unshift(y),(!N[N.length-1]||!oe(N[N.length-1],p))&&N.push(p),Lu(N,ct,U.value)}),T=y=>{const N=1/U.value;return`-${y*N}s`},k=S(()=>e.data.path),R=S(()=>{if(!e.data.points)return{x:(e.sourceX+e.targetX)/2,y:(e.sourceY+e.targetY)/2};const y=[[e.sourceX,e.data.routedSourceY??e.sourceY],...e.data.points,[e.targetX,e.data.routedTargetY??e.targetY]];let p=0;for(let Y=1;Y<y.length;Y++){const q=y[Y-1],J=y[Y];p+=Math.hypot(J[0]-q[0],J[1]-q[1])}if(p===0)return{x:(e.sourceX+e.targetX)/2,y:(e.sourceY+e.targetY)/2};let N=0;const D=p/2;for(let Y=1;Y<y.length;Y++){const q=y[Y-1],J=y[Y],_=Math.hypot(J[0]-q[0],J[1]-q[1]);if(N+_>=D){const ne=(D-N)/_;return{x:q[0]+(J[0]-q[0])*ne,y:q[1]+(J[1]-q[1])*ne}}N+=_}return{x:(e.sourceX+e.targetX)/2,y:(e.sourceY+e.targetY)/2}}),I=S(()=>Math.min((k.value?.length??0)*7+18,220));return(y,p)=>(m(),O(X,null,[(m(!0),O(X,null,re(g.value,(N,D)=>(m(),O(X,{key:`static-${D}`},[te(D)?(m(),O("polyline",{key:0,points:N.join(" "),stroke:ce(D),fill:"none","stroke-width":ct,style:{opacity:"0.8"}},null,8,Du)):z("",!0)],64))),128)),(m(!0),O(X,null,re(g.value,(N,D)=>(m(),O(X,{key:`highlight-${D}`},[te(D)?(m(),O("polyline",{key:0,points:N.join(" "),stroke:"white",fill:"none","stroke-width":ct,class:"highlight-polyline animated-highlight",style:he({animationDelay:T(D)})},null,12,Uu)):z("",!0)],64))),128)),k.value?(m(),O("g",Xu,[L("rect",{x:R.value.x-I.value/2,y:R.value.y-12,width:I.value,height:"24",rx:"6",class:"expression-label-background"},null,8,Yu),L("text",{x:R.value.x,y:R.value.y+4,"text-anchor":"middle",class:"expression-label-text"},Z(k.value),9,qu)])):z("",!0)],64))}}),Gu=se(Wu,[["__scopeId","data-v-ec0b076a"]]),Ku=K({__name:"SelectionRectangle",props:{selectionMode:{default:"add"},selectionArea:{}},setup(e){const t=S(()=>{if(!e.selectionArea)return;const n={left:e.selectionArea.x+"px",top:e.selectionArea.y+"px",width:e.selectionArea.width+"px",height:e.selectionArea.height+"px"};return e.selectionMode==="add"?{...n,border:"2px dashed #2196F3",background:"rgba(33, 150, 243, 0.1)"}:{...n,border:"2px dashed #F44336",background:"rgba(244, 67, 54, 0.1)"}});return(n,i)=>f(t)?(m(),O("div",{key:0,class:"selection-rectangle",style:he(f(t))},null,4)):z("",!0)}}),Ju=se(Ku,[["__scopeId","data-v-f27fcf23"]]);export{sc as G,lc as H,rc as I,Pu as _,Ma as a};
@@ -1 +0,0 @@
1
- import{P as C,b6 as h}from"#entry";import{E as M,V as m,Y as f,ac as g,aR as B,_ as t,W as a,b1 as L,D as b,af as $,ab as i,a9 as u,ad as V,ae as k,a3 as E,al as c,aG as S,a_ as T,H as D,M as N,b4 as O,a4 as Y,aO as G,r as x,n as P}from"./DW3fpWuG.js";import{I as R}from"./BvmKIGhu.js";const W=M({__name:"ContextMenuItem",props:{title:{},subtitle:{},color:{},icon:{},customIcon:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(e,{emit:d}){const n=d;return(l,s)=>(m(),f(g,{disabled:e.disabled,onClick:s[0]||(s[0]=r=>n("click"))},B({append:t(()=>[c(l.$slots,"append")]),default:t(()=>[a(V,{color:e.color},{default:t(()=>[i(u(e.title),1)]),_:1},8,["color"]),e.subtitle?(m(),f(k,{key:0,color:e.color},{default:t(()=>[i(u(e.subtitle),1)]),_:1},8,["color"])):E("",!0),c(l.$slots,"default")]),_:2},[e.loading?{name:"prepend",fn:t(()=>[a(L,{indeterminate:"",color:"primary"})]),key:"0"}:e.customIcon?{name:"prepend",fn:t(()=>[a(b(C),{icon:e.customIcon,color:e.color,style:{"margin-right":"-20px",width:"24px",height:"24px"}},null,8,["icon","color"])]),key:"1"}:e.icon?{name:"prepend",fn:t(()=>[a($,{color:e.color,style:{"margin-right":"-20px"}},{default:t(()=>[i(u(e.icon),1)]),_:1},8,["color"])]),key:"2"}:void 0]),1032,["disabled"]))}}),j=M({__name:"GenericContextMenu",props:G({title:{},subtitle:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(e,{expose:d}){const n=S(e,"visible"),l=x(0),s=x(0),r=T("contextMenu"),{isOutside:I}=h(r),p=async o=>{o.preventDefault(),n.value=!1,l.value=o.clientX,s.value=o.clientY,await P(),n.value=!0},v=()=>{I.value&&(n.value=!1)};return D(()=>{window.addEventListener("mousedown",v)}),N(()=>{window.removeEventListener("mousedown",v),n.value=!1}),d({showContextMenu:p}),(o,y)=>(m(),f(O,{modelValue:n.value,"onUpdate:modelValue":y[0]||(y[0]=w=>n.value=w),target:[b(l),b(s)],location:"end","close-on-content-click":!1},{default:t(()=>[a(Y,{ref_key:"contextMenu",ref:r,density:"compact",variant:"text",style:{"padding-bottom":"0"}},{default:t(()=>[c(o.$slots,"header",{},()=>[a(g,{class:"mb-2"},{default:t(()=>[a(V,null,{default:t(()=>[i(u(e.title),1)]),_:1}),a(k,{class:"d-flex align-center",style:{"font-family":"monospace"}},{default:t(()=>[i(u(e.subtitle)+" ",1),a(R,{content:e.subtitle},null,8,["content"])]),_:1})]),_:1})]),c(o.$slots,"default")]),_:3},512)]),_:3},8,["modelValue","target"]))}});export{W as _,j as a};
@@ -1 +0,0 @@
1
- {"id":"2fb84624-3ce9-43ea-94fb-c5d537778bf1","timestamp":1793836426821,"prerendered":[]}
@@ -1 +0,0 @@
1
- let n,y=null;function Y(){return(y===null||y.byteLength===0)&&(y=new Uint8Array(n.memory.buffer)),y}let E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});E.decode();const $=2146435072;let O=0;function q(r,t){return O+=t,O>=$&&(E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),E.decode(),O=t),E.decode(Y().subarray(r,r+t))}function H(r,t){return r=r>>>0,q(r,t)}function s(r,t){if(!(r instanceof t))throw new Error(`expected instance of ${t.name}`)}function X(r){return r==null}const D=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_avoidlib_free(r>>>0,1));class d{static __wrap(t){t=t>>>0;const e=Object.create(d.prototype);return e.__wbg_ptr=t,D.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_avoidlib_free(t,0)}static getInstance(){const t=n.avoidlib_getInstance();return d.__wrap(t)}static load(){const t=n.avoidlib_getInstance();return d.__wrap(t)}}Symbol.dispose&&(d.prototype[Symbol.dispose]=d.prototype.free);const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_box_free(r>>>0,1));class f{static __wrap(t){t=t>>>0;const e=Object.create(f.prototype);return e.__wbg_ptr=t,N.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_box_free(t,0)}static fromCoords(t,e,_,o){const a=n.box_fromCoords(t,e,_,o);return f.__wrap(a)}get max(){const t=n.box_max(this.__wbg_ptr);return i.__wrap(t)}get min(){const t=n.box_min(this.__wbg_ptr);return i.__wrap(t)}constructor(){const t=n.box_new();return this.__wbg_ptr=t>>>0,N.register(this,this.__wbg_ptr,this),this}width(){return n.box_width(this.__wbg_ptr)}height(){return n.box_height(this.__wbg_ptr)}length(t){return n.box_length(this.__wbg_ptr,t)}set max(t){s(t,i),n.box_set_max(this.__wbg_ptr,t.__wbg_ptr)}set min(t){s(t,i),n.box_set_min(this.__wbg_ptr,t.__wbg_ptr)}contains(t){return s(t,i),n.box_contains(this.__wbg_ptr,t.__wbg_ptr)!==0}}Symbol.dispose&&(f.prototype[Symbol.dispose]=f.prototype.free);const T=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_connend_free(r>>>0,1));class g{static __wrap(t){t=t>>>0;const e=Object.create(g.prototype);return e.__wbg_ptr=t,T.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,T.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_connend_free(t,0)}static fromShapePin(t,e){s(t,c);const _=n.connend_fromShapePin(t.__wbg_ptr,e);return g.__wrap(_)}constructor(t,e){s(t,i);const _=n.connend_new(t.__wbg_ptr,X(e)?4294967297:e>>>0);return this.__wbg_ptr=_>>>0,T.register(this,this.__wbg_ptr,this),this}}Symbol.dispose&&(g.prototype[Symbol.dispose]=g.prototype.free);const C=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_connref_free(r>>>0,1));class w{static __wrap(t){t=t>>>0;const e=Object.create(w.prototype);return e.__wbg_ptr=t,C.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,C.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_connref_free(t,0)}routingType(){return n.connref_routingType(this.__wbg_ptr)>>>0}setCallback(t,e){n.connref_setCallback(this.__wbg_ptr,t,e)}displayRoute(){const t=n.connref_displayRoute(this.__wbg_ptr);return t===0?void 0:p.__wrap(t)}static createWithId(t,e,_,o){s(t,b),s(e,g),s(_,g);const a=n.connref_createWithId(t.__wbg_ptr,e.__wbg_ptr,_.__wbg_ptr,o);return w.__wrap(a)}setRoutingType(t){n.connref_setRoutingType(this.__wbg_ptr,t)}setDestEndpoint(t){s(t,g),n.connref_setDestEndpoint(this.__wbg_ptr,t.__wbg_ptr)}setHateCrossings(t){n.connref_setHateCrossings(this.__wbg_ptr,t)}doesHateCrossings(){return n.connref_doesHateCrossings(this.__wbg_ptr)!==0}setSourceEndpoint(t){s(t,g),n.connref_setSourceEndpoint(this.__wbg_ptr,t.__wbg_ptr)}static createWithEndpoints(t,e,_){s(t,b),s(e,g),s(_,g);const o=n.connref_createWithEndpoints(t.__wbg_ptr,e.__wbg_ptr,_.__wbg_ptr);return w.__wrap(o)}id(){return n.connref_id(this.__wbg_ptr)>>>0}constructor(t){s(t,b);const e=n.connref_new(t.__wbg_ptr);return this.__wbg_ptr=e>>>0,C.register(this,this.__wbg_ptr,this),this}}Symbol.dispose&&(w.prototype[Symbol.dispose]=w.prototype.free);typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>n.__wbg_hyperedgererouter_free(r>>>0,1));typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>n.__wbg_junctionref_free(r>>>0,1));const I=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_point_free(r>>>0,1));class i{static __wrap(t){t=t>>>0;const e=Object.create(i.prototype);return e.__wbg_ptr=t,I.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,I.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_point_free(t,0)}get x(){return n.point_x(this.__wbg_ptr)}get y(){return n.point_y(this.__wbg_ptr)}get id(){return n.point_id(this.__wbg_ptr)>>>0}get vn(){return n.point_vn(this.__wbg_ptr)>>>0}constructor(t,e){const _=n.point_new(t,e);return this.__wbg_ptr=_>>>0,I.register(this,this.__wbg_ptr,this),this}equal(t){return s(t,i),n.point_equal(this.__wbg_ptr,t.__wbg_ptr)!==0}set x(t){n.point_set_x(this.__wbg_ptr,t)}set y(t){n.point_set_y(this.__wbg_ptr,t)}static origin(){const t=n.point_origin();return i.__wrap(t)}set id(t){n.point_set_id(this.__wbg_ptr,t)}set vn(t){n.point_set_vn(this.__wbg_ptr,t)}}Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);const F=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_polygon_free(r>>>0,1));class p{static __wrap(t){t=t>>>0;const e=Object.create(p.prototype);return e.__wbg_ptr=t,F.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,F.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_polygon_free(t,0)}offsetPolygon(t){const e=n.polygon_offsetPolygon(this.__wbg_ptr,t);return p.__wrap(e)}offsetBoundingBox(t){const e=n.polygon_offsetBoundingBox(this.__wbg_ptr,t);return f.__wrap(e)}boundingRectPolygon(){const t=n.polygon_boundingRectPolygon(this.__wbg_ptr);return p.__wrap(t)}at(t){const e=n.polygon_at(this.__wbg_ptr,t);return e===0?void 0:i.__wrap(e)}id(){return n.point_vn(this.__wbg_ptr)>>>0}constructor(t){const e=n.polygon_new(t);return this.__wbg_ptr=e>>>0,F.register(this,this.__wbg_ptr,this),this}size(){return n.polygon_size(this.__wbg_ptr)>>>0}clear(){n.polygon_clear(this.__wbg_ptr)}empty(){return n.polygon_empty(this.__wbg_ptr)!==0}get_ps(t){const e=n.polygon_at(this.__wbg_ptr,t);return e===0?void 0:i.__wrap(e)}set_ps(t,e){s(e,i),n.polygon_set_ps(this.__wbg_ptr,t,e.__wbg_ptr)}setPoint(t,e){s(e,i),n.polygon_setPoint(this.__wbg_ptr,t,e.__wbg_ptr)}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);const P=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_rectangle_free(r>>>0,1));class h{static __wrap(t){t=t>>>0;const e=Object.create(h.prototype);return e.__wbg_ptr=t,P.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_rectangle_free(t,0)}toPolygon(){const t=n.rectangle_toPolygon(this.__wbg_ptr);return p.__wrap(t)}static fromCorners(t,e){s(t,i),s(e,i);const _=n.rectangle_fromCorners(t.__wbg_ptr,e.__wbg_ptr);return h.__wrap(_)}constructor(t,e,_){s(t,i);const o=n.rectangle_new(t.__wbg_ptr,e,_);return this.__wbg_ptr=o>>>0,P.register(this,this.__wbg_ptr,this),this}width(){return n.rectangle_width(this.__wbg_ptr)}center(){const t=n.rectangle_center(this.__wbg_ptr);return i.__wrap(t)}height(){return n.rectangle_height(this.__wbg_ptr)}}Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);const U=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_router_free(r>>>0,1));class b{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,U.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_router_free(t,0)}moveShape(t,e,_){s(t,c),n.router_moveShape(this.__wbg_ptr,t.__wbg_ptr,e,_)}deleteShape(t){s(t,c),n.router_deleteShape(this.__wbg_ptr,t.__wbg_ptr)}addConnector(t){s(t,w),n.router_addConnector(this.__wbg_ptr,t.__wbg_ptr)}moveShapeTo(t,e){s(t,c),s(e,p),n.router_moveShapeTo(this.__wbg_ptr,t.__wbg_ptr,e.__wbg_ptr)}routingOption(t){return n.router_routingOption(this.__wbg_ptr,t)!==0}deleteConnector(t){s(t,w),n.router_deleteConnector(this.__wbg_ptr,t.__wbg_ptr)}updateConnector(t){s(t,w),n.router_updateConnector(this.__wbg_ptr,t.__wbg_ptr)}routingParameter(t){return n.router_routingParameter(this.__wbg_ptr,t)}setRoutingOption(t,e){n.router_setRoutingOption(this.__wbg_ptr,t,e)}getConnectorRoute(t){const e=n.router_getConnectorRoute(this.__wbg_ptr,t);return e===0?void 0:p.__wrap(e)}processTransaction(){return n.router_processTransaction(this.__wbg_ptr)!==0}setTransactionUse(t){n.router_setTransactionUse(this.__wbg_ptr,t)}setRoutingParameter(t,e){n.router_setRoutingParameter(this.__wbg_ptr,t,e)}outputInstanceToSVG(){let t,e;try{const _=n.router_outputInstanceToSVG(this.__wbg_ptr);return t=_[0],e=_[1],H(_[0],_[1])}finally{n.__wbindgen_free(t,e,1)}}constructor(t){const e=n.router_new(t);return this.__wbg_ptr=e>>>0,U.register(this,this.__wbg_ptr,this),this}addShape(t){s(t,c),n.router_addShape(this.__wbg_ptr,t.__wbg_ptr)}}Symbol.dispose&&(b.prototype[Symbol.dispose]=b.prototype.free);typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>n.__wbg_shapeconnectionpin_free(r>>>0,1));const z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>n.__wbg_shaperef_free(r>>>0,1));class c{static __wrap(t){t=t>>>0;const e=Object.create(c.prototype);return e.__wbg_ptr=t,z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,z.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shaperef_free(t,0)}setNewPoly(t){s(t,p),n.shaperef_setNewPoly(this.__wbg_ptr,t.__wbg_ptr)}static createWithId(t,e,_){s(t,b),s(e,p);const o=n.shaperef_createWithId(t.__wbg_ptr,e.__wbg_ptr,_);return c.__wrap(o)}id(){return n.shaperef_id(this.__wbg_ptr)>>>0}constructor(t,e){s(t,b),s(e,p);const _=n.shaperef_new(t.__wbg_ptr,e.__wbg_ptr);return this.__wbg_ptr=_>>>0,z.register(this,this.__wbg_ptr,this),this}polygon(){const t=n.shaperef_polygon(this.__wbg_ptr);return p.__wrap(t)}position(){const t=n.shaperef_position(this.__wbg_ptr);return i.__wrap(t)}}Symbol.dispose&&(c.prototype[Symbol.dispose]=c.prototype.free);const V=new Set(["basic","cors","default"]);async function K(r,t){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,t)}catch(_){if(r.ok&&V.has(r.type)&&r.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_);else throw _}const e=await r.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{const e=await WebAssembly.instantiate(r,t);return e instanceof WebAssembly.Instance?{instance:e,module:r}:e}}function Z(){const r={};return r.wbg={},r.wbg.__wbg___wbindgen_throw_b855445ff6a94295=function(t,e){throw new Error(H(t,e))},r.wbg.__wbindgen_init_externref_table=function(){const t=n.__wbindgen_externrefs,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},r}function J(r,t){return n=r.exports,j.__wbindgen_wasm_module=t,y=null,n.__wbindgen_start(),n}async function j(r){if(n!==void 0)return n;typeof r<"u"&&(Object.getPrototypeOf(r)===Object.prototype?{module_or_path:r}=r:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof r>"u"&&(r=new URL("libavoid_bg.wasm",import.meta.url));const t=Z();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:e,module:_}=await K(await r,t);return J(e,_)}const W=(r,t)=>{r.postMessage(t)},Q=j("/libavoid.wasm").then(()=>d.getInstance()),l=new Map,A=150,k=2,v={SHAPE_BUFFER_DISTANCE:6,IDEAL_NUDGING_DISTANCE:7},R={NUDGE_ORTHOGONAL_SEGMENTS:0,NUDGE_ORTHOGONAL_TOUCHING_COLINEAR_SEGMENTS:3,PERFORM_UNIFYING_NUDGING_PREPROCESSING_STEP:4,NUDGE_SHARED_PATHS_WITH_COMMON_END_POINT:6},tt=4,et=8,rt=async()=>{await new Promise(r=>{setTimeout(r,0)})},nt=async(r,t,e)=>{if(e.length<=A){for(const _ of e)x(r,t,_);t.router.processTransaction(),M(r,t);return}for(let _=0;_<e.length;_+=A){const o=e.slice(_,_+A);for(const a of o)x(r,t,a);t.router.processTransaction(),M(r,t),await rt()}},_t=async(r,t,e,_)=>{if(l.has(t)){console.warn(`router with id "${t}" already exists`);return}await Q;const o=new b(k);o.setRoutingParameter(v.IDEAL_NUDGING_DISTANCE,6),o.setRoutingParameter(v.SHAPE_BUFFER_DISTANCE,40),o.setRoutingOption(R.NUDGE_ORTHOGONAL_SEGMENTS,!0),o.setRoutingOption(R.NUDGE_ORTHOGONAL_TOUCHING_COLINEAR_SEGMENTS,!0),o.setRoutingOption(R.PERFORM_UNIFYING_NUDGING_PREPROCESSING_STEP,!0),o.setRoutingOption(R.NUDGE_SHARED_PATHS_WITH_COMMON_END_POINT,!1);const a={routerId:t,router:o,shapeMap:new Map,edgeConnRefMap:new Map};l.set(t,a),console.log(`router with id "${t}" created with ${e.length} shapes and ${_.length} edges`);for(const S of e)G(a,S);await nt(r,a,_),W(r,{type:"router-ready",routerId:t})},L=r=>h.fromCorners(new i(r.x,r.y),new i(r.x+r.width,r.y+r.height)),G=(r,t)=>{const e=L(t),_=new c(r.router,e.toPolygon());r.router.addShape(_),r.shapeMap.set(t.id,_)},ot=(r,t)=>{const e=r.shapeMap.get(t.id);if(e){const _=L(t);r.router.moveShapeTo(e,_.toPolygon())}else G(r,t)},st=(r,t)=>{const e=r.router.getConnectorRoute(t.id())??t.displayRoute();if(!e)return[];const _=[];for(let o=0;o<e.size();o++){const a=e.at(o);a&&_.push([a.x,a.y])}return _},M=(r,t)=>{const e=Array.from(t.edgeConnRefMap.entries()).map(([_,o])=>({edgeId:_,points:st(t,o)}));W(r,{type:"edge-paths-updated",routerId:t.routerId,updates:e})},it=(r,t)=>{const e=r.shapeMap.get(t);e&&(r.router.deleteShape(e),r.shapeMap.delete(t))},B=r=>{const t=new i(r.sourceX,r.sourceY),e=new i(r.targetX,r.targetY),_=new g(t,et),o=new g(e,tt);return{srcConnEnd:_,dstConnEnd:o}},x=(r,t,e)=>{const _=t.shapeMap.get(e.source),o=t.shapeMap.get(e.target);if(_&&o){const{srcConnEnd:a,dstConnEnd:S}=B(e),m=w.createWithEndpoints(t.router,a,S);m.setRoutingType(k),t.router.addConnector(m),t.edgeConnRefMap.set(e.id,m)}},at=(r,t)=>{const e=r.edgeConnRefMap.get(t.id);if(e){const{srcConnEnd:_,dstConnEnd:o}=B(t);e.setSourceEndpoint(_),e.setDestEndpoint(o),r.router.updateConnector(e)}},pt=(r,t)=>{const e=r.edgeConnRefMap.get(t);e&&(r.router.deleteConnector(e),r.edgeConnRefMap.delete(t))},gt=r=>{const t=l.get(r);t&&(t.edgeConnRefMap.clear(),t.shapeMap.clear(),l.delete(r))},u=(r,t)=>{const e=l.get(r);if(!e){console.warn(`router with id "${r}" not found`);return}t(e)};self.onconnect=r=>{const t=r.ports[0];console.debug("EdgeRouter worker connected",{event:r}),t.onmessage=e=>{const _=e.data;switch(_.type){case"create-router":{_t(t,_.routerId,_.shapes,_.edges);break}case"add-shape":{u(_.routerId,o=>G(o,_.shape));break}case"update-shape":{u(_.routerId,o=>ot(o,_.shape));break}case"remove-shape":{u(_.routerId,o=>it(o,_.shapeId));break}case"add-edge":{u(_.routerId,o=>x(t,o,_.edge));break}case"update-edge":{u(_.routerId,o=>at(o,_.edge));break}case"remove-edge":{u(_.routerId,o=>pt(o,_.edgeId));break}case"process-transaction":{u(_.routerId,o=>{o.router.processTransaction(),M(t,o)});break}case"dispose-router":{gt(_.routerId);break}}}};console.debug("EdgeRouter worker ready");