{"version":3,"file":"editor-D0FCvyPb.mjs","names":["workflowActions","DECIMAL","actions","Section","insertAtCursor","stringifyValue","parseTypenames","get","set","namespaces","namespace","selector","Selection","selectorAll","Selection","matcher","Selection","Selection","sparse","constant","Selection","Selection","sparse","Selection","Selection","attrRemove","attrRemoveNS","attrConstant","attrConstantNS","attrFunction","attrFunctionNS","namespace","styleRemove","styleConstant","styleFunction","defaultView","textConstant","textFunction","creator","creator","selector","defaultView","Selection","selection_select","selection_selectAll","selection_selectChild","selection_selectChildren","selection_filter","selection_data","selection_enter","selection_exit","selection_join","selection_merge","selection_order","selection_sort","selection_call","selection_nodes","selection_node","selection_size","selection_empty","selection_each","selection_attr","selection_style","selection_property","selection_classed","selection_text","selection_html","selection_raise","selection_lower","selection_append","selection_insert","selection_remove","selection_clone","selection_datum","selection_on","selection_dispatch","selection_iterator","Selection","sourceEvent","nopropagation","select","noevent","defaultFilter","defaultTouchable","pointer","constant","define","constant","rgb","colorRgb","basis","basisClosed","value","value","number","constant","number","rgb","string","date","numberArray","object","identity","identity","decompose","number","timeout","interpolateNumber","interpolateRgb","interpolateString","namespace","interpolateTransform","interpolate","namespace","matcher","selector","selectorAll","style","interpolateTransform","interpolate","transition_select","transition_selectAll","transition_filter","transition_merge","transition_selection","transition_transition","transition_on","transition_attr","transition_attrTween","transition_style","transition_styleTween","transition_text","transition_textTween","transition_remove","transition_tween","transition_delay","transition_duration","transition_ease","transition_easeVarying","transition_end","easeCubicInOut","selection_interrupt","selection_transition","identity","identity","interpolateZoom","select","pointer","constant","addEdge","select","drag","zoom","zoomIdentity","pointer","interpolate","interpolateZoom","transform","zoomTransform","initPrevValues","React","React","createStore","ReactExports","useSyncExternalStoreExports","createStore","Fragment","shallow","ReactFlow"],"sources":["../../editors/workflow-editor/undo-policy.ts","../../editors/workflow-editor/ui/prop-defaults.ts","../../editors/workflow-editor/ui/add-follow-up.ts","../../editors/workflow-editor/document/useWorkflowModel.ts","../../editors/workflow-editor/ui/variable-types.ts","../../editors/workflow-editor/ui/expression-scope.ts","../../editors/workflow-editor/ui/canvas-menu.ts","../../editors/workflow-editor/ui/expression-tokens.ts","../../editors/workflow-editor/ui/ExpressionPicker.tsx","../../editors/workflow-editor/ui/ap-layout.ts","../../editors/workflow-editor/ui/connection-create.ts","../../editors/workflow-editor/ui/CreateConnectionModal.tsx","../../editors/workflow-editor/ui/ConnectionField.tsx","../../editors/workflow-editor/ui/secret-ref.ts","../../editors/workflow-editor/ui/prop-controls.tsx","../../editors/workflow-editor/ui/prop-layout.tsx","../../editors/workflow-editor/ui/PropertyForm.tsx","../../editors/workflow-editor/ui/schedule-draft.ts","../../editors/workflow-editor/ui/ScheduleBuilder.tsx","../../editors/workflow-editor/ui/step-test.ts","../../editors/workflow-editor/ui/test-state.ts","../../editors/workflow-editor/ui/StepTest.tsx","../../editors/workflow-editor/ui/use-validity.ts","../../editors/workflow-editor/ui/StepPanel.tsx","../../editors/workflow-editor/ui/VariablesEditor.tsx","../../../../node_modules/.pnpm/classcat@5.0.5/node_modules/classcat/index.js","../../../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/sourceEvent.js","../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/pointer.js","../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/noevent.js","../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/nodrag.js","../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/constant.js","../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/event.js","../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/drag.js","../../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js","../../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basis.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basisClosed.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js","../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/zoom.js","../../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js","../../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js","../../../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js","../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js","../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js","../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js","../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js","../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js","../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js","../../../../node_modules/.pnpm/@xyflow+system@0.0.82/node_modules/@xyflow/system/dist/esm/index.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/shim/index.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/shim/with-selector.js","../../../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.14_react@19.2.6/node_modules/zustand/esm/vanilla.mjs","../../../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.14_react@19.2.6/node_modules/zustand/esm/traditional.mjs","../../../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.14_react@19.2.6/node_modules/zustand/esm/shallow.mjs","../../../../node_modules/.pnpm/@xyflow+react@12.11.6_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@19.2.1_4b9d8a368098ff3c381e691ebf38dc2a/node_modules/@xyflow/react/dist/esm/index.js","../../editors/workflow-editor/ui/step-drag.ts","../../editors/workflow-editor/ui/ap-nodes.tsx","../../editors/workflow-editor/ui/ap-edge.tsx","../../editors/workflow-editor/ui/CanvasContextMenu.tsx","../../editors/workflow-editor/ui/WorkflowCanvas.tsx","../../editors/workflow-editor/ui/WorkflowEditorApp.tsx","../../editors/workflow-editor/editor.tsx"],"sourcesContent":["// How the workflow editor's undo treats the runtime's facts.\nimport type { Action } from \"@powerhousedao/shared/document-model\";\nimport { actions as workflowActions } from \"document-models/workflow\";\nimport type { UndoPolicy } from \"../shared/undo-plan.js\";\n\n// Whether an edit adds the block `id`, or sets the trigger it names.\nfunction placesBlock(edit: Action, id: string): boolean {\n  if (edit.type !== \"ADD_STEP\" && edit.type !== \"SET_TRIGGER\") return false;\n  return (edit.input as { id?: unknown } | undefined)?.id === id;\n}\n\n// Undo passes over the runtime's facts and writes them again, so undoing an\n// edit never loses a test or a run. A test of a block the undo removes goes.\nexport const WORKFLOW_UNDO: UndoPolicy = {\n  skip: new Set([\"SET_LAST_TEST\", \"SET_LAST_RUN\"]),\n  replay: (action, undone) => {\n    if (action.type === \"SET_LAST_TEST\") {\n      const input = action.input as Parameters<\n        typeof workflowActions.setLastTest\n      >[0];\n      return undone.some((edit) => placesBlock(edit, input.id))\n        ? undefined\n        : workflowActions.setLastTest(input);\n    }\n    if (action.type === \"SET_LAST_RUN\") {\n      return workflowActions.setLastRun(\n        action.input as Parameters<typeof workflowActions.setLastRun>[0],\n      );\n    }\n    return undefined;\n  },\n};\n","// A new step, array item or resolved object stores its piece's defaults, so\n// a run does not depend on whichever piece version supplies them later.\nimport type { BlockFormProp } from \"./forms.js\";\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n  return value !== null && typeof value === \"object\" && !Array.isArray(value)\n    ? (value as Record<string, unknown>)\n    : {};\n}\n\n// `config` with every unset prop's defaultValue written in; set values win.\nexport function withPropDefaults(\n  props: readonly BlockFormProp[],\n  config: unknown,\n): Record<string, unknown> {\n  const next = { ...asRecord(config) };\n  for (const prop of props) {\n    if (prop.type === \"MARKDOWN\" || prop.defaultValue === undefined) continue;\n    if (next[prop.name] === undefined) next[prop.name] = prop.defaultValue;\n  }\n  return next;\n}\n\n// Whether withPropDefaults would write anything into `config`.\nexport function lacksDefaults(\n  props: readonly BlockFormProp[],\n  config: unknown,\n): boolean {\n  const record = asRecord(config);\n  return props.some(\n    (prop) =>\n      prop.type !== \"MARKDOWN\" &&\n      prop.defaultValue !== undefined &&\n      record[prop.name] === undefined,\n  );\n}\n","// A block is added before its form loads; this is what the loaded form adds\n// afterwards: the defaults still unset, and the port the step continues on.\nimport { flowPorts } from \"@powerhousedao/pieces-framework/workflow\";\nimport { sameBlock, type BlockRef } from \"./blocks.js\";\nimport type { BlockForm } from \"./forms.js\";\nimport { lacksDefaults, withPropDefaults } from \"./prop-defaults.js\";\n\n// An edge as the follow-up reads and rewrites it.\nexport interface FollowUpEdge {\n  id: string;\n  from: string;\n  to: string;\n  port: string;\n  condition?: string | null;\n}\n\n// A block just added, for the follow-up that completes it.\nexport interface AddedBlock {\n  id: string;\n  // Undo takes the add and its follow-up back together.\n  group: string;\n  block: BlockRef;\n  // The edge the step continues on, when its port was guessed.\n  continuation?: { edgeId: string; port: string };\n}\n\n// The config with the form's defaults written into unset fields, or null\n// when there is nothing to add. A value set in the meantime wins.\nexport function followUpConfig(\n  form: Pick<BlockForm, \"props\">,\n  config: unknown,\n): Record<string, unknown> | null {\n  return lacksDefaults(form.props, config)\n    ? withPropDefaults(form.props, config)\n    : null;\n}\n\nexport interface FollowUp {\n  config?: Record<string, unknown>;\n  // Re-points the continuing edge onto the port the form declares.\n  repoint?: { edge: FollowUpEdge; port: string };\n}\n\n// Null when there is nothing to do, or the block is gone.\nexport function planFollowUp(\n  added: AddedBlock,\n  current: { block: BlockRef; config: unknown } | undefined,\n  edges: readonly FollowUpEdge[],\n  form: BlockForm,\n): FollowUp | null {\n  if (!current || !sameBlock(current.block, added.block)) return null;\n  const config = followUpConfig(form, current.config);\n  const port = form.ports ? flowPorts(form.ports)[0] : undefined;\n  const edge = added.continuation\n    ? edges.find((entry) => entry.id === added.continuation!.edgeId)\n    : undefined;\n  const repoint =\n    edge && port && edge.port !== port && edge.port === added.continuation!.port\n      ? { edge, port }\n      : undefined;\n  if (!config && !repoint) return null;\n  return {\n    ...(config ? { config } : {}),\n    ...(repoint ? { repoint } : {}),\n  };\n}\n","// The only file coupling the editor UI to the Powerhouse document: maps the\n// workflow document state to the plain view model and callbacks to actions.\nimport { generateId } from \"document-model\";\nimport {\n  actions,\n  useSelectedWorkflowDocument,\n  type PropertySetting,\n  type StepTestRecord,\n  type WorkflowState,\n} from \"document-models/workflow\";\nimport { useMemo, useRef } from \"react\";\nimport { groupedAction, newUndoGroup } from \"../../shared/undo-plan.js\";\nimport { planFollowUp, type AddedBlock } from \"../ui/add-follow-up.js\";\nimport { stepBlock, triggerBlock, type BlockRef } from \"../ui/blocks.js\";\nimport {\n  uniqueStepKey,\n  type BlockStateModel,\n  type PropertySettingModel,\n  type WorkflowEditorCallbacks,\n  type WorkflowModel,\n} from \"../ui/model.js\";\n\n// How long a follow-up waits for the add it completes to reach the state.\nconst FOLLOW_UP_ATTEMPTS = 20;\nconst FOLLOW_UP_WAIT_MS = 50;\n\n// Older documents lack these fields entirely, hence the optional reads.\nfunction blockState(block: {\n  propertySettings?: PropertySetting[] | null;\n  lastTest?: StepTestRecord | null;\n  updatedAt?: string | null;\n}): BlockStateModel {\n  return {\n    propertySettings: block.propertySettings?.map((setting) => ({\n      prop: setting.prop,\n      mode: setting.mode,\n      schema: setting.schema ?? null,\n    })),\n    lastTest: block.lastTest\n      ? { runId: block.lastTest.runId, testedAt: block.lastTest.testedAt }\n      : null,\n    updatedAt: block.updatedAt ?? null,\n  };\n}\n\nfunction settingsInput(settings: PropertySettingModel[]) {\n  return settings.map((setting) => ({\n    prop: setting.prop,\n    mode: setting.mode,\n    schema: setting.schema ?? null,\n  }));\n}\n\nfunction toModel(state: WorkflowState): WorkflowModel {\n  return {\n    name: state.name,\n    status: state.status,\n    version: state.version,\n    published: state.published\n      ? {\n          version: state.published.version,\n          publishedAt: state.published.publishedAt,\n        }\n      : null,\n    readOnly: false,\n    trigger: state.trigger\n      ? {\n          id: state.trigger.id,\n          pieceName: state.trigger.pieceName,\n          pieceVersion: state.trigger.pieceVersion,\n          triggerName: state.trigger.triggerName,\n          config: state.trigger.config,\n          connectionId: state.trigger.connectionId ?? null,\n          ...blockState(state.trigger),\n        }\n      : null,\n    steps: state.steps.map((step) => ({\n      id: step.id,\n      key: step.key,\n      name: step.name,\n      pieceName: step.pieceName,\n      pieceVersion: step.pieceVersion,\n      actionName: step.actionName,\n      connectionId: step.connectionId ?? null,\n      config: step.config,\n      retry: step.retry\n        ? {\n            maxAttempts: step.retry.maxAttempts,\n            backoff: step.retry.backoff,\n            initialDelaySeconds: step.retry.initialDelaySeconds,\n            maxDelaySeconds: step.retry.maxDelaySeconds,\n            retryOn: [...step.retry.retryOn],\n          }\n        : null,\n      timeoutSeconds: step.timeoutSeconds ?? null,\n      idempotencyKeyExpression: step.idempotencyKeyExpression ?? null,\n      position: step.position\n        ? { x: step.position.x, y: step.position.y }\n        : null,\n      skip: step.skip === true,\n      ...blockState(step),\n    })),\n    edges: state.edges.map((edge) => ({\n      id: edge.id,\n      from: edge.from,\n      to: edge.to,\n      port: edge.port,\n      condition: edge.condition ?? null,\n    })),\n    variables: state.variables.map((variable) => ({\n      id: variable.id,\n      key: variable.key,\n      value: variable.value ?? null,\n      description: variable.description ?? null,\n      type: variable.type ?? null,\n    })),\n  };\n}\n\nexport function useWorkflowModel(): {\n  model: WorkflowModel;\n  callbacks: WorkflowEditorCallbacks;\n} {\n  const [document, dispatch] = useSelectedWorkflowDocument();\n  const state = document.state.global;\n  // Follow-ups land after the add; they read the state as it is by then.\n  const latest = useRef(state);\n  latest.current = state;\n\n  const model = useMemo(() => toModel(state), [state]);\n\n  const callbacks = useMemo<WorkflowEditorCallbacks>(\n    () => ({\n      setName: (name) => {\n        dispatch(actions.setWorkflowName({ name }));\n        // Base action keeps the document header name in sync for drive views.\n        dispatch(actions.setName(name));\n      },\n      setStatus: (status) => dispatch(actions.setWorkflowStatus({ status })),\n      setTrigger: (input) => {\n        // Keep the trigger id stable so edges from it survive edits.\n        const id = state.trigger?.id ?? generateId();\n        const group = newUndoGroup();\n        dispatch(\n          groupedAction(\n            actions.setTrigger({\n              id,\n              pieceName: input.pieceName,\n              pieceVersion: input.pieceVersion,\n              triggerName: input.triggerName,\n              config: input.config,\n              connectionId: input.connectionId,\n              ...(input.propertySettings\n                ? { propertySettings: settingsInput(input.propertySettings) }\n                : {}),\n            }),\n            group,\n          ),\n        );\n        return { id, group, block: triggerBlock(input) };\n      },\n      clearTrigger: () => dispatch(actions.clearTrigger({})),\n      addStep: (input) => {\n        const id = generateId();\n        const group = newUndoGroup();\n        dispatch(\n          groupedAction(\n            actions.addStep({\n              id,\n              key: input.key,\n              name: input.name,\n              pieceName: input.pieceName,\n              pieceVersion: input.pieceVersion,\n              actionName: input.actionName,\n              config: input.config,\n              position: input.position,\n            }),\n            group,\n          ),\n        );\n        return { id, group, block: stepBlock(input) };\n      },\n      updateStep: (input) => dispatch(actions.updateStep(input)),\n      setStepConfig: (id, config, extras) =>\n        dispatch(\n          actions.setStepConfig({\n            id,\n            config,\n            ...(extras?.propertySettings\n              ? { propertySettings: settingsInput(extras.propertySettings) }\n              : {}),\n          }),\n        ),\n      publish: () =>\n        new Promise<void>((resolve, reject) => {\n          const publish = actions.publishWorkflow({\n            publishedAt: new Date().toISOString(),\n          });\n          // Activepieces turns a flow on when it is published.\n          const batch =\n            state.status === \"ENABLED\"\n              ? [publish]\n              : [\n                  publish,\n                  actions.setWorkflowStatus({ status: \"ENABLED\" as const }),\n                ];\n          dispatch(\n            batch,\n            (errors) => reject(errors[0]),\n            () => resolve(),\n          );\n        }),\n      discardChanges: () => dispatch(actions.revertToPublished({})),\n      removeStep: (id) => dispatch(actions.removeStep({ id })),\n      addEdge: (input) =>\n        dispatch(\n          actions.addEdge({\n            id: generateId(),\n            from: input.from,\n            to: input.to,\n            port: input.port,\n            condition: input.condition,\n          }),\n        ),\n      removeEdge: (id) => dispatch(actions.removeEdge({ id })),\n      moveStep: (move) => {\n        // Re-parent only: the step keeps its own outgoing edges, and the port\n        // it used to hang off simply becomes free again.\n        for (const edge of state.edges.filter(\n          (entry) => entry.to === move.stepId,\n        )) {\n          dispatch(actions.removeEdge({ id: edge.id }));\n        }\n        dispatch(\n          actions.addEdge({\n            id: generateId(),\n            from: move.toParentId,\n            to: move.stepId,\n            port: move.port,\n          }),\n        );\n      },\n      setVariable: (input) =>\n        dispatch(\n          actions.setVariable({\n            id: input.id ?? generateId(),\n            key: input.key,\n            value: input.value,\n            description: input.description,\n            ...(input.type !== undefined ? { type: input.type } : {}),\n          }),\n        ),\n      removeVariable: (id) => dispatch(actions.removeVariable({ id })),\n      insertStepOnEdge: (edgeId, input, port) => {\n        const edge = state.edges.find((entry) => entry.id === edgeId);\n        if (!edge) return undefined;\n        const stepId = generateId();\n        const continuing = generateId();\n        const group = newUndoGroup();\n        dispatch(\n          [\n            actions.addStep({\n              id: stepId,\n              key: input.key,\n              name: input.name,\n              pieceName: input.pieceName,\n              pieceVersion: input.pieceVersion,\n              actionName: input.actionName,\n              config: input.config,\n            }),\n            actions.removeEdge({ id: edgeId }),\n            actions.addEdge({\n              id: generateId(),\n              from: edge.from,\n              to: stepId,\n              port: edge.port,\n              condition: edge.condition,\n            }),\n            actions.addEdge({\n              id: continuing,\n              from: stepId,\n              to: edge.to,\n              port,\n            }),\n          ].map((action) => groupedAction(action, group)),\n        );\n        return {\n          id: stepId,\n          group,\n          block: stepBlock(input),\n          continuation: { edgeId: continuing, port },\n        };\n      },\n      duplicateStep: (id) => {\n        const step = state.steps.find((entry) => entry.id === id);\n        if (!step) return;\n        dispatch(\n          actions.addStep({\n            id: generateId(),\n            key: uniqueStepKey(\n              state.steps.map((entry) => entry.key),\n              step.key,\n            ),\n            name: step.name,\n            pieceName: step.pieceName,\n            pieceVersion: step.pieceVersion,\n            actionName: step.actionName,\n            connectionId: step.connectionId,\n            config: step.config,\n            retry: step.retry,\n            timeoutSeconds: step.timeoutSeconds,\n            idempotencyKeyExpression: step.idempotencyKeyExpression,\n            position: step.position,\n            propertySettings: step.propertySettings,\n          }),\n        );\n      },\n      appendStep: (fromId, port, input) => {\n        const stepId = generateId();\n        const group = newUndoGroup();\n        dispatch(\n          [\n            actions.addStep({\n              id: stepId,\n              key: input.key,\n              name: input.name,\n              pieceName: input.pieceName,\n              pieceVersion: input.pieceVersion,\n              actionName: input.actionName,\n              config: input.config,\n            }),\n            actions.addEdge({\n              id: generateId(),\n              from: fromId,\n              to: stepId,\n              port,\n            }),\n          ].map((action) => groupedAction(action, group)),\n        );\n        return { id: stepId, group, block: stepBlock(input) };\n      },\n      completeBlock: (added, form) => {\n        let attempts = 0;\n        const attempt = () => {\n          const current = latest.current;\n          const found = findBlock(current, added);\n          // Not in the state yet: the add may still be on its way.\n          if (!found && attempts++ < FOLLOW_UP_ATTEMPTS) {\n            setTimeout(attempt, FOLLOW_UP_WAIT_MS);\n            return;\n          }\n          const plan = planFollowUp(added, found, current.edges, form);\n          if (!plan) return;\n          const trigger = current.trigger;\n          const followUps = [\n            ...(plan.config && trigger?.id === added.id\n              ? [\n                  actions.setTrigger({\n                    id: trigger.id,\n                    pieceName: trigger.pieceName,\n                    pieceVersion: trigger.pieceVersion,\n                    triggerName: trigger.triggerName,\n                    config: plan.config,\n                    connectionId: trigger.connectionId,\n                  }),\n                ]\n              : plan.config\n                ? [actions.setStepConfig({ id: added.id, config: plan.config })]\n                : []),\n            ...(plan.repoint\n              ? [\n                  actions.removeEdge({ id: plan.repoint.edge.id }),\n                  actions.addEdge({\n                    id: generateId(),\n                    from: plan.repoint.edge.from,\n                    to: plan.repoint.edge.to,\n                    port: plan.repoint.port,\n                    condition: plan.repoint.edge.condition,\n                  }),\n                ]\n              : []),\n          ];\n          dispatch(\n            followUps.map((action) => groupedAction(action, added.group)),\n          );\n        };\n        attempt();\n      },\n    }),\n    [dispatch, state],\n  );\n\n  return { model, callbacks };\n}\n\n// The added block as the state holds it now, or undefined when it is gone.\nfunction findBlock(\n  state: WorkflowState,\n  added: AddedBlock,\n): { block: BlockRef; config: unknown } | undefined {\n  if (state.trigger?.id === added.id) {\n    return { block: triggerBlock(state.trigger), config: state.trigger.config };\n  }\n  const step = state.steps.find((entry) => entry.id === added.id);\n  return step ? { block: stepBlock(step), config: step.config } : undefined;\n}\n","// Typed workflow variables: what each type accepts and how typed text parses.\nimport type { VariableTypeValue } from \"./model.js\";\n\nexport const VARIABLE_TYPE_LABEL: Record<VariableTypeValue, string> = {\n  TEXT: \"Text\",\n  NUMBER: \"Number\",\n  BOOLEAN: \"True or false\",\n  JSON: \"JSON\",\n  SECRET: \"Secret\",\n};\n\nexport const VARIABLE_TYPES = Object.keys(\n  VARIABLE_TYPE_LABEL,\n) as VariableTypeValue[];\n\nexport type Parsed =\n  | { ok: true; value: unknown }\n  | { ok: false; error: string };\n\nconst DECIMAL = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)$/;\n\n// Typed text to a value of that type, or why it isn't one. Never coerces.\nexport function parseTypedValue(type: VariableTypeValue, raw: string): Parsed {\n  const trimmed = raw.trim();\n  switch (type) {\n    case \"TEXT\":\n      return { ok: true, value: raw === \"\" ? null : raw };\n    case \"NUMBER\":\n      if (trimmed === \"\") return { ok: true, value: null };\n      return DECIMAL.test(trimmed)\n        ? { ok: true, value: Number(trimmed) }\n        : { ok: false, error: \"Not a number\" };\n    case \"BOOLEAN\":\n      if (trimmed === \"true\") return { ok: true, value: true };\n      if (trimmed === \"false\") return { ok: true, value: false };\n      return { ok: false, error: \"Not true or false\" };\n    case \"JSON\":\n      if (trimmed === \"\") return { ok: true, value: null };\n      try {\n        return { ok: true, value: JSON.parse(trimmed) as unknown };\n      } catch (error) {\n        return {\n          ok: false,\n          error: `Not valid JSON: ${error instanceof Error ? error.message : String(error)}`,\n        };\n      }\n    case \"SECRET\":\n      return { ok: false, error: \"Secrets are set through the secret field\" };\n  }\n}\n\n// Whether a stored value fits its type; a mismatch is shown, never fixed.\nexport function valueMismatch(\n  type: VariableTypeValue,\n  value: unknown,\n): string | null {\n  if (value === null || value === undefined) return null;\n  switch (type) {\n    case \"TEXT\":\n      return typeof value === \"string\" ? null : \"Not text\";\n    case \"NUMBER\":\n      return typeof value === \"number\" ? null : \"Not a number\";\n    case \"BOOLEAN\":\n      return typeof value === \"boolean\" ? null : \"Not true or false\";\n    case \"JSON\":\n      return null;\n    case \"SECRET\":\n      return typeof value === \"string\" ? null : \"Not a secret reference\";\n  }\n}\n\n// The value carried over to a new type, where it converts without loss;\n// a secret reference never becomes text, nor text a secret.\nexport function convertVariableValue(\n  value: unknown,\n  from: VariableTypeValue,\n  to: VariableTypeValue,\n): unknown {\n  if (from === to) return value;\n  if (from === \"SECRET\" || to === \"SECRET\") return null;\n  if (to === \"JSON\" || value === null || value === undefined)\n    return value ?? null;\n  if (to === \"TEXT\") {\n    return typeof value === \"string\" ? value : JSON.stringify(value);\n  }\n  if (typeof value === \"string\") {\n    const parsed = parseTypedValue(to, value);\n    if (parsed.ok) return parsed.value;\n  }\n  return value;\n}\n","// Builds the {} picker scope for a step: upstream step outputs and the trigger\n// payload from their last test, else the latest run, else the authored shape.\nimport { stepBlock, triggerBlock, type BlockRef } from \"./blocks.js\";\nimport type { WorkflowModel } from \"./model.js\";\nimport { VARIABLE_TYPE_LABEL } from \"./variable-types.js\";\n\nexport interface ExpressionScope {\n  // { trigger: { payload }, steps: { key: { output } }, variables: {...} }.\n  value: Record<string, unknown>;\n  // Caption per subtree root path, e.g. \"steps.fetch.output\" → \"from run 09:14\".\n  captions: Record<string, string>;\n}\n\nexport const EMPTY_SCOPE: ExpressionScope = { value: {}, captions: {} };\n\nexport interface ScopeRunStep {\n  stepKey: string;\n  pieceName: string;\n  blockName: string;\n  status: string;\n  output: unknown;\n}\n\nexport interface ScopeRun {\n  startedAt: string;\n  triggerPayload: unknown;\n  steps: ScopeRunStep[];\n}\n\nexport interface BuildScopeOptions {\n  model: WorkflowModel;\n  stepId: string;\n  latestRun?: ScopeRun;\n  // Authored output shape of a block (declared types as leaves).\n  authoredOutput: (block: BlockRef, config: unknown) => Promise<unknown>;\n  // A block's last test sample, by step or trigger id; undefined when none.\n  testOutput?: (blockId: string) => Promise<TestSample | undefined>;\n  now?: Date;\n}\n\nexport interface TestSample {\n  value: unknown;\n  testedAt: string;\n}\n\nconst MAX_DEPTH = 6;\nconst MAX_ARRAY_ITEMS = 25;\n\n// Run outputs can be huge; the picker only needs a browsable prefix.\nexport function capValue(value: unknown, depth = 0): unknown {\n  if (value === null || typeof value !== \"object\") return value;\n  if (depth >= MAX_DEPTH) return Array.isArray(value) ? \"[…]\" : \"{…}\";\n  if (Array.isArray(value)) {\n    return value\n      .slice(0, MAX_ARRAY_ITEMS)\n      .map((item) => capValue(item, depth + 1));\n  }\n  return Object.fromEntries(\n    Object.entries(value as Record<string, unknown>).map(([key, entry]) => [\n      key,\n      capValue(entry, depth + 1),\n    ]),\n  );\n}\n\nexport function upstreamStepIds(\n  model: WorkflowModel,\n  stepId: string,\n): Set<string> {\n  const incoming = new Map<string, string[]>();\n  for (const edge of model.edges) {\n    incoming.set(edge.to, [...(incoming.get(edge.to) ?? []), edge.from]);\n  }\n  const upstream = new Set<string>();\n  const queue = [stepId];\n  while (queue.length > 0) {\n    for (const from of incoming.get(queue.pop()!) ?? []) {\n      if (!upstream.has(from)) {\n        upstream.add(from);\n        queue.push(from);\n      }\n    }\n  }\n  return upstream;\n}\n\nexport function formatRunTime(startedAt: string, now = new Date()): string {\n  const date = new Date(startedAt);\n  if (Number.isNaN(date.getTime())) return startedAt;\n  const sameDay = date.toDateString() === now.toDateString();\n  const time = date.toLocaleTimeString([], {\n    hour: \"2-digit\",\n    minute: \"2-digit\",\n  });\n  return sameDay\n    ? time\n    : `${date.toLocaleDateString([], { month: \"short\", day: \"numeric\" })} ${time}`;\n}\n\nconst hasOutput = (step: ScopeRunStep) =>\n  (step.status === \"SUCCEEDED\" || step.status === \"REPLAYED\") &&\n  step.output !== undefined &&\n  step.output !== null;\n\nexport async function buildExpressionScope(\n  options: BuildScopeOptions,\n): Promise<ExpressionScope> {\n  const { model, latestRun } = options;\n  const runCaption = latestRun\n    ? `from run ${formatRunTime(latestRun.startedAt, options.now)}`\n    : undefined;\n  const runSteps = new Map(\n    (latestRun?.steps ?? [])\n      .filter(hasOutput)\n      .map((step) => [step.stepKey, step]),\n  );\n  const value: Record<string, unknown> = {};\n  const captions: Record<string, string> = {};\n\n  const testCaption = (sample: TestSample) =>\n    `from test ${formatRunTime(sample.testedAt, options.now)}`;\n  const tested = async (block: { id: string; lastTest?: unknown }) =>\n    block.lastTest && options.testOutput\n      ? options.testOutput(block.id).catch(() => undefined)\n      : undefined;\n\n  if (model.trigger) {\n    const sample = await tested(model.trigger);\n    if (sample) {\n      value.trigger = { payload: capValue(sample.value) };\n      captions[\"trigger.payload\"] = testCaption(sample);\n    } else if (\n      runCaption &&\n      latestRun?.triggerPayload !== undefined &&\n      latestRun.triggerPayload !== null\n    ) {\n      value.trigger = { payload: capValue(latestRun.triggerPayload) };\n      captions[\"trigger.payload\"] = runCaption;\n    } else {\n      value.trigger = {\n        payload: await options.authoredOutput(\n          triggerBlock(model.trigger),\n          model.trigger.config,\n        ),\n      };\n      captions[\"trigger.payload\"] = \"declared type\";\n    }\n  }\n\n  const upstream = upstreamStepIds(model, options.stepId);\n  const steps: Record<string, unknown> = {};\n  await Promise.all(\n    model.steps\n      .filter((step) => upstream.has(step.id))\n      .map(async (step) => {\n        const sample = await tested(step);\n        if (sample) {\n          steps[step.key] = { output: capValue(sample.value) };\n          captions[`steps.${step.key}.output`] = testCaption(sample);\n          return;\n        }\n        const journaled = runSteps.get(step.key);\n        // A renamed/retyped step's old output would mislead: match on both.\n        if (\n          runCaption &&\n          journaled &&\n          journaled.pieceName === step.pieceName &&\n          journaled.blockName === step.actionName\n        ) {\n          steps[step.key] = { output: capValue(journaled.output) };\n          captions[`steps.${step.key}.output`] = runCaption;\n          return;\n        }\n        steps[step.key] = {\n          output: await options.authoredOutput(stepBlock(step), step.config),\n        };\n        captions[`steps.${step.key}.output`] = \"declared type\";\n      }),\n  );\n  // Omit empty groups so the picker never offers a bare {{steps}}.\n  if (Object.keys(steps).length > 0) value.steps = steps;\n\n  if (model.variables.length > 0) {\n    // A secret shows as such: its reference is no use in a field.\n    value.variables = Object.fromEntries(\n      model.variables.map((variable) => [\n        variable.key,\n        variable.type === \"SECRET\" ? \"secret\" : (variable.value ?? null),\n      ]),\n    );\n    captions.variables = \"workflow variables\";\n    for (const variable of model.variables) {\n      if (variable.type) {\n        captions[`variables.${variable.key}`] =\n          VARIABLE_TYPE_LABEL[variable.type].toLowerCase();\n      }\n    }\n  }\n  return { value, captions };\n}\n\n// A path segment the picker can insert: dotted when it is an identifier,\n// bracketed otherwise, and indexed inside arrays.\nconst IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\nexport function childPath(\n  parent: string,\n  key: string,\n  parentIsArray: boolean,\n): string {\n  if (parentIsArray) return `${parent}[${key}]`;\n  if (!parent) return key;\n  return IDENTIFIER.test(key)\n    ? `${parent}.${key}`\n    : `${parent}[${JSON.stringify(key)}]`;\n}\n","// Right-click menu contents and placement; pure so the canvas only has to\n// map an action id onto the editor callbacks.\nimport { NEXT_PORT } from \"@powerhousedao/pieces-framework/workflow\";\nimport { stepBlock, type BlockRef } from \"./blocks.js\";\nimport type { PointModel, WorkflowModel } from \"./model.js\";\n\n// A block's declared ports; undefined while its form is unknown.\nexport type PortsOf = (block: BlockRef) => readonly string[] | undefined;\n\nexport type ContextMenuTarget =\n  | { kind: \"step\"; id: string }\n  | { kind: \"trigger\" }\n  | { kind: \"edge\"; id: string }\n  | { kind: \"pane\" };\n\nexport type ContextMenuActionId =\n  | \"open\"\n  | \"addBelow\"\n  | \"duplicate\"\n  | \"toggleSkip\"\n  | \"removeStep\"\n  | \"changeTrigger\"\n  | \"removeTrigger\"\n  | \"insertStep\"\n  | \"removeEdge\"\n  | \"addStep\"\n  | \"selectAll\"\n  | \"fitView\";\n\nexport interface ContextMenuItem {\n  id: ContextMenuActionId;\n  label: string;\n  disabled?: boolean;\n}\n\n// Only a block that declares \"next\" can have a step added below it. A port\n// that already has an edge is fine: the engine fans out on a taken port.\nfunction hasNextPort(model: WorkflowModel, id: string, portsOf: PortsOf) {\n  if (model.trigger?.id === id) return true;\n  const step = model.steps.find((entry) => entry.id === id);\n  return step\n    ? (portsOf(stepBlock(step))?.includes(NEXT_PORT) ?? false)\n    : false;\n}\n\nexport function contextMenuItems(\n  target: ContextMenuTarget,\n  model: WorkflowModel,\n  portsOf: PortsOf,\n): ContextMenuItem[] {\n  switch (target.kind) {\n    case \"step\": {\n      const skipped =\n        model.steps.find((entry) => entry.id === target.id)?.skip === true;\n      return [\n        { id: \"open\", label: \"Open settings\" },\n        {\n          id: \"addBelow\",\n          label: \"Add step below\",\n          disabled: !hasNextPort(model, target.id, portsOf),\n        },\n        { id: \"duplicate\", label: \"Duplicate step\" },\n        {\n          id: \"toggleSkip\",\n          label: skipped ? \"Stop skipping this step\" : \"Skip this step\",\n        },\n        { id: \"removeStep\", label: \"Remove step\" },\n      ];\n    }\n    case \"trigger\":\n      return [\n        { id: \"open\", label: \"Open settings\" },\n        {\n          id: \"addBelow\",\n          label: \"Add step below\",\n          disabled: !model.trigger,\n        },\n        { id: \"changeTrigger\", label: \"Change trigger\" },\n        { id: \"removeTrigger\", label: \"Remove trigger\" },\n      ];\n    case \"edge\":\n      return [\n        { id: \"insertStep\", label: \"Insert step here\" },\n        { id: \"removeEdge\", label: \"Remove edge\" },\n      ];\n    case \"pane\":\n      return [\n        { id: \"addStep\", label: \"Add step here\" },\n        {\n          id: \"selectAll\",\n          label: \"Select all steps\",\n          disabled: model.steps.length === 0,\n        },\n        { id: \"fitView\", label: \"Fit view\" },\n      ];\n  }\n}\n\nexport const MENU_WIDTH = 176;\nconst MENU_ITEM_HEIGHT = 28;\nconst MENU_PADDING = 4;\nconst VIEWPORT_MARGIN = 8;\n\nexport function menuHeight(items: number): number {\n  return items * MENU_ITEM_HEIGHT + MENU_PADDING * 2;\n}\n\nexport interface MenuSize {\n  width: number;\n  height: number;\n}\n\nfunction clampToViewport(\n  at: number,\n  extent: number,\n  available: number,\n): number {\n  return Math.max(\n    VIEWPORT_MARGIN,\n    Math.min(at, available - extent - VIEWPORT_MARGIN),\n  );\n}\n\n// Anchors the menu at the pointer, flipping it back over the pointer near the\n// right/bottom edges and clamping so it always stays inside the viewport.\nexport function menuPosition(\n  point: PointModel,\n  size: MenuSize,\n  viewport: MenuSize,\n): PointModel {\n  const place = (at: number, extent: number, available: number): number =>\n    clampToViewport(\n      at + extent > available - VIEWPORT_MARGIN ? at - extent : at,\n      extent,\n      available,\n    );\n  return {\n    x: place(point.x, size.width, viewport.width),\n    y: place(point.y, size.height, viewport.height),\n  };\n}\n\n// The box a side-panel popup hangs off: only the edges placement reads.\nexport interface MenuAnchor {\n  left: number;\n  right: number;\n  top: number;\n}\n\nconst ANCHOR_GAP = 8;\n\n// Places a popup beside its anchor: right edge at the anchor's left edge,\n// flipped to the anchor's right side when the left has no room, top aligned\n// with the anchor, and clamped into the viewport on both axes.\nexport function anchorLeftPosition(\n  anchor: MenuAnchor,\n  size: MenuSize,\n  viewport: MenuSize,\n): PointModel {\n  const left = anchor.left - ANCHOR_GAP - size.width;\n  return {\n    x: clampToViewport(\n      left >= VIEWPORT_MARGIN ? left : anchor.right + ANCHOR_GAP,\n      size.width,\n      viewport.width,\n    ),\n    y: clampToViewport(anchor.top, size.height, viewport.height),\n  };\n}\n","// Splits authored text into literal and {{expression}} runs for highlighting.\n// `\\{{` is a literal `{{`, as in the workflow engine's evaluator.\nconst EMBEDDED_EXPRESSION = /(?<!\\\\)\\{\\{\\s*([^{}]+?)\\s*\\}\\}/g;\n\nexport type ExpressionToken =\n  | { kind: \"text\"; text: string }\n  | { kind: \"expression\"; text: string; expression: string };\n\nexport function splitExpressionTokens(value: string): ExpressionToken[] {\n  const tokens: ExpressionToken[] = [];\n  let last = 0;\n  for (const match of value.matchAll(EMBEDDED_EXPRESSION)) {\n    const index = match.index;\n    if (index > last) {\n      tokens.push({ kind: \"text\", text: value.slice(last, index) });\n    }\n    tokens.push({ kind: \"expression\", text: match[0], expression: match[1] });\n    last = index + match[0].length;\n  }\n  if (last < value.length) {\n    tokens.push({ kind: \"text\", text: value.slice(last) });\n  }\n  return tokens;\n}\n\nexport function hasExpressions(value: unknown): value is string {\n  return (\n    typeof value === \"string\" && new RegExp(EMBEDDED_EXPRESSION).test(value)\n  );\n}\n\nexport interface ExpressionRef {\n  // \"steps\" carries the step key; the others keep the remaining path.\n  root: \"steps\" | \"trigger\" | \"variables\" | \"other\";\n  stepKey?: string;\n  // Path after the root (and step key), dotted; \"\" for the whole subtree.\n  rest: string;\n  // Only the first `||` term is described; fallbacks stay literal.\n  hasFallback: boolean;\n}\n\n// Describes the leading term of an expression for a compact chip label.\nexport function describeExpression(expression: string): ExpressionRef {\n  const terms = expression.split(\"||\");\n  const path = terms[0].trim();\n  const hasFallback = terms.length > 1;\n  const segments = path.split(\".\");\n  switch (segments[0]) {\n    case \"steps\":\n      return {\n        root: \"steps\",\n        stepKey: segments[1] ?? \"\",\n        rest: segments.slice(2).join(\".\"),\n        hasFallback,\n      };\n    case \"trigger\":\n      return {\n        root: \"trigger\",\n        rest: segments.slice(1).join(\".\"),\n        hasFallback,\n      };\n    case \"variables\":\n      return {\n        root: \"variables\",\n        rest: segments.slice(1).join(\".\"),\n        hasFallback,\n      };\n    default:\n      return { root: \"other\", rest: path, hasFallback };\n  }\n}\n","// Expression picker popup: opens beside the focused config field and inserts\n// {{path}} expressions from the run scope (trigger.payload / steps.* / variables.*).\nimport { Icon } from \"../../shared/icons.js\";\nimport {\n  createContext,\n  useContext,\n  useEffect,\n  useId,\n  useMemo,\n  useRef,\n  useState,\n  type ReactNode,\n} from \"react\";\nimport type { BlockRef } from \"@powerhousedao/pieces-framework/block-type\";\nimport { createPortal } from \"react-dom\";\nimport { blockMeta } from \"./block-meta.js\";\nimport { BlockLogo } from \"./BlockSelector.js\";\nimport { anchorLeftPosition, type MenuAnchor } from \"./canvas-menu.js\";\nimport {\n  childPath,\n  EMPTY_SCOPE,\n  type ExpressionScope,\n} from \"./expression-scope.js\";\nimport {\n  describeExpression,\n  splitExpressionTokens,\n} from \"./expression-tokens.js\";\n\nexport interface ExpressionScopeSource {\n  // Scope for the field being edited; stepId limits steps to its ancestors.\n  load: (context: { stepId?: string }) => Promise<ExpressionScope>;\n}\n\nconst ScopeSourceContext = createContext<ExpressionScopeSource | undefined>(\n  undefined,\n);\n\n// A new source value reloads an open picker's scope.\nexport const ExpressionScopeSourceProvider = ScopeSourceContext.Provider;\n\nfunction useScopeSource(): ExpressionScopeSource | undefined {\n  return useContext(ScopeSourceContext);\n}\n\n// The field the popup inserts into, plus the box it hangs off.\nexport interface ExpressionTarget {\n  id: string;\n  stepId?: string;\n  label: string;\n  anchor: MenuAnchor;\n  insert: (expression: string) => void;\n}\n\ninterface TargetContextValue {\n  target: ExpressionTarget | null;\n  setTarget: (target: ExpressionTarget | null) => void;\n  // Step key → block, so chips can show the referenced step's logo.\n  stepBlocks: Record<string, BlockRef>;\n  // The trigger's block, for the same reason on the trigger's own node.\n  triggerBlock?: BlockRef;\n}\n\nconst TargetContext = createContext<TargetContextValue | null>(null);\n\nexport function ExpressionTargetProvider(props: {\n  stepBlocks: Record<string, BlockRef>;\n  triggerBlock?: BlockRef;\n  children: ReactNode;\n}) {\n  const [target, setTarget] = useState<ExpressionTarget | null>(null);\n  const value = useMemo(\n    () => ({\n      target,\n      setTarget,\n      stepBlocks: props.stepBlocks,\n      triggerBlock: props.triggerBlock,\n    }),\n    [target, props.stepBlocks, props.triggerBlock],\n  );\n  return (\n    <TargetContext.Provider value={value}>\n      {props.children}\n    </TargetContext.Provider>\n  );\n}\n\nexport function useExpressionTarget(): TargetContextValue | null {\n  return useContext(TargetContext);\n}\n\n// The \"{}\" button sits at the field's right edge, so the popup anchors on the\n// field row instead: its left edge clears the whole side panel.\nfunction fieldAnchor(element: Element | undefined): MenuAnchor {\n  const row = element?.closest(\"label,div\") ?? element;\n  const rect = row?.getBoundingClientRect();\n  if (!rect) {\n    return { left: window.innerWidth, right: window.innerWidth, top: 0 };\n  }\n  return { left: rect.left, right: rect.right, top: rect.top };\n}\n\n// Registers a config field as an insertion target; call focus() when the\n// user focuses it — the focus/click event supplies the popup's anchor.\n// `insert` is read through a ref so it never goes stale.\nexport function useExpressionField(options: {\n  stepId?: string;\n  label: string;\n  insert: (expression: string) => void;\n}): {\n  active: boolean;\n  focus: (event?: { currentTarget: Element }) => void;\n} {\n  const id = useId();\n  const context = useExpressionTarget();\n  const insertRef = useRef(options.insert);\n  useEffect(() => {\n    insertRef.current = options.insert;\n  });\n  const { stepId, label } = options;\n  return {\n    active: context?.target?.id === id,\n    focus: (event) => {\n      context?.setTarget({\n        id,\n        stepId,\n        label,\n        anchor: fieldAnchor(event?.currentTarget),\n        insert: (expression) => insertRef.current(expression),\n      });\n    },\n  };\n}\n\nfunction preview(value: unknown): string {\n  if (value === null) return \"null\";\n  if (value === undefined) return \"\";\n  if (Array.isArray(value)) return `[${value.length}]`;\n  if (typeof value === \"object\") return \"{…}\";\n  const text =\n    typeof value === \"string\"\n      ? value\n      : ((JSON.stringify(value) as string | undefined) ?? \"\");\n  return text.length > 28 ? `${text.slice(0, 28)}…` : text;\n}\n\nfunction isExpandable(value: unknown): boolean {\n  return (\n    value !== null && typeof value === \"object\" && Object.keys(value).length > 0\n  );\n}\n\nfunction entriesOf(value: unknown): [string, unknown][] {\n  if (Array.isArray(value)) return value.map((item, i) => [String(i), item]);\n  if (value !== null && typeof value === \"object\") {\n    return Object.entries(value as Record<string, unknown>);\n  }\n  return [];\n}\n\nfunction Caption(props: { text?: string }) {\n  if (!props.text) return null;\n  return (\n    <span className=\"ml-auto shrink-0 pl-2 text-[10px] italic text-muted-foreground/80\">\n      {props.text}\n    </span>\n  );\n}\n\nfunction ValueNode(props: {\n  name: string;\n  path: string;\n  value: unknown;\n  depth: number;\n  captions: Record<string, string>;\n  onPick: (path: string) => void;\n}) {\n  const context = useExpressionTarget();\n  const [open, setOpen] = useState(props.depth < 2);\n  const expandable = isExpandable(props.value);\n  // A step's own node reads as the block it runs; the key stays in the tooltip\n  // alongside the expression it inserts.\n  const stepKey = /^steps\\.([^.]+)$/.exec(props.path)?.[1];\n  const nodeBlock = stepKey\n    ? context?.stepBlocks[stepKey]\n    : props.path === \"trigger\"\n      ? context?.triggerBlock\n      : undefined;\n  return (\n    <div>\n      <div\n        className=\"flex items-center gap-1 rounded px-1 py-0.5 hover:bg-muted/50\"\n        style={{ paddingLeft: props.depth * 14 + 4 }}\n      >\n        {expandable ? (\n          <button\n            type=\"button\"\n            className=\"w-3 shrink-0 text-[10px] text-muted-foreground/80\"\n            onClick={() => setOpen((value) => !value)}\n          >\n            {open ? \"▾\" : \"▸\"}\n          </button>\n        ) : (\n          <span className=\"w-3 shrink-0\" />\n        )}\n        <button\n          type=\"button\"\n          className=\"flex min-w-0 flex-1 items-baseline gap-2 text-left\"\n          title={`{{${props.path}}}`}\n          onClick={() => props.onPick(props.path)}\n        >\n          {nodeBlock ? (\n            <>\n              <BlockLogo block={nodeBlock} size={16} />\n              <span className=\"shrink-0 text-xs font-medium text-foreground\">\n                {blockMeta(nodeBlock).displayName}\n              </span>\n            </>\n          ) : (\n            <span className=\"shrink-0 font-mono text-xs text-foreground\">\n              {props.name}\n            </span>\n          )}\n          <span className=\"truncate text-[11px] text-muted-foreground/80\">\n            {preview(props.value)}\n          </span>\n        </button>\n        <Caption text={props.captions[props.path]} />\n      </div>\n      {expandable && open\n        ? entriesOf(props.value).map(([key, child]) => (\n            <ValueNode\n              key={key}\n              name={key}\n              path={childPath(props.path, key, Array.isArray(props.value))}\n              value={child}\n              depth={props.depth + 1}\n              captions={props.captions}\n              onPick={props.onPick}\n            />\n          ))\n        : null}\n    </div>\n  );\n}\n\ninterface FlatEntry {\n  path: string;\n  value: unknown;\n}\n\nconst SEARCH_DEPTH = 6;\nconst SEARCH_LIMIT = 200;\n\nfunction flatten(\n  value: unknown,\n  path: string,\n  depth: number,\n  out: FlatEntry[],\n) {\n  for (const [key, child] of entriesOf(value)) {\n    const nested = childPath(path, key, Array.isArray(value));\n    out.push({ path: nested, value: child });\n    if (depth < SEARCH_DEPTH && isExpandable(child)) {\n      flatten(child, nested, depth + 1, out);\n    }\n  }\n}\n\nfunction SearchResults(props: {\n  scope: ExpressionScope;\n  query: string;\n  onPick: (path: string) => void;\n}) {\n  const matches = useMemo(() => {\n    const all: FlatEntry[] = [];\n    flatten(props.scope.value, \"\", 0, all);\n    const lowered = props.query.toLowerCase();\n    return all\n      .filter((entry) => entry.path.toLowerCase().includes(lowered))\n      .slice(0, SEARCH_LIMIT);\n  }, [props.scope, props.query]);\n  if (matches.length === 0) {\n    return (\n      <div className=\"px-2 py-1 text-xs text-muted-foreground/80\">\n        No matches\n      </div>\n    );\n  }\n  return (\n    <>\n      {matches.map((entry) => (\n        <button\n          key={entry.path}\n          type=\"button\"\n          className=\"flex w-full items-baseline gap-2 rounded px-2 py-0.5 text-left hover:bg-muted/50\"\n          title={`{{${entry.path}}}`}\n          onClick={() => props.onPick(entry.path)}\n        >\n          <span className=\"min-w-0 truncate font-mono text-[11px] text-foreground\">\n            {entry.path}\n          </span>\n          <span className=\"truncate text-[10px] text-muted-foreground/80\">\n            {preview(entry.value)}\n          </span>\n        </button>\n      ))}\n    </>\n  );\n}\n\nconst POPUP_SIZE = { width: 420, height: 520 };\n\n// Anchored beside the focused field; portalled to <body> so the side panel's\n// scroll container cannot clip it.\nexport function ExpressionPickerPopup() {\n  const context = useExpressionTarget();\n  const target = context?.target ?? null;\n  const [query, setQuery] = useState(\"\");\n  const [state, setState] = useState<\n    | { kind: \"idle\" }\n    | { kind: \"loading\" }\n    | { kind: \"ready\"; scope: ExpressionScope; stepId?: string }\n    | { kind: \"error\"; message: string }\n  >({ kind: \"idle\" });\n  const scopeSource = useScopeSource();\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  const stepId = target?.stepId;\n  const hasTarget = target !== null;\n  useEffect(() => {\n    if (!hasTarget || !scopeSource) return;\n    let alive = true;\n    // A reload for the same step keeps its tree up, so an edit elsewhere in\n    // the workflow doesn't blank it under the cursor.\n    // eslint-disable-next-line react-hooks-extra/set-state-in-effect -- marks the load that starts on this very line\n    setState((current) =>\n      current.kind === \"ready\" && current.stepId === stepId\n        ? current\n        : { kind: \"loading\" },\n    );\n    scopeSource.load({ stepId }).then(\n      (scope) => {\n        if (alive) setState({ kind: \"ready\", scope, stepId });\n      },\n      (error: unknown) => {\n        if (alive) {\n          setState({\n            kind: \"error\",\n            message: error instanceof Error ? error.message : String(error),\n          });\n        }\n      },\n    );\n    return () => {\n      alive = false;\n    };\n  }, [hasTarget, stepId, scopeSource]);\n\n  // A fresh field starts from an unfiltered tree.\n  const targetId = target?.id;\n  // eslint-disable-next-line react-hooks-extra/set-state-in-effect -- a fresh field starts from an unfiltered tree\n  useEffect(() => setQuery(\"\"), [targetId]);\n\n  const close = context?.setTarget;\n  useEffect(() => {\n    if (!hasTarget || !close) return;\n    const dismiss = () => close(null);\n    const outside = (event: Event) =>\n      !containerRef.current?.contains(event.target as globalThis.Node);\n    const onMouseDown = (event: MouseEvent) => {\n      if (outside(event)) dismiss();\n    };\n    const onKeyDown = (event: KeyboardEvent) => {\n      if (event.key === \"Escape\") dismiss();\n    };\n    // Scrolling the popup's own tree must not dismiss it.\n    const onScroll = (event: Event) => {\n      if (outside(event)) dismiss();\n    };\n    window.addEventListener(\"mousedown\", onMouseDown);\n    window.addEventListener(\"keydown\", onKeyDown);\n    window.addEventListener(\"scroll\", onScroll, true);\n    return () => {\n      window.removeEventListener(\"mousedown\", onMouseDown);\n      window.removeEventListener(\"keydown\", onKeyDown);\n      window.removeEventListener(\"scroll\", onScroll, true);\n    };\n  }, [hasTarget, close]);\n\n  if (!context || !scopeSource || !target) return null;\n\n  const pick = (path: string) => {\n    target.insert(`{{${path}}}`);\n    context.setTarget(null);\n  };\n  const scope =\n    state.kind === \"ready\" && state.stepId === stepId\n      ? state.scope\n      : EMPTY_SCOPE;\n  const empty = entriesOf(scope.value).length === 0;\n  const position = anchorLeftPosition(target.anchor, POPUP_SIZE, {\n    width: window.innerWidth,\n    height: window.innerHeight,\n  });\n\n  return createPortal(\n    <div\n      ref={containerRef}\n      className=\"workflow-expression-popup fixed flex flex-col rounded-md border border-solid border-foreground/10 bg-card shadow-lg\"\n      // Picking keeps the field focused, so it neither commits nor loses its\n      // cursor; the search box still takes focus.\n      onMouseDown={(event) => {\n        if (!(event.target instanceof HTMLInputElement)) event.preventDefault();\n      }}\n      style={{\n        left: position.x,\n        top: position.y,\n        width: POPUP_SIZE.width,\n        maxHeight: POPUP_SIZE.height,\n      }}\n    >\n      <div className=\"flex items-center gap-2 px-3 py-1.5\">\n        <span className=\"font-mono text-[11px] text-muted-foreground\">\n          {\"{}\"}\n        </span>\n        <span className=\"min-w-0 truncate text-xs text-muted-foreground\">\n          Insert into{\" \"}\n          <span className=\"font-semibold text-foreground\">{target.label}</span>\n        </span>\n        <button\n          type=\"button\"\n          className=\"ml-auto text-[11px] text-muted-foreground/80 hover:text-muted-foreground\"\n          title=\"Close\"\n          onClick={() => context.setTarget(null)}\n        >\n          ✕\n        </button>\n      </div>\n      <div className=\"px-3 pb-1.5\">\n        <input\n          className=\"w-full rounded border border-foreground/10 px-2 py-1.5 text-sm\"\n          placeholder=\"Search paths…\"\n          value={query}\n          onChange={(event) => setQuery(event.target.value)}\n        />\n      </div>\n      <div className=\"min-h-0 flex-1 overflow-y-auto px-1 pb-1\">\n        {state.kind === \"error\" ? (\n          <div className=\"px-2 py-1 text-xs text-wf-fail\">{state.message}</div>\n        ) : state.kind === \"loading\" ? (\n          <div className=\"px-2 py-1 text-xs text-muted-foreground/80\">\n            Loading…\n          </div>\n        ) : empty ? (\n          <div className=\"px-2 py-1 text-xs text-muted-foreground/80\">\n            No values available for this field yet.\n          </div>\n        ) : query.trim() ? (\n          <SearchResults scope={scope} query={query.trim()} onPick={pick} />\n        ) : (\n          entriesOf(scope.value).map(([key, value]) => (\n            <ValueNode\n              key={key}\n              name={key}\n              path={key}\n              value={value}\n              depth={0}\n              captions={scope.captions}\n              onPick={pick}\n            />\n          ))\n        )}\n      </div>\n    </div>,\n    document.body,\n  );\n}\n\n// Per-field \"{}\" affordance: focuses the docked panel on this field.\nexport function ExpressionPickerButton(props: {\n  active: boolean;\n  onFocusField: (event: { currentTarget: Element }) => void;\n}) {\n  const scopeSource = useScopeSource();\n  if (!scopeSource) return null;\n  return (\n    <button\n      type=\"button\"\n      title=\"Insert data from the trigger or an earlier step\"\n      className={`inline-flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${\n        props.active\n          ? \"bg-wf-run/10 text-wf-run\"\n          : // Revealed with its field, so a long form isn't a column of buttons.\n            \"text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-focus-within/field:opacity-100 group-hover/field:opacity-100 [@media(hover:none)]:opacity-100\"\n      }`}\n      onClick={props.onFocusField}\n    >\n      <Icon name=\"braces\" className=\"h-3.5 w-3.5\" />\n      Insert data\n    </button>\n  );\n}\n\nfunction Chip(props: {\n  expression: string;\n  stepBlocks: Record<string, BlockRef>;\n}) {\n  const ref = describeExpression(props.expression);\n  const block = ref.stepKey ? props.stepBlocks[ref.stepKey] : undefined;\n  const head =\n    ref.root === \"steps\"\n      ? ref.stepKey\n      : ref.root === \"trigger\"\n        ? \"trigger\"\n        : ref.root === \"variables\"\n          ? \"var\"\n          : \"\";\n  return (\n    <span\n      className=\"inline-flex max-w-full items-center gap-1 rounded border border-solid border-wf-run/20 bg-wf-run/10 px-1 py-px font-mono text-[11px] text-wf-run\"\n      title={`{{${props.expression}}}`}\n    >\n      {block ? <BlockLogo block={block} size={12} /> : null}\n      {head ? <span className=\"font-semibold\">{head}</span> : null}\n      <span className=\"truncate\">\n        {ref.root === \"other\" ? ref.rest : ref.rest || \"*\"}\n      </span>\n      {ref.hasFallback ? <span className=\"text-wf-run\">||…</span> : null}\n    </span>\n  );\n}\n\n// Read-only line under a text field: literal runs plus a chip per {{token}}.\nexport function ExpressionTokenLine(props: { value: string }) {\n  const context = useExpressionTarget();\n  const tokens = splitExpressionTokens(props.value);\n  if (!tokens.some((token) => token.kind === \"expression\")) return null;\n  return (\n    <div className=\"mt-1.5 flex flex-wrap items-center gap-1 text-xs text-muted-foreground\">\n      {tokens.map((token, index) =>\n        token.kind === \"text\" ? (\n          <span key={index} className=\"max-w-40 truncate whitespace-pre\">\n            {token.text}\n          </span>\n        ) : (\n          <Chip\n            key={index}\n            expression={token.expression}\n            stepBlocks={context?.stepBlocks ?? {}}\n          />\n        ),\n      )}\n    </div>\n  );\n}\n","// Vertical tree layout, a port of the Activepieces builder flow-canvas\n// layout behavior (MIT, activepieces packages/web) onto our flat graph.\nimport { flowPorts } from \"@powerhousedao/pieces-framework/workflow\";\nimport type { Edge, Node } from \"@xyflow/react\";\nimport { stepBlock, triggerBlock, type BlockRef } from \"./blocks.js\";\nimport type { EdgeModel, StepModel, WorkflowModel } from \"./model.js\";\n\nexport function reachableFrom(start: string, edges: EdgeModel[]): Set<string> {\n  const outgoing = new Map<string, string[]>();\n  for (const edge of edges) {\n    const list = outgoing.get(edge.from) ?? [];\n    list.push(edge.to);\n    outgoing.set(edge.from, list);\n  }\n  const seen = new Set<string>([start]);\n  const queue = [start];\n  while (queue.length > 0) {\n    for (const next of outgoing.get(queue.pop()!) ?? []) {\n      if (!seen.has(next)) {\n        seen.add(next);\n        queue.push(next);\n      }\n    }\n  }\n  return seen;\n}\n\n// Steps an edge from `fromId` may target without creating a cycle.\nexport function acyclicTargets(\n  model: WorkflowModel,\n  fromId: string,\n): StepModel[] {\n  return model.steps.filter(\n    (step) =>\n      step.id !== fromId && !reachableFrom(step.id, model.edges).has(fromId),\n  );\n}\n\n// Steps a new edge from `fromId` may target: unreachable from the trigger,\n// not `fromId` itself, and not an ancestor of it (no cycles).\nexport function attachableSteps(\n  model: WorkflowModel,\n  fromId: string,\n): StepModel[] {\n  if (!model.trigger) return [];\n  const attached = reachableFrom(model.trigger.id, model.edges);\n  return model.steps.filter(\n    (step) =>\n      !attached.has(step.id) &&\n      step.id !== fromId &&\n      !reachableFrom(step.id, model.edges).has(fromId),\n  );\n}\n\nexport const STEP_WIDTH = 232;\nexport const STEP_HEIGHT = 60;\nexport const VSPACE = 60;\nexport const HSPACE = 80;\nexport const ADD_BUTTON_SIZE = 20;\nexport const BIG_ADD_BUTTON_SIZE = 50;\n\nconst PORT_ORDER = [\"next\", \"true\", \"false\", \"error\"];\n\nexport function portRank(port: string): number {\n  const index = PORT_ORDER.indexOf(port);\n  return index === -1 ? PORT_ORDER.length : index;\n}\n\nexport interface ApLayout {\n  nodes: Node[];\n  edges: Edge[];\n}\n\n// Builds react-flow nodes/edges: steps laid out as a centered vertical tree,\n// append buttons under a block's free declared ports, one add button per edge.\nexport function layoutWorkflow(\n  model: WorkflowModel,\n  portsOf: (block: BlockRef) => readonly string[] | undefined = () => undefined,\n): ApLayout {\n  const nodes: Node[] = [];\n  const edges: Edge[] = [];\n\n  if (!model.trigger) {\n    nodes.push({\n      id: \"__big-add\",\n      type: \"apBigButton\",\n      position: { x: -BIG_ADD_BUTTON_SIZE / 2, y: 0 },\n      data: {},\n      draggable: false,\n      selectable: false,\n    });\n    return { nodes, edges };\n  }\n\n  const stepIds = new Set(model.steps.map((step) => step.id));\n  const outgoing = new Map<string, EdgeModel[]>();\n  for (const edge of model.edges) {\n    if (!stepIds.has(edge.to)) continue;\n    const list = outgoing.get(edge.from) ?? [];\n    list.push(edge);\n    outgoing.set(edge.from, list);\n  }\n  for (const list of outgoing.values()) {\n    list.sort((a, b) => portRank(a.port) - portRank(b.port));\n  }\n\n  const placed = new Set<string>();\n  const stepById = new Map(model.steps.map((step) => [step.id, step]));\n\n  // Declared ports of a block, undefined until its form is known.\n  const declared = (id: string): readonly string[] | undefined => {\n    const step = stepById.get(id);\n    const block =\n      id === model.trigger?.id\n        ? triggerBlock(model.trigger)\n        : step\n          ? stepBlock(step)\n          : undefined;\n    return block ? portsOf(block) : undefined;\n  };\n  const outPorts = (id: string): string[] => {\n    const ports = declared(id);\n    return ports ? flowPorts(ports) : [];\n  };\n  // A block with several flow ports keeps a column for each, wired or not.\n  const branchPorts = (id: string): string[] => {\n    const ports = outPorts(id);\n    return ports.length > 1 ? ports : [];\n  };\n\n  // An unwired branch port still occupies a column: it gets a placeholder card\n  // where its step would go, so both branches read as branches.\n  const outletsOf = (\n    id: string,\n    used: (target: string) => boolean,\n  ): { port: string; edge?: EdgeModel }[] => {\n    const edges = (outgoing.get(id) ?? []).filter((edge) => !used(edge.to));\n    const ports = branchPorts(id);\n    if (ports.length === 0) {\n      return edges.map((edge) => ({ port: edge.port, edge }));\n    }\n    const wired = new Set(edges.map((edge) => edge.port));\n    return [\n      ...edges.map((edge) => ({ port: edge.port, edge })),\n      ...ports.filter((port) => !wired.has(port)).map((port) => ({ port })),\n    ].sort((a, b) => portRank(a.port) - portRank(b.port));\n  };\n\n  const subtreeWidth = (id: string, visited: Set<string>): number => {\n    if (visited.has(id)) return STEP_WIDTH;\n    visited.add(id);\n    const outlets = outletsOf(id, (target) => visited.has(target));\n    if (outlets.length === 0) return STEP_WIDTH;\n    const total = outlets\n      .map((outlet) =>\n        outlet.edge ? subtreeWidth(outlet.edge.to, visited) : STEP_WIDTH,\n      )\n      .reduce((sum, width) => sum + width, 0);\n    return Math.max(STEP_WIDTH, total + (outlets.length - 1) * HSPACE);\n  };\n\n  // Centre of the column reserved for an unwired port, keyed \"stepId:port\".\n  const placeholders = new Map<string, { x: number; y: number }>();\n\n  const place = (id: string, centerX: number, y: number) => {\n    if (placed.has(id)) return;\n    placed.add(id);\n    const step = stepById.get(id);\n    const isTrigger = id === model.trigger?.id;\n    nodes.push({\n      id,\n      type: \"apStep\",\n      position: { x: centerX - STEP_WIDTH / 2, y },\n      data: {\n        ...(isTrigger\n          ? { kind: \"trigger\", trigger: model.trigger }\n          : { kind: \"step\", step }),\n        outgoingPorts: model.edges\n          .filter((edge) => edge.from === id)\n          .map((edge) => edge.port),\n      },\n      draggable: false,\n    });\n\n    const outlets = outletsOf(id, (target) => placed.has(target));\n    const widths = outlets.map((outlet) =>\n      outlet.edge ? subtreeWidth(outlet.edge.to, new Set(placed)) : STEP_WIDTH,\n    );\n    const total =\n      widths.reduce((sum, width) => sum + width, 0) +\n      Math.max(outlets.length - 1, 0) * HSPACE;\n    const childY = y + STEP_HEIGHT + VSPACE;\n    let cursor = centerX - total / 2;\n    outlets.forEach((outlet, index) => {\n      const slotCenter = cursor + widths[index] / 2;\n      if (outlet.edge) {\n        place(outlet.edge.to, slotCenter, childY);\n      } else {\n        placeholders.set(`${id}:${outlet.port}`, { x: slotCenter, y: childY });\n      }\n      cursor += widths[index] + HSPACE;\n    });\n  };\n\n  place(model.trigger.id, 0, 0);\n\n  // Steps unreachable from the trigger stack in a column to the right.\n  let orphanY = 0;\n  const mainWidth = subtreeWidth(model.trigger.id, new Set());\n  for (const step of model.steps) {\n    if (placed.has(step.id)) continue;\n    place(step.id, mainWidth / 2 + HSPACE + STEP_WIDTH / 2, orphanY);\n    orphanY += STEP_HEIGHT + VSPACE;\n  }\n\n  const nodeById = new Map(nodes.map((node) => [node.id, node]));\n\n  for (const edge of model.edges) {\n    if (!nodeById.has(edge.from) || !nodeById.has(edge.to)) continue;\n    edges.push({\n      id: edge.id,\n      type: \"apEdge\",\n      source: edge.from,\n      target: edge.to,\n      data: {\n        edgeId: edge.id,\n        port: edge.port,\n        condition: edge.condition,\n        // A skipped step passes the run straight through this edge.\n        fromSkipped: stepById.get(edge.from)?.skip === true,\n        // On a port its source never takes: drawn, but as an error.\n        dead: declared(edge.from)?.includes(edge.port) === false,\n      },\n      selectable: true,\n    });\n  }\n\n  // Append buttons under every free flow port the block declares.\n  const candidatePorts = outPorts;\n\n  const appendPorts = (id: string): string[] => {\n    const used = new Set((outgoing.get(id) ?? []).map((edge) => edge.port));\n    return candidatePorts(id).filter((port) => !used.has(port));\n  };\n\n  for (const node of [...nodes]) {\n    if (node.type !== \"apStep\") continue;\n    appendPorts(node.id).forEach((port) => {\n      const slot = placeholders.get(`${node.id}:${port}`);\n      const buttonId = `__append:${node.id}:${port}`;\n      nodes.push({\n        id: buttonId,\n        type: \"apAppend\",\n        position: slot\n          ? { x: slot.x - STEP_WIDTH / 2, y: slot.y }\n          : {\n              x: node.position.x + STEP_WIDTH / 2 - ADD_BUTTON_SIZE / 2,\n              y:\n                node.position.y +\n                STEP_HEIGHT +\n                VSPACE / 2 -\n                ADD_BUTTON_SIZE / 2,\n            },\n        data: {\n          parentId: node.id,\n          port,\n          card: Boolean(slot),\n          // An empty workflow says where its first step goes.\n          ...(model.steps.length === 0 ? { hint: true } : {}),\n        },\n        draggable: false,\n        selectable: false,\n      });\n      edges.push({\n        id: `${buttonId}:line`,\n        type: \"apLink\",\n        source: node.id,\n        target: buttonId,\n        data: { port },\n        selectable: false,\n      });\n    });\n  }\n\n  return { nodes, edges };\n}\n\n// Steps in the order a run meets them (depth first, branches in port order),\n// then anything the trigger can't reach, in authored order.\nexport function flowOrder(model: WorkflowModel): string[] {\n  const stepIds = new Set(model.steps.map((step) => step.id));\n  const seen = new Set<string>();\n  const order: string[] = [];\n  const visit = (from: string) => {\n    const next = model.edges\n      .filter((edge) => edge.from === from && stepIds.has(edge.to))\n      .sort((a, b) => portRank(a.port) - portRank(b.port));\n    for (const edge of next) {\n      if (seen.has(edge.to)) continue;\n      seen.add(edge.to);\n      order.push(edge.to);\n      visit(edge.to);\n    }\n  };\n  if (model.trigger) visit(model.trigger.id);\n  for (const step of model.steps) {\n    if (!seen.has(step.id)) order.push(step.id);\n  }\n  return order;\n}\n","// When the connection picker offers to create a connection, and what the new\n// powerhouse/connection document gets prefilled with.\nimport {\n  connectorIdForPiece,\n  packageFromConnectorId,\n} from \"../../connection-editor/piece-auth.js\";\nimport { pieceDisplayName } from \"./block-meta.js\";\nimport { isCoreBlock, type BlockIdentity } from \"./blocks.js\";\n\nexport const CONNECTION_TYPE = \"powerhouse/connection\";\n\n// A connection is usable by a block when it configures the block's own piece.\n// Everything else is noise: picking it would just fail at run time.\nexport function compatibleConnections<T extends { connectorId: string }>(\n  connections: T[],\n  block: BlockIdentity,\n): T[] {\n  return connections.filter(\n    (connection) =>\n      packageFromConnectorId(connection.connectorId) === block.pieceName,\n  );\n}\n\n// The picker lists only compatible connections, so pasting a document id stays\n// the escape hatch for anything it does not offer.\nexport function looksLikeDocumentId(value: string): boolean {\n  const trimmed = value.trim();\n  return trimmed.length >= 8 && !/\\s/.test(trimmed);\n}\n\nexport interface ConnectionDraft {\n  piecePackage: string;\n  connectorId: string;\n  name: string;\n}\n\n// \"@activepieces/piece-google-sheets\" -> \"Google Sheets connection\"\nexport function connectionNameFor(\n  piecePackage: string,\n  displayName?: string,\n): string {\n  if (displayName) return `${displayName} connection`;\n  const short =\n    piecePackage\n      .split(\"/\")\n      .pop()\n      ?.replace(/^piece-/, \"\") ?? piecePackage;\n  const words = short\n    .split(/[-_]/)\n    .filter(Boolean)\n    .map((word) => word.charAt(0).toUpperCase() + word.slice(1));\n  return `${words.join(\" \") || piecePackage} connection`;\n}\n\n// Only piece blocks that take a connection and have none for their own package\n// yet: everything else already has a better answer in the list.\nexport function connectionDraftFor(input: {\n  block: BlockIdentity;\n  authMode: \"loading\" | \"none\" | \"optional\" | \"required\";\n  matchingCount: number;\n}): ConnectionDraft | null {\n  if (input.authMode === \"none\" || input.authMode === \"loading\") return null;\n  if (input.matchingCount > 0) return null;\n  if (isCoreBlock(input.block)) return null;\n  const piecePackage = input.block.pieceName;\n  return {\n    piecePackage,\n    connectorId: connectorIdForPiece(piecePackage),\n    name: connectionNameFor(piecePackage, pieceDisplayName(piecePackage)),\n  };\n}\n","// The connection editor's own form over a just-created document, hosted in the\n// host modal so binding a step never leaves the workflow editor.\nimport { Modal } from \"@powerhousedao/design-system\";\nimport { actions, useConnectionDocumentById } from \"document-models/connection\";\nimport { useEffect, useState } from \"react\";\nimport { connectionCallbacks } from \"../../connection-editor/connection-callbacks.js\";\nimport { ConnectionForm } from \"../../connection-editor/connection-form.js\";\nimport {\n  planFromAuth,\n  UNKNOWN_AUTH,\n} from \"../../connection-editor/piece-auth.js\";\nimport { useRuntime } from \"../runtime-context.js\";\nimport { catalogQuery } from \"../runtime-queries.js\";\nimport {\n  connectionNameFor,\n  type ConnectionDraft,\n} from \"./connection-create.js\";\n\nexport function CreateConnectionModal(props: {\n  connectionId: string;\n  draft: ConnectionDraft;\n  onDone: (connectionId: string) => void;\n}) {\n  const [document, dispatch] = useConnectionDocumentById(props.connectionId);\n  const [prefilled, setPrefilled] = useState(false);\n  const { client, queryClient } = useRuntime();\n  const state = document?.state.global;\n\n  // The picker knows the piece; the connector is prefilled once, exactly as\n  // picking it by hand would, so only the credentials are left to fill in.\n  useEffect(() => {\n    if (!dispatch || prefilled || state === undefined) return;\n    if (state.connectorId) return;\n    // eslint-disable-next-line react-hooks-extra/set-state-in-effect -- one-shot latch so the prefill dispatches exactly once\n    setPrefilled(true);\n    dispatch(actions.setConnectionName({ name: props.draft.name }));\n    dispatch(actions.setName(props.draft.name));\n    const setConnector = (auth: unknown) => {\n      const { authType } = planFromAuth(auth);\n      // Left unset rather than saved as another type; the form says why.\n      if (authType === UNKNOWN_AUTH) return;\n      dispatch(\n        actions.setConnector({\n          connectorId: props.draft.connectorId,\n          authType,\n        }),\n      );\n    };\n    queryClient.fetchQuery(catalogQuery(client)).then(\n      (pieces) => {\n        const piece = pieces.find(\n          (entry) => entry.name === props.draft.piecePackage,\n        );\n        setConnector(piece?.auth);\n        // The draft may have been named before the catalog knew the piece.\n        const name = connectionNameFor(\n          props.draft.piecePackage,\n          piece?.displayName,\n        );\n        if (name !== props.draft.name) {\n          dispatch(actions.setConnectionName({ name }));\n          dispatch(actions.setName(name));\n        }\n      },\n      // Unreachable catalog: the connector still points at the piece and the\n      // form recovers the auth kind once the catalog loads.\n      () => setConnector(null),\n    );\n  }, [dispatch, prefilled, props.draft, state, client, queryClient]);\n\n  const callbacks =\n    state && dispatch ? connectionCallbacks(state, dispatch) : null;\n\n  return (\n    <Modal\n      open\n      title=\"New connection\"\n      onOpenChange={(open) => {\n        if (!open) props.onDone(props.connectionId);\n      }}\n      contentProps={{\n        className: \"max-h-[85vh] w-[36rem] max-w-[92vw] overflow-y-auto\",\n      }}\n    >\n      <div className=\"flex flex-col gap-4 p-6\">\n        <div className=\"flex items-center gap-2\">\n          <input\n            key={state?.name}\n            className=\"min-w-0 flex-1 rounded border border-transparent px-1 py-0.5 text-sm font-semibold text-foreground hover:border-foreground/10 focus:border-foreground/15 focus:outline-none\"\n            defaultValue={state?.name ?? props.draft.name}\n            placeholder=\"Untitled connection\"\n            spellCheck={false}\n            aria-label=\"Connection name\"\n            onKeyDown={(event) => {\n              if (event.key === \"Enter\") event.currentTarget.blur();\n            }}\n            onBlur={(event) => {\n              const name = event.target.value.trim();\n              if (name && name !== state?.name) callbacks?.setName(name);\n            }}\n          />\n          <button\n            type=\"button\"\n            className=\"shrink-0 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground\"\n            onClick={() => props.onDone(props.connectionId)}\n          >\n            Use this connection\n          </button>\n        </div>\n        {state && callbacks ? (\n          <ConnectionForm\n            state={state}\n            callbacks={callbacks}\n            connectionId={props.connectionId}\n          />\n        ) : (\n          <p className=\"text-xs text-muted-foreground/80\">\n            Loading the new connection document…\n          </p>\n        )}\n      </div>\n    </Modal>\n  );\n}\n","// Connection picker: autocomplete over the powerhouse/connection documents\n// that configure this block's own piece.\nimport {\n  addDocument,\n  useSelectedDriveId,\n} from \"@powerhousedao/reactor-browser\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { FieldLabel, Hint, textInputClass } from \"../../shared/controls.js\";\nimport { Icon } from \"../../shared/icons.js\";\nimport { pieceLogo, usePieceLogos } from \"./block-meta.js\";\nimport {\n  CONNECTION_TYPE,\n  compatibleConnections,\n  connectionDraftFor,\n  looksLikeDocumentId,\n  type ConnectionDraft,\n} from \"./connection-create.js\";\nimport { packageFromConnectorId } from \"../../connection-editor/piece-auth.js\";\nimport type { BlockRef } from \"./blocks.js\";\nimport { CreateConnectionModal } from \"./CreateConnectionModal.js\";\nimport { useBlockForm, useConnectionList } from \"./design-time.js\";\nimport type { ConnectionSummary } from \"./forms.js\";\n\nconst STATUS_DOT: Record<string, string> = {\n  OK: \"bg-wf-ok\",\n  UNCONFIGURED: \"bg-wf-warn\",\n  ERROR: \"bg-wf-fail\",\n  REVOKED: \"bg-wf-fail\",\n};\n\n// The piece's own logo, falling back to its initial until the catalog lands.\nfunction ConnectorIcon(props: { connectorId: string }) {\n  usePieceLogos();\n  const [broken, setBroken] = useState(false);\n  const piecePackage = packageFromConnectorId(props.connectorId);\n  const src = broken ? undefined : pieceLogo(piecePackage);\n  if (!src) {\n    const short =\n      piecePackage\n        .split(\"/\")\n        .pop()\n        ?.replace(/^piece-/, \"\") ?? \"\";\n    return (\n      <span className=\"flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-solid border-foreground/10 bg-muted/50 text-[9px] text-muted-foreground\">\n        {short.slice(0, 1).toUpperCase() || \"?\"}\n      </span>\n    );\n  }\n  return (\n    <img\n      src={src}\n      alt=\"\"\n      className=\"h-4 w-4 shrink-0 object-contain\"\n      onError={() => setBroken(true)}\n    />\n  );\n}\n\nfunction ConnectionRow(props: {\n  connection: ConnectionSummary;\n  onPick: (connection: ConnectionSummary) => void;\n}) {\n  const { connection } = props;\n  return (\n    <button\n      type=\"button\"\n      className=\"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-accent\"\n      // mousedown so the pick lands before the input's blur.\n      onMouseDown={(event) => {\n        event.preventDefault();\n        props.onPick(connection);\n      }}\n    >\n      <ConnectorIcon connectorId={connection.connectorId} />\n      <span className=\"min-w-0 flex-1 truncate font-medium text-foreground\">\n        {connection.name}\n        {connection.accountLabel ? (\n          <span className=\"ml-1.5 font-normal text-muted-foreground\">\n            {connection.accountLabel}\n          </span>\n        ) : null}\n      </span>\n      <span\n        className={`h-2 w-2 shrink-0 rounded-full ${STATUS_DOT[connection.status] ?? \"bg-muted-foreground/40\"}`}\n        title={connection.status}\n      />\n    </button>\n  );\n}\n\nfunction CreateRow(props: {\n  draft: ConnectionDraft;\n  busy: boolean;\n  onCreate: () => void;\n}) {\n  return (\n    <button\n      type=\"button\"\n      className=\"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-accent disabled:opacity-50\"\n      disabled={props.busy}\n      // mousedown so the click lands before the input's blur.\n      onMouseDown={(event) => {\n        event.preventDefault();\n        props.onCreate();\n      }}\n    >\n      <span className=\"flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-solid border-foreground/15 text-[10px] text-muted-foreground\">\n        +\n      </span>\n      <span className=\"min-w-0 flex-1 truncate font-medium text-foreground\">\n        {props.busy ? \"Creating connection…\" : \"Create connection\"}\n      </span>\n    </button>\n  );\n}\n\nconst LINK_ATTEMPTS = 30;\nconst LINK_INTERVAL_MS = 500;\n\nexport function ConnectionField(props: {\n  block: BlockRef;\n  value: string;\n  onChange: (connectionId: string | null) => void;\n}) {\n  const { form } = useBlockForm(props.block);\n  const { connections, refetch, invalidate, fetchNow } = useConnectionList();\n  const [open, setOpen] = useState(false);\n  const [query, setQuery] = useState(\"\");\n  const [creating, setCreating] = useState(false);\n  const [createError, setCreateError] = useState<string | null>(null);\n  const [draftId, setDraftId] = useState<string | null>(null);\n  const [linking, setLinking] = useState(false);\n  const containerRef = useRef<HTMLDivElement>(null);\n  const driveId = useSelectedDriveId();\n\n  // Loaded up front so a bound connection shows by name, and again on open.\n  const openField = () => {\n    refetch();\n    setOpen(true);\n  };\n\n  useEffect(() => {\n    if (!open) return;\n    const handler = (event: MouseEvent) => {\n      if (!containerRef.current?.contains(event.target as globalThis.Node)) {\n        setOpen(false);\n      }\n    };\n    window.addEventListener(\"mousedown\", handler);\n    return () => window.removeEventListener(\"mousedown\", handler);\n  }, [open]);\n\n  // The selected connection may configure another piece (a stale value, or one\n  // pasted by hand), so it is resolved against the whole listing.\n  const selected = connections.find(\n    (connection) => connection.id === props.value,\n  );\n\n  const authMode = form === \"loading\" ? \"loading\" : (form?.auth ?? \"optional\");\n  // Blocks that take no connection only show the field to clear a stale one;\n  // until the form says which it is, an empty field stays hidden.\n  if ((authMode === \"none\" || authMode === \"loading\") && !props.value) {\n    return null;\n  }\n\n  const compatible = compatibleConnections(connections, props.block);\n  const needle = query.trim().toLowerCase();\n  const visible = needle\n    ? compatible.filter((connection) =>\n        [connection.name, connection.accountLabel ?? \"\"].some((candidate) =>\n          candidate.toLowerCase().includes(needle),\n        ),\n      )\n    : compatible;\n  const draft = driveId\n    ? connectionDraftFor({\n        block: props.block,\n        authMode,\n        // The unfiltered set, so typing cannot summon the create entry for a\n        // piece that already has a connection.\n        matchingCount: compatible.length,\n      })\n    : null;\n\n  const create = (pending: ConnectionDraft) => {\n    if (!driveId || creating) return;\n    setCreating(true);\n    setCreateError(null);\n    addDocument(driveId, pending.name, CONNECTION_TYPE)\n      .then((node) => {\n        invalidate();\n        setDraftId(node.id);\n      })\n      .catch((error: unknown) => {\n        setCreateError(error instanceof Error ? error.message : String(error));\n      })\n      .finally(() => setCreating(false));\n  };\n\n  const pick = (connectionId: string) => {\n    setQuery(\"\");\n    setOpen(false);\n    if (connectionId !== props.value) props.onChange(connectionId);\n  };\n\n  const clear = () => {\n    setQuery(\"\");\n    setOpen(false);\n    if (props.value) props.onChange(null);\n  };\n\n  // The new document reaches the switchboard a moment after the modal closes;\n  // binding it earlier leaves the step pointing at an id nothing resolves.\n  const finishCreate = (connectionId: string) => {\n    setDraftId(null);\n    setLinking(true);\n    const poll = (attempt: number) => {\n      const done = () => {\n        setLinking(false);\n        pick(connectionId);\n      };\n      fetchNow().then(\n        (result) => {\n          // Ready once the synced document names this block's piece.\n          const ready = result.some(\n            (connection) =>\n              connection.id === connectionId &&\n              packageFromConnectorId(connection.connectorId) ===\n                props.block.pieceName,\n          );\n          if (ready || attempt >= LINK_ATTEMPTS) {\n            done();\n          } else {\n            setTimeout(() => poll(attempt + 1), LINK_INTERVAL_MS);\n          }\n        },\n        () => done(),\n      );\n    };\n    poll(0);\n  };\n\n  return (\n    <div ref={containerRef} className=\"relative\">\n      <FieldLabel\n        label=\"Connection\"\n        optional={authMode === \"optional\"}\n        needsValue={!props.value && authMode === \"required\"}\n        action={\n          props.value && !open ? (\n            <button\n              type=\"button\"\n              className=\"rounded px-1 text-xs text-muted-foreground hover:text-foreground\"\n              onClick={clear}\n            >\n              Clear\n            </button>\n          ) : undefined\n        }\n      />\n      {open ? (\n        <input\n          autoFocus\n          aria-label=\"Search connections\"\n          className={`${textInputClass} border-ring ring-2 ring-ring/25`}\n          value={query}\n          placeholder=\"Search connections or paste a document id\"\n          onChange={(event) => setQuery(event.target.value)}\n          onKeyDown={(event) => {\n            if (event.key === \"Escape\") {\n              setQuery(\"\");\n              setOpen(false);\n            }\n          }}\n        />\n      ) : (\n        // Closed, the field reads as the chosen connection rather than its id.\n        <button\n          type=\"button\"\n          className={`${textInputClass} flex items-center gap-2 text-left ${\n            !props.value && authMode === \"required\"\n              ? \"border-wf-warn/70 hover:border-wf-warn\"\n              : \"\"\n          }`}\n          onClick={openField}\n        >\n          {selected ? (\n            <>\n              <ConnectorIcon connectorId={selected.connectorId} />\n              <span className=\"min-w-0 flex-1 truncate text-foreground\">\n                {selected.name}\n                {selected.accountLabel ? (\n                  <span className=\"ml-1.5 text-muted-foreground\">\n                    {selected.accountLabel}\n                  </span>\n                ) : null}\n              </span>\n              <span\n                className={`h-2 w-2 shrink-0 rounded-full ${STATUS_DOT[selected.status] ?? \"bg-muted-foreground/40\"}`}\n                title={selected.status}\n              />\n            </>\n          ) : (\n            <span className=\"flex-1 truncate text-muted-foreground/70\">\n              {props.value ? props.value : \"Choose a connection\"}\n            </span>\n          )}\n          <Icon\n            name=\"chevronDown\"\n            className=\"h-3.5 w-3.5 text-muted-foreground\"\n          />\n        </button>\n      )}\n      {props.value && !selected ? (\n        <Hint>Not a known connection document.</Hint>\n      ) : null}\n      {selected &&\n      packageFromConnectorId(selected.connectorId) !== props.block.pieceName ? (\n        <p className=\"mt-1.5 text-xs text-wf-warn\">\n          Configures {selected.connectorId}, not this block&apos;s piece.\n        </p>\n      ) : null}\n      {!props.value && authMode === \"required\" ? (\n        <Hint>This block signs in to its service through a connection.</Hint>\n      ) : null}\n      {linking ? <Hint>Linking the new connection…</Hint> : null}\n      {createError ? (\n        <p className=\"mt-1.5 text-xs font-medium text-wf-fail\">{createError}</p>\n      ) : null}\n      {open ? (\n        <div className=\"absolute left-0 right-0 top-full z-50 mt-1 max-h-64 overflow-y-auto rounded-lg border border-solid border-foreground/10 bg-popover p-1 shadow-lg\">\n          {visible.map((connection) => (\n            <ConnectionRow\n              key={connection.id}\n              connection={connection}\n              onPick={(picked) => pick(picked.id)}\n            />\n          ))}\n          {draft && !needle ? (\n            <CreateRow\n              draft={draft}\n              busy={creating}\n              onCreate={() => create(draft)}\n            />\n          ) : null}\n          {visible.length === 0 && looksLikeDocumentId(query) ? (\n            <button\n              type=\"button\"\n              className=\"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-accent\"\n              onMouseDown={(event) => {\n                event.preventDefault();\n                pick(query.trim());\n              }}\n            >\n              <span className=\"min-w-0 flex-1 truncate text-xs text-foreground\">\n                Use document id{\" \"}\n                <span className=\"font-mono text-muted-foreground\">\n                  {query.trim()}\n                </span>\n              </span>\n            </button>\n          ) : null}\n          {visible.length === 0 && !draft && !looksLikeDocumentId(query) ? (\n            <p className=\"px-2 py-1.5 text-xs text-muted-foreground/80\">\n              {needle\n                ? \"No matching connection.\"\n                : \"No connection for this piece yet.\"}\n            </p>\n          ) : null}\n        </div>\n      ) : null}\n      {draftId && draft ? (\n        <CreateConnectionModal\n          connectionId={draftId}\n          draft={draft}\n          onDone={finishCreate}\n        />\n      ) : null}\n    </div>\n  );\n}\n","// The connection editor's secret flow: the input takes the VALUE and only the\n// minted ref is committed. Pasting over an existing ref rotates it.\nimport { useEffect, useState } from \"react\";\nimport type { SecretFormService, SecretStat } from \"./forms.js\";\n\nexport const SECRET_REF_PREFIX = \"secret://v1:\";\n\nexport function useSecretRef(options: {\n  value: unknown;\n  secrets?: SecretFormService;\n  label: string;\n  onCommit: (ref: string) => void;\n}) {\n  const { secrets } = options;\n  const ref = typeof options.value === \"string\" ? options.value : \"\";\n  const managed = ref.startsWith(SECRET_REF_PREFIX);\n  const [draft, setDraft] = useState(\"\");\n  const [busy, setBusy] = useState(false);\n  const [error, setError] = useState<string | null>(null);\n  const [stat, setStat] = useState<SecretStat | null>(null);\n\n  useEffect(() => {\n    // eslint-disable-next-line react-hooks-extra/set-state-in-effect -- clears the stale stat before the ref's own fetch\n    setStat(null);\n    if (!managed || !secrets) return;\n    let cancelled = false;\n    secrets.stat(ref).then(\n      (result) => {\n        if (!cancelled) setStat(result);\n      },\n      () => undefined,\n    );\n    return () => {\n      cancelled = true;\n    };\n  }, [ref, managed, secrets]);\n\n  const commit = () => {\n    if (draft === \"\" || busy || !secrets) return;\n    setBusy(true);\n    setError(null);\n    secrets\n      .save({\n        ref: managed ? ref : undefined,\n        value: draft,\n        label: options.label,\n      })\n      .then((result) => {\n        setDraft(\"\");\n        if (result.ref !== ref) options.onCommit(result.ref);\n        else setStat(result);\n      })\n      .catch((requestError: unknown) => {\n        setError(\n          requestError instanceof Error\n            ? requestError.message\n            : String(requestError),\n        );\n      })\n      .finally(() => setBusy(false));\n  };\n\n  return { ref, managed, draft, setDraft, busy, error, stat, commit };\n}\n","// Controls for Activepieces prop types and display hints that PropertyForm\n// renders beyond plain inputs: callouts, steppers, date ranges, cards, colour.\nimport type { DateRangePreset } from \"@powerhousedao/pieces-framework\";\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport {\n  IconButton,\n  invalidClass,\n  Select,\n  textInputClass,\n} from \"../../shared/controls.js\";\nimport { Icon, isIconName } from \"../../shared/icons.js\";\nimport type { FormOption } from \"./forms.js\";\n\n// ─── markdown ───────────────────────────────────────────────────────────────\n\nconst CALLOUT: Record<string, { box: string; icon?: \"alert\" | \"bolt\" }> = {\n  INFO: { box: \"rounded bg-muted px-2 py-1.5\" },\n  WARNING: {\n    box: \"rounded border border-solid border-wf-warn/40 bg-wf-warn/10 px-2 py-1.5\",\n    icon: \"alert\",\n  },\n  TIP: {\n    box: \"rounded border border-solid border-wf-ok/30 bg-wf-ok/10 px-2 py-1.5\",\n    icon: \"bolt\",\n  },\n  BORDERLESS: { box: \"\" },\n};\n\n/** A MARKDOWN prop's text, styled by the piece's `variant` (INFO default). */\nexport function MarkdownCallout(props: {\n  variant?: string;\n  children: ReactNode;\n}) {\n  const callout = CALLOUT[props.variant ?? \"INFO\"] ?? CALLOUT.INFO;\n  return (\n    <div\n      className={`flex gap-2 ${callout.box}`}\n      data-variant={props.variant ?? \"INFO\"}\n    >\n      {callout.icon ? (\n        <Icon\n          name={callout.icon}\n          className={`mt-0.5 h-3.5 w-3.5 shrink-0 ${\n            callout.icon === \"alert\" ? \"text-wf-warn\" : \"text-wf-ok\"\n          }`}\n        />\n      ) : null}\n      <div className=\"min-w-0 flex-1\">{props.children}</div>\n    </div>\n  );\n}\n\n// ─── options ────────────────────────────────────────────────────────────────\n\n/** An option's icon, when the piece names one this editor draws. */\nexport function optionIcon(name: string | undefined): ReactNode {\n  return isIconName(name) ? (\n    <Icon name={name} className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n  ) : undefined;\n}\n\n/** STATIC_DROPDOWN with `display: 'cards'`: one selectable card per option. */\nexport function OptionCards(props: {\n  id: string;\n  options: FormOption[];\n  value: unknown;\n  keyOf: (value: unknown) => string;\n  onChange: (value: unknown) => void;\n  invalid: boolean;\n  clearable: boolean;\n}) {\n  const current = props.keyOf(props.value);\n  return (\n    <div\n      id={props.id}\n      role=\"radiogroup\"\n      className={`grid grid-cols-2 gap-2 ${props.invalid ? \"rounded-md ring-1 ring-wf-warn/60\" : \"\"}`}\n    >\n      {props.options.map((option) => {\n        const key = props.keyOf(option.value);\n        const selected = key === current;\n        return (\n          <button\n            key={key}\n            type=\"button\"\n            role=\"radio\"\n            aria-checked={selected}\n            className={`flex min-w-0 flex-col items-start gap-1 rounded-lg border border-solid p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${\n              selected\n                ? \"border-foreground/40 bg-accent\"\n                : \"border-foreground/10 hover:border-foreground/25\"\n            }`}\n            onClick={() =>\n              props.onChange(\n                selected && props.clearable ? undefined : option.value,\n              )\n            }\n          >\n            <span className=\"flex items-center gap-1.5 text-[13px] font-medium text-foreground\">\n              {optionIcon(option.icon)}\n              {option.label}\n            </span>\n            {option.description ? (\n              <span className=\"text-xs leading-snug text-muted-foreground\">\n                {option.description}\n              </span>\n            ) : null}\n          </button>\n        );\n      })}\n    </div>\n  );\n}\n\n// ─── number ─────────────────────────────────────────────────────────────────\n\n/** The declared bounds, for the hint and the check: \"Between 0 and 5\". */\nexport function numberRangeText(min?: number, max?: number): string | null {\n  if (min !== undefined && max !== undefined)\n    return `Between ${min} and ${max}`;\n  if (min !== undefined) return `At least ${min}`;\n  if (max !== undefined) return `At most ${max}`;\n  return null;\n}\n\nexport function numberRangeError(\n  value: unknown,\n  min?: number,\n  max?: number,\n): string | null {\n  if (typeof value !== \"number\") return null;\n  if (\n    (min !== undefined && value < min) ||\n    (max !== undefined && value > max)\n  ) {\n    return `${numberRangeText(min, max)}.`;\n  }\n  return null;\n}\n\n/** NUMBER with `display: 'stepper'`: − value +, still accepting expressions. */\nexport function NumberStepper(props: {\n  id: string;\n  value: unknown;\n  min?: number;\n  max?: number;\n  step?: number;\n  invalid: boolean;\n  onCommit: (value: unknown) => void;\n  // Typed text, parsed by the caller.\n  onCommitText: (raw: string) => void;\n  onFocus?: (event: { currentTarget: Element }) => void;\n}) {\n  const step = props.step ?? 1;\n  const numeric = typeof props.value === \"number\" ? props.value : undefined;\n  const clamp = (next: number) =>\n    Math.min(props.max ?? Infinity, Math.max(props.min ?? -Infinity, next));\n  const bump = (direction: 1 | -1) =>\n    props.onCommit(clamp((numeric ?? props.min ?? 0) + direction * step));\n  const text =\n    props.value === undefined || props.value === null\n      ? \"\"\n      : String(props.value);\n  return (\n    <div className=\"flex items-center gap-1\">\n      <IconButton\n        icon=\"minus\"\n        label=\"Decrease\"\n        disabled={\n          numeric !== undefined &&\n          props.min !== undefined &&\n          numeric <= props.min\n        }\n        onClick={() => bump(-1)}\n      />\n      <input\n        id={props.id}\n        key={text}\n        className={`${textInputClass} w-24 text-center tabular-nums ${props.invalid ? invalidClass : \"\"}`}\n        defaultValue={text}\n        inputMode=\"decimal\"\n        spellCheck={false}\n        onFocus={props.onFocus}\n        onBlur={(event) => props.onCommitText(event.target.value)}\n      />\n      <IconButton\n        icon=\"plus\"\n        label=\"Increase\"\n        disabled={\n          numeric !== undefined &&\n          props.max !== undefined &&\n          numeric >= props.max\n        }\n        onClick={() => bump(1)}\n      />\n    </div>\n  );\n}\n\n// ─── date range ─────────────────────────────────────────────────────────────\n\nexport interface DateRangeValue {\n  preset?: string;\n  after?: string;\n  before?: string;\n}\n\n// Keyed by the framework's DateRangePreset, so the typecheck holds the set to\n// it; a type import, as the framework's entry is not browser-safe at runtime.\nconst PRESET_LABELS: Record<DateRangePreset, string> = {\n  any_time: \"Any time\",\n  last_24_hours: \"Last 24 hours\",\n  last_7_days: \"Last 7 days\",\n  last_30_days: \"Last 30 days\",\n  last_90_days: \"Last 90 days\",\n  this_month: \"This month\",\n  custom: \"Custom\",\n};\n\nexport const DATE_PRESETS = (\n  Object.entries(PRESET_LABELS) as [DateRangePreset, string][]\n).map(([value, label]) => ({ value, label }));\n\nfunction toLocalInput(iso: string | undefined): string {\n  if (!iso) return \"\";\n  const date = new Date(iso);\n  if (Number.isNaN(date.getTime())) return \"\";\n  const pad = (n: number) => String(n).padStart(2, \"0\");\n  return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;\n}\n\nfunction fromLocalInput(local: string): string | undefined {\n  if (!local) return undefined;\n  const date = new Date(local);\n  return Number.isNaN(date.getTime()) ? undefined : date.toISOString();\n}\n\nexport function asDateRange(value: unknown): DateRangeValue {\n  return typeof value === \"object\" && value !== null && !Array.isArray(value)\n    ? (value as DateRangeValue)\n    : {};\n}\n\n// DATE_RANGE: a preset, or a custom after/before pair; commits the object the\n// framework resolves, never a string.\nexport function DateRangeField(props: {\n  id: string;\n  value: unknown;\n  dropdown: boolean;\n  invalid: boolean;\n  clearable: boolean;\n  onCommit: (value: DateRangeValue | undefined) => void;\n}) {\n  const range = asDateRange(props.value);\n  const setPreset = (preset: string) =>\n    props.onCommit(\n      preset === \"\"\n        ? undefined\n        : preset === \"custom\"\n          ? { preset, after: range.after, before: range.before }\n          : { preset },\n    );\n  return (\n    <div className=\"flex flex-col gap-2\">\n      {props.dropdown ? (\n        <Select\n          id={props.id}\n          options={DATE_PRESETS}\n          value={range.preset ?? \"\"}\n          onChange={setPreset}\n          invalid={props.invalid}\n          clearable={props.clearable}\n          placeholder=\"Choose a range\"\n        />\n      ) : (\n        <div id={props.id} role=\"radiogroup\" className=\"flex flex-wrap gap-1.5\">\n          {DATE_PRESETS.map((preset) => {\n            const selected = range.preset === preset.value;\n            return (\n              <button\n                key={preset.value}\n                type=\"button\"\n                role=\"radio\"\n                aria-checked={selected}\n                className={`h-7 rounded-full border border-solid px-2.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${\n                  selected\n                    ? \"border-foreground bg-foreground text-background\"\n                    : \"border-foreground/15 text-muted-foreground hover:text-foreground\"\n                }`}\n                onClick={() =>\n                  setPreset(selected && props.clearable ? \"\" : preset.value)\n                }\n              >\n                {preset.label}\n              </button>\n            );\n          })}\n        </div>\n      )}\n      {range.preset === \"custom\" ? (\n        <div className=\"grid grid-cols-2 gap-2\">\n          {([\"after\", \"before\"] as const).map((edge) => (\n            <label\n              key={edge}\n              className=\"flex flex-col gap-1 text-xs text-muted-foreground\"\n            >\n              {edge === \"after\" ? \"From\" : \"To\"}\n              <input\n                type=\"datetime-local\"\n                className={textInputClass}\n                defaultValue={toLocalInput(range[edge])}\n                onBlur={(event) =>\n                  props.onCommit({\n                    ...range,\n                    [edge]: fromLocalInput(event.target.value),\n                  })\n                }\n              />\n            </label>\n          ))}\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\n// ─── colour ─────────────────────────────────────────────────────────────────\n\nconst HEX = /^#[0-9a-f]{6}$/i;\n\n/** COLOR: a swatch picker beside a text field that also takes expressions. */\nexport function ColorField(props: {\n  id: string;\n  value: unknown;\n  invalid: boolean;\n  onCommit: (value: unknown) => void;\n  onFocus?: (event: { currentTarget: Element }) => void;\n}) {\n  const text = typeof props.value === \"string\" ? props.value : \"\";\n  // React's onChange fires on every drag tick; the native change event fires\n  // once the pick is done, so only that one commits.\n  const [draft, setDraft] = useState<string | null>(null);\n  const swatchRef = useRef<HTMLInputElement>(null);\n  const onCommit = props.onCommit;\n  useEffect(() => {\n    const swatch = swatchRef.current;\n    if (!swatch) return;\n    const commit = () => {\n      setDraft(null);\n      onCommit(swatch.value);\n    };\n    swatch.addEventListener(\"change\", commit);\n    return () => swatch.removeEventListener(\"change\", commit);\n  }, [onCommit]);\n  return (\n    <div className=\"flex items-center gap-2\">\n      <input\n        ref={swatchRef}\n        type=\"color\"\n        aria-label=\"Pick a colour\"\n        className=\"h-9 w-10 shrink-0 cursor-pointer rounded-md border border-solid border-foreground/15 bg-card p-1\"\n        value={draft ?? (HEX.test(text) ? text : \"#000000\")}\n        onChange={(event) => setDraft(event.target.value)}\n      />\n      <input\n        id={props.id}\n        key={text}\n        className={`${textInputClass} font-mono text-xs ${props.invalid ? invalidClass : \"\"}`}\n        defaultValue={text}\n        placeholder=\"#1d63d6 or {{steps.…}}\"\n        spellCheck={false}\n        onFocus={props.onFocus}\n        onBlur={(event) => {\n          const raw = event.target.value.trim();\n          props.onCommit(raw === \"\" ? undefined : raw);\n        }}\n      />\n    </div>\n  );\n}\n\n// ─── rich text ──────────────────────────────────────────────────────────────\n\n// The mapping RichTextProperty's `formatProperty` doc declares (upstream\n// rich-text-property.ts): 'html', 'markdown' | 'md', anything else plain.\nexport function richTextMode(format: unknown): \"plain\" | \"markdown\" | \"html\" {\n  if (format === \"html\") return \"html\";\n  if (format === \"markdown\" || format === \"md\") return \"markdown\";\n  return \"plain\";\n}\n","// Arranges a form's fields by the piece's layout hints: property groups\n// (section, tabs, summary, builder, footer), checkbox reveals and half width.\nimport { Fragment, useState, type ReactNode } from \"react\";\nimport { IconButton, Select, Tabs } from \"../../shared/controls.js\";\nimport { Icon, isIconName } from \"../../shared/icons.js\";\nimport type { BlockFormProp, PropertyGroup } from \"./forms.js\";\nimport { isEmptyValue } from \"./validation.js\";\n\ninterface LayoutProps {\n  props: BlockFormProp[];\n  groups?: PropertyGroup[];\n  values: Record<string, unknown>;\n  renderField: (prop: BlockFormProp) => ReactNode;\n  onCommit: (name: string, value: unknown) => void;\n}\n\n// Grouped where the group's first member is declared, not hoisted to the top,\n// so a piece's own prop order still reads top to bottom.\nconst PLACED = new Set([\"section\", \"tabs\", \"builder\", \"footer\"]);\n\nfunction chipText(value: unknown): string {\n  if (typeof value === \"string\") return value;\n  if (typeof value === \"number\" || typeof value === \"boolean\") {\n    return String(value);\n  }\n  if (Array.isArray(value)) return value.map(chipText).join(\", \");\n  return \"set\";\n}\n\n/** Consecutive `width: 'half'` fields share a row, two at a time. */\nfunction Rows(props: { items: { prop: BlockFormProp; node: ReactNode }[] }) {\n  const rows: ReactNode[] = [];\n  let pending: { prop: BlockFormProp; node: ReactNode } | null = null;\n  const flush = () => {\n    if (pending)\n      rows.push(<Fragment key={pending.prop.name}>{pending.node}</Fragment>);\n    pending = null;\n  };\n  for (const item of props.items) {\n    if (item.prop.width !== \"half\") {\n      flush();\n      rows.push(<Fragment key={item.prop.name}>{item.node}</Fragment>);\n      continue;\n    }\n    if (!pending) {\n      pending = item;\n      continue;\n    }\n    const first: { prop: BlockFormProp; node: ReactNode } = pending;\n    pending = null;\n    rows.push(\n      <div\n        key={`${first.prop.name}+${item.prop.name}`}\n        className=\"grid grid-cols-1 gap-4 min-[420px]:grid-cols-2\"\n      >\n        <div className=\"min-w-0\">{first.node}</div>\n        <div className=\"min-w-0\">{item.node}</div>\n      </div>,\n    );\n  }\n  flush();\n  return <>{rows}</>;\n}\n\n// A checkbox and the fields it reveals while checked, indented beneath it.\nfunction RevealCard(props: {\n  checkbox: BlockFormProp;\n  revealed: BlockFormProp[];\n  layout: LayoutProps;\n}) {\n  const open = props.layout.values[props.checkbox.name] === true;\n  return (\n    <div className=\"flex flex-col gap-4\">\n      {props.layout.renderField(props.checkbox)}\n      {open && props.revealed.length > 0 ? (\n        <div className=\"flex flex-col gap-4 border-l-2 border-solid border-foreground/10 pl-3\">\n          <Rows\n            items={props.revealed.map((prop) => ({\n              prop,\n              node: props.layout.renderField(prop),\n            }))}\n          />\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\n// Fields of a list, reveals folded under their checkbox and halves paired.\nfunction FieldList(props: { members: BlockFormProp[]; layout: LayoutProps }) {\n  const byName = new Map(props.members.map((prop) => [prop.name, prop]));\n  const revealedBy = new Map<string, BlockFormProp>();\n  for (const prop of props.members) {\n    for (const name of prop.reveals ?? []) {\n      if (byName.has(name)) revealedBy.set(name, prop);\n    }\n  }\n  const items = props.members\n    .filter((prop) => !revealedBy.has(prop.name))\n    .map((prop) => {\n      const revealed = (prop.reveals ?? [])\n        .map((name) => byName.get(name))\n        .filter((entry): entry is BlockFormProp => entry !== undefined);\n      return {\n        prop,\n        node:\n          revealed.length > 0 ? (\n            <RevealCard\n              checkbox={prop}\n              revealed={revealed}\n              layout={props.layout}\n            />\n          ) : (\n            props.layout.renderField(prop)\n          ),\n      };\n    });\n  return <Rows items={items} />;\n}\n\nfunction GroupHeading(props: { group: PropertyGroup }) {\n  const { group } = props;\n  if (!group.label && !group.description) return null;\n  return (\n    <div className=\"flex flex-col gap-0.5\">\n      {group.label ? (\n        <span className=\"flex items-center gap-1.5 text-[13px] font-semibold text-foreground\">\n          {isIconName(group.icon) ? (\n            <Icon\n              name={group.icon}\n              className=\"h-3.5 w-3.5 text-muted-foreground\"\n            />\n          ) : null}\n          {group.label}\n        </span>\n      ) : null}\n      {group.description ? (\n        <span className=\"text-xs text-muted-foreground\">\n          {group.description}\n        </span>\n      ) : null}\n    </div>\n  );\n}\n\nfunction Section(props: {\n  group: PropertyGroup;\n  members: BlockFormProp[];\n  layout: LayoutProps;\n}) {\n  return (\n    <section\n      aria-label={props.group.label}\n      className=\"flex flex-col gap-4 rounded-lg border border-solid border-foreground/10 p-4\"\n    >\n      <GroupHeading group={props.group} />\n      <FieldList members={props.members} layout={props.layout} />\n    </section>\n  );\n}\n\n// One member at a time; a dot marks tabs that hold a value.\nfunction TabbedGroup(props: {\n  group: PropertyGroup;\n  members: BlockFormProp[];\n  layout: LayoutProps;\n}) {\n  const [active, setActive] = useState(props.members[0]?.name ?? \"\");\n  const current =\n    props.members.find((prop) => prop.name === active) ?? props.members[0];\n  if (!current) return null;\n  return (\n    <div className=\"flex flex-col gap-3\">\n      <GroupHeading group={props.group} />\n      <div className=\"border-b border-solid border-foreground/10\">\n        <Tabs\n          value={current.name}\n          onChange={setActive}\n          tabs={props.members.map((prop) => ({\n            value: prop.name,\n            label: prop.displayName,\n            badge: isEmptyValue(props.layout.values[prop.name]) ? undefined : (\n              <span\n                aria-label=\"has a value\"\n                className=\"h-1.5 w-1.5 rounded-full bg-wf-run\"\n              />\n            ),\n          }))}\n        />\n      </div>\n      {props.layout.renderField(current)}\n    </div>\n  );\n}\n\n// Filters: only the ones in use show, and \"Add filter\" offers the rest.\nfunction BuilderGroups(props: {\n  groups: PropertyGroup[];\n  byName: Map<string, BlockFormProp>;\n  layout: LayoutProps;\n}) {\n  const members = props.groups.flatMap((group) =>\n    group.props\n      .map((name) => props.byName.get(name))\n      .filter((prop): prop is BlockFormProp => prop !== undefined),\n  );\n  const [added, setAdded] = useState<string[]>([]);\n  const inUse = members.filter(\n    (prop) =>\n      prop.required ||\n      added.includes(prop.name) ||\n      !isEmptyValue(props.layout.values[prop.name]),\n  );\n  const available = members.filter((prop) => !inUse.includes(prop));\n  return (\n    <div className=\"flex flex-col gap-3\">\n      {props.groups.map((group) => (\n        <GroupHeading key={group.key} group={group} />\n      ))}\n      {inUse.map((prop) => (\n        <div key={prop.name} className=\"flex items-start gap-1\">\n          <div className=\"min-w-0 flex-1\">{props.layout.renderField(prop)}</div>\n          {prop.required ? null : (\n            <IconButton\n              icon=\"close\"\n              label={`Remove ${prop.displayName}`}\n              className=\"mt-7\"\n              onClick={() => {\n                setAdded((names) => names.filter((name) => name !== prop.name));\n                props.layout.onCommit(prop.name, undefined);\n              }}\n            />\n          )}\n        </div>\n      ))}\n      {available.length > 0 ? (\n        <div className=\"max-w-60\">\n          <Select\n            options={available.map((prop) => ({\n              value: prop.name,\n              label: prop.displayName,\n              description: prop.description,\n            }))}\n            value=\"\"\n            placeholder=\"Add filter\"\n            onChange={(name) => {\n              if (name) setAdded((names) => [...names, name]);\n            }}\n          />\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\n// Chips for what the form's sections hold, each clearable in place.\nfunction Summary(props: { members: BlockFormProp[]; layout: LayoutProps }) {\n  const set = props.members.filter(\n    (prop) => !isEmptyValue(props.layout.values[prop.name]),\n  );\n  if (set.length === 0) return null;\n  return (\n    <div className=\"flex flex-wrap gap-1.5\" aria-label=\"Filters in use\">\n      {set.map((prop) => (\n        <span\n          key={prop.name}\n          className=\"inline-flex h-6 max-w-full items-center gap-1 rounded-full bg-muted pl-2.5 pr-1 text-xs text-foreground\"\n        >\n          <span className=\"truncate\">\n            {prop.displayName}: {chipText(props.layout.values[prop.name])}\n          </span>\n          <button\n            type=\"button\"\n            aria-label={`Clear ${prop.displayName}`}\n            className=\"flex h-4 w-4 items-center justify-center rounded-full text-muted-foreground hover:bg-foreground/10 hover:text-foreground\"\n            onClick={() => props.layout.onCommit(prop.name, undefined)}\n          >\n            <Icon name=\"close\" className=\"h-3 w-3\" />\n          </button>\n        </span>\n      ))}\n    </div>\n  );\n}\n\nexport function PropLayout(props: LayoutProps) {\n  const groups = (props.groups ?? []).filter(\n    (group) => PLACED.has(group.display) || group.display === \"summary\",\n  );\n  const byName = new Map(props.props.map((prop) => [prop.name, prop]));\n  const groupOf = new Map<string, PropertyGroup>();\n  for (const group of groups) {\n    if (!PLACED.has(group.display)) continue;\n    for (const name of group.props) {\n      if (byName.has(name) && !groupOf.has(name)) groupOf.set(name, group);\n    }\n  }\n  const membersOf = (group: PropertyGroup) =>\n    group.props\n      .map((name) => byName.get(name))\n      .filter((prop): prop is BlockFormProp => prop !== undefined);\n  const builderGroups = groups.filter((group) => group.display === \"builder\");\n  const summaries = groups.filter((group) => group.display === \"summary\");\n  const sectionMembers = groups\n    .filter((group) => group.display === \"section\")\n    .flatMap(membersOf);\n\n  const blocks: ReactNode[] = [];\n  let loose: BlockFormProp[] = [];\n  const flushLoose = () => {\n    if (loose.length === 0) return;\n    blocks.push(\n      <FieldList\n        key={`loose:${loose[0].name}`}\n        members={loose}\n        layout={props}\n      />,\n    );\n    loose = [];\n  };\n  // The summary sits just above the first section it summarises.\n  const summarised = summaries.length > 0 && sectionMembers.length > 0;\n  const placed = new Set<string>();\n  for (const prop of props.props) {\n    const group = groupOf.get(prop.name);\n    if (!group) {\n      loose.push(prop);\n      continue;\n    }\n    const key = group.display === \"builder\" ? \"builder\" : group.key;\n    if (placed.has(key)) continue;\n    placed.add(key);\n    flushLoose();\n    if (group.display === \"builder\") {\n      blocks.push(\n        <BuilderGroups\n          key=\"builder\"\n          groups={builderGroups}\n          byName={byName}\n          layout={props}\n        />,\n      );\n    } else if (group.display === \"tabs\") {\n      blocks.push(\n        <TabbedGroup\n          key={group.key}\n          group={group}\n          members={membersOf(group)}\n          layout={props}\n        />,\n      );\n    } else if (group.display === \"footer\") {\n      blocks.push(\n        <div\n          key={group.key}\n          className=\"flex flex-col gap-4 border-t border-solid border-foreground/10 pt-4\"\n        >\n          <GroupHeading group={group} />\n          <FieldList members={membersOf(group)} layout={props} />\n        </div>,\n      );\n    } else {\n      if (summarised && !placed.has(\"summary\")) {\n        placed.add(\"summary\");\n        blocks.push(\n          <Summary key=\"summary\" members={sectionMembers} layout={props} />,\n        );\n      }\n      blocks.push(\n        <Section\n          key={group.key}\n          group={group}\n          members={membersOf(group)}\n          layout={props}\n        />,\n      );\n    }\n  }\n  flushLoose();\n  return <>{blocks}</>;\n}\n","// Property-driven config form, modeled on the Activepieces piece-properties\n// panel: one control per prop, typed by the descriptor.\nimport {\n  lazy,\n  Suspense,\n  useEffect,\n  useId,\n  useRef,\n  useState,\n  type ReactNode,\n} from \"react\";\nimport {\n  Button,\n  FieldError,\n  Hint,\n  IconButton,\n  invalidClass,\n  Segmented,\n  Select,\n  type SelectAction,\n  Switch,\n  textAreaClass,\n  textInputClass,\n} from \"../../shared/controls.js\";\nimport { Icon } from \"../../shared/icons.js\";\nimport {\n  ExpressionPickerButton,\n  ExpressionTokenLine,\n  useExpressionField,\n} from \"./ExpressionPicker.js\";\nimport { hasExpressions } from \"./expression-tokens.js\";\nimport {\n  useDynamicCache,\n  useOptionSearch,\n  useResolvedProp,\n  type LoadState,\n} from \"./design-time.js\";\nimport type { PropertyModeValue, PropertySettingModel } from \"./model.js\";\nimport type { BlockRef } from \"./blocks.js\";\nimport type { ResolverKeyInput } from \"./query-keys.js\";\nimport {\n  isPropVisible,\n  parsePropList,\n  resolverInputFor,\n  settingFor,\n  stripOptions,\n  withSetting,\n} from \"./validation.js\";\nimport type {\n  BlockFormProp,\n  FormOption,\n  PropertyGroup,\n  SecretFormService,\n} from \"./forms.js\";\nimport { useSecretRef } from \"./secret-ref.js\";\nimport { lacksDefaults, withPropDefaults } from \"./prop-defaults.js\";\nimport {\n  ColorField,\n  DateRangeField,\n  MarkdownCallout,\n  NumberStepper,\n  numberRangeError,\n  numberRangeText,\n  OptionCards,\n  optionIcon,\n  richTextMode,\n} from \"./prop-controls.js\";\nimport { PropLayout } from \"./prop-layout.js\";\nimport { isEmptyValue } from \"./validation.js\";\n\n// Splices text at the field's cursor and returns the updated value.\nfunction insertAtCursor(\n  element: HTMLInputElement | HTMLTextAreaElement,\n  text: string,\n): string {\n  const start = element.selectionStart ?? element.value.length;\n  const end = element.selectionEnd ?? start;\n  element.value =\n    element.value.slice(0, start) + text + element.value.slice(end);\n  return element.value;\n}\n\nconst WHOLE_EXPRESSION = /^\\{\\{\\s*[^{}]+?\\s*\\}\\}$/;\n\n// Plain decimal notation only; Number() would take \"0x10\" or \"1e3\".\nconst DECIMAL = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)$/;\n\nexport function parseDecimal(raw: string): number | undefined {\n  const trimmed = raw.trim();\n  return DECIMAL.test(trimmed) ? Number(trimmed) : undefined;\n}\n\nfunction stringifyValue(value: unknown): string {\n  if (value === undefined || value === null) return \"\";\n  if (typeof value === \"string\") return value;\n  try {\n    return JSON.stringify(value, null, 2);\n  } catch {\n    return String(value as number | boolean);\n  }\n}\n\ninterface DropdownResult {\n  options: FormOption[];\n  placeholder?: string;\n  disabled?: boolean;\n}\n\nfunction parseDropdownResult(result: unknown): DropdownResult {\n  const record = result as {\n    options?: {\n      label?: unknown;\n      value?: unknown;\n      description?: unknown;\n      icon?: unknown;\n    }[];\n    placeholder?: string;\n    disabled?: boolean;\n  } | null;\n  if (!record || !Array.isArray(record.options)) {\n    throw new Error(\"Unexpected options result\");\n  }\n  return {\n    options: record.options.map((option) => ({\n      label: stringifyValue(option.label ?? option.value),\n      value: option.value,\n      ...(typeof option.description === \"string\" && option.description\n        ? { description: option.description }\n        : {}),\n      ...(typeof option.icon === \"string\" ? { icon: option.icon } : {}),\n    })),\n    placeholder: record.placeholder,\n    disabled: record.disabled,\n  };\n}\n\nconst RELOAD_DEBOUNCE_MS = 400;\n\n// Deferred: react-markdown's remark chain is a large graph, and most blocks\n// carry no markdown at all.\nconst PieceMarkdown = lazy(() => import(\"./PieceMarkdown.js\"));\n\n// Substituted when the endpoint is not available, rather than left as the raw\n// placeholder: an author must not be told to paste \"{{webhookUrl}}\".\nconst NO_ENDPOINT = \"[no endpoint yet — see Endpoint URL above]\";\n\n// Activepieces writes its setup instructions as markdown carrying these\n// placeholders; unsubstituted, an author is told to paste \"{{webhookUrl}}\".\nexport function fillPiecePlaceholders(\n  text: string,\n  values: { webhookUrl?: string; webhookTimeoutSeconds?: number },\n): string {\n  return text\n    .replace(/\\{\\{\\s*webhookUrl\\s*\\}\\}/g, values.webhookUrl ?? NO_ENDPOINT)\n    .replace(\n      /\\{\\{\\s*webhookTimeoutSeconds\\s*\\}\\}/g,\n      values.webhookTimeoutSeconds === undefined\n        ? \"{{webhookTimeoutSeconds}}\"\n        : String(values.webhookTimeoutSeconds),\n    );\n}\n\n// Marks controls whose runtime support has not landed yet.\nexport function AvailableSoon(props: { children?: ReactNode }) {\n  return (\n    <span\n      className=\"inline-flex items-center gap-1 rounded-full bg-wf-warn/10 px-2 py-0.5 text-[11px] font-medium normal-case tracking-normal text-wf-warn\"\n      title=\"Not supported by the runtime yet\"\n    >\n      Available soon{props.children ? <span>: {props.children}</span> : null}\n    </span>\n  );\n}\n\n// The label points at its control by id rather than wrapping it: a wrapping\n// label would bind to the first control inside, the \"Insert data\" button.\nfunction FieldShell(props: {\n  prop: BlockFormProp;\n  invalid: boolean;\n  htmlFor?: string;\n  picker?: ReactNode;\n  children: ReactNode;\n  error?: string | null;\n}) {\n  const { prop } = props;\n  const LabelTag = props.htmlFor ? \"label\" : \"span\";\n  return (\n    <div className=\"group/field\">\n      <div className=\"mb-1.5 flex min-h-6 items-center justify-between gap-2\">\n        <LabelTag\n          htmlFor={props.htmlFor}\n          className=\"flex min-w-0 items-baseline gap-1.5 text-[13px] font-medium text-foreground\"\n        >\n          {optionIcon(prop.icon)}\n          <span className=\"truncate\">{prop.displayName}</span>\n          {!prop.required ? (\n            <span className=\"shrink-0 text-xs font-normal text-muted-foreground\">\n              Optional\n            </span>\n          ) : null}\n          {props.invalid ? (\n            <span className=\"shrink-0 text-xs font-normal text-wf-warn\">\n              Needs a value\n            </span>\n          ) : null}\n        </LabelTag>\n        {props.picker ? (\n          <span className=\"flex shrink-0 items-center gap-0.5\">\n            {props.picker}\n          </span>\n        ) : null}\n      </div>\n      {props.children}\n      <FieldError>{props.error}</FieldError>\n      <Hint text={prop.description} />\n    </div>\n  );\n}\n\nfunction OptionList(props: {\n  options: { label: string; value: unknown }[];\n  selected: unknown[];\n  onChange: (next: unknown[]) => void;\n  invalid: boolean;\n  loading?: boolean;\n  onRefresh?: () => void;\n  placeholder?: string;\n  id?: string;\n}) {\n  const keyOf = (value: unknown) => stringifyValue(value);\n  const byKey = new Map(\n    props.options.map((option) => [keyOf(option.value), option]),\n  );\n  return (\n    <Select\n      id={props.id}\n      multiple\n      options={props.options.map((option) => ({\n        value: keyOf(option.value),\n        label: option.label,\n      }))}\n      value={props.selected.map(keyOf)}\n      onChange={(keys) =>\n        props.onChange(keys.map((key) => byKey.get(key)?.value ?? key))\n      }\n      invalid={props.invalid}\n      loading={props.loading}\n      onRefresh={props.onRefresh}\n      placeholder={props.placeholder ?? \"Choose any\"}\n    />\n  );\n}\n\n// Single choice over typed option values, keyed by their serialised form.\nfunction OptionSelect(props: {\n  options: FormOption[];\n  value: unknown;\n  onChange: (next: unknown) => void;\n  invalid: boolean;\n  placeholder?: string;\n  loading?: boolean;\n  disabled?: boolean;\n  onRefresh?: () => void;\n  clearable?: boolean;\n  emptyText?: string;\n  id?: string;\n  searchable?: boolean;\n  actions?: SelectAction[];\n  onQueryChange?: (query: string) => void;\n}) {\n  const keyOf = (value: unknown) => stringifyValue(value);\n  const byKey = new Map(\n    props.options.map((option) => [keyOf(option.value), option]),\n  );\n  return (\n    <Select\n      id={props.id}\n      options={props.options.map((option) => ({\n        value: keyOf(option.value),\n        label: option.label,\n        description: option.description,\n        icon: optionIcon(option.icon),\n      }))}\n      value={keyOf(props.value)}\n      onChange={(key) =>\n        props.onChange(key === \"\" ? undefined : (byKey.get(key)?.value ?? key))\n      }\n      invalid={props.invalid}\n      placeholder={props.placeholder}\n      loading={props.loading}\n      disabled={props.disabled}\n      onRefresh={props.onRefresh}\n      clearable={props.clearable}\n      emptyText={props.emptyText}\n      searchable={props.searchable}\n      actions={props.actions}\n      onQueryChange={props.onQueryChange}\n    />\n  );\n}\n\n// Rows of nested forms for an ARRAY prop with item properties.\nfunction ArrayRows(props: {\n  prop: BlockFormProp;\n  value: unknown;\n  onCommit: (value: unknown) => void;\n  scopeStepId?: string;\n  invalid: boolean;\n}) {\n  const fields = props.prop.properties ?? [];\n  const rows = Array.isArray(props.value)\n    ? props.value.map((item) =>\n        item !== null && typeof item === \"object\"\n          ? (item as Record<string, unknown>)\n          : {},\n      )\n    : [];\n  const update = (next: Record<string, unknown>[]) =>\n    props.onCommit(next.length > 0 ? next : undefined);\n  return (\n    <div\n      className={`flex flex-col gap-2 ${props.invalid ? \"rounded-md ring-1 ring-wf-warn/50\" : \"\"}`}\n    >\n      {rows.map((row, index) => (\n        <div\n          key={index}\n          className=\"rounded-lg border border-solid border-foreground/10 bg-muted/40 p-3\"\n        >\n          <div className=\"mb-2 flex items-center justify-between\">\n            <span className=\"text-xs font-medium text-muted-foreground\">\n              Item {index + 1}\n            </span>\n            <IconButton\n              icon=\"trash\"\n              label={`Remove item ${index + 1}`}\n              onClick={() => update(rows.filter((_, i) => i !== index))}\n            />\n          </div>\n          <PropertyForm\n            props={fields}\n            value={row}\n            onChange={(next) =>\n              update(rows.map((entry, i) => (i === index ? next : entry)))\n            }\n            scopeStepId={props.scopeStepId}\n            nested\n          />\n        </div>\n      ))}\n      <Button\n        size=\"sm\"\n        className=\"self-start\"\n        onClick={() => update([...rows, withPropDefaults(fields, {})])}\n      >\n        <Icon name=\"plus\" className=\"h-3.5 w-3.5\" />\n        Add item\n      </Button>\n    </div>\n  );\n}\n\n// Key/value rows for an OBJECT dictionary; values stay strings.\nfunction ObjectRows(props: {\n  value: Record<string, unknown>;\n  onCommit: (value: Record<string, unknown> | undefined) => void;\n  invalid: boolean;\n}) {\n  const [rows, setRows] = useState(() =>\n    Object.entries(props.value).map(([key, value]) => ({\n      key,\n      value: stringifyValue(value),\n    })),\n  );\n  const [prevValue, setPrevValue] = useState(props.value);\n  if (props.value !== prevValue) {\n    setPrevValue(props.value);\n    setRows(\n      Object.entries(props.value).map(([key, value]) => ({\n        key,\n        value: stringifyValue(value),\n      })),\n    );\n  }\n  const commit = (next: { key: string; value: string }[]) => {\n    setRows(next);\n    const record: Record<string, unknown> = {};\n    for (const row of next) {\n      if (row.key.trim() !== \"\") record[row.key.trim()] = row.value;\n    }\n    props.onCommit(Object.keys(record).length > 0 ? record : undefined);\n  };\n  return (\n    <div\n      className={`flex flex-col gap-1.5 ${props.invalid ? \"rounded-md ring-1 ring-wf-warn/50\" : \"\"}`}\n    >\n      {rows.map((row, index) => (\n        <div key={index} className=\"flex items-center gap-1\">\n          <input\n            className={`${textInputClass} font-mono text-xs`}\n            placeholder=\"Key\"\n            value={row.key}\n            onChange={(event) =>\n              setRows(\n                rows.map((entry, i) =>\n                  i === index ? { ...entry, key: event.target.value } : entry,\n                ),\n              )\n            }\n            onBlur={() => commit(rows)}\n          />\n          <input\n            className={`${textInputClass} font-mono text-xs`}\n            placeholder=\"Value\"\n            value={row.value}\n            onChange={(event) =>\n              setRows(\n                rows.map((entry, i) =>\n                  i === index ? { ...entry, value: event.target.value } : entry,\n                ),\n              )\n            }\n            onBlur={() => commit(rows)}\n          />\n          <IconButton\n            icon=\"close\"\n            label=\"Remove entry\"\n            onClick={() => commit(rows.filter((_, i) => i !== index))}\n          />\n        </div>\n      ))}\n      <Button\n        size=\"sm\"\n        className=\"self-start\"\n        onClick={() => setRows([...rows, { key: \"\", value: \"\" }])}\n      >\n        <Icon name=\"plus\" className=\"h-3.5 w-3.5\" />\n        Add entry\n      </Button>\n    </div>\n  );\n}\n\n// ISO ↔ the local wall-clock string a datetime-local input speaks.\nfunction isoToLocalInput(value: unknown): string {\n  if (typeof value !== \"string\" || value === \"\") return \"\";\n  const date = new Date(value);\n  if (Number.isNaN(date.getTime())) return \"\";\n  const pad = (n: number) => String(n).padStart(2, \"0\");\n  return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;\n}\n\nfunction localInputToIso(value: string): string | undefined {\n  if (value === \"\") return undefined;\n  const date = new Date(value);\n  return Number.isNaN(date.getTime()) ? value : date.toISOString();\n}\n\nfunction isDropdownType(type: string): boolean {\n  return type === \"DROPDOWN\" || type === \"MULTI_SELECT_DROPDOWN\";\n}\n\nconst SEARCH_DEBOUNCE_MS = 300;\n\n// Controls that are not text inputs, so an expression switches them to one.\nconst FLIPS_TO_TEXT = new Set([\n  \"DATE_TIME\",\n  \"OBJECT\",\n  \"DROPDOWN\",\n  \"CHECKBOX\",\n  \"NUMBER\",\n]);\n\nconst TEXT_MODE_TYPES = new Set([\n  \"SHORT_TEXT\",\n  \"LONG_TEXT\",\n  \"NUMBER\",\n  \"SECRET_TEXT\",\n  \"FILE\",\n  \"JSON\",\n  \"DATE_TIME\",\n  \"OBJECT\",\n  \"DROPDOWN\",\n  \"CHECKBOX\",\n]);\n\n// Mirrors the connection editor's SecretField: the input takes the VALUE and\n// only the minted ref reaches the config. Pasting over a ref rotates it.\nfunction SecretRefField(props: {\n  prop: BlockFormProp;\n  value: unknown;\n  onCommit: (value: unknown) => void;\n  invalid: boolean;\n  secrets?: SecretFormService;\n}) {\n  const { secrets } = props;\n  const fieldId = useId();\n  const { ref, managed, draft, setDraft, busy, error, stat, commit } =\n    useSecretRef({\n      value: props.value,\n      secrets,\n      label: props.prop.displayName,\n      onCommit: props.onCommit,\n    });\n\n  if (!secrets) {\n    return (\n      <FieldShell htmlFor={fieldId} prop={props.prop} invalid={props.invalid}>\n        <p className=\"text-xs text-muted-foreground\">\n          Managed secrets are unavailable in this session.\n        </p>\n      </FieldShell>\n    );\n  }\n  return (\n    <FieldShell\n      htmlFor={fieldId}\n      prop={props.prop}\n      invalid={props.invalid}\n      error={error}\n    >\n      {managed ? (\n        <p className=\"mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground\">\n          <span className=\"font-medium text-foreground\">\n            {stat?.label ?? ref}\n          </span>\n          {stat ? <span>version {stat.version}</span> : null}\n          {stat?.status === \"DELETED\" ? (\n            <span className=\"font-medium text-wf-fail\">deleted</span>\n          ) : null}\n        </p>\n      ) : null}\n      <div className=\"flex items-center gap-1\">\n        <input\n          id={fieldId}\n          className={`${textInputClass} ${props.invalid ? invalidClass : \"\"}`}\n          type=\"password\"\n          value={draft}\n          disabled={busy}\n          placeholder={\n            managed\n              ? \"Paste a new value to replace it\"\n              : \"Paste the secret value\"\n          }\n          autoComplete=\"off\"\n          spellCheck={false}\n          onChange={(event) => setDraft(event.target.value)}\n          onKeyDown={(event) => {\n            if (event.key === \"Enter\") commit();\n          }}\n          onBlur={commit}\n        />\n        {ref ? (\n          <IconButton\n            icon=\"close\"\n            label=\"Remove secret\"\n            onClick={() => props.onCommit(undefined)}\n          />\n        ) : null}\n      </div>\n    </FieldShell>\n  );\n}\n\n// A small text button in a field's label row that switches its mode.\nfunction ModeButton(props: { label: string; onClick: () => void }) {\n  return (\n    <button\n      type=\"button\"\n      className=\"inline-flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground\"\n      onClick={props.onClick}\n    >\n      {props.label}\n    </button>\n  );\n}\n\nfunction PropField(props: {\n  prop: BlockFormProp;\n  value: unknown;\n  // A mode rides along when the edit also switched it.\n  onCommit: (value: unknown, mode?: PropertyModeValue) => void;\n  // The stored mode; absent means inferred from the value.\n  mode?: PropertyModeValue;\n  // A mode switch with no value change.\n  onMode?: (mode: PropertyModeValue) => void;\n  loadOptions?: (propName: string, searchValue?: string) => Promise<unknown>;\n  // The form's other values, for a prop that reads a sibling.\n  config?: Record<string, unknown>;\n  secrets?: SecretFormService;\n  scopeStepId?: string;\n  // Keys the resolver's answer: block, prop, refresher values, connection.\n  resolverInput: ResolverKeyInput;\n  // A sibling this prop's resolver reads that is still empty.\n  waitingOn?: string;\n  // Inside an ARRAY item or DYNAMIC result: options cannot load yet.\n  nested?: boolean;\n  // Substituted into MARKDOWN props; absent until the endpoint is minted.\n  webhookUrl?: string;\n}) {\n  const { prop, value } = props;\n  const fieldId = useId();\n  const optionsUnavailable = Boolean(\n    props.nested && prop.hasDynamicResolver && !props.loadOptions,\n  );\n  const fieldRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n  const invalid =\n    prop.required && prop.type !== \"MARKDOWN\" && isEmptyValue(value);\n\n  // Live text of the field for token highlighting (inputs are uncontrolled).\n  const [draft, setDraft] = useState(() => stringifyValue(value));\n  const [prevValue, setPrevValue] = useState(value);\n  if (value !== prevValue) {\n    setPrevValue(value);\n    setDraft(stringifyValue(value));\n  }\n  const [jsonError, setJsonError] = useState<string | null>(null);\n  // EXPRESSION mode: the field is a text input for a {{…}} value.\n  const [textMode, setTextMode] = useState(props.mode === \"EXPRESSION\");\n  const [prevMode, setPrevMode] = useState(props.mode);\n  if (props.mode !== prevMode) {\n    setPrevMode(props.mode);\n    if (props.mode) setTextMode(props.mode === \"EXPRESSION\");\n  }\n  // Every edit records the field's mode, so it never has to be guessed.\n  const onCommit = (next: unknown, mode?: PropertyModeValue) =>\n    props.onCommit(next, mode ?? (textMode ? \"EXPRESSION\" : \"MANUAL\"));\n  const toMode = (expression: boolean) => {\n    setTextMode(expression);\n    props.onMode?.(expression ? \"EXPRESSION\" : \"MANUAL\");\n  };\n  const [numberError, setNumberError] = useState<string | null>(null);\n\n  // JSON-ish fields only splice the text; their blur handler parses/commits.\n  const commitsOnInsert = prop.type !== \"JSON\";\n  const field = useExpressionField({\n    stepId: props.scopeStepId,\n    label: prop.displayName,\n    insert: (expression) => {\n      if (FLIPS_TO_TEXT.has(prop.type) && !textMode) {\n        setTextMode(true);\n        setDraft(expression);\n        setNumberError(null);\n        onCommit(expression, \"EXPRESSION\");\n        return;\n      }\n      if (!fieldRef.current) return;\n      const next = insertAtCursor(fieldRef.current, expression);\n      setDraft(next);\n      if (commitsOnInsert) onCommit(next);\n    },\n  });\n  const picker = TEXT_MODE_TYPES.has(prop.type) ? (\n    <ExpressionPickerButton active={field.active} onFocusField={field.focus} />\n  ) : undefined;\n\n  const dynamicLoad =\n    props.loadOptions && prop.hasDynamicResolver\n      ? () => props.loadOptions!(prop.name)\n      : undefined;\n  const isDropdown =\n    prop.type === \"DROPDOWN\" || prop.type === \"MULTI_SELECT_DROPDOWN\";\n  const dropdown = useResolvedProp({\n    kind: \"options\",\n    input: props.resolverInput,\n    load: isDropdown ? dynamicLoad : undefined,\n    parse: parseDropdownResult,\n    debounceMs: RELOAD_DEBOUNCE_MS,\n  });\n  const dynamic = useResolvedProp({\n    kind: \"dynamic\",\n    input: props.resolverInput,\n    load: prop.type === \"DYNAMIC\" ? dynamicLoad : undefined,\n    parse: parsePropList,\n    debounceMs: RELOAD_DEBOUNCE_MS,\n  });\n  // An unset DYNAMIC object stores its fields' defaults once they resolve.\n  const dynamicFields =\n    dynamic.state.kind === \"ready\" ? dynamic.state.result : null;\n  useEffect(() => {\n    if (value !== undefined || !dynamicFields) return;\n    if (lacksDefaults(dynamicFields, {})) {\n      props.onCommit(withPropDefaults(dynamicFields, {}), \"MANUAL\");\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- once per schema\n  }, [dynamicFields]);\n\n  // refreshOnSearch: options() re-runs with what the author types, debounced;\n  // a stale answer to an earlier query is dropped.\n  const [searchQuery, setSearchQuery] = useState(\"\");\n  // A choice from search results, kept so the field still shows its label\n  // once the list falls back to the unfiltered options.\n  const [picked, setPicked] = useState<FormOption | null>(null);\n  const loadOptions = props.loadOptions;\n  const searchable = Boolean(prop.refreshOnSearch && loadOptions);\n  const searchResult = useOptionSearch({\n    input: props.resolverInput,\n    query: searchQuery,\n    load:\n      searchable && loadOptions\n        ? (searchValue) => loadOptions(prop.name, searchValue)\n        : undefined,\n    parse: parseDropdownResult,\n    debounceMs: SEARCH_DEBOUNCE_MS,\n  });\n  const onSearch = searchable ? setSearchQuery : undefined;\n\n  const retryButton = (state: LoadState<unknown>, reload: () => void) => (\n    <IconButton\n      icon=\"retry\"\n      label=\"Reload\"\n      disabled={state.kind === \"loading\"}\n      onClick={reload}\n    />\n  );\n  const loadError = (state: LoadState<unknown>) =>\n    state.kind === \"error\" ? state.message : null;\n\n  const textInput = (extra: {\n    type?: string;\n    mono?: boolean;\n    placeholder?: string;\n    commit: (raw: string) => void;\n  }) => (\n    <>\n      <div className=\"flex items-center gap-1\">\n        <input\n          id={fieldId}\n          ref={fieldRef as React.RefObject<HTMLInputElement>}\n          type={extra.type ?? \"text\"}\n          className={`${textInputClass} ${extra.mono ? \"font-mono text-xs\" : \"\"} ${\n            invalid ? invalidClass : \"\"\n          }`}\n          defaultValue={stringifyValue(value)}\n          placeholder={extra.placeholder ?? prop.placeholder}\n          spellCheck={false}\n          onFocus={field.focus}\n          onChange={(event) => setDraft(event.target.value)}\n          onBlur={(event) => extra.commit(event.target.value)}\n        />\n      </div>\n      {extra.type === \"password\" ? null : <ExpressionTokenLine value={draft} />}\n    </>\n  );\n\n  switch (prop.type) {\n    case \"PH_SECRET_REF\":\n      return (\n        <SecretRefField\n          prop={prop}\n          value={value}\n          onCommit={onCommit}\n          invalid={invalid}\n          secrets={props.secrets}\n        />\n      );\n    case \"MARKDOWN\": {\n      const markdown = fillPiecePlaceholders(\n        stringifyValue(\n          prop.description ?? prop.defaultValue ?? prop.displayName,\n        ),\n        { webhookUrl: props.webhookUrl },\n      );\n      // The fallback keeps the text readable while the chunk loads, rather\n      // than collapsing the panel's height and reflowing it.\n      return (\n        <MarkdownCallout variant={prop.variant}>\n          <Suspense\n            fallback={\n              <p className=\"whitespace-pre-wrap text-xs text-muted-foreground\">\n                {markdown}\n              </p>\n            }\n          >\n            <PieceMarkdown text={markdown} />\n          </Suspense>\n        </MarkdownCallout>\n      );\n    }\n    case \"CHECKBOX\":\n      if (textMode) {\n        return (\n          <FieldShell\n            htmlFor={fieldId}\n            prop={prop}\n            invalid={invalid}\n            picker={\n              <>\n                {picker}\n                <ModeButton\n                  label=\"Use a switch\"\n                  onClick={() => {\n                    setTextMode(false);\n                    onCommit(undefined, \"MANUAL\");\n                  }}\n                />\n              </>\n            }\n          >\n            {textInput({\n              mono: true,\n              placeholder: \"{{steps.…}} yielding true or false\",\n              commit: (raw) => {\n                const trimmed = raw.trim();\n                if (trimmed === \"\") {\n                  setTextMode(false);\n                  return onCommit(undefined, \"MANUAL\");\n                }\n                onCommit(trimmed, \"EXPRESSION\");\n              },\n            })}\n          </FieldShell>\n        );\n      }\n      // A string here is not a choice; only true reads as on.\n      return (\n        <div className=\"group/field flex items-start gap-1\">\n          <div className=\"min-w-0 flex-1\">\n            <Switch\n              checked={value === true}\n              onChange={(checked) => onCommit(checked, \"MANUAL\")}\n              label={prop.displayName}\n              description={prop.description}\n            />\n          </div>\n          {picker}\n        </div>\n      );\n    case \"NUMBER\": {\n      const rangeError = numberRangeError(value, prop.min, prop.max);\n      // Manual text is a number or nothing; {{…}} switches to an expression.\n      const commitNumber = (raw: string) => {\n        const trimmed = raw.trim();\n        if (trimmed === \"\") {\n          setNumberError(null);\n          if (!textMode) return onCommit(undefined);\n          setTextMode(false);\n          return onCommit(undefined, \"MANUAL\");\n        }\n        if (textMode || hasExpressions(trimmed)) {\n          setNumberError(null);\n          setTextMode(true);\n          return onCommit(trimmed, \"EXPRESSION\");\n        }\n        const parsed = parseDecimal(trimmed);\n        if (parsed === undefined) {\n          setNumberError(\"Not a number\");\n          return;\n        }\n        setNumberError(null);\n        onCommit(parsed);\n      };\n      if (prop.display === \"stepper\" && !textMode) {\n        return (\n          <FieldShell\n            htmlFor={fieldId}\n            prop={prop}\n            invalid={invalid}\n            picker={picker}\n            error={numberError ?? rangeError}\n          >\n            <NumberStepper\n              id={fieldId}\n              value={value}\n              min={prop.min}\n              max={prop.max}\n              step={prop.step}\n              invalid={invalid || rangeError !== null || numberError !== null}\n              onCommit={(next) => {\n                setNumberError(null);\n                onCommit(next);\n              }}\n              onCommitText={commitNumber}\n              onFocus={field.focus}\n            />\n          </FieldShell>\n        );\n      }\n      // Text input so expressions stay possible; numeric text commits a number.\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={picker}\n          error={numberError ?? (textMode ? null : rangeError)}\n        >\n          {textInput({\n            mono: textMode,\n            placeholder: textMode\n              ? \"{{expression}} yielding a number\"\n              : (prop.placeholder ??\n                numberRangeText(prop.min, prop.max) ??\n                undefined),\n            commit: commitNumber,\n          })}\n        </FieldShell>\n      );\n    }\n    case \"SECRET_TEXT\":\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={picker}\n        >\n          {textInput({\n            type: \"password\",\n            commit: (raw) => onCommit(raw === \"\" ? undefined : raw),\n          })}\n        </FieldShell>\n      );\n    case \"FILE\":\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={picker}\n        >\n          {textInput({\n            mono: true,\n            placeholder: prop.placeholder ?? \"https://… or data:…;base64,…\",\n            commit: (raw) =>\n              onCommit(raw.trim() === \"\" ? undefined : raw.trim()),\n          })}\n        </FieldShell>\n      );\n    case \"DATE_TIME\":\n      if (textMode) {\n        return (\n          <FieldShell\n            htmlFor={fieldId}\n            prop={prop}\n            invalid={invalid}\n            picker={picker}\n          >\n            {textInput({\n              mono: true,\n              placeholder: \"ISO 8601 or {{expression}}\",\n              commit: (raw) => {\n                const trimmed = raw.trim();\n                if (trimmed === \"\") {\n                  setTextMode(false);\n                  return onCommit(undefined, \"MANUAL\");\n                }\n                onCommit(\n                  hasExpressions(trimmed) ? trimmed : localInputToIso(trimmed),\n                );\n              },\n            })}\n          </FieldShell>\n        );\n      }\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={picker}\n        >\n          <input\n            id={fieldId}\n            type=\"datetime-local\"\n            className={`${textInputClass} ${invalid ? invalidClass : \"\"}`}\n            defaultValue={isoToLocalInput(value)}\n            onFocus={field.focus}\n            onBlur={(event) => onCommit(localInputToIso(event.target.value))}\n          />\n        </FieldShell>\n      );\n    case \"STATIC_DROPDOWN\": {\n      const options = prop.staticOptions ?? [];\n      if (prop.display === \"cards\") {\n        return (\n          <FieldShell htmlFor={fieldId} prop={prop} invalid={invalid}>\n            <OptionCards\n              id={fieldId}\n              options={options}\n              value={value}\n              keyOf={stringifyValue}\n              onChange={onCommit}\n              invalid={invalid}\n              clearable={!prop.required}\n            />\n          </FieldShell>\n        );\n      }\n      // A short either/or reads faster as buttons than as a closed list.\n      if (\n        !prop.staticDisabled &&\n        prop.required !== true &&\n        prop.defaultValue !== undefined &&\n        options.length >= 2 &&\n        options.length <= 3 &&\n        options.every((option) => option.label.length <= 22)\n      ) {\n        return (\n          <FieldShell htmlFor={fieldId} prop={prop} invalid={false}>\n            <Segmented\n              value={stringifyValue(value)}\n              options={options.map((option) => ({\n                value: stringifyValue(option.value),\n                label: option.label,\n              }))}\n              onChange={(key) =>\n                onCommit(\n                  options.find((option) => stringifyValue(option.value) === key)\n                    ?.value ?? key,\n                )\n              }\n            />\n          </FieldShell>\n        );\n      }\n      return (\n        <FieldShell htmlFor={fieldId} prop={prop} invalid={invalid}>\n          <OptionSelect\n            id={fieldId}\n            options={prop.staticOptions ?? []}\n            value={value}\n            onChange={onCommit}\n            invalid={invalid}\n            placeholder={prop.staticPlaceholder ?? prop.placeholder}\n            disabled={prop.staticDisabled && isEmptyValue(value)}\n            clearable={!prop.required}\n          />\n        </FieldShell>\n      );\n    }\n    case \"STATIC_MULTI_SELECT_DROPDOWN\":\n      return (\n        <FieldShell htmlFor={fieldId} prop={prop} invalid={invalid}>\n          <OptionList\n            id={fieldId}\n            options={prop.staticOptions ?? []}\n            selected={Array.isArray(value) ? (value as unknown[]) : []}\n            onChange={(next) => onCommit(next.length > 0 ? next : undefined)}\n            invalid={invalid}\n          />\n        </FieldShell>\n      );\n    case \"DROPDOWN\": {\n      if (textMode) {\n        return (\n          <FieldShell\n            htmlFor={fieldId}\n            prop={prop}\n            invalid={invalid}\n            picker={\n              <>\n                {picker}\n                <ModeButton\n                  label=\"Pick from list\"\n                  onClick={() => {\n                    // An expression is not an option; keep a plain id.\n                    if (hasExpressions(value)) {\n                      setTextMode(false);\n                      onCommit(undefined, \"MANUAL\");\n                    } else toMode(false);\n                  }}\n                />\n              </>\n            }\n          >\n            {textInput({\n              mono: true,\n              placeholder: \"{{steps.…}} or an id\",\n              commit: (raw) => onCommit(raw.trim() === \"\" ? undefined : raw),\n            })}\n          </FieldShell>\n        );\n      }\n      const result =\n        searchResult ??\n        (dropdown.state.kind === \"ready\" ? dropdown.state.result : null);\n      const listed = result?.options ?? [];\n      const keepPicked =\n        picked !== null &&\n        stringifyValue(picked.value) === stringifyValue(value) &&\n        !listed.some(\n          (option) => stringifyValue(option.value) === stringifyValue(value),\n        );\n      const options = keepPicked ? [...listed, picked] : listed;\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          error={loadError(dropdown.state)}\n          picker={optionsUnavailable ? <AvailableSoon /> : picker}\n        >\n          <OptionSelect\n            id={fieldId}\n            options={options}\n            value={value}\n            onChange={(next) => {\n              setPicked(\n                listed.find(\n                  (option) =>\n                    stringifyValue(option.value) === stringifyValue(next),\n                ) ?? null,\n              );\n              onCommit(next);\n            }}\n            invalid={invalid}\n            loading={dropdown.state.kind === \"loading\"}\n            disabled={\n              (result?.disabled && !stringifyValue(value)) || optionsUnavailable\n            }\n            onRefresh={dynamicLoad ? dropdown.reload : undefined}\n            clearable={!prop.required}\n            searchable\n            onQueryChange={onSearch}\n            actions={[\n              {\n                label: \"Use data from an earlier step\",\n                icon: \"braces\",\n                onSelect: () => {\n                  toMode(true);\n                  field.focus();\n                },\n              },\n            ]}\n            emptyText={\n              result?.placeholder ??\n              \"Nothing to choose from yet. Some lists need a connection first.\"\n            }\n            placeholder={\n              optionsUnavailable\n                ? \"Options for nested fields are available soon\"\n                : (result?.placeholder ?? prop.placeholder ?? \"Choose…\")\n            }\n          />\n        </FieldShell>\n      );\n    }\n    case \"MULTI_SELECT_DROPDOWN\": {\n      const result =\n        dropdown.state.kind === \"ready\" ? dropdown.state.result : null;\n      const selected: unknown[] = Array.isArray(value) ? value : [];\n      // Keep selections the current options don't list so they stay visible.\n      const listed = new Set(\n        (result?.options ?? []).map((o) => stringifyValue(o.value)),\n      );\n      const extra = selected\n        .filter((entry) => !listed.has(stringifyValue(entry)))\n        .map((entry) => ({ label: stringifyValue(entry), value: entry }));\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          error={loadError(dropdown.state)}\n          picker={optionsUnavailable ? <AvailableSoon /> : undefined}\n        >\n          {optionsUnavailable ? (\n            <p className=\"text-xs text-muted-foreground\">\n              Options for nested fields are available soon.\n            </p>\n          ) : (\n            <OptionList\n              id={fieldId}\n              options={[...extra, ...(result?.options ?? [])]}\n              selected={selected}\n              onChange={(next) => onCommit(next.length > 0 ? next : undefined)}\n              invalid={invalid}\n              loading={dropdown.state.kind === \"loading\"}\n              onRefresh={dynamicLoad ? dropdown.reload : undefined}\n              placeholder={result?.placeholder ?? prop.placeholder}\n            />\n          )}\n        </FieldShell>\n      );\n    }\n    case \"DYNAMIC\": {\n      const fields =\n        dynamic.state.kind === \"ready\" ? dynamic.state.result : null;\n      const record =\n        value !== null && typeof value === \"object\" && !Array.isArray(value)\n          ? (value as Record<string, unknown>)\n          : {};\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid && fields !== null && fields.length > 0}\n          error={loadError(dynamic.state)}\n          picker={\n            optionsUnavailable ? (\n              <AvailableSoon />\n            ) : dynamicLoad ? (\n              retryButton(dynamic.state, dynamic.reload)\n            ) : undefined\n          }\n        >\n          {optionsUnavailable ? (\n            <p className=\"text-xs text-muted-foreground\">\n              Nested dynamic properties are available soon.\n            </p>\n          ) : dynamic.state.kind === \"loading\" && !fields ? (\n            <p className=\"text-xs text-muted-foreground\">\n              Resolving properties…\n            </p>\n          ) : !dynamicLoad ? (\n            <p className=\"text-xs text-muted-foreground\">\n              Properties resolve once the runtime is reachable.\n            </p>\n          ) : fields && fields.length > 0 ? (\n            <div className=\"rounded-lg border border-solid border-foreground/10 bg-muted/40 p-3\">\n              <PropertyForm\n                props={fields}\n                value={record}\n                onChange={(next) =>\n                  onCommit(Object.keys(next).length > 0 ? next : undefined)\n                }\n                scopeStepId={props.scopeStepId}\n                nested\n              />\n            </div>\n          ) : fields ? (\n            <p className=\"text-xs text-muted-foreground\">\n              {props.waitingOn\n                ? `Pick ${props.waitingOn} first; its fields show here.`\n                : \"No properties for the current selection.\"}\n            </p>\n          ) : null}\n        </FieldShell>\n      );\n    }\n    case \"ARRAY\": {\n      if (prop.properties && prop.properties.length > 0) {\n        return (\n          <FieldShell htmlFor={fieldId} prop={prop} invalid={invalid}>\n            <ArrayRows\n              prop={prop}\n              value={value}\n              onCommit={onCommit}\n              scopeStepId={props.scopeStepId}\n              invalid={invalid}\n            />\n          </FieldShell>\n        );\n      }\n      // Bound: one expression yields the whole list.\n      if (textMode) {\n        return (\n          <FieldShell\n            htmlFor={fieldId}\n            prop={prop}\n            invalid={invalid}\n            picker={\n              <>\n                <ExpressionPickerButton\n                  active={field.active}\n                  onFocusField={field.focus}\n                />\n                <ModeButton\n                  label=\"Enter items\"\n                  onClick={() => {\n                    setTextMode(false);\n                    const bound = stringifyValue(value).trim();\n                    onCommit(bound ? [bound] : undefined, \"MANUAL\");\n                  }}\n                />\n              </>\n            }\n          >\n            {textInput({\n              mono: true,\n              placeholder: \"{{steps.…}} yielding a list\",\n              commit: (raw) =>\n                onCommit(\n                  raw.trim() === \"\" ? undefined : raw.trim(),\n                  \"EXPRESSION\",\n                ),\n            })}\n          </FieldShell>\n        );\n      }\n      // One item per line, each stored as it is.\n      const lines = Array.isArray(value)\n        ? value.map((item) => stringifyValue(item)).join(\"\\n\")\n        : stringifyValue(value);\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={\n            <>\n              <ExpressionPickerButton\n                active={field.active}\n                onFocusField={field.focus}\n              />\n              <ModeButton\n                label=\"Bind the whole list\"\n                onClick={() => {\n                  setTextMode(true);\n                  onCommit(undefined, \"EXPRESSION\");\n                }}\n              />\n            </>\n          }\n        >\n          <textarea\n            id={fieldId}\n            ref={fieldRef as React.RefObject<HTMLTextAreaElement>}\n            className={`${textAreaClass} font-mono text-xs ${\n              invalid ? invalidClass : \"\"\n            }`}\n            defaultValue={lines}\n            placeholder={prop.placeholder ?? \"One item per line\"}\n            spellCheck={false}\n            onFocus={field.focus}\n            onChange={(event) => setDraft(event.target.value)}\n            onBlur={(event) => {\n              const items = event.target.value\n                .split(\"\\n\")\n                .map((line) => line.trim())\n                .filter((line) => line !== \"\");\n              if (items.length === 0) return onCommit(undefined);\n              onCommit(items);\n            }}\n          />\n          <ExpressionTokenLine value={draft} />\n        </FieldShell>\n      );\n    }\n    case \"OBJECT\": {\n      if (textMode) {\n        return (\n          <FieldShell\n            htmlFor={fieldId}\n            prop={prop}\n            invalid={invalid}\n            picker={picker}\n          >\n            {textInput({\n              mono: true,\n              placeholder: \"{{expression}} yielding an object\",\n              commit: (raw) => {\n                const trimmed = raw.trim();\n                if (trimmed === \"\") {\n                  setTextMode(false);\n                  return onCommit(undefined, \"MANUAL\");\n                }\n                onCommit(trimmed);\n              },\n            })}\n          </FieldShell>\n        );\n      }\n      const record =\n        value !== null && typeof value === \"object\" && !Array.isArray(value)\n          ? (value as Record<string, unknown>)\n          : {};\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={picker}\n        >\n          <ObjectRows value={record} onCommit={onCommit} invalid={invalid} />\n        </FieldShell>\n      );\n    }\n    case \"DATE_RANGE\":\n      return (\n        <FieldShell htmlFor={fieldId} prop={prop} invalid={invalid}>\n          <DateRangeField\n            id={fieldId}\n            value={value}\n            dropdown={prop.display === \"dropdown\"}\n            invalid={invalid}\n            clearable={!prop.required}\n            onCommit={onCommit}\n          />\n        </FieldShell>\n      );\n    case \"COLOR\":\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={picker}\n        >\n          <ColorField\n            id={fieldId}\n            value={value}\n            invalid={invalid}\n            onCommit={onCommit}\n            onFocus={field.focus}\n          />\n        </FieldShell>\n      );\n    case \"RICH_TEXT\":\n    case \"LONG_TEXT\":\n    case \"CUSTOM\":\n    case \"JSON\": {\n      // A CUSTOM prop's own renderer is DOM script; its value is edited as JSON.\n      const isJson = prop.type === \"JSON\" || prop.type === \"CUSTOM\";\n      const mode =\n        prop.type === \"RICH_TEXT\"\n          ? richTextMode(\n              prop.formatProperty ? props.config?.[prop.formatProperty] : \"\",\n            )\n          : null;\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={\n            mode ? (\n              <>\n                <span className=\"rounded bg-muted px-1.5 text-[11px] text-muted-foreground\">\n                  {mode === \"html\"\n                    ? \"HTML\"\n                    : mode === \"markdown\"\n                      ? \"Markdown\"\n                      : \"Plain text\"}\n                </span>\n                {picker}\n              </>\n            ) : (\n              picker\n            )\n          }\n          error={jsonError}\n        >\n          <textarea\n            id={fieldId}\n            ref={fieldRef as React.RefObject<HTMLTextAreaElement>}\n            className={`${textAreaClass} ${isJson || mode === \"html\" || prop.display === \"code\" ? \"font-mono text-xs\" : \"\"} ${\n              mode ? \"min-h-32\" : \"\"\n            } ${invalid ? invalidClass : \"\"}`}\n            defaultValue={stringifyValue(value)}\n            placeholder={prop.placeholder}\n            spellCheck={false}\n            onFocus={field.focus}\n            onChange={(event) => setDraft(event.target.value)}\n            onBlur={(event) => {\n              const raw = event.target.value;\n              if (!isJson) return onCommit(raw === \"\" ? undefined : raw);\n              const trimmed = raw.trim();\n              if (trimmed === \"\") {\n                setJsonError(null);\n                return onCommit(undefined);\n              }\n              // A whole expression resolves to the value at run time.\n              if (WHOLE_EXPRESSION.test(trimmed)) {\n                setJsonError(null);\n                return onCommit(trimmed);\n              }\n              try {\n                onCommit(JSON.parse(trimmed));\n                setJsonError(null);\n              } catch {\n                setJsonError(\"Not valid JSON, so it wasn't saved.\");\n              }\n            }}\n          />\n          <ExpressionTokenLine value={draft} />\n        </FieldShell>\n      );\n    }\n    default:\n      return (\n        <FieldShell\n          htmlFor={fieldId}\n          prop={prop}\n          invalid={invalid}\n          picker={picker}\n        >\n          {prop.emptyChoice && value === \"\"\n            ? null\n            : textInput({\n                commit: (raw) => onCommit(raw === \"\" ? undefined : raw),\n              })}\n          {prop.emptyChoice ? (\n            <label className=\"mt-1.5 flex items-center gap-2 text-xs text-muted-foreground\">\n              <input\n                type=\"checkbox\"\n                className=\"h-3.5 w-3.5 accent-current\"\n                checked={value === \"\"}\n                onChange={(event) =>\n                  onCommit(event.target.checked ? \"\" : undefined, \"MANUAL\")\n                }\n              />\n              {prop.emptyChoice}\n            </label>\n          ) : null}\n        </FieldShell>\n      );\n  }\n}\n\n// Stands in for the block of a form with no resolvers.\nconst NO_BLOCK: BlockRef = {\n  pieceName: \"\",\n  pieceVersion: \"\",\n  kind: \"action\",\n  name: \"\",\n};\n\nexport function PropertyForm(props: {\n  props: BlockFormProp[];\n  // Leads the resolver cache keys; absent for forms with no resolvers.\n  block?: BlockRef;\n  // The piece's property groups; props outside them render as they are.\n  groups?: PropertyGroup[];\n  value: Record<string, unknown>;\n  // Settings come along when the edit changed them too.\n  onChange: (\n    next: Record<string, unknown>,\n    settings?: PropertySettingModel[],\n  ) => void;\n  // Per-field mode and DYNAMIC schema; top-level forms only.\n  settings?: PropertySettingModel[] | null;\n  // Edits carry field modes and resolved DYNAMIC schemas; off when\n  // read-only or nested.\n  writesSettings?: boolean;\n  loadOptions?: (\n    propName: string,\n    current: Record<string, unknown>,\n    searchValue?: string,\n  ) => Promise<unknown>;\n  // Backs PH_SECRET_REF props.\n  secrets?: SecretFormService;\n  // Step whose config is being edited; scopes the expression picker.\n  scopeStepId?: string;\n  // Auth-dependent resolvers re-run when this changes.\n  connectionId?: string;\n  // Rendered inside another field; nested resolvers are not loadable yet.\n  nested?: boolean;\n  // This workflow's endpoint URL, for a piece's setup markdown.\n  webhookUrl?: string;\n}) {\n  // Track the latest committed config so sequential field edits accumulate;\n  // derive-during-render resets it when the document value changes.\n  const [current, setCurrent] = useState(props.value);\n  const [prevValue, setPrevValue] = useState(props.value);\n  if (props.value !== prevValue) {\n    setPrevValue(props.value);\n    setCurrent(props.value);\n  }\n\n  const [settings, setSettings] = useState(props.settings ?? null);\n  const [prevSettings, setPrevSettings] = useState(props.settings);\n  if (props.settings !== prevSettings) {\n    setPrevSettings(props.settings);\n    setSettings(props.settings ?? null);\n  }\n  const tracksSettings = props.writesSettings === true;\n  const readDynamic = useDynamicCache();\n\n  // Each DYNAMIC prop's children as resolved for `config`, when cached.\n  const withResolvedSchemas = (\n    list: PropertySettingModel[] | null,\n    config: Record<string, unknown>,\n  ): PropertySettingModel[] | null => {\n    let next = list;\n    for (const prop of props.props) {\n      if (prop.type !== \"DYNAMIC\") continue;\n      if (settingFor(next, prop.name)?.mode === \"EXPRESSION\") continue;\n      const fields = readDynamic(\n        resolverInputFor(\n          props.block ?? NO_BLOCK,\n          prop,\n          config,\n          props.connectionId,\n        ),\n      );\n      if (!fields) continue;\n      const schema = stripOptions(fields);\n      const stored = settingFor(next, prop.name)?.schema ?? null;\n      if (JSON.stringify(stored) === JSON.stringify(schema)) continue;\n      next = withSetting(next, prop.name, { schema });\n    }\n    return next;\n  };\n\n  const commitField = (\n    name: string,\n    value: unknown,\n    mode?: PropertyModeValue,\n  ) => {\n    const next = { ...current };\n    if (value === undefined) delete next[name];\n    else next[name] = value;\n    let nextSettings = settings;\n    // A touched field always has a mode; layout-driven edits are MANUAL.\n    const nextMode = mode ?? settingFor(settings, name)?.mode ?? \"MANUAL\";\n    if (tracksSettings && settingFor(settings, name)?.mode !== nextMode) {\n      nextSettings = withSetting(nextSettings, name, { mode: nextMode });\n    }\n    // A pick made against the old value of a refresher no longer holds.\n    if (value !== current[name]) {\n      for (const dependent of props.props) {\n        if (!dependent.refreshers?.includes(name)) continue;\n        if (isDropdownType(dependent.type)) delete next[dependent.name];\n        // Its children were resolved for the old value.\n        if (\n          tracksSettings &&\n          dependent.type === \"DYNAMIC\" &&\n          settingFor(nextSettings, dependent.name)?.schema != null\n        ) {\n          nextSettings = withSetting(nextSettings, dependent.name, {\n            schema: null,\n          });\n        }\n      }\n    }\n    if (tracksSettings) nextSettings = withResolvedSchemas(nextSettings, next);\n    setCurrent(next);\n    if (nextSettings !== settings) {\n      setSettings(nextSettings);\n      props.onChange(next, nextSettings ?? []);\n    } else props.onChange(next);\n  };\n\n  // A mode switch alone is still an edit of the config it belongs to.\n  const setMode = (name: string, mode: PropertyModeValue) => {\n    if (!tracksSettings || settingFor(settings, name)?.mode === mode) return;\n    const next = withResolvedSchemas(\n      withSetting(settings, name, { mode }),\n      current,\n    );\n    setSettings(next);\n    props.onChange(current, next ?? []);\n  };\n\n  // A hidden field's value is not cleared: switching scheme to None and back\n  // must not silently discard the secret ref the author already minted.\n  const visible = props.props.filter((prop) => isPropVisible(prop, current));\n  const essential = visible.filter((prop) => !prop.advanced);\n  const advanced = visible.filter((prop) => prop.advanced);\n  const [showAdvanced, setShowAdvanced] = useState(false);\n  // Closed even when advanced fields hold values, so the count goes in the\n  // label — else config already in effect reads as config that is not there.\n  const advancedSet = advanced.filter(\n    (prop) => current[prop.name] !== undefined,\n  ).length;\n\n  const field = (prop: BlockFormProp) => (\n    <PropField\n      key={prop.name}\n      prop={prop}\n      value={current[prop.name]}\n      onCommit={(value, mode) => commitField(prop.name, value, mode)}\n      mode={settingFor(settings, prop.name)?.mode}\n      onMode={(mode) => setMode(prop.name, mode)}\n      loadOptions={\n        props.loadOptions\n          ? (propName, searchValue) =>\n              props.loadOptions!(propName, current, searchValue)\n          : undefined\n      }\n      config={current}\n      secrets={props.secrets}\n      scopeStepId={props.scopeStepId}\n      resolverInput={resolverInputFor(\n        props.block ?? NO_BLOCK,\n        prop,\n        current,\n        props.connectionId,\n      )}\n      waitingOn={\n        props.props.find(\n          (sibling) =>\n            prop.refreshers?.includes(sibling.name) &&\n            isEmptyValue(current[sibling.name]),\n        )?.displayName\n      }\n      nested={props.nested}\n      webhookUrl={props.webhookUrl}\n    />\n  );\n\n  return (\n    <div className={`flex flex-col ${props.nested ? \"gap-4\" : \"gap-5\"}`}>\n      <PropLayout\n        props={essential}\n        groups={props.groups}\n        values={current}\n        renderField={field}\n        onCommit={commitField}\n      />\n      {advanced.length > 0 ? (\n        <div className=\"flex flex-col gap-5 border-t border-solid border-foreground/10 pt-4\">\n          <button\n            type=\"button\"\n            className=\"-mx-1 flex items-center gap-1.5 self-start rounded px-1 text-[13px] font-medium text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40\"\n            aria-expanded={showAdvanced}\n            onClick={() => setShowAdvanced((open) => !open)}\n          >\n            <Icon\n              name=\"chevron\"\n              className={`h-3.5 w-3.5 transition-transform ${showAdvanced ? \"rotate-90\" : \"\"}`}\n            />\n            More options\n            <span className=\"font-normal\">\n              {advancedSet > 0\n                ? `${advanced.length} fields, ${advancedSet} set`\n                : `${advanced.length} fields`}\n            </span>\n          </button>\n          <div hidden={!showAdvanced} className=\"flex flex-col gap-5\">\n            <PropLayout\n              props={advanced}\n              groups={props.groups}\n              values={current}\n              renderField={field}\n              onCommit={commitField}\n            />\n          </div>\n        </div>\n      ) : null}\n    </div>\n  );\n}\n","// The schedule trigger's config as the builder edits it: daily, weekly, a\n// fixed interval, or a raw cron for anything the presets can't say.\n\nimport {\n  DEFAULT_TIMEZONE,\n  parseScheduleConfig,\n  type ScheduleUnit,\n} from \"@powerhousedao/pieces-framework/workflow\";\n\nexport type IntervalUnit = ScheduleUnit;\n\nexport type ScheduleDraft =\n  | { kind: \"daily\"; time: string; weekdaysOnly: boolean }\n  | { kind: \"weekly\"; time: string; days: number[] }\n  | { kind: \"interval\"; every: number; unit: IntervalUnit }\n  | { kind: \"custom\"; cron: string };\n\nexport type ScheduleKind = ScheduleDraft[\"kind\"];\n\nexport const DEFAULT_TIME = \"09:00\";\nexport { DEFAULT_TIMEZONE };\n\nfunction isInt(field: string): boolean {\n  return /^\\d+$/.test(field);\n}\n\nfunction toTime(hour: string, minute: string): string {\n  return `${hour.padStart(2, \"0\")}:${minute.padStart(2, \"0\")}`;\n}\n\nfunction fromTime(time: string): { hour: number; minute: number } {\n  const [hour = \"9\", minute = \"0\"] = time.split(\":\");\n  return { hour: Number(hour), minute: Number(minute) };\n}\n\nfunction cronDraft(cron: string): ScheduleDraft {\n  if (!cron) return { kind: \"daily\", time: DEFAULT_TIME, weekdaysOnly: false };\n  const fields = cron.split(/\\s+/);\n  if (fields.length !== 5) return { kind: \"custom\", cron };\n  const [minute, hour, dayOfMonth, month, dayOfWeek] = fields;\n  if (!isInt(minute) || !isInt(hour) || dayOfMonth !== \"*\" || month !== \"*\") {\n    return { kind: \"custom\", cron };\n  }\n  const time = toTime(hour, minute);\n  if (dayOfWeek === \"*\") return { kind: \"daily\", time, weekdaysOnly: false };\n  if (dayOfWeek === \"1-5\") return { kind: \"daily\", time, weekdaysOnly: true };\n  const days = dayOfWeek.split(\",\");\n  if (days.every((day) => isInt(day) && Number(day) <= 7)) {\n    const unique = [...new Set(days.map((day) => Number(day) % 7))];\n    return { kind: \"weekly\", time, days: unique.sort((a, b) => a - b) };\n  }\n  return { kind: \"custom\", cron };\n}\n\n// Reads a stored config back into the builder's terms, by its `mode`.\nexport function draftFromConfig(config: unknown): ScheduleDraft {\n  try {\n    const schedule = parseScheduleConfig(config);\n    return schedule.mode === \"interval\"\n      ? { kind: \"interval\", every: schedule.every, unit: schedule.unit }\n      : cronDraft(schedule.cron);\n  } catch {\n    // Not valid yet: the builder still opens on the mode it names.\n  }\n  const record = (config ?? {}) as Record<string, unknown>;\n  if (record.mode === \"interval\") {\n    return { kind: \"interval\", every: 15, unit: \"minutes\" };\n  }\n  return cronDraft(typeof record.cron === \"string\" ? record.cron.trim() : \"\");\n}\n\n/** The cron a draft stands for; undefined for an interval. */\nexport function cronFromDraft(draft: ScheduleDraft): string | undefined {\n  switch (draft.kind) {\n    case \"daily\": {\n      const { hour, minute } = fromTime(draft.time);\n      return `${minute} ${hour} * * ${draft.weekdaysOnly ? \"1-5\" : \"*\"}`;\n    }\n    case \"weekly\": {\n      const { hour, minute } = fromTime(draft.time);\n      const days = draft.days.length > 0 ? draft.days.join(\",\") : \"1\";\n      return `${minute} ${hour} * * ${days}`;\n    }\n    case \"custom\":\n      return draft.cron;\n    case \"interval\":\n      return undefined;\n  }\n}\n\n/** The config the runtime reads; UTC is the default, so it isn't stored. */\nexport function configFromDraft(\n  draft: ScheduleDraft,\n  timezone: string,\n): Record<string, unknown> {\n  const zone =\n    timezone && timezone !== DEFAULT_TIMEZONE ? { timezone } : undefined;\n  if (draft.kind === \"interval\") {\n    return { mode: \"interval\", every: draft.every, unit: draft.unit, ...zone };\n  }\n  return { mode: \"cron\", cron: cronFromDraft(draft), ...zone };\n}\n\n/** Switches kind, keeping whatever carries over (the time, mostly). */\nexport function switchKind(\n  draft: ScheduleDraft,\n  kind: ScheduleKind,\n): ScheduleDraft {\n  if (draft.kind === kind) return draft;\n  const time = \"time\" in draft ? draft.time : DEFAULT_TIME;\n  switch (kind) {\n    case \"daily\":\n      return { kind, time, weekdaysOnly: false };\n    case \"weekly\":\n      return { kind, time, days: [1] };\n    case \"interval\":\n      return { kind, every: 15, unit: \"minutes\" };\n    case \"custom\":\n      return { kind, cron: cronFromDraft(draft) ?? \"0 9 * * *\" };\n  }\n}\n\nexport function timezoneOf(config: unknown): string {\n  const zone = (config as { timezone?: unknown } | null)?.timezone;\n  return typeof zone === \"string\" && zone ? zone : DEFAULT_TIMEZONE;\n}\n","// The schedule trigger's form: pick how often in plain terms; raw cron is\n// there for anything the presets can't express.\nimport { useId, useState } from \"react\";\nimport {\n  FieldError,\n  FieldLabel,\n  Hint,\n  Segmented,\n  Select,\n  Switch,\n  textInputClass,\n} from \"../../shared/controls.js\";\nimport {\n  configFromDraft,\n  draftFromConfig,\n  switchKind,\n  timezoneOf,\n  type IntervalUnit,\n  type ScheduleDraft,\n  type ScheduleKind,\n} from \"./schedule-draft.js\";\nimport { describeCron, describeSchedule } from \"./trigger-text.js\";\nimport { scheduleConfigIssue } from \"@powerhousedao/pieces-framework/workflow\";\n\nconst KINDS: { value: ScheduleKind; label: string }[] = [\n  { value: \"daily\", label: \"Daily\" },\n  { value: \"weekly\", label: \"Weekly\" },\n  { value: \"interval\", label: \"Interval\" },\n  { value: \"custom\", label: \"Custom\" },\n];\n\n// Monday first; values are cron weekdays.\nconst DAYS = [\n  { value: 1, label: \"Mon\", name: \"Monday\" },\n  { value: 2, label: \"Tue\", name: \"Tuesday\" },\n  { value: 3, label: \"Wed\", name: \"Wednesday\" },\n  { value: 4, label: \"Thu\", name: \"Thursday\" },\n  { value: 5, label: \"Fri\", name: \"Friday\" },\n  { value: 6, label: \"Sat\", name: \"Saturday\" },\n  { value: 0, label: \"Sun\", name: \"Sunday\" },\n];\n\nconst UNITS: { value: IntervalUnit; label: string }[] = [\n  { value: \"minutes\", label: \"Minutes\" },\n  { value: \"hours\", label: \"Hours\" },\n  { value: \"days\", label: \"Days\" },\n];\n\nfunction timezones(): string[] {\n  try {\n    return [\n      \"UTC\",\n      ...Intl.supportedValuesOf(\"timeZone\").filter((z) => z !== \"UTC\"),\n    ];\n  } catch {\n    return [\"UTC\"];\n  }\n}\n\nconst TIMEZONES = timezones();\n\nfunction TimeField(props: { time: string; onChange: (time: string) => void }) {\n  const id = useId();\n  return (\n    <div>\n      <FieldLabel htmlFor={id} label=\"At\" />\n      <input\n        id={id}\n        type=\"time\"\n        className={`${textInputClass} w-32 tabular-nums`}\n        value={props.time}\n        onChange={(event) => {\n          if (event.target.value) props.onChange(event.target.value);\n        }}\n      />\n    </div>\n  );\n}\n\n// Holds what's typed, so the field can be cleared and retyped; only a whole\n// number of at least 1 is saved, and leaving it empty puts the saved value back.\nfunction EveryInput(props: {\n  id: string;\n  every: number;\n  onCommit: (every: number) => void;\n}) {\n  const [text, setText] = useState(String(props.every));\n  const [saved, setSaved] = useState(props.every);\n  if (saved !== props.every) {\n    setSaved(props.every);\n    setText(String(props.every));\n  }\n  return (\n    <input\n      id={props.id}\n      type=\"number\"\n      min={1}\n      step={1}\n      className={`${textInputClass} w-24 tabular-nums`}\n      value={text}\n      onChange={(event) => {\n        setText(event.target.value);\n        const every = Number(event.target.value);\n        if (\n          event.target.value !== \"\" &&\n          Number.isInteger(every) &&\n          every >= 1\n        ) {\n          setSaved(every);\n          props.onCommit(every);\n        }\n      }}\n      onBlur={() => setText(String(props.every))}\n    />\n  );\n}\n\nexport function ScheduleBuilder(props: {\n  config: unknown;\n  onChange: (config: Record<string, unknown>) => void;\n}) {\n  const everyId = useId();\n  const cronId = useId();\n  const parsed = draftFromConfig(props.config);\n  const timezone = timezoneOf(props.config);\n  // Custom stays open while its cron is typed, even when it spells a preset.\n  const [customPinned, setCustomPinned] = useState(parsed.kind === \"custom\");\n  const draft: ScheduleDraft =\n    customPinned && parsed.kind !== \"custom\"\n      ? switchKind(parsed, \"custom\")\n      : parsed;\n  const commit = (next: ScheduleDraft, zone = timezone) =>\n    props.onChange(configFromDraft(next, zone));\n  // The runtime's own parser: what it would refuse, said before it is armed.\n  const issue = scheduleConfigIssue(props.config);\n\n  return (\n    <div className=\"flex flex-col gap-5\">\n      <div>\n        <FieldLabel label=\"Repeats\" />\n        <Segmented\n          value={draft.kind}\n          options={KINDS}\n          onChange={(value) => {\n            const kind = value as ScheduleKind;\n            setCustomPinned(kind === \"custom\");\n            commit(switchKind(draft, kind));\n          }}\n        />\n      </div>\n\n      {draft.kind === \"daily\" ? (\n        <>\n          <TimeField\n            time={draft.time}\n            onChange={(time) => commit({ ...draft, time })}\n          />\n          <Switch\n            checked={draft.weekdaysOnly}\n            onChange={(weekdaysOnly) => commit({ ...draft, weekdaysOnly })}\n            label=\"Weekdays only\"\n            description=\"Skip Saturdays and Sundays.\"\n          />\n        </>\n      ) : null}\n\n      {draft.kind === \"weekly\" ? (\n        <>\n          <div>\n            <FieldLabel label=\"On\" />\n            <div role=\"group\" aria-label=\"Days\" className=\"flex gap-1\">\n              {DAYS.map((day) => {\n                const on = draft.days.includes(day.value);\n                return (\n                  <button\n                    key={day.value}\n                    type=\"button\"\n                    aria-pressed={on}\n                    aria-label={day.name}\n                    className={`h-8 flex-1 rounded-md text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${\n                      on\n                        ? \"bg-primary text-primary-foreground\"\n                        : \"border border-solid border-foreground/15 text-muted-foreground hover:bg-accent hover:text-foreground\"\n                    }`}\n                    onClick={() => {\n                      const days = on\n                        ? draft.days.filter((value) => value !== day.value)\n                        : [...draft.days, day.value];\n                      // At least one day, or the schedule would never fire.\n                      if (days.length > 0) commit({ ...draft, days });\n                    }}\n                  >\n                    {day.label}\n                  </button>\n                );\n              })}\n            </div>\n          </div>\n          <TimeField\n            time={draft.time}\n            onChange={(time) => commit({ ...draft, time })}\n          />\n        </>\n      ) : null}\n\n      {draft.kind === \"interval\" ? (\n        <div>\n          <FieldLabel htmlFor={everyId} label=\"Every\" />\n          <div className=\"flex items-center gap-2\">\n            <EveryInput\n              id={everyId}\n              every={draft.every}\n              onCommit={(every) => commit({ ...draft, every })}\n            />\n            <div className=\"w-32\">\n              <Select\n                value={draft.unit}\n                options={UNITS}\n                onChange={(unit) =>\n                  commit({ ...draft, unit: unit as IntervalUnit })\n                }\n              />\n            </div>\n          </div>\n          <Hint text=\"Counted from when the workflow is enabled.\" />\n        </div>\n      ) : null}\n\n      {draft.kind === \"custom\" ? (\n        <div>\n          <FieldLabel htmlFor={cronId} label=\"Cron expression\" />\n          <input\n            id={cronId}\n            className={`${textInputClass} font-mono`}\n            value={draft.cron}\n            spellCheck={false}\n            placeholder=\"0 9 * * 1-5\"\n            onChange={(event) =>\n              commit({ kind: \"custom\", cron: event.target.value })\n            }\n          />\n          {issue ? (\n            <FieldError>{issue.replace(/^Schedule: /, \"\")}</FieldError>\n          ) : (\n            <Hint\n              text={\n                describeCron(draft.cron) ??\n                \"Minute, hour, day of month, month, weekday.\"\n              }\n            />\n          )}\n        </div>\n      ) : null}\n\n      <div>\n        <FieldLabel label=\"Timezone\" />\n        <Select\n          value={timezone}\n          options={TIMEZONES.map((zone) => ({\n            value: zone,\n            label: zone.replace(/_/g, \" \"),\n          }))}\n          onChange={(zone) => commit(draft, zone)}\n        />\n      </div>\n\n      <p className=\"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground\">\n        Runs{\" \"}\n        <span className=\"font-medium text-foreground\">\n          {describeSchedule(props.config).replace(/^\\w/, (c) =>\n            c.toLowerCase(),\n          )}\n        </span>\n      </p>\n    </div>\n  );\n}\n","// Reads the runtime's step-test refusals, so the panel can point at the block\n// the author has to fix first.\n\n// Where a refusal sends the author: a step by key, the trigger or the variables.\nexport type TestErrorTarget =\n  | { kind: \"step\"; key: string }\n  | { kind: \"trigger\" }\n  | { kind: \"variables\" };\n\nexport interface TestErrorExplained {\n  message: string;\n  targets: TestErrorTarget[];\n}\n\nconst UPSTREAM = /^Test \"(.+?)\" first(?::|$)/;\nconst TRIGGER = /^Test the trigger first(?::|$)/;\nconst REDACTED = /^\"(.+?)\" reads a value redacted from the last test of (.+)$/;\nconst VARIABLE = /^(?:Secret variable|Variable) \"(.+?)\" /;\nconst QUOTED = /\"([^\"]+)\"/g;\n\n// A redaction names its sources as `\"j\"`, `\"j\", \"k\"` or `the trigger`.\nfunction sourcesOf(list: string): TestErrorTarget[] {\n  const targets: TestErrorTarget[] = [...list.matchAll(QUOTED)].map(\n    (match) => ({ kind: \"step\", key: match[1] }),\n  );\n  if (/\\bthe trigger\\b/.test(list)) targets.unshift({ kind: \"trigger\" });\n  return targets;\n}\n\nexport function explainTestError(error: string): TestErrorExplained {\n  const upstream = UPSTREAM.exec(error);\n  if (upstream) {\n    return { message: error, targets: [{ kind: \"step\", key: upstream[1] }] };\n  }\n  if (TRIGGER.test(error)) {\n    return { message: error, targets: [{ kind: \"trigger\" }] };\n  }\n  const redacted = REDACTED.exec(error);\n  if (redacted) {\n    return { message: error, targets: sourcesOf(redacted[2]) };\n  }\n  if (VARIABLE.test(error)) {\n    return { message: error, targets: [{ kind: \"variables\" }] };\n  }\n  return { message: error, targets: [] };\n}\n","// Where a block's last test stands, the way Activepieces reads it: a test\n// taken before the block's last edit no longer says anything about it.\nimport { isCoreBlock, type BlockIdentity } from \"./blocks.js\";\nimport type { BlockStateModel } from \"./model.js\";\n\nexport type TestState = \"never\" | \"stale\" | \"failed\" | \"passed\";\n\nexport function testState(\n  block: BlockStateModel,\n  // The test run's status, once known.\n  runStatus?: string | null,\n): TestState {\n  const test = block.lastTest;\n  if (!test) return \"never\";\n  if (\n    block.updatedAt &&\n    Date.parse(block.updatedAt) > Date.parse(test.testedAt)\n  )\n    return \"stale\";\n  return runStatus === \"FAILED\" ? \"failed\" : \"passed\";\n}\n\n// Piece triggers are the ones the runtime can test through a hook.\nexport function isTestableTrigger(block: BlockIdentity): boolean {\n  return block.kind === \"trigger\" && !isCoreBlock(block);\n}\n\nexport function relativeTime(iso: string, now = Date.now()): string {\n  const diff = now - new Date(iso).getTime();\n  if (diff < 60_000) return \"just now\";\n  if (diff < 3_600_000) return `${Math.floor(diff / 60_000)}m ago`;\n  if (diff < 86_400_000) return `${Math.floor(diff / 3_600_000)}h ago`;\n  return new Date(iso).toLocaleDateString();\n}\n","// Test step, the Activepieces way: run one step against the last tests of\n// the blocks it reads, and show what it produced right in the panel.\nimport { useState } from \"react\";\nimport { Button } from \"../../shared/controls.js\";\nimport { DataViewer } from \"../../shared/data-viewer.js\";\nimport { Icon } from \"../../shared/icons.js\";\nimport { useRunById, useTestStepRunner } from \"./design-time.js\";\nimport type { StepTestOutcome } from \"./forms.js\";\nimport { VARIABLES_VIEW, type StepModel, type WorkflowModel } from \"./model.js\";\nimport { explainTestError, type TestErrorTarget } from \"./step-test.js\";\nimport { relativeTime, testState } from \"./test-state.js\";\n\ntype Attempt =\n  | { kind: \"running\" }\n  | { kind: \"done\"; outcome: StepTestOutcome }\n  | { kind: \"error\"; message: string };\n\n// \"Tested 2h ago\", \"Test failed 5m ago\" or \"Not tested yet\", with staleness.\nexport function TestedLine(props: {\n  block: StepModel | NonNullable<WorkflowModel[\"trigger\"]>;\n  noun: string;\n}) {\n  const { block } = props;\n  const run = useRunById(block.lastTest?.runId);\n  if (!block.lastTest) {\n    return (\n      <span className=\"text-xs text-muted-foreground\">Not tested yet</span>\n    );\n  }\n  const state = testState(block, run?.status);\n  return (\n    <span\n      className=\"flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground\"\n      title={new Date(block.lastTest.testedAt).toLocaleString()}\n    >\n      <span\n        className={\n          state === \"failed\" ? \"font-medium text-wf-fail\" : \"text-foreground\"\n        }\n      >\n        {state === \"failed\" ? \"Test failed\" : \"Tested\"}{\" \"}\n        {relativeTime(block.lastTest.testedAt)}\n      </span>\n      {state === \"stale\" ? (\n        <span className=\"text-wf-warn\">\n          The {props.noun} changed since, so test it again.\n        </span>\n      ) : null}\n    </span>\n  );\n}\n\nfunction targetLabel(target: TestErrorTarget, model: WorkflowModel): string {\n  if (target.kind === \"trigger\") return \"Open the trigger\";\n  if (target.kind === \"variables\") return \"Open variables\";\n  const step = model.steps.find((entry) => entry.key === target.key);\n  return `Open ${step?.name || target.key}`;\n}\n\nfunction targetId(\n  target: TestErrorTarget,\n  model: WorkflowModel,\n): string | undefined {\n  if (target.kind === \"trigger\") return model.trigger?.id;\n  if (target.kind === \"variables\") return VARIABLES_VIEW;\n  return model.steps.find((entry) => entry.key === target.key)?.id;\n}\n\nfunction TestError(props: {\n  error: string;\n  // False when the runtime refused before running anything.\n  ran: boolean;\n  model: WorkflowModel;\n  onSelect?: (id: string) => void;\n}) {\n  const explained = explainTestError(props.error);\n  return (\n    <div\n      role=\"alert\"\n      className=\"flex flex-col gap-1.5 rounded-md bg-wf-fail/10 p-2.5 text-xs text-wf-fail\"\n    >\n      <span className=\"whitespace-pre-wrap break-words\">\n        {props.ran ? null : <span className=\"font-medium\">Nothing ran. </span>}\n        {explained.message}\n      </span>\n      {props.onSelect && explained.targets.length > 0 ? (\n        <span className=\"flex flex-wrap gap-x-3\">\n          {explained.targets.map((target) => {\n            const id = targetId(target, props.model);\n            if (!id) return null;\n            return (\n              <button\n                key={id}\n                type=\"button\"\n                className=\"font-medium underline underline-offset-2 hover:no-underline\"\n                onClick={() => props.onSelect!(id)}\n              >\n                {targetLabel(target, props.model)}\n              </button>\n            );\n          })}\n        </span>\n      ) : null}\n    </div>\n  );\n}\n\n// What the last test left behind, read back from its run.\nfunction LastTestResult(props: {\n  step: StepModel;\n  model: WorkflowModel;\n  onSelect?: (id: string) => void;\n}) {\n  const run = useRunById(props.step.lastTest?.runId);\n  if (!props.step.lastTest) return null;\n  if (run === undefined) {\n    return <div className=\"h-12 animate-pulse rounded-md bg-foreground/5\" />;\n  }\n  if (run === null) {\n    return (\n      <p className=\"text-xs text-muted-foreground\">\n        That test run is no longer kept.\n      </p>\n    );\n  }\n  const record = run.steps.at(0);\n  const error = record?.error ?? run.error;\n  if (error) {\n    return (\n      <TestError\n        error={error}\n        ran\n        model={props.model}\n        onSelect={props.onSelect}\n      />\n    );\n  }\n  return (\n    <DataViewer\n      label=\"Output\"\n      value={record?.output}\n      root={`steps.${props.step.key}.output`}\n    />\n  );\n}\n\nexport function StepTestSection(props: {\n  step: StepModel;\n  model: WorkflowModel;\n  onSelect?: (id: string) => void;\n}) {\n  const { step } = props;\n  const runTest = useTestStepRunner();\n  const [attempt, setAttempt] = useState<Attempt | null>(null);\n  const running = attempt?.kind === \"running\";\n  return (\n    <div className=\"flex flex-col gap-3\">\n      <div className=\"flex items-center justify-between gap-3\">\n        <TestedLine block={step} noun=\"step\" />\n        {runTest ? (\n          <Button\n            size=\"sm\"\n            disabled={running}\n            aria-busy={running}\n            onClick={() => {\n              setAttempt({ kind: \"running\" });\n              runTest(step.id).then(\n                (outcome) => setAttempt({ kind: \"done\", outcome }),\n                (error: unknown) =>\n                  setAttempt({\n                    kind: \"error\",\n                    message:\n                      error instanceof Error ? error.message : String(error),\n                  }),\n              );\n            }}\n          >\n            <Icon name=\"play\" className=\"h-3.5 w-3.5\" />\n            {running ? \"Testing…\" : \"Test step\"}\n          </Button>\n        ) : null}\n      </div>\n      {attempt === null ? (\n        <LastTestResult\n          step={step}\n          model={props.model}\n          onSelect={props.onSelect}\n        />\n      ) : attempt.kind === \"running\" ? (\n        <div\n          role=\"status\"\n          aria-label=\"Testing the step\"\n          className=\"h-12 animate-pulse rounded-md bg-foreground/5\"\n        />\n      ) : attempt.kind === \"error\" ? (\n        <TestError\n          error={attempt.message}\n          ran={false}\n          model={props.model}\n          onSelect={props.onSelect}\n        />\n      ) : attempt.outcome.status === \"FAILED\" ? (\n        <TestError\n          error={attempt.outcome.error ?? \"The test failed\"}\n          ran={attempt.outcome.runId !== null}\n          model={props.model}\n          onSelect={props.onSelect}\n        />\n      ) : (\n        <DataViewer\n          label=\"Output\"\n          value={attempt.outcome.output}\n          root={`steps.${step.key}.output`}\n        />\n      )}\n    </div>\n  );\n}\n","// Validity is computed where it is shown, never stored: one blockMissing\n// reading per block, for the canvas badge, the panel header and Publish.\nimport { useEffect, useMemo } from \"react\";\nimport { flowOrder } from \"./ap-layout.js\";\nimport {\n  useBlockForm,\n  useBlockForms,\n  useDynamicLookup,\n  useDynamicPrefetch,\n} from \"./design-time.js\";\nimport { stepBlock, triggerBlock, type BlockRef } from \"./blocks.js\";\nimport type { BlockForm, BlockFormProp } from \"./forms.js\";\nimport { blockRefKey } from \"./query-keys.js\";\nimport type { PropertySettingModel, WorkflowModel } from \"./model.js\";\nimport type { ResolverKeyInput } from \"./query-keys.js\";\nimport {\n  blockMissing,\n  isPropVisible,\n  resolverInputFor,\n  settingFor,\n  storedSchema,\n  undeclaredPortIssues,\n  workflowReadiness,\n  type WorkflowReadiness,\n} from \"./validation.js\";\n\nexport interface CheckedBlock {\n  id: string;\n  block: BlockRef;\n  config: unknown;\n  connectionId: string | null;\n  propertySettings?: PropertySettingModel[] | null;\n  skip?: boolean;\n  // Ports of the edges leaving this block, checked against the declared ones.\n  outgoingPorts?: readonly string[];\n}\n\nexport interface BlockCheck {\n  form: BlockForm | null | \"loading\";\n  formError?: string;\n  // Null while not checked.\n  missing: string[] | null;\n  // Wiring the block cannot honour, e.g. an edge on an undeclared port.\n  issues: string[];\n  lookup: (input: ResolverKeyInput) => BlockFormProp[] | undefined;\n}\n\nfunction configOf(block: CheckedBlock): Record<string, unknown> {\n  return block.config && typeof block.config === \"object\"\n    ? (block.config as Record<string, unknown>)\n    : {};\n}\n\n// Resolver inputs for the DYNAMIC props nothing has stored a schema for.\nfunction unknownDynamic(\n  block: CheckedBlock,\n  form: BlockForm | null | \"loading\" | undefined,\n): ResolverKeyInput[] {\n  if (!form || form === \"loading\" || block.skip) return [];\n  const config = configOf(block);\n  return form.props\n    .filter(\n      (prop) =>\n        prop.type === \"DYNAMIC\" &&\n        isPropVisible(prop, config) &&\n        settingFor(block.propertySettings, prop.name)?.mode !== \"EXPRESSION\" &&\n        !storedSchema(block.propertySettings, prop.name),\n    )\n    .map((prop) =>\n      resolverInputFor(block.block, prop, config, block.connectionId),\n    );\n}\n\n// Missing fields and wiring issues, as one list a Publish gate can read.\nfunction withIssues(\n  missing: string[] | null,\n  issues: readonly string[],\n): string[] | null {\n  if (issues.length === 0) return missing;\n  return [...(missing ?? []), ...issues];\n}\n\nexport function useBlockCheck(block: CheckedBlock): BlockCheck {\n  const { form, error } = useBlockForm(block.block);\n  const lookup = useDynamicLookup();\n  return {\n    form,\n    formError: error,\n    issues: block.skip ? [] : undeclaredPortIssues(form, block.outgoingPorts),\n    missing: blockMissing({\n      form,\n      block: block.block,\n      config: block.config,\n      connectionId: block.connectionId,\n      propertySettings: block.propertySettings,\n      skip: block.skip,\n      resolveDynamic: lookup,\n    }),\n    lookup,\n  };\n}\n\nexport interface WorkflowCheck {\n  readiness: WorkflowReadiness;\n  missing: ReadonlyMap<string, string[] | null>;\n}\n\n// Every block of the draft, opened or not: forms and unknown DYNAMIC\n// children are fetched into the cache the panels read.\nexport function useWorkflowCheck(model: WorkflowModel): WorkflowCheck {\n  const blocks = useMemo(() => {\n    const byId = new Map<string, CheckedBlock>(\n      model.steps.map((step) => [step.id, { ...step, block: stepBlock(step) }]),\n    );\n    const ordered: CheckedBlock[] = model.trigger\n      ? [{ ...model.trigger, block: triggerBlock(model.trigger) }]\n      : [];\n    for (const id of flowOrder(model)) {\n      const step = byId.get(id);\n      if (step) ordered.push(step);\n    }\n    return ordered.map((block) => ({\n      ...block,\n      outgoingPorts: model.edges\n        .filter((edge) => edge.from === block.id)\n        .map((edge) => edge.port),\n    }));\n  }, [model]);\n  const forms = useBlockForms(blocks.map((block) => block.block));\n  const formOf = (block: CheckedBlock) => forms.get(blockRefKey(block.block));\n  const lookup = useDynamicLookup();\n  const prefetch = useDynamicPrefetch();\n\n  const wanted = blocks.flatMap((block) =>\n    unknownDynamic(block, formOf(block)).map((input) => ({\n      input,\n      config: configOf(block),\n    })),\n  );\n  const wantedKey = JSON.stringify(wanted);\n  useEffect(() => {\n    const entries = JSON.parse(wantedKey) as {\n      input: ResolverKeyInput;\n      config: Record<string, unknown>;\n    }[];\n    for (const entry of entries) prefetch(entry.input, entry.config);\n  }, [wantedKey, prefetch]);\n\n  const results = blocks.map((block) => ({\n    id: block.id,\n    missing: withIssues(\n      blockMissing({\n        form: formOf(block),\n        block: block.block,\n        config: block.config,\n        connectionId: block.connectionId,\n        propertySettings: block.propertySettings,\n        skip: block.skip,\n        resolveDynamic: lookup,\n      }),\n      block.skip\n        ? []\n        : undeclaredPortIssues(formOf(block), block.outgoingPorts),\n    ),\n  }));\n  return {\n    readiness: workflowReadiness(results, Boolean(model.trigger)),\n    missing: new Map(results.map((result) => [result.id, result.missing])),\n  };\n}\n","import {\n  isCoreBlock,\n  stepBlock,\n  triggerBlock,\n  triggerFields,\n  type BlockRef,\n} from \"./blocks.js\";\nimport { useId, useRef, useState, type ReactNode } from \"react\";\nimport {\n  Button,\n  FieldError,\n  FieldLabel,\n  Hint,\n  IconButton,\n  Select,\n  Switch,\n  Tabs,\n  textAreaClass,\n  textInputClass,\n} from \"../../shared/controls.js\";\nimport { Icon } from \"../../shared/icons.js\";\nimport { acyclicTargets, flowOrder, reachableFrom } from \"./ap-layout.js\";\nimport { useBlockMeta } from \"./block-meta.js\";\nimport { BlockLogo } from \"./BlockSelector.js\";\nimport { ConnectionField } from \"./ConnectionField.js\";\nimport {\n  ExpressionPickerButton,\n  ExpressionTokenLine,\n  useExpressionField,\n} from \"./ExpressionPicker.js\";\nimport {\n  useBlockForm,\n  useDesignTime,\n  useLatestRun,\n  useRunById,\n  useTestTrigger,\n  useWebhookEndpoint,\n  type EndpointState,\n} from \"./design-time.js\";\nimport type { BlockForm, ErrorHandlingDefaults } from \"./forms.js\";\nimport { flowPorts } from \"@powerhousedao/pieces-framework/workflow\";\nimport {\n  type PropertySettingModel,\n  type RetryPolicyModel,\n  type StepModel,\n  type TriggerModel,\n  type WorkflowEditorCallbacks,\n  type WorkflowModel,\n} from \"./model.js\";\nimport { AvailableSoon, PropertyForm } from \"./PropertyForm.js\";\nimport { DataViewer } from \"../../shared/data-viewer.js\";\nimport { ScheduleBuilder } from \"./ScheduleBuilder.js\";\nimport { StepTestSection } from \"./StepTest.js\";\nimport { relativeTime, testState } from \"./test-state.js\";\nimport { describeTrigger } from \"./trigger-text.js\";\nimport { useBlockCheck } from \"./use-validity.js\";\nimport {\n  resolutionText,\n  runsDifferentVersion,\n  updateVersion,\n  useResolution,\n} from \"./version-badge.js\";\n\nfunction stringify(value: unknown): string {\n  try {\n    return JSON.stringify(value ?? {}, null, 2);\n  } catch {\n    return \"{}\";\n  }\n}\n\nfunction Section(props: {\n  title: string;\n  description?: string;\n  children: ReactNode;\n}) {\n  return (\n    <section className=\"flex flex-col gap-4 border-t border-solid border-foreground/10 pt-5 first:border-t-0 first:pt-0\">\n      <div>\n        <h4 className=\"text-[13px] font-semibold text-foreground\">\n          {props.title}\n        </h4>\n        {props.description ? (\n          <p className=\"mt-0.5 text-xs text-muted-foreground\">\n            {props.description}\n          </p>\n        ) : null}\n      </div>\n      {props.children}\n    </section>\n  );\n}\n\nfunction RawConfigEditor(props: {\n  value: unknown;\n  onApply: (config: unknown) => void;\n}) {\n  const [text, setText] = useState(() => stringify(props.value));\n  const [error, setError] = useState<string | null>(null);\n  const [prevValue, setPrevValue] = useState(props.value);\n  if (props.value !== prevValue) {\n    setPrevValue(props.value);\n    setText(stringify(props.value));\n  }\n  const dirty = text !== stringify(props.value);\n  return (\n    <div>\n      <textarea\n        aria-label=\"Configuration as JSON\"\n        className={`${textAreaClass} min-h-40 font-mono text-xs`}\n        value={text}\n        onChange={(event) => setText(event.target.value)}\n        spellCheck={false}\n      />\n      <FieldError>{error}</FieldError>\n      <div className=\"mt-2 flex gap-2\">\n        <Button\n          size=\"sm\"\n          disabled={!dirty}\n          onClick={() => {\n            try {\n              props.onApply(JSON.parse(text));\n              setError(null);\n            } catch (parseError) {\n              setError(\n                parseError instanceof Error\n                  ? parseError.message\n                  : \"Not valid JSON\",\n              );\n            }\n          }}\n        >\n          Apply JSON\n        </Button>\n        {dirty ? (\n          <Button\n            size=\"sm\"\n            variant=\"ghost\"\n            onClick={() => {\n              setText(stringify(props.value));\n              setError(null);\n            }}\n          >\n            Discard\n          </Button>\n        ) : null}\n      </div>\n    </div>\n  );\n}\n\nfunction FormSkeleton() {\n  return (\n    <div className=\"flex animate-pulse flex-col gap-5\" aria-label=\"Loading\">\n      {[0, 1, 2].map((row) => (\n        <div key={row} className=\"flex flex-col gap-2\">\n          <div className=\"h-3 w-24 rounded bg-foreground/10\" />\n          <div className=\"h-9 rounded-md bg-foreground/5\" />\n        </div>\n      ))}\n    </div>\n  );\n}\n\nfunction ConfigSection(props: {\n  block: BlockRef;\n  form: BlockForm | null | \"loading\";\n  formError?: string;\n  config: unknown;\n  onChange: (config: unknown, settings?: PropertySettingModel[]) => void;\n  settings?: PropertySettingModel[] | null;\n  // False while read-only: edits carry no field modes or schemas.\n  writesSettings?: boolean;\n  connectionId?: string;\n  // Step whose config this is; scopes the expression picker to its ancestors.\n  scopeStepId?: string;\n  // Substituted into a piece's setup markdown; triggers only.\n  webhookUrl?: string;\n}) {\n  const { form } = props;\n  const designTime = useDesignTime();\n  const configRecord = (props.config ?? {}) as Record<string, unknown>;\n\n  if (form === \"loading\") return <FormSkeleton />;\n  return (\n    <div className=\"flex flex-col gap-5\">\n      {form?.description || form?.classification === \"DESTRUCTIVE\" ? (\n        <div className=\"flex flex-col gap-2\">\n          {form.classification === \"DESTRUCTIVE\" ? (\n            <span className=\"inline-flex items-center gap-1 self-start rounded-full bg-wf-fail/10 px-2 py-0.5 text-[11px] font-medium text-wf-fail\">\n              <Icon name=\"alert\" className=\"h-3 w-3\" />\n              Changes or deletes data\n            </span>\n          ) : null}\n          {form.description ? (\n            <p className=\"text-[13px] leading-relaxed text-muted-foreground\">\n              {form.description}\n            </p>\n          ) : null}\n        </div>\n      ) : null}\n      {props.formError ? (\n        <p className=\"rounded-md bg-wf-fail/10 px-3 py-2 text-xs text-wf-fail\">\n          {props.formError}\n        </p>\n      ) : null}\n      {form && form.props.length > 0 ? (\n        <PropertyForm\n          props={form.props}\n          groups={form.propertyGroups}\n          value={configRecord}\n          onChange={props.onChange}\n          settings={props.settings}\n          writesSettings={props.writesSettings}\n          scopeStepId={props.scopeStepId}\n          connectionId={props.connectionId}\n          secrets={designTime?.secrets}\n          block={props.block}\n          webhookUrl={props.webhookUrl}\n          loadOptions={\n            designTime\n              ? (propName, current, searchValue) =>\n                  designTime.loadOptions(\n                    props.block,\n                    propName,\n                    current,\n                    props.connectionId,\n                    searchValue,\n                  )\n              : undefined\n          }\n        />\n      ) : null}\n      {form && form.props.length === 0 ? (\n        <p className=\"text-[13px] text-muted-foreground\">\n          Nothing to set up. This block runs as it is.\n        </p>\n      ) : null}\n      {!form && !props.formError ? (\n        <p className=\"text-[13px] text-muted-foreground\">\n          This block has no form. Edit its configuration as JSON under Settings.\n        </p>\n      ) : null}\n    </div>\n  );\n}\n\n// Name, piece and readiness at the top of the panel; the name edits in place.\nfunction PanelHeader(props: {\n  block: BlockRef;\n  name: string;\n  onRename?: (name: string) => void;\n  actionLabel: string;\n  // Null while unknown: nothing is claimed either way.\n  missing: string[] | null;\n  // Wiring errors, shown ahead of missing fields.\n  issues?: readonly string[];\n  loading: boolean;\n  skipped?: boolean;\n  onClose: () => void;\n  position?: {\n    index: number;\n    total: number;\n    onPrevious?: () => void;\n    onNext?: () => void;\n  };\n  children?: ReactNode;\n}) {\n  return (\n    <header className=\"border-b border-solid border-foreground/10 px-4 pt-4\">\n      <div className=\"flex items-start gap-3\">\n        <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-solid border-foreground/10 bg-card\">\n          <BlockLogo block={props.block} size={24} />\n        </div>\n        <div className=\"min-w-0 flex-1\">\n          {props.onRename ? (\n            <input\n              key={props.name}\n              aria-label=\"Step name\"\n              className=\"-mx-1 w-full rounded-md border border-solid border-transparent bg-transparent px-1 text-[15px] font-semibold text-foreground hover:border-foreground/15 focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/25\"\n              defaultValue={props.name}\n              spellCheck={false}\n              onKeyDown={(event) => {\n                if (event.key === \"Enter\") event.currentTarget.blur();\n                if (event.key === \"Escape\") {\n                  event.currentTarget.value = props.name;\n                  event.currentTarget.blur();\n                }\n              }}\n              onBlur={(event) => {\n                const name = event.target.value.trim();\n                if (name && name !== props.name) props.onRename!(name);\n                else event.target.value = props.name;\n              }}\n            />\n          ) : (\n            <h3 className=\"truncate text-[15px] font-semibold text-foreground\">\n              {props.name}\n            </h3>\n          )}\n          <p className=\"truncate text-xs text-muted-foreground\">\n            {props.actionLabel}\n          </p>\n        </div>\n        {props.position ? (\n          <div className=\"flex shrink-0 items-center\">\n            <IconButton\n              icon=\"back\"\n              label=\"Previous step\"\n              disabled={!props.position.onPrevious}\n              onClick={props.position.onPrevious}\n            />\n            <span className=\"px-0.5 text-xs tabular-nums text-muted-foreground\">\n              {props.position.index + 1} of {props.position.total}\n            </span>\n            <IconButton\n              icon=\"chevron\"\n              label=\"Next step\"\n              disabled={!props.position.onNext}\n              onClick={props.position.onNext}\n            />\n          </div>\n        ) : null}\n        <IconButton icon=\"close\" label=\"Close panel\" onClick={props.onClose} />\n      </div>\n      <div className=\"mt-3 flex items-center gap-1.5 text-xs\">\n        {props.skipped ? (\n          <span className=\"flex items-center gap-1.5 text-muted-foreground\">\n            Skipped: runs pass over this step\n          </span>\n        ) : props.loading ? (\n          <span className=\"text-muted-foreground\">Checking setup…</span>\n        ) : props.issues && props.issues.length > 0 ? (\n          <span\n            className=\"flex min-w-0 items-center gap-1.5 text-wf-fail\"\n            title={props.issues.join(\"\\n\")}\n          >\n            <Icon name=\"alert\" className=\"h-3.5 w-3.5\" />\n            <span className=\"truncate\">{props.issues[0]}</span>\n          </span>\n        ) : props.missing === null ? null : props.missing.length > 0 ? (\n          <span\n            className=\"flex min-w-0 items-center gap-1.5 text-wf-warn\"\n            title={props.missing.join(\", \")}\n          >\n            <Icon name=\"alert\" className=\"h-3.5 w-3.5\" />\n            <span className=\"truncate\">\n              {props.missing.length === 1\n                ? `${props.missing[0]} needs a value`\n                : `${props.missing.length} fields need a value: ${props.missing.join(\", \")}`}\n            </span>\n          </span>\n        ) : (\n          <span className=\"flex items-center gap-1.5 text-wf-ok\">\n            <Icon name=\"check\" className=\"h-3.5 w-3.5\" />\n            Ready to run\n          </span>\n        )}\n      </div>\n      <div className=\"mt-3\">{props.children}</div>\n    </header>\n  );\n}\n\nconst DEFAULT_RETRY: RetryPolicyModel = {\n  maxAttempts: 3,\n  backoff: \"EXPONENTIAL\",\n  initialDelaySeconds: 5,\n  maxDelaySeconds: 300,\n  retryOn: [],\n};\n\nfunction intOrUndefined(raw: string): number | undefined {\n  const parsed = Number.parseInt(raw.trim(), 10);\n  return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;\n}\n\n// A number input with its unit drawn inside the field.\nfunction NumberField(props: {\n  label: string;\n  value: number | null;\n  unit?: string;\n  min?: number;\n  placeholder?: string;\n  hint?: string;\n  onCommit: (value: number | null) => void;\n}) {\n  return (\n    <label className=\"block\">\n      <FieldLabel label={props.label} />\n      <span className=\"relative block\">\n        <input\n          key={`${props.label}-${props.value ?? \"\"}`}\n          type=\"number\"\n          min={props.min}\n          className={`${textInputClass} ${props.unit ? \"pr-16\" : \"\"}`}\n          defaultValue={props.value ?? \"\"}\n          placeholder={props.placeholder}\n          onBlur={(event) => {\n            const raw = event.target.value.trim();\n            if (raw === \"\") return props.onCommit(null);\n            const next = intOrUndefined(raw);\n            if (next !== undefined && next >= (props.min ?? 0))\n              props.onCommit(next);\n          }}\n        />\n        {props.unit ? (\n          <span className=\"pointer-events-none absolute inset-y-0 right-3 flex items-center text-xs text-muted-foreground\">\n            {props.unit}\n          </span>\n        ) : null}\n      </span>\n      {props.hint ? <Hint>{props.hint}</Hint> : null}\n    </label>\n  );\n}\n\nfunction RetryEditor(props: {\n  value: RetryPolicyModel | null;\n  onChange: (value: RetryPolicyModel | null) => void;\n}) {\n  const retry = props.value;\n  const patch = (partial: Partial<RetryPolicyModel>) =>\n    props.onChange({ ...(retry ?? DEFAULT_RETRY), ...partial });\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <Switch\n        checked={retry !== null}\n        onChange={(checked) => props.onChange(checked ? DEFAULT_RETRY : null)}\n        label=\"Retry when it fails\"\n        description=\"Try the step again before failing the run.\"\n      />\n      {retry ? (\n        <div className=\"grid grid-cols-2 gap-3\">\n          <NumberField\n            label=\"Attempts\"\n            value={retry.maxAttempts}\n            min={1}\n            onCommit={(next) => {\n              if (next !== null) patch({ maxAttempts: next });\n            }}\n          />\n          <label className=\"block\">\n            <FieldLabel label=\"Backoff\" />\n            <Select\n              value={retry.backoff}\n              options={[\n                { value: \"FIXED\", label: \"Fixed\" },\n                { value: \"EXPONENTIAL\", label: \"Exponential\" },\n              ]}\n              onChange={(backoff) =>\n                patch({ backoff: backoff as RetryPolicyModel[\"backoff\"] })\n              }\n            />\n          </label>\n          <NumberField\n            label=\"First delay\"\n            unit=\"seconds\"\n            value={retry.initialDelaySeconds}\n            onCommit={(next) => {\n              if (next !== null) patch({ initialDelaySeconds: next });\n            }}\n          />\n          <NumberField\n            label=\"Longest delay\"\n            unit=\"seconds\"\n            value={retry.maxDelaySeconds}\n            onCommit={(next) => {\n              if (next !== null) patch({ maxDelaySeconds: next });\n            }}\n          />\n          <label className=\"col-span-2 block\">\n            <FieldLabel label=\"Retry on\" optional />\n            <input\n              key={`on-${retry.retryOn.join(\",\")}`}\n              className={`${textInputClass} font-mono text-xs`}\n              defaultValue={retry.retryOn.join(\", \")}\n              placeholder=\"TRANSIENT, RATE_LIMIT\"\n              onBlur={(event) =>\n                patch({\n                  retryOn: event.target.value\n                    .split(\",\")\n                    .map((entry) => entry.trim())\n                    .filter((entry) => entry !== \"\"),\n                })\n              }\n            />\n            <Hint>\n              Error classes, comma-separated. Empty retries every error.\n            </Hint>\n          </label>\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\nconst PORT_LABEL: Record<string, string> = {\n  next: \"Then\",\n  true: \"When true\",\n  false: \"When false\",\n};\n\nfunction EdgeRow(props: {\n  target?: StepModel;\n  fallback: string;\n  onRemove: () => void;\n  tone?: \"warn\" | \"fail\";\n}) {\n  return (\n    <div\n      className={`flex min-w-0 items-center gap-2 rounded-md border border-solid px-2 py-1.5 text-[13px] ${\n        props.tone === \"warn\"\n          ? \"border-wf-warn/30 bg-wf-warn/5\"\n          : props.tone === \"fail\"\n            ? \"border-wf-fail/30 bg-wf-fail/5\"\n            : \"border-foreground/10 bg-muted/40\"\n      }`}\n    >\n      <Icon name=\"arrowRight\" className=\"h-3.5 w-3.5 text-muted-foreground\" />\n      {props.target ? (\n        <BlockLogo block={stepBlock(props.target)} size={16} />\n      ) : null}\n      <span className=\"min-w-0 flex-1 truncate text-foreground\">\n        {props.target ? props.target.name || props.target.key : props.fallback}\n      </span>\n      <IconButton icon=\"close\" label=\"Disconnect\" onClick={props.onRemove} />\n    </div>\n  );\n}\n\n// A port may hold several edges: the engine runs every successor on a taken\n// port. acyclicTargets offers any step that is not an ancestor.\nfunction FlowPortEditor(props: {\n  step: StepModel;\n  model: WorkflowModel;\n  callbacks: WorkflowEditorCallbacks;\n}) {\n  const { step, model, callbacks } = props;\n  const { form } = useBlockForm(stepBlock(step));\n  const declared = form && form !== \"loading\" ? form.ports : undefined;\n  const ports = declared ? flowPorts(declared) : [];\n  // Wired, but on a port the block never takes: listed so it can be removed.\n  const dead = declared\n    ? model.edges.filter(\n        (edge) => edge.from === step.id && !declared.includes(edge.port),\n      )\n    : [];\n  const attached = model.trigger\n    ? reachableFrom(model.trigger.id, model.edges)\n    : new Set<string>();\n  const candidates = acyclicTargets(model, step.id);\n  return (\n    <div className=\"flex flex-col gap-4\">\n      {dead.length > 0 ? (\n        <div>\n          <FieldLabel label=\"Never taken\" />\n          <div className=\"flex flex-col gap-1.5\">\n            {dead.map((edge) => (\n              <EdgeRow\n                key={edge.id}\n                tone=\"fail\"\n                target={model.steps.find((entry) => entry.id === edge.to)}\n                fallback={`${edge.to} (port \"${edge.port}\")`}\n                onRemove={() => callbacks.removeEdge(edge.id)}\n              />\n            ))}\n          </div>\n        </div>\n      ) : null}\n      {ports.map((port) => {\n        const edges = model.edges.filter(\n          (candidate) => candidate.from === step.id && candidate.port === port,\n        );\n        const targets = candidates.filter(\n          (candidate) => !edges.some((edge) => edge.to === candidate.id),\n        );\n        return (\n          <div key={port}>\n            <FieldLabel label={PORT_LABEL[port] ?? port} />\n            <div className=\"flex flex-col gap-1.5\">\n              {edges.map((edge) => (\n                <EdgeRow\n                  key={edge.id}\n                  target={model.steps.find((entry) => entry.id === edge.to)}\n                  fallback={edge.to}\n                  onRemove={() => callbacks.removeEdge(edge.id)}\n                />\n              ))}\n              <Select\n                value=\"\"\n                disabled={targets.length === 0}\n                placeholder={\n                  targets.length === 0\n                    ? \"No other step to connect to\"\n                    : edges.length > 0\n                      ? \"Also run…\"\n                      : \"Run next…\"\n                }\n                options={targets.map((target) => ({\n                  value: target.id,\n                  label: target.name || target.key,\n                  description: attached.has(target.id)\n                    ? undefined\n                    : \"Not connected to the trigger yet\",\n                  icon: <BlockLogo block={stepBlock(target)} size={16} />,\n                }))}\n                onChange={(to) => {\n                  if (to) callbacks.addEdge({ from: step.id, to, port });\n                }}\n              />\n            </div>\n          </div>\n        );\n      })}\n    </div>\n  );\n}\n\nfunction ErrorPortEditor(props: {\n  step: StepModel;\n  model: WorkflowModel;\n  callbacks: WorkflowEditorCallbacks;\n}) {\n  const { step, model, callbacks } = props;\n  const errorEdges = model.edges.filter(\n    (edge) => edge.from === step.id && edge.port === \"error\",\n  );\n  const targets = acyclicTargets(model, step.id).filter(\n    (candidate) => !errorEdges.some((edge) => edge.to === candidate.id),\n  );\n  return (\n    <div>\n      <FieldLabel label=\"On error, run\" optional />\n      <div className=\"flex flex-col gap-1.5\">\n        {errorEdges.map((edge) => (\n          <EdgeRow\n            key={edge.id}\n            tone=\"warn\"\n            target={model.steps.find((entry) => entry.id === edge.to)}\n            fallback={edge.to}\n            onRemove={() => callbacks.removeEdge(edge.id)}\n          />\n        ))}\n        <Select\n          value=\"\"\n          disabled={targets.length === 0}\n          placeholder={\n            targets.length === 0\n              ? \"No other step to run\"\n              : errorEdges.length > 0\n                ? \"Also run…\"\n                : \"Fail the run\"\n          }\n          options={targets.map((target) => ({\n            value: target.id,\n            label: target.name || target.key,\n            icon: <BlockLogo block={stepBlock(target)} size={16} />,\n          }))}\n          onChange={(to) => {\n            if (to) callbacks.addEdge({ from: step.id, to, port: \"error\" });\n          }}\n        />\n      </div>\n      <Hint>Route failures to another step instead of failing the run.</Hint>\n    </div>\n  );\n}\n\n// Splices text at the field's cursor and returns the updated value.\nfunction insertAtCursor(element: HTMLInputElement, text: string): string {\n  const start = element.selectionStart ?? element.value.length;\n  const end = element.selectionEnd ?? start;\n  element.value =\n    element.value.slice(0, start) + text + element.value.slice(end);\n  return element.value;\n}\n\nfunction IdempotencyField(props: {\n  step: StepModel;\n  callbacks: WorkflowEditorCallbacks;\n}) {\n  const { step, callbacks } = props;\n  const ref = useRef<HTMLInputElement>(null);\n  const [draft, setDraft] = useState(step.idempotencyKeyExpression ?? \"\");\n  const commit = (raw: string) => {\n    const next = raw.trim() || null;\n    if (next !== step.idempotencyKeyExpression) {\n      callbacks.updateStep({ id: step.id, idempotencyKeyExpression: next });\n    }\n  };\n  const field = useExpressionField({\n    stepId: step.id,\n    label: \"Idempotency key\",\n    insert: (expression) => {\n      if (!ref.current) return;\n      const next = insertAtCursor(ref.current, expression);\n      setDraft(next);\n      commit(next);\n    },\n  });\n  return (\n    <div className=\"group/field\">\n      <FieldLabel\n        label=\"Idempotency key\"\n        optional\n        action={\n          <ExpressionPickerButton\n            active={field.active}\n            onFocusField={field.focus}\n          />\n        }\n      />\n      <input\n        ref={ref}\n        key={`${step.id}-idem`}\n        aria-label=\"Idempotency key\"\n        className={`${textInputClass} font-mono text-xs`}\n        defaultValue={step.idempotencyKeyExpression ?? \"\"}\n        placeholder=\"{{trigger.payload.id}}\"\n        spellCheck={false}\n        onFocus={field.focus}\n        onChange={(event) => setDraft(event.target.value)}\n        onBlur={(event) => commit(event.target.value)}\n      />\n      <ExpressionTokenLine value={draft} />\n      <Hint>Two runs with the same key count as one side effect.</Hint>\n    </div>\n  );\n}\n\n// Steps are referenced by key in expressions, so it must stay a clean slug.\nfunction KeyField(props: {\n  step: StepModel;\n  callbacks: WorkflowEditorCallbacks;\n}) {\n  const { step, callbacks } = props;\n  const [copied, setCopied] = useState(false);\n  const id = useId();\n  return (\n    <div>\n      <FieldLabel\n        htmlFor={id}\n        label=\"Key\"\n        action={\n          <IconButton\n            icon={copied ? \"check\" : \"copy\"}\n            label=\"Copy reference\"\n            onClick={(event) => {\n              event.preventDefault();\n              navigator.clipboard\n                .writeText(`{{steps.${step.key}.output}}`)\n                .then(\n                  () => setCopied(true),\n                  () => undefined,\n                );\n            }}\n          />\n        }\n      />\n      <input\n        id={id}\n        key={`${step.id}-key-${step.key}`}\n        className={`${textInputClass} font-mono text-xs`}\n        defaultValue={step.key}\n        spellCheck={false}\n        onBlur={(event) => {\n          const key = event.target.value.trim();\n          if (key && key !== step.key)\n            callbacks.updateStep({ id: step.id, key });\n          else event.target.value = step.key;\n        }}\n      />\n      <Hint>\n        Later steps read this step&apos;s output as{\" \"}\n        <code className=\"rounded bg-muted px-1 font-mono text-[11px] text-foreground\">\n          {`{{steps.${step.key}.output.…}}`}\n        </code>\n        . Renaming it doesn&apos;t update expressions that use it.\n      </Hint>\n    </div>\n  );\n}\n\n// Which piece version runs, and the newer one a source offers.\nfunction PieceVersionSection(props: {\n  id: string;\n  block: BlockRef;\n  kind: \"step\" | \"trigger\";\n  // Edits only the pinned version.\n  onUpdate?: (pieceVersion: string) => void;\n}) {\n  const resolution = useResolution(props.id, props.block);\n  const update = updateVersion(resolution);\n  const [updated, setUpdated] = useState<string | null>(null);\n  const differs = resolution ? runsDifferentVersion(resolution) : false;\n  if (!resolution && !updated) return null;\n  // The core piece always runs as installed; it is worth a line only when\n  // the pin has drifted from it.\n  if (isCoreBlock(props.block) && !differs && !update && !updated) return null;\n  return (\n    <Section title=\"Piece version\">\n      <div className=\"flex items-center justify-between gap-3\">\n        <p className=\"text-xs text-muted-foreground\">\n          {resolution\n            ? differs\n              ? resolutionText(resolution)\n              : `Runs v${resolution.pieceVersion}${resolution.source ? ` from ${resolution.source}` : \"\"}`\n            : null}\n        </p>\n        {update && props.onUpdate ? (\n          <Button\n            size=\"sm\"\n            variant=\"secondary\"\n            onClick={() => {\n              props.onUpdate!(update);\n              setUpdated(update);\n            }}\n          >\n            Update to v{update}\n          </Button>\n        ) : null}\n      </div>\n      {updated ? (\n        <p role=\"status\" className=\"text-xs text-muted-foreground\">\n          Updated to v{updated}. The {props.kind}'s fields are re-checked\n          against this version.\n        </p>\n      ) : null}\n    </Section>\n  );\n}\n\nfunction StepSettings(props: {\n  step: StepModel;\n  model: WorkflowModel;\n  callbacks: WorkflowEditorCallbacks;\n  // The piece's defaults for how the step handles failure.\n  errorHandling?: ErrorHandlingDefaults;\n  onRemoved: () => void;\n}) {\n  const { step, callbacks } = props;\n  return (\n    <div className=\"flex flex-col gap-6\">\n      <PieceVersionSection\n        id={step.id}\n        block={stepBlock(step)}\n        kind=\"step\"\n        onUpdate={(pieceVersion) =>\n          callbacks.updateStep({ id: step.id, pieceVersion })\n        }\n      />\n      <Section title=\"Run\">\n        <Switch\n          checked={step.skip === true}\n          onChange={(skip) => callbacks.updateStep({ id: step.id, skip })}\n          label=\"Skip this step\"\n          description=\"Runs pass over it and carry on with the next step.\"\n        />\n      </Section>\n      <Section title=\"Identity\">\n        <KeyField step={step} callbacks={callbacks} />\n      </Section>\n      <Section\n        title=\"What runs next\"\n        description=\"Any step that isn't upstream of this one.\"\n      >\n        <FlowPortEditor step={step} model={props.model} callbacks={callbacks} />\n      </Section>\n      <Section title=\"When it fails\">\n        <ErrorPortEditor\n          step={step}\n          model={props.model}\n          callbacks={callbacks}\n        />\n        <NumberField\n          label=\"Timeout\"\n          unit=\"seconds\"\n          min={1}\n          value={step.timeoutSeconds}\n          placeholder=\"Runtime default\"\n          onCommit={(next) => {\n            if (next === 0) return;\n            if (next !== step.timeoutSeconds)\n              callbacks.updateStep({ id: step.id, timeoutSeconds: next });\n          }}\n        />\n        {props.errorHandling?.retryOnFailure?.defaultValue ? (\n          <Hint>This piece suggests retrying the step when it fails.</Hint>\n        ) : null}\n        {/* Stored on the step, but the runtime does not enforce them yet. */}\n        <fieldset\n          hidden={props.errorHandling?.retryOnFailure?.hide === true}\n          disabled\n          className=\"m-0 flex min-w-0 flex-col gap-4 rounded-lg border border-dashed border-foreground/15 p-3\"\n        >\n          <legend className=\"px-1\">\n            <AvailableSoon>retries and idempotency</AvailableSoon>\n          </legend>\n          <div className=\"flex flex-col gap-4 opacity-70\">\n            <RetryEditor\n              value={step.retry}\n              onChange={(retry) => callbacks.updateStep({ id: step.id, retry })}\n            />\n            <IdempotencyField step={step} callbacks={callbacks} />\n          </div>\n        </fieldset>\n      </Section>\n      <Section\n        title=\"Configuration as JSON\"\n        description=\"Everything the setup form stores, for pasting or bulk edits.\"\n      >\n        <RawConfigEditor\n          value={step.config}\n          onApply={(config) => callbacks.updateStep({ id: step.id, config })}\n        />\n      </Section>\n      <Section title=\"Remove\">\n        <div className=\"flex items-center justify-between gap-3\">\n          <p className=\"text-xs text-muted-foreground\">\n            Removes the step and its connections.\n          </p>\n          <Button\n            variant=\"danger\"\n            onClick={() => {\n              callbacks.removeStep(step.id);\n              props.onRemoved();\n            }}\n          >\n            <Icon name=\"trash\" className=\"h-3.5 w-3.5\" />\n            Remove step\n          </Button>\n        </div>\n      </Section>\n    </div>\n  );\n}\n\nconst RUN_TEXT: Record<string, string> = {\n  SUCCEEDED: \"text-wf-ok\",\n  FAILED: \"text-wf-fail\",\n  SKIPPED: \"text-muted-foreground\",\n};\n\n// What this step (or the trigger) saw in the workflow's most recent run.\nfunction LastRunSection(props: {\n  stepKey?: string;\n  latest?: ReturnType<typeof useLatestRun>;\n  bare?: boolean;\n}) {\n  const own = useLatestRun(props.latest === undefined);\n  const latest = props.latest ?? own;\n  if (!latest) return null;\n  const run = latest.kind === \"ready\" ? latest.run : null;\n  const step = props.stepKey\n    ? run?.steps.find((entry) => entry.stepKey === props.stepKey)\n    : undefined;\n  const status = props.stepKey ? step?.status : run ? \"FIRED\" : undefined;\n  const body = (\n    <>\n      {latest.kind === \"loading\" ? (\n        <div className=\"h-16 animate-pulse rounded-md bg-foreground/5\" />\n      ) : !run ? (\n        <p className=\"text-xs text-muted-foreground\">\n          No runs yet. Once the workflow runs, what this{\" \"}\n          {props.stepKey ? \"step receives and produces\" : \"trigger hands on\"}{\" \"}\n          shows up here.\n        </p>\n      ) : props.stepKey && !step ? (\n        <p className=\"text-xs text-muted-foreground\">\n          The last run, {relativeTime(run.startedAt)}, didn&apos;t reach this\n          step.\n        </p>\n      ) : (\n        <div className=\"flex flex-col gap-3\">\n          <p className=\"text-xs text-muted-foreground\">\n            <span\n              className={`font-medium ${RUN_TEXT[status ?? \"\"] ?? \"text-wf-ok\"}`}\n            >\n              {status === \"FIRED\"\n                ? \"Fired\"\n                : (status ?? \"\").charAt(0) +\n                  (status ?? \"\").slice(1).toLowerCase()}\n            </span>{\" \"}\n            {relativeTime(run.startedAt)}\n          </p>\n          {step?.error ? (\n            <pre className=\"overflow-auto whitespace-pre-wrap rounded-md bg-wf-fail/10 p-2.5 text-xs text-wf-fail\">\n              {step.error}\n            </pre>\n          ) : null}\n          {step ? (\n            <>\n              <DataViewer label=\"Received\" value={step.input} />\n              <DataViewer\n                label=\"Produced\"\n                value={step.output}\n                root={`steps.${props.stepKey}.output`}\n              />\n            </>\n          ) : (\n            <DataViewer\n              label=\"Payload\"\n              value={run.triggerPayload}\n              root=\"trigger.payload\"\n            />\n          )}\n        </div>\n      )}\n    </>\n  );\n  return props.bare ? (\n    <div className=\"flex flex-col gap-4\">{body}</div>\n  ) : (\n    <Section title=\"Last run\">{body}</Section>\n  );\n}\n\ntype StepTab = \"setup\" | \"run\" | \"settings\";\n\nfunction settingsCustomised(step: StepModel, model: WorkflowModel): number {\n  return [\n    step.retry !== null,\n    step.timeoutSeconds !== null,\n    step.idempotencyKeyExpression !== null,\n    model.edges.some((edge) => edge.from === step.id && edge.port === \"error\"),\n  ].filter(Boolean).length;\n}\n\nexport function StepPanel(props: {\n  step: StepModel;\n  model: WorkflowModel;\n  callbacks: WorkflowEditorCallbacks;\n  onClose: () => void;\n  onSelect?: (id: string) => void;\n  readOnly?: boolean;\n}) {\n  const { step, callbacks } = props;\n  const [tab, setTab] = useState<StepTab>(\"setup\");\n  const block = stepBlock(step);\n  const meta = useBlockMeta(block);\n  const { form, formError, missing, issues } = useBlockCheck({\n    ...step,\n    block,\n    outgoingPorts: props.model.edges\n      .filter((edge) => edge.from === step.id)\n      .map((edge) => edge.port),\n  });\n  const writes = !props.readOnly;\n  const customised = settingsCustomised(step, props.model);\n  const update = updateVersion(useResolution(step.id, block));\n  const latest = useLatestRun();\n  const lastStatus =\n    latest?.kind === \"ready\"\n      ? latest.run?.steps.find((entry) => entry.stepKey === step.key)?.status\n      : undefined;\n  const order = flowOrder(props.model);\n  const index = order.indexOf(step.id);\n  const select = props.onSelect;\n  const position =\n    select && index >= 0\n      ? {\n          index,\n          total: order.length,\n          onPrevious: index > 0 ? () => select(order[index - 1]) : undefined,\n          onNext:\n            index < order.length - 1\n              ? () => select(order[index + 1])\n              : undefined,\n        }\n      : undefined;\n  return (\n    <div className=\"flex min-h-full flex-col\">\n      <PanelHeader\n        block={block}\n        name={step.name || step.key}\n        onRename={(name) => callbacks.updateStep({ id: step.id, name })}\n        actionLabel={\n          form && form !== \"loading\" && form.title\n            ? form.title\n            : [meta.subtitle, meta.displayName].filter(Boolean).join(\": \")\n        }\n        missing={missing}\n        issues={issues}\n        loading={form === \"loading\"}\n        skipped={step.skip === true}\n        onClose={props.onClose}\n        position={position}\n      >\n        <Tabs\n          value={tab}\n          onChange={setTab}\n          tabs={[\n            { value: \"setup\", label: \"Setup\" },\n            ...(latest\n              ? [\n                  {\n                    value: \"run\" as const,\n                    label: \"Last run\",\n                    badge: lastStatus ? (\n                      <span\n                        aria-label={lastStatus.toLowerCase()}\n                        className={`h-1.5 w-1.5 rounded-full ${\n                          lastStatus === \"SUCCEEDED\"\n                            ? \"bg-wf-ok\"\n                            : lastStatus === \"FAILED\"\n                              ? \"bg-wf-fail\"\n                              : \"bg-foreground/30\"\n                        }`}\n                      />\n                    ) : undefined,\n                  },\n                ]\n              : []),\n            {\n              value: \"settings\",\n              label: \"Settings\",\n              badge:\n                customised > 0 ? (\n                  <span className=\"rounded-full bg-muted px-1.5 text-[11px] tabular-nums text-muted-foreground\">\n                    {customised}\n                  </span>\n                ) : update ? (\n                  <span\n                    aria-label=\"Update available\"\n                    title={`v${update} is available`}\n                    className=\"h-1.5 w-1.5 rounded-full bg-wf-run\"\n                  />\n                ) : undefined,\n            },\n          ]}\n        />\n      </PanelHeader>\n      <div className=\"flex-1 px-4 py-5\">\n        {tab === \"setup\" ? (\n          <div className=\"flex flex-col gap-5\">\n            <ConnectionField\n              key={`${step.id}-conn`}\n              block={block}\n              value={step.connectionId ?? \"\"}\n              onChange={(connectionId) =>\n                callbacks.updateStep({ id: step.id, connectionId })\n              }\n            />\n            <ConfigSection\n              key={`${step.id}-config`}\n              block={block}\n              form={form}\n              formError={formError}\n              config={step.config}\n              settings={step.propertySettings}\n              onChange={(config, settings) =>\n                callbacks.setStepConfig(\n                  step.id,\n                  config,\n                  writes ? { propertySettings: settings } : undefined,\n                )\n              }\n              writesSettings={writes}\n              connectionId={step.connectionId ?? undefined}\n              scopeStepId={step.id}\n            />\n            {writes ? (\n              <Section title=\"Test\">\n                <StepTestSection\n                  step={step}\n                  model={props.model}\n                  onSelect={props.onSelect}\n                />\n              </Section>\n            ) : null}\n          </div>\n        ) : tab === \"run\" ? (\n          <LastRunSection stepKey={step.key} latest={latest} bare />\n        ) : (\n          <StepSettings\n            step={step}\n            model={props.model}\n            callbacks={callbacks}\n            errorHandling={\n              form && form !== \"loading\" ? form.errorHandling : undefined\n            }\n            onRemoved={props.onClose}\n          />\n        )}\n      </div>\n    </div>\n  );\n}\n\n// The trigger's last test: when, and whether it still describes the trigger.\nfunction LastTestLine(props: { trigger: TriggerModel }) {\n  const { trigger } = props;\n  const [open, setOpen] = useState(false);\n  const run = useRunById(trigger.lastTest?.runId);\n  const state = testState(trigger, run?.status);\n  if (!trigger.lastTest) {\n    return <p className=\"text-xs text-muted-foreground\">Not tested yet</p>;\n  }\n  const output = run?.steps.at(0);\n  return (\n    <div className=\"flex flex-col gap-2\">\n      <p className=\"flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground\">\n        <button\n          type=\"button\"\n          aria-expanded={open}\n          className={`font-medium underline decoration-foreground/20 underline-offset-2 hover:decoration-current ${\n            state === \"failed\" ? \"text-wf-fail\" : \"text-foreground\"\n          }`}\n          title={new Date(trigger.lastTest.testedAt).toLocaleString()}\n          onClick={() => setOpen((value) => !value)}\n        >\n          {state === \"failed\" ? \"Test failed\" : \"Tested\"}{\" \"}\n          {relativeTime(trigger.lastTest.testedAt)}\n        </button>\n        {state === \"stale\" ? (\n          <span className=\"text-wf-warn\">\n            The trigger changed since, so test it again.\n          </span>\n        ) : null}\n      </p>\n      {open ? (\n        run === undefined ? (\n          <div className=\"h-12 animate-pulse rounded-md bg-foreground/5\" />\n        ) : run === null ? (\n          <p className=\"text-xs text-muted-foreground\">\n            That test run is no longer kept.\n          </p>\n        ) : output?.error || run.error ? (\n          <pre className=\"overflow-auto whitespace-pre-wrap rounded-md bg-wf-fail/10 p-2.5 text-xs text-wf-fail\">\n            {output?.error ?? run.error}\n          </pre>\n        ) : (\n          <DataViewer\n            label=\"Sample\"\n            value={output?.output}\n            root=\"trigger.payload\"\n          />\n        )\n      ) : null}\n    </div>\n  );\n}\n\nfunction TestTriggerSection(props: {\n  trigger: TriggerModel;\n  onTest: () => Promise<unknown>;\n}) {\n  const [state, setState] = useState<\n    | { kind: \"idle\" }\n    | { kind: \"loading\" }\n    | { kind: \"done\"; result: string; failed: boolean }\n  >({ kind: \"idle\" });\n  return (\n    <div className=\"flex flex-col gap-3\">\n      <LastTestLine trigger={props.trigger} />\n      <div className=\"flex items-center justify-between gap-3\">\n        <p className=\"text-xs text-muted-foreground\">\n          Fetch sample data to see what this trigger hands the next steps.\n        </p>\n        <Button\n          size=\"sm\"\n          disabled={state.kind === \"loading\"}\n          onClick={() => {\n            setState({ kind: \"loading\" });\n            props.onTest().then(\n              (result) =>\n                setState({\n                  kind: \"done\",\n                  result: JSON.stringify(result, null, 2),\n                  failed: false,\n                }),\n              (error: unknown) =>\n                setState({\n                  kind: \"done\",\n                  result:\n                    error instanceof Error ? error.message : String(error),\n                  failed: true,\n                }),\n            );\n          }}\n        >\n          <Icon name=\"play\" className=\"h-3.5 w-3.5\" />\n          {state.kind === \"loading\" ? \"Testing…\" : \"Test trigger\"}\n        </Button>\n      </div>\n      {state.kind === \"done\" ? (\n        <pre\n          className={`mt-3 max-h-56 overflow-auto rounded-md p-2 text-xs ${\n            state.failed\n              ? \"bg-wf-fail/10 text-wf-fail\"\n              : \"bg-muted text-foreground\"\n          }`}\n        >\n          {state.result}\n        </pre>\n      ) : null}\n    </div>\n  );\n}\n\n// The endpoint URL is the whole credential, so it is read from the runtime\n// rather than derived here, and only exists once the workflow is enabled.\nfunction WebhookUrlSection(props: { state: EndpointState }) {\n  const [copied, setCopied] = useState(false);\n  const state = props.state;\n\n  return (\n    <div>\n      <FieldLabel label=\"Endpoint URL\" />\n      {state.kind === \"loading\" ? (\n        <div className=\"h-9 animate-pulse rounded-md bg-foreground/5\" />\n      ) : null}\n      {state.kind === \"syncing\" ? (\n        <p className=\"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground\">\n          Syncing the workflow to the runtime…\n        </p>\n      ) : null}\n      {state.kind === \"empty\" ? (\n        <p className=\"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground\">\n          Enable the workflow to create its endpoint.\n        </p>\n      ) : null}\n      {state.kind === \"error\" ? (\n        <p className=\"text-xs text-wf-fail\">{state.message}</p>\n      ) : null}\n      {state.kind === \"ready\" ? (\n        <>\n          <div className=\"flex items-center gap-1.5\">\n            <input\n              readOnly\n              aria-label=\"Endpoint URL\"\n              className={`${textInputClass} bg-muted/50 font-mono text-xs`}\n              value={state.endpoint.url}\n              onFocus={(event) => event.currentTarget.select()}\n            />\n            <Button\n              onClick={() => {\n                navigator.clipboard.writeText(state.endpoint.url).then(\n                  () => setCopied(true),\n                  () => undefined,\n                );\n              }}\n            >\n              <Icon name={copied ? \"check\" : \"copy\"} className=\"h-3.5 w-3.5\" />\n              {copied ? \"Copied\" : \"Copy\"}\n            </Button>\n          </div>\n          {!state.endpoint.armed ? (\n            <p className=\"mt-2 rounded-md bg-wf-warn/10 px-3 py-2 text-xs text-wf-warn\">\n              Not accepting deliveries: the workflow is disabled or its webhook\n              config is invalid.\n            </p>\n          ) : null}\n          {!state.endpoint.absoluteUrl ? (\n            <p className=\"mt-2 rounded-md bg-wf-warn/10 px-3 py-2 text-xs text-wf-warn\">\n              This reactor doesn&apos;t know its public address, so the URL is\n              missing its host. Prefix it with the host the provider can reach.\n            </p>\n          ) : null}\n          <Hint>\n            Treat this URL as a secret: anyone who has it can call the endpoint.\n          </Hint>\n        </>\n      ) : null}\n    </div>\n  );\n}\n\nexport function TriggerPanel(props: {\n  trigger: TriggerModel;\n  callbacks: WorkflowEditorCallbacks;\n  onClose: () => void;\n  readOnly?: boolean;\n}) {\n  const { trigger, callbacks } = props;\n  const designTime = useDesignTime();\n  const testTrigger = useTestTrigger();\n  const block = triggerBlock(trigger);\n  const meta = useBlockMeta(block);\n  const isPieceTrigger = !isCoreBlock(block);\n  const { form, formError, missing } = useBlockCheck({ ...trigger, block });\n  const writes = !props.readOnly;\n  // The core webhook, and any piece trigger the provider pushes to: both are\n  // reached through this workflow's endpoint URL.\n  const isWebhookTrigger =\n    form !== \"loading\" && form?.triggerDelivery === \"webhook\";\n  // Only a webhook trigger asks. The query mints on first ask, so opening\n  // this panel on a schedule or document trigger must not create an endpoint.\n  const endpoint = useWebhookEndpoint(isWebhookTrigger);\n  const setTrigger = (patch: {\n    config?: unknown;\n    connectionId?: string | null;\n    settings?: PropertySettingModel[];\n  }) => {\n    const config = patch.config === undefined ? trigger.config : patch.config;\n    const connectionId =\n      patch.connectionId === undefined\n        ? trigger.connectionId\n        : patch.connectionId;\n    callbacks.setTrigger({\n      ...triggerFields(block),\n      config,\n      connectionId,\n      ...(writes ? { propertySettings: patch.settings } : {}),\n    });\n  };\n  return (\n    <div className=\"flex min-h-full flex-col\">\n      <PanelHeader\n        block={block}\n        name={\n          form && form !== \"loading\" && form.title\n            ? form.title\n            : meta.displayName\n        }\n        actionLabel={describeTrigger(trigger)}\n        missing={missing}\n        loading={form === \"loading\"}\n        onClose={props.onClose}\n      />\n      <div className=\"flex flex-1 flex-col gap-6 px-4 py-5\">\n        {isWebhookTrigger && designTime?.webhookEndpoint ? (\n          <WebhookUrlSection state={endpoint} />\n        ) : null}\n        {isPieceTrigger ? (\n          <ConnectionField\n            key={`${trigger.id}-conn`}\n            block={block}\n            value={trigger.connectionId ?? \"\"}\n            onChange={(connectionId) => setTrigger({ connectionId })}\n          />\n        ) : null}\n        {form !== \"loading\" && form?.display === \"schedule\" ? (\n          <ScheduleBuilder\n            key={trigger.id}\n            config={trigger.config}\n            onChange={(config) => setTrigger({ config })}\n          />\n        ) : (\n          <ConfigSection\n            key={trigger.id}\n            block={block}\n            form={form}\n            formError={formError}\n            config={trigger.config}\n            settings={trigger.propertySettings}\n            onChange={(config, settings) => setTrigger({ config, settings })}\n            writesSettings={writes}\n            connectionId={trigger.connectionId ?? undefined}\n            webhookUrl={\n              endpoint.kind === \"ready\" ? endpoint.endpoint.url : undefined\n            }\n          />\n        )}\n        <LastRunSection />\n        <PieceVersionSection\n          id={trigger.id}\n          block={block}\n          kind=\"trigger\"\n          onUpdate={\n            writes\n              ? (pieceVersion) =>\n                  callbacks.setTrigger({\n                    ...triggerFields(block),\n                    pieceVersion,\n                    config: trigger.config,\n                    connectionId: trigger.connectionId,\n                    propertySettings: trigger.propertySettings ?? undefined,\n                  })\n              : undefined\n          }\n        />\n        {isPieceTrigger && testTrigger ? (\n          <Section title=\"Try it\">\n            <TestTriggerSection trigger={trigger} onTest={testTrigger} />\n          </Section>\n        ) : null}\n        <Section title=\"Remove\">\n          <div className=\"flex items-center justify-between gap-3\">\n            <p className=\"text-xs text-muted-foreground\">\n              Without a trigger the workflow never starts.\n            </p>\n            <Button\n              variant=\"danger\"\n              onClick={() => {\n                callbacks.clearTrigger();\n                props.onClose();\n              }}\n            >\n              <Icon name=\"trash\" className=\"h-3.5 w-3.5\" />\n              Remove trigger\n            </Button>\n          </div>\n        </Section>\n      </div>\n    </div>\n  );\n}\n","// Workflow-level variables: typed name/value rows exposed to expressions as\n// {{variables.<name>}}. The value is parsed by its type, never guessed.\nimport { useId, useState } from \"react\";\nimport {\n  Button,\n  FieldError,\n  IconButton,\n  Select,\n  Switch,\n  textAreaClass,\n  textInputClass,\n} from \"../../shared/controls.js\";\nimport { useDesignTime } from \"./design-time.js\";\nimport type { SecretFormService } from \"./forms.js\";\nimport type {\n  VariableModel,\n  VariableTypeValue,\n  WorkflowEditorCallbacks,\n} from \"./model.js\";\nimport { useSecretRef } from \"./secret-ref.js\";\nimport {\n  convertVariableValue,\n  parseTypedValue,\n  valueMismatch,\n  VARIABLE_TYPE_LABEL,\n  VARIABLE_TYPES,\n} from \"./variable-types.js\";\n\nconst KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\nconst TYPE_OPTIONS = VARIABLE_TYPES.map((type) => ({\n  value: type,\n  label: VARIABLE_TYPE_LABEL[type],\n}));\n\n// A row written before types were stored reads as text.\nconst typeOf = (variable: VariableModel): VariableTypeValue =>\n  variable.type ?? \"TEXT\";\n\nfunction stringifyValue(value: unknown, pretty = false): string {\n  if (value === undefined || value === null) return \"\";\n  if (typeof value === \"string\") return value;\n  try {\n    return JSON.stringify(value, null, pretty ? 2 : undefined);\n  } catch {\n    return String(value as number | boolean);\n  }\n}\n\nfunction SecretValue(props: {\n  variable: VariableModel;\n  secrets?: SecretFormService;\n  onCommit: (ref: string | null) => void;\n}) {\n  const id = useId();\n  const secret = useSecretRef({\n    value: props.variable.value,\n    secrets: props.secrets,\n    label: `Variable ${props.variable.key}`,\n    onCommit: props.onCommit,\n  });\n  if (!props.secrets) {\n    return (\n      <p className=\"text-xs text-muted-foreground\">\n        Managed secrets are unavailable in this session.\n      </p>\n    );\n  }\n  return (\n    <div>\n      {secret.managed ? (\n        <p className=\"mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground\">\n          <span className=\"font-medium text-foreground\">\n            {secret.stat?.label ?? \"Stored secret\"}\n          </span>\n          {secret.stat ? <span>version {secret.stat.version}</span> : null}\n        </p>\n      ) : null}\n      <div className=\"flex items-center gap-1\">\n        <input\n          id={id}\n          aria-label={`Value of ${props.variable.key}`}\n          className={textInputClass}\n          type=\"password\"\n          value={secret.draft}\n          disabled={secret.busy}\n          placeholder={\n            secret.managed\n              ? \"Paste a new value to replace it\"\n              : \"Paste the secret value\"\n          }\n          autoComplete=\"off\"\n          spellCheck={false}\n          onChange={(event) => secret.setDraft(event.target.value)}\n          onKeyDown={(event) => {\n            if (event.key === \"Enter\") secret.commit();\n          }}\n          onBlur={secret.commit}\n        />\n        {secret.ref ? (\n          <IconButton\n            icon=\"close\"\n            label=\"Remove secret\"\n            onClick={() => props.onCommit(null)}\n          />\n        ) : null}\n      </div>\n      <FieldError>{secret.error}</FieldError>\n    </div>\n  );\n}\n\nfunction ValueControl(props: {\n  variable: VariableModel;\n  commit: (value: unknown) => void;\n}) {\n  const { variable } = props;\n  const type = typeOf(variable);\n  const designTime = useDesignTime();\n  const [error, setError] = useState<string | null>(null);\n  const label = `Value of ${variable.key}`;\n  const mismatch = valueMismatch(type, variable.value);\n\n  if (type === \"SECRET\") {\n    return (\n      <SecretValue\n        variable={variable}\n        secrets={designTime?.secrets}\n        onCommit={props.commit}\n      />\n    );\n  }\n  if (type === \"BOOLEAN\" && !mismatch) {\n    return (\n      <Switch\n        checked={variable.value === true}\n        onChange={(checked) => props.commit(checked)}\n        label={variable.value === true ? \"True\" : \"False\"}\n      />\n    );\n  }\n  const json = type === \"JSON\";\n  const commitText = (raw: string) => {\n    const parsed = parseTypedValue(type, raw);\n    if (!parsed.ok) return setError(parsed.error);\n    setError(null);\n    if (stringifyValue(parsed.value) !== stringifyValue(variable.value)) {\n      props.commit(parsed.value);\n    }\n  };\n  const shown = error ?? mismatch;\n  const common = {\n    \"aria-label\": label,\n    \"aria-invalid\": shown ? true : undefined,\n    defaultValue: stringifyValue(variable.value, json),\n    placeholder: type === \"NUMBER\" ? \"0\" : \"value\",\n    spellCheck: false,\n  };\n  return (\n    <div>\n      {json ? (\n        <textarea\n          key={`${variable.id}-${stringifyValue(variable.value)}`}\n          {...common}\n          className={`${textAreaClass} font-mono text-xs`}\n          onBlur={(event) => commitText(event.target.value)}\n        />\n      ) : (\n        <input\n          key={`${variable.id}-${stringifyValue(variable.value)}`}\n          {...common}\n          inputMode={type === \"NUMBER\" ? \"decimal\" : undefined}\n          className={`${textInputClass} font-mono text-xs`}\n          onBlur={(event) => commitText(event.target.value)}\n          onKeyDown={(event) => {\n            if (event.key === \"Enter\") event.currentTarget.blur();\n          }}\n        />\n      )}\n      <FieldError>{shown}</FieldError>\n    </div>\n  );\n}\n\nfunction VariableRow(props: {\n  variable: VariableModel;\n  callbacks: WorkflowEditorCallbacks;\n}) {\n  const { variable, callbacks } = props;\n  const type = typeOf(variable);\n  const set = (value: unknown, nextType: VariableTypeValue = type) =>\n    callbacks.setVariable({\n      id: variable.id,\n      key: variable.key,\n      value,\n      type: nextType,\n    });\n  return (\n    <div className=\"flex flex-col gap-2 rounded-lg border border-solid border-foreground/10 bg-card p-3\">\n      <div className=\"flex items-center gap-2\">\n        <code\n          className=\"min-w-0 flex-1 truncate font-mono text-xs font-medium text-foreground\"\n          title=\"Keys are fixed once created; remove and re-add to rename\"\n        >\n          {variable.key}\n        </code>\n        <div className=\"w-44\">\n          <Select\n            ariaLabel={`Type of ${variable.key}`}\n            value={type}\n            options={TYPE_OPTIONS}\n            onChange={(next) => {\n              const nextType = next as VariableTypeValue;\n              set(\n                convertVariableValue(variable.value, type, nextType),\n                nextType,\n              );\n            }}\n          />\n        </div>\n        <IconButton\n          icon=\"trash\"\n          label={`Remove ${variable.key}`}\n          onClick={() => callbacks.removeVariable(variable.id)}\n        />\n      </div>\n      <ValueControl\n        key={type}\n        variable={variable}\n        commit={(value) => set(value)}\n      />\n    </div>\n  );\n}\n\nexport function VariablesEditor(props: {\n  variables: VariableModel[];\n  callbacks: WorkflowEditorCallbacks;\n  onClose: () => void;\n}) {\n  const [key, setKey] = useState(\"\");\n  const [type, setType] = useState<VariableTypeValue>(\"TEXT\");\n  const [value, setValue] = useState(\"\");\n  const trimmedKey = key.trim();\n  const keyError =\n    trimmedKey === \"\"\n      ? null\n      : !KEY_PATTERN.test(trimmedKey)\n        ? \"Letters, digits and _ only; must not start with a digit\"\n        : props.variables.some((variable) => variable.key === trimmedKey)\n          ? \"A variable with this name already exists\"\n          : null;\n  // A secret's value goes in through its row, never through this form.\n  const parsed =\n    type === \"SECRET\"\n      ? ({ ok: true, value: null } as const)\n      : parseTypedValue(type, value);\n  const valueError = parsed.ok || value.trim() === \"\" ? null : parsed.error;\n  const canAdd = trimmedKey !== \"\" && keyError === null && parsed.ok;\n  const add = () => {\n    if (!canAdd) return;\n    props.callbacks.setVariable({ key: trimmedKey, value: parsed.value, type });\n    setKey(\"\");\n    setValue(\"\");\n  };\n\n  return (\n    <div className=\"flex flex-col gap-3 p-4\">\n      <div className=\"flex items-center justify-between\">\n        <h3 className=\"text-sm font-semibold text-foreground\">Variables</h3>\n        <IconButton icon=\"close\" label=\"Close\" onClick={props.onClose} />\n      </div>\n      <p className=\"text-xs text-muted-foreground\">\n        Reference a variable in any step field as{\" \"}\n        <code className=\"font-mono\">{\"{{variables.name}}\"}</code>. Secrets are\n        stored in the secret store; the workflow keeps only a reference.\n      </p>\n      {props.variables.length === 0 ? (\n        <p className=\"text-xs text-muted-foreground\">No variables yet.</p>\n      ) : (\n        <div className=\"flex flex-col gap-2\">\n          {props.variables.map((variable) => (\n            <VariableRow\n              key={variable.id}\n              variable={variable}\n              callbacks={props.callbacks}\n            />\n          ))}\n        </div>\n      )}\n      <div className=\"flex flex-col gap-2 rounded-lg border border-dashed border-foreground/15 p-3\">\n        <div className=\"flex items-start gap-2\">\n          <div className=\"min-w-0 flex-1\">\n            <input\n              aria-label=\"New variable name\"\n              className={`${textInputClass} font-mono text-xs`}\n              placeholder=\"new_variable\"\n              value={key}\n              spellCheck={false}\n              onChange={(event) => setKey(event.target.value)}\n              onKeyDown={(event) => {\n                if (event.key === \"Enter\") add();\n              }}\n            />\n            <FieldError>{keyError}</FieldError>\n          </div>\n          <div className=\"w-36\">\n            <Select\n              ariaLabel=\"New variable type\"\n              value={type}\n              options={TYPE_OPTIONS}\n              onChange={(next) => setType(next as VariableTypeValue)}\n            />\n          </div>\n        </div>\n        <div className=\"flex items-start gap-2\">\n          <div className=\"min-w-0 flex-1\">\n            {type === \"SECRET\" ? (\n              <p className=\"py-2 text-xs text-muted-foreground\">\n                Paste the secret once the variable is added.\n              </p>\n            ) : (\n              <input\n                aria-label=\"New variable value\"\n                className={`${textInputClass} font-mono text-xs`}\n                placeholder={type === \"BOOLEAN\" ? \"true or false\" : \"value\"}\n                value={value}\n                spellCheck={false}\n                onChange={(event) => setValue(event.target.value)}\n                onKeyDown={(event) => {\n                  if (event.key === \"Enter\") add();\n                }}\n              />\n            )}\n            <FieldError>{valueError}</FieldError>\n          </div>\n          <Button variant=\"primary\" disabled={!canAdd} onClick={add}>\n            Add\n          </Button>\n        </div>\n      </div>\n    </div>\n  );\n}\n","export default function cc(names) {\n  if (typeof names === \"string\" || typeof names === \"number\") return \"\" + names\n\n  let out = \"\"\n\n  if (Array.isArray(names)) {\n    for (let i = 0, tmp; i < names.length; i++) {\n      if ((tmp = cc(names[i])) !== \"\") {\n        out += (out && \" \") + tmp\n      }\n    }\n  } else {\n    for (let k in names) {\n      if (names[k]) out += (out && \" \") + k\n    }\n  }\n\n  return out\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n  for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n    if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n    _[t] = [];\n  }\n  return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n  this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n  return typenames.trim().split(/^|\\s+/).map(function(t) {\n    var name = \"\", i = t.indexOf(\".\");\n    if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n    if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n    return {type: t, name: name};\n  });\n}\n\nDispatch.prototype = dispatch.prototype = {\n  constructor: Dispatch,\n  on: function(typename, callback) {\n    var _ = this._,\n        T = parseTypenames(typename + \"\", _),\n        t,\n        i = -1,\n        n = T.length;\n\n    // If no callback was specified, return the callback of the given type and name.\n    if (arguments.length < 2) {\n      while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n      return;\n    }\n\n    // If a type was specified, set the callback for the given type and name.\n    // Otherwise, if a null callback was specified, remove callbacks of the given name.\n    if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n    while (++i < n) {\n      if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n      else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n    }\n\n    return this;\n  },\n  copy: function() {\n    var copy = {}, _ = this._;\n    for (var t in _) copy[t] = _[t].slice();\n    return new Dispatch(copy);\n  },\n  call: function(type, that) {\n    if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n    if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n    for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n  },\n  apply: function(type, that, args) {\n    if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n    for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n  }\n};\n\nfunction get(type, name) {\n  for (var i = 0, n = type.length, c; i < n; ++i) {\n    if ((c = type[i]).name === name) {\n      return c.value;\n    }\n  }\n}\n\nfunction set(type, name, callback) {\n  for (var i = 0, n = type.length; i < n; ++i) {\n    if (type[i].name === name) {\n      type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n      break;\n    }\n  }\n  if (callback != null) type.push({name: name, value: callback});\n  return type;\n}\n\nexport default dispatch;\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n  svg: \"http://www.w3.org/2000/svg\",\n  xhtml: xhtml,\n  xlink: \"http://www.w3.org/1999/xlink\",\n  xml: \"http://www.w3.org/XML/1998/namespace\",\n  xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n  var prefix = name += \"\", i = prefix.indexOf(\":\");\n  if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n  return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n","import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n  return function() {\n    var document = this.ownerDocument,\n        uri = this.namespaceURI;\n    return uri === xhtml && document.documentElement.namespaceURI === xhtml\n        ? document.createElement(name)\n        : document.createElementNS(uri, name);\n  };\n}\n\nfunction creatorFixed(fullname) {\n  return function() {\n    return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n  };\n}\n\nexport default function(name) {\n  var fullname = namespace(name);\n  return (fullname.local\n      ? creatorFixed\n      : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n  return selector == null ? none : function() {\n    return this.querySelector(selector);\n  };\n}\n","import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n  if (typeof select !== \"function\") select = selector(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n      if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n        if (\"__data__\" in node) subnode.__data__ = node.__data__;\n        subgroup[i] = subnode;\n      }\n    }\n  }\n\n  return new Selection(subgroups, this._parents);\n}\n","// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don’t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n  return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n","function empty() {\n  return [];\n}\n\nexport default function(selector) {\n  return selector == null ? empty : function() {\n    return this.querySelectorAll(selector);\n  };\n}\n","import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n  return function() {\n    return array(select.apply(this, arguments));\n  };\n}\n\nexport default function(select) {\n  if (typeof select === \"function\") select = arrayAll(select);\n  else select = selectorAll(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        subgroups.push(select.call(node, node.__data__, i, group));\n        parents.push(node);\n      }\n    }\n  }\n\n  return new Selection(subgroups, parents);\n}\n","export default function(selector) {\n  return function() {\n    return this.matches(selector);\n  };\n}\n\nexport function childMatcher(selector) {\n  return function(node) {\n    return node.matches(selector);\n  };\n}\n\n","import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n  return function() {\n    return find.call(this.children, match);\n  };\n}\n\nfunction childFirst() {\n  return this.firstElementChild;\n}\n\nexport default function(match) {\n  return this.select(match == null ? childFirst\n      : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n  return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n  return function() {\n    return filter.call(this.children, match);\n  };\n}\n\nexport default function(match) {\n  return this.selectAll(match == null ? children\n      : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n  if (typeof match !== \"function\") match = matcher(match);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n      if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n        subgroup.push(node);\n      }\n    }\n  }\n\n  return new Selection(subgroups, this._parents);\n}\n","export default function(update) {\n  return new Array(update.length);\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n  return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n  this.ownerDocument = parent.ownerDocument;\n  this.namespaceURI = parent.namespaceURI;\n  this._next = null;\n  this._parent = parent;\n  this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n  constructor: EnterNode,\n  appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n  insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n  querySelector: function(selector) { return this._parent.querySelector(selector); },\n  querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n  return function() {\n    return x;\n  };\n}\n","import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n  var i = 0,\n      node,\n      groupLength = group.length,\n      dataLength = data.length;\n\n  // Put any non-null nodes that fit into update.\n  // Put any null nodes into enter.\n  // Put any remaining data into enter.\n  for (; i < dataLength; ++i) {\n    if (node = group[i]) {\n      node.__data__ = data[i];\n      update[i] = node;\n    } else {\n      enter[i] = new EnterNode(parent, data[i]);\n    }\n  }\n\n  // Put any non-null nodes that don’t fit into exit.\n  for (; i < groupLength; ++i) {\n    if (node = group[i]) {\n      exit[i] = node;\n    }\n  }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n  var i,\n      node,\n      nodeByKeyValue = new Map,\n      groupLength = group.length,\n      dataLength = data.length,\n      keyValues = new Array(groupLength),\n      keyValue;\n\n  // Compute the key for each node.\n  // If multiple nodes have the same key, the duplicates are added to exit.\n  for (i = 0; i < groupLength; ++i) {\n    if (node = group[i]) {\n      keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n      if (nodeByKeyValue.has(keyValue)) {\n        exit[i] = node;\n      } else {\n        nodeByKeyValue.set(keyValue, node);\n      }\n    }\n  }\n\n  // Compute the key for each datum.\n  // If there a node associated with this key, join and add it to update.\n  // If there is not (or the key is a duplicate), add it to enter.\n  for (i = 0; i < dataLength; ++i) {\n    keyValue = key.call(parent, data[i], i, data) + \"\";\n    if (node = nodeByKeyValue.get(keyValue)) {\n      update[i] = node;\n      node.__data__ = data[i];\n      nodeByKeyValue.delete(keyValue);\n    } else {\n      enter[i] = new EnterNode(parent, data[i]);\n    }\n  }\n\n  // Add any remaining nodes that were not bound to data to exit.\n  for (i = 0; i < groupLength; ++i) {\n    if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n      exit[i] = node;\n    }\n  }\n}\n\nfunction datum(node) {\n  return node.__data__;\n}\n\nexport default function(value, key) {\n  if (!arguments.length) return Array.from(this, datum);\n\n  var bind = key ? bindKey : bindIndex,\n      parents = this._parents,\n      groups = this._groups;\n\n  if (typeof value !== \"function\") value = constant(value);\n\n  for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n    var parent = parents[j],\n        group = groups[j],\n        groupLength = group.length,\n        data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n        dataLength = data.length,\n        enterGroup = enter[j] = new Array(dataLength),\n        updateGroup = update[j] = new Array(dataLength),\n        exitGroup = exit[j] = new Array(groupLength);\n\n    bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n    // Now connect the enter nodes to their following update node, such that\n    // appendChild can insert the materialized enter node before this node,\n    // rather than at the end of the parent node.\n    for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n      if (previous = enterGroup[i0]) {\n        if (i0 >= i1) i1 = i0 + 1;\n        while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n        previous._next = next || null;\n      }\n    }\n  }\n\n  update = new Selection(update, parents);\n  update._enter = enter;\n  update._exit = exit;\n  return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn’t worried about “live” collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don’t; we’d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n  return typeof data === \"object\" && \"length\" in data\n    ? data // Array, TypedArray, NodeList, array-like\n    : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n  return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n  var enter = this.enter(), update = this, exit = this.exit();\n  if (typeof onenter === \"function\") {\n    enter = onenter(enter);\n    if (enter) enter = enter.selection();\n  } else {\n    enter = enter.append(onenter + \"\");\n  }\n  if (onupdate != null) {\n    update = onupdate(update);\n    if (update) update = update.selection();\n  }\n  if (onexit == null) exit.remove(); else onexit(exit);\n  return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(context) {\n  var selection = context.selection ? context.selection() : context;\n\n  for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n    for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group0[i] || group1[i]) {\n        merge[i] = node;\n      }\n    }\n  }\n\n  for (; j < m0; ++j) {\n    merges[j] = groups0[j];\n  }\n\n  return new Selection(merges, this._parents);\n}\n","export default function() {\n\n  for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n    for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n      if (node = group[i]) {\n        if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n        next = node;\n      }\n    }\n  }\n\n  return this;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n  if (!compare) compare = ascending;\n\n  function compareNode(a, b) {\n    return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n  }\n\n  for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        sortgroup[i] = node;\n      }\n    }\n    sortgroup.sort(compareNode);\n  }\n\n  return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n  var callback = arguments[0];\n  arguments[0] = this;\n  callback.apply(null, arguments);\n  return this;\n}\n","export default function() {\n  return Array.from(this);\n}\n","export default function() {\n\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n      var node = group[i];\n      if (node) return node;\n    }\n  }\n\n  return null;\n}\n","export default function() {\n  let size = 0;\n  for (const node of this) ++size; // eslint-disable-line no-unused-vars\n  return size;\n}\n","export default function() {\n  return !this.node();\n}\n","export default function(callback) {\n\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n      if (node = group[i]) callback.call(node, node.__data__, i, group);\n    }\n  }\n\n  return this;\n}\n","import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n  return function() {\n    this.removeAttribute(name);\n  };\n}\n\nfunction attrRemoveNS(fullname) {\n  return function() {\n    this.removeAttributeNS(fullname.space, fullname.local);\n  };\n}\n\nfunction attrConstant(name, value) {\n  return function() {\n    this.setAttribute(name, value);\n  };\n}\n\nfunction attrConstantNS(fullname, value) {\n  return function() {\n    this.setAttributeNS(fullname.space, fullname.local, value);\n  };\n}\n\nfunction attrFunction(name, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.removeAttribute(name);\n    else this.setAttribute(name, v);\n  };\n}\n\nfunction attrFunctionNS(fullname, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n    else this.setAttributeNS(fullname.space, fullname.local, v);\n  };\n}\n\nexport default function(name, value) {\n  var fullname = namespace(name);\n\n  if (arguments.length < 2) {\n    var node = this.node();\n    return fullname.local\n        ? node.getAttributeNS(fullname.space, fullname.local)\n        : node.getAttribute(fullname);\n  }\n\n  return this.each((value == null\n      ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n      ? (fullname.local ? attrFunctionNS : attrFunction)\n      : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n  return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n      || (node.document && node) // node is a Window\n      || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n  return function() {\n    this.style.removeProperty(name);\n  };\n}\n\nfunction styleConstant(name, value, priority) {\n  return function() {\n    this.style.setProperty(name, value, priority);\n  };\n}\n\nfunction styleFunction(name, value, priority) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.style.removeProperty(name);\n    else this.style.setProperty(name, v, priority);\n  };\n}\n\nexport default function(name, value, priority) {\n  return arguments.length > 1\n      ? this.each((value == null\n            ? styleRemove : typeof value === \"function\"\n            ? styleFunction\n            : styleConstant)(name, value, priority == null ? \"\" : priority))\n      : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n  return node.style.getPropertyValue(name)\n      || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function propertyRemove(name) {\n  return function() {\n    delete this[name];\n  };\n}\n\nfunction propertyConstant(name, value) {\n  return function() {\n    this[name] = value;\n  };\n}\n\nfunction propertyFunction(name, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) delete this[name];\n    else this[name] = v;\n  };\n}\n\nexport default function(name, value) {\n  return arguments.length > 1\n      ? this.each((value == null\n          ? propertyRemove : typeof value === \"function\"\n          ? propertyFunction\n          : propertyConstant)(name, value))\n      : this.node()[name];\n}\n","function classArray(string) {\n  return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n  return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n  this._node = node;\n  this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n  add: function(name) {\n    var i = this._names.indexOf(name);\n    if (i < 0) {\n      this._names.push(name);\n      this._node.setAttribute(\"class\", this._names.join(\" \"));\n    }\n  },\n  remove: function(name) {\n    var i = this._names.indexOf(name);\n    if (i >= 0) {\n      this._names.splice(i, 1);\n      this._node.setAttribute(\"class\", this._names.join(\" \"));\n    }\n  },\n  contains: function(name) {\n    return this._names.indexOf(name) >= 0;\n  }\n};\n\nfunction classedAdd(node, names) {\n  var list = classList(node), i = -1, n = names.length;\n  while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n  var list = classList(node), i = -1, n = names.length;\n  while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n  return function() {\n    classedAdd(this, names);\n  };\n}\n\nfunction classedFalse(names) {\n  return function() {\n    classedRemove(this, names);\n  };\n}\n\nfunction classedFunction(names, value) {\n  return function() {\n    (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n  };\n}\n\nexport default function(name, value) {\n  var names = classArray(name + \"\");\n\n  if (arguments.length < 2) {\n    var list = classList(this.node()), i = -1, n = names.length;\n    while (++i < n) if (!list.contains(names[i])) return false;\n    return true;\n  }\n\n  return this.each((typeof value === \"function\"\n      ? classedFunction : value\n      ? classedTrue\n      : classedFalse)(names, value));\n}\n","function textRemove() {\n  this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n  return function() {\n    this.textContent = value;\n  };\n}\n\nfunction textFunction(value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    this.textContent = v == null ? \"\" : v;\n  };\n}\n\nexport default function(value) {\n  return arguments.length\n      ? this.each(value == null\n          ? textRemove : (typeof value === \"function\"\n          ? textFunction\n          : textConstant)(value))\n      : this.node().textContent;\n}\n","function htmlRemove() {\n  this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n  return function() {\n    this.innerHTML = value;\n  };\n}\n\nfunction htmlFunction(value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    this.innerHTML = v == null ? \"\" : v;\n  };\n}\n\nexport default function(value) {\n  return arguments.length\n      ? this.each(value == null\n          ? htmlRemove : (typeof value === \"function\"\n          ? htmlFunction\n          : htmlConstant)(value))\n      : this.node().innerHTML;\n}\n","function raise() {\n  if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n  return this.each(raise);\n}\n","function lower() {\n  if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n  return this.each(lower);\n}\n","import creator from \"../creator.js\";\n\nexport default function(name) {\n  var create = typeof name === \"function\" ? name : creator(name);\n  return this.select(function() {\n    return this.appendChild(create.apply(this, arguments));\n  });\n}\n","import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n  return null;\n}\n\nexport default function(name, before) {\n  var create = typeof name === \"function\" ? name : creator(name),\n      select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n  return this.select(function() {\n    return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n  });\n}\n","function remove() {\n  var parent = this.parentNode;\n  if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n  return this.each(remove);\n}\n","function selection_cloneShallow() {\n  var clone = this.cloneNode(false), parent = this.parentNode;\n  return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n  var clone = this.cloneNode(true), parent = this.parentNode;\n  return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n  return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","export default function(value) {\n  return arguments.length\n      ? this.property(\"__data__\", value)\n      : this.node().__data__;\n}\n","function contextListener(listener) {\n  return function(event) {\n    listener.call(this, event, this.__data__);\n  };\n}\n\nfunction parseTypenames(typenames) {\n  return typenames.trim().split(/^|\\s+/).map(function(t) {\n    var name = \"\", i = t.indexOf(\".\");\n    if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n    return {type: t, name: name};\n  });\n}\n\nfunction onRemove(typename) {\n  return function() {\n    var on = this.__on;\n    if (!on) return;\n    for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n      if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n        this.removeEventListener(o.type, o.listener, o.options);\n      } else {\n        on[++i] = o;\n      }\n    }\n    if (++i) on.length = i;\n    else delete this.__on;\n  };\n}\n\nfunction onAdd(typename, value, options) {\n  return function() {\n    var on = this.__on, o, listener = contextListener(value);\n    if (on) for (var j = 0, m = on.length; j < m; ++j) {\n      if ((o = on[j]).type === typename.type && o.name === typename.name) {\n        this.removeEventListener(o.type, o.listener, o.options);\n        this.addEventListener(o.type, o.listener = listener, o.options = options);\n        o.value = value;\n        return;\n      }\n    }\n    this.addEventListener(typename.type, listener, options);\n    o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n    if (!on) this.__on = [o];\n    else on.push(o);\n  };\n}\n\nexport default function(typename, value, options) {\n  var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n  if (arguments.length < 2) {\n    var on = this.node().__on;\n    if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n      for (i = 0, o = on[j]; i < n; ++i) {\n        if ((t = typenames[i]).type === o.type && t.name === o.name) {\n          return o.value;\n        }\n      }\n    }\n    return;\n  }\n\n  on = value ? onAdd : onRemove;\n  for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n  return this;\n}\n","import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n  var window = defaultView(node),\n      event = window.CustomEvent;\n\n  if (typeof event === \"function\") {\n    event = new event(type, params);\n  } else {\n    event = window.document.createEvent(\"Event\");\n    if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n    else event.initEvent(type, false, false);\n  }\n\n  node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n  return function() {\n    return dispatchEvent(this, type, params);\n  };\n}\n\nfunction dispatchFunction(type, params) {\n  return function() {\n    return dispatchEvent(this, type, params.apply(this, arguments));\n  };\n}\n\nexport default function(type, params) {\n  return this.each((typeof params === \"function\"\n      ? dispatchFunction\n      : dispatchConstant)(type, params));\n}\n","export default function*() {\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n      if (node = group[i]) yield node;\n    }\n  }\n}\n","import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n  this._groups = groups;\n  this._parents = parents;\n}\n\nfunction selection() {\n  return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n  return this;\n}\n\nSelection.prototype = selection.prototype = {\n  constructor: Selection,\n  select: selection_select,\n  selectAll: selection_selectAll,\n  selectChild: selection_selectChild,\n  selectChildren: selection_selectChildren,\n  filter: selection_filter,\n  data: selection_data,\n  enter: selection_enter,\n  exit: selection_exit,\n  join: selection_join,\n  merge: selection_merge,\n  selection: selection_selection,\n  order: selection_order,\n  sort: selection_sort,\n  call: selection_call,\n  nodes: selection_nodes,\n  node: selection_node,\n  size: selection_size,\n  empty: selection_empty,\n  each: selection_each,\n  attr: selection_attr,\n  style: selection_style,\n  property: selection_property,\n  classed: selection_classed,\n  text: selection_text,\n  html: selection_html,\n  raise: selection_raise,\n  lower: selection_lower,\n  append: selection_append,\n  insert: selection_insert,\n  remove: selection_remove,\n  clone: selection_clone,\n  datum: selection_datum,\n  on: selection_on,\n  dispatch: selection_dispatch,\n  [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n","import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n  return typeof selector === \"string\"\n      ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n      : new Selection([[selector]], root);\n}\n","export default function(event) {\n  let sourceEvent;\n  while (sourceEvent = event.sourceEvent) event = sourceEvent;\n  return event;\n}\n","import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n  event = sourceEvent(event);\n  if (node === undefined) node = event.currentTarget;\n  if (node) {\n    var svg = node.ownerSVGElement || node;\n    if (svg.createSVGPoint) {\n      var point = svg.createSVGPoint();\n      point.x = event.clientX, point.y = event.clientY;\n      point = point.matrixTransform(node.getScreenCTM().inverse());\n      return [point.x, point.y];\n    }\n    if (node.getBoundingClientRect) {\n      var rect = node.getBoundingClientRect();\n      return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n    }\n  }\n  return [event.pageX, event.pageY];\n}\n","// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n  event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n  event.preventDefault();\n  event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n  var root = view.document.documentElement,\n      selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n  if (\"onselectstart\" in root) {\n    selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n  } else {\n    root.__noselect = root.style.MozUserSelect;\n    root.style.MozUserSelect = \"none\";\n  }\n}\n\nexport function yesdrag(view, noclick) {\n  var root = view.document.documentElement,\n      selection = select(view).on(\"dragstart.drag\", null);\n  if (noclick) {\n    selection.on(\"click.drag\", noevent, nonpassivecapture);\n    setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n  }\n  if (\"onselectstart\" in root) {\n    selection.on(\"selectstart.drag\", null);\n  } else {\n    root.style.MozUserSelect = root.__noselect;\n    delete root.__noselect;\n  }\n}\n","export default x => () => x;\n","export default function DragEvent(type, {\n  sourceEvent,\n  subject,\n  target,\n  identifier,\n  active,\n  x, y, dx, dy,\n  dispatch\n}) {\n  Object.defineProperties(this, {\n    type: {value: type, enumerable: true, configurable: true},\n    sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n    subject: {value: subject, enumerable: true, configurable: true},\n    target: {value: target, enumerable: true, configurable: true},\n    identifier: {value: identifier, enumerable: true, configurable: true},\n    active: {value: active, enumerable: true, configurable: true},\n    x: {value: x, enumerable: true, configurable: true},\n    y: {value: y, enumerable: true, configurable: true},\n    dx: {value: dx, enumerable: true, configurable: true},\n    dy: {value: dy, enumerable: true, configurable: true},\n    _: {value: dispatch}\n  });\n}\n\nDragEvent.prototype.on = function() {\n  var value = this._.on.apply(this._, arguments);\n  return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {select, pointer} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nonpassive, nonpassivecapture, nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n  return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n  return this.parentNode;\n}\n\nfunction defaultSubject(event, d) {\n  return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n  return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n  var filter = defaultFilter,\n      container = defaultContainer,\n      subject = defaultSubject,\n      touchable = defaultTouchable,\n      gestures = {},\n      listeners = dispatch(\"start\", \"drag\", \"end\"),\n      active = 0,\n      mousedownx,\n      mousedowny,\n      mousemoving,\n      touchending,\n      clickDistance2 = 0;\n\n  function drag(selection) {\n    selection\n        .on(\"mousedown.drag\", mousedowned)\n      .filter(touchable)\n        .on(\"touchstart.drag\", touchstarted)\n        .on(\"touchmove.drag\", touchmoved, nonpassive)\n        .on(\"touchend.drag touchcancel.drag\", touchended)\n        .style(\"touch-action\", \"none\")\n        .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n  }\n\n  function mousedowned(event, d) {\n    if (touchending || !filter.call(this, event, d)) return;\n    var gesture = beforestart(this, container.call(this, event, d), event, d, \"mouse\");\n    if (!gesture) return;\n    select(event.view)\n      .on(\"mousemove.drag\", mousemoved, nonpassivecapture)\n      .on(\"mouseup.drag\", mouseupped, nonpassivecapture);\n    nodrag(event.view);\n    nopropagation(event);\n    mousemoving = false;\n    mousedownx = event.clientX;\n    mousedowny = event.clientY;\n    gesture(\"start\", event);\n  }\n\n  function mousemoved(event) {\n    noevent(event);\n    if (!mousemoving) {\n      var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n      mousemoving = dx * dx + dy * dy > clickDistance2;\n    }\n    gestures.mouse(\"drag\", event);\n  }\n\n  function mouseupped(event) {\n    select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n    yesdrag(event.view, mousemoving);\n    noevent(event);\n    gestures.mouse(\"end\", event);\n  }\n\n  function touchstarted(event, d) {\n    if (!filter.call(this, event, d)) return;\n    var touches = event.changedTouches,\n        c = container.call(this, event, d),\n        n = touches.length, i, gesture;\n\n    for (i = 0; i < n; ++i) {\n      if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) {\n        nopropagation(event);\n        gesture(\"start\", event, touches[i]);\n      }\n    }\n  }\n\n  function touchmoved(event) {\n    var touches = event.changedTouches,\n        n = touches.length, i, gesture;\n\n    for (i = 0; i < n; ++i) {\n      if (gesture = gestures[touches[i].identifier]) {\n        noevent(event);\n        gesture(\"drag\", event, touches[i]);\n      }\n    }\n  }\n\n  function touchended(event) {\n    var touches = event.changedTouches,\n        n = touches.length, i, gesture;\n\n    if (touchending) clearTimeout(touchending);\n    touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n    for (i = 0; i < n; ++i) {\n      if (gesture = gestures[touches[i].identifier]) {\n        nopropagation(event);\n        gesture(\"end\", event, touches[i]);\n      }\n    }\n  }\n\n  function beforestart(that, container, event, d, identifier, touch) {\n    var dispatch = listeners.copy(),\n        p = pointer(touch || event, container), dx, dy,\n        s;\n\n    if ((s = subject.call(that, new DragEvent(\"beforestart\", {\n        sourceEvent: event,\n        target: drag,\n        identifier,\n        active,\n        x: p[0],\n        y: p[1],\n        dx: 0,\n        dy: 0,\n        dispatch\n      }), d)) == null) return;\n\n    dx = s.x - p[0] || 0;\n    dy = s.y - p[1] || 0;\n\n    return function gesture(type, event, touch) {\n      var p0 = p, n;\n      switch (type) {\n        case \"start\": gestures[identifier] = gesture, n = active++; break;\n        case \"end\": delete gestures[identifier], --active; // falls through\n        case \"drag\": p = pointer(touch || event, container), n = active; break;\n      }\n      dispatch.call(\n        type,\n        that,\n        new DragEvent(type, {\n          sourceEvent: event,\n          subject: s,\n          target: drag,\n          identifier,\n          active: n,\n          x: p[0] + dx,\n          y: p[1] + dy,\n          dx: p[0] - p0[0],\n          dy: p[1] - p0[1],\n          dispatch\n        }),\n        d\n      );\n    };\n  }\n\n  drag.filter = function(_) {\n    return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n  };\n\n  drag.container = function(_) {\n    return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n  };\n\n  drag.subject = function(_) {\n    return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n  };\n\n  drag.touchable = function(_) {\n    return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n  };\n\n  drag.on = function() {\n    var value = listeners.on.apply(listeners, arguments);\n    return value === listeners ? drag : value;\n  };\n\n  drag.clickDistance = function(_) {\n    return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n  };\n\n  return drag;\n}\n","export default function(constructor, factory, prototype) {\n  constructor.prototype = factory.prototype = prototype;\n  prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n  var prototype = Object.create(parent.prototype);\n  for (var key in definition) prototype[key] = definition[key];\n  return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n    reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n    reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n    reHex = /^#([0-9a-f]{3,8})$/,\n    reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n    reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n    reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n    reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n    reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n    reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n  aliceblue: 0xf0f8ff,\n  antiquewhite: 0xfaebd7,\n  aqua: 0x00ffff,\n  aquamarine: 0x7fffd4,\n  azure: 0xf0ffff,\n  beige: 0xf5f5dc,\n  bisque: 0xffe4c4,\n  black: 0x000000,\n  blanchedalmond: 0xffebcd,\n  blue: 0x0000ff,\n  blueviolet: 0x8a2be2,\n  brown: 0xa52a2a,\n  burlywood: 0xdeb887,\n  cadetblue: 0x5f9ea0,\n  chartreuse: 0x7fff00,\n  chocolate: 0xd2691e,\n  coral: 0xff7f50,\n  cornflowerblue: 0x6495ed,\n  cornsilk: 0xfff8dc,\n  crimson: 0xdc143c,\n  cyan: 0x00ffff,\n  darkblue: 0x00008b,\n  darkcyan: 0x008b8b,\n  darkgoldenrod: 0xb8860b,\n  darkgray: 0xa9a9a9,\n  darkgreen: 0x006400,\n  darkgrey: 0xa9a9a9,\n  darkkhaki: 0xbdb76b,\n  darkmagenta: 0x8b008b,\n  darkolivegreen: 0x556b2f,\n  darkorange: 0xff8c00,\n  darkorchid: 0x9932cc,\n  darkred: 0x8b0000,\n  darksalmon: 0xe9967a,\n  darkseagreen: 0x8fbc8f,\n  darkslateblue: 0x483d8b,\n  darkslategray: 0x2f4f4f,\n  darkslategrey: 0x2f4f4f,\n  darkturquoise: 0x00ced1,\n  darkviolet: 0x9400d3,\n  deeppink: 0xff1493,\n  deepskyblue: 0x00bfff,\n  dimgray: 0x696969,\n  dimgrey: 0x696969,\n  dodgerblue: 0x1e90ff,\n  firebrick: 0xb22222,\n  floralwhite: 0xfffaf0,\n  forestgreen: 0x228b22,\n  fuchsia: 0xff00ff,\n  gainsboro: 0xdcdcdc,\n  ghostwhite: 0xf8f8ff,\n  gold: 0xffd700,\n  goldenrod: 0xdaa520,\n  gray: 0x808080,\n  green: 0x008000,\n  greenyellow: 0xadff2f,\n  grey: 0x808080,\n  honeydew: 0xf0fff0,\n  hotpink: 0xff69b4,\n  indianred: 0xcd5c5c,\n  indigo: 0x4b0082,\n  ivory: 0xfffff0,\n  khaki: 0xf0e68c,\n  lavender: 0xe6e6fa,\n  lavenderblush: 0xfff0f5,\n  lawngreen: 0x7cfc00,\n  lemonchiffon: 0xfffacd,\n  lightblue: 0xadd8e6,\n  lightcoral: 0xf08080,\n  lightcyan: 0xe0ffff,\n  lightgoldenrodyellow: 0xfafad2,\n  lightgray: 0xd3d3d3,\n  lightgreen: 0x90ee90,\n  lightgrey: 0xd3d3d3,\n  lightpink: 0xffb6c1,\n  lightsalmon: 0xffa07a,\n  lightseagreen: 0x20b2aa,\n  lightskyblue: 0x87cefa,\n  lightslategray: 0x778899,\n  lightslategrey: 0x778899,\n  lightsteelblue: 0xb0c4de,\n  lightyellow: 0xffffe0,\n  lime: 0x00ff00,\n  limegreen: 0x32cd32,\n  linen: 0xfaf0e6,\n  magenta: 0xff00ff,\n  maroon: 0x800000,\n  mediumaquamarine: 0x66cdaa,\n  mediumblue: 0x0000cd,\n  mediumorchid: 0xba55d3,\n  mediumpurple: 0x9370db,\n  mediumseagreen: 0x3cb371,\n  mediumslateblue: 0x7b68ee,\n  mediumspringgreen: 0x00fa9a,\n  mediumturquoise: 0x48d1cc,\n  mediumvioletred: 0xc71585,\n  midnightblue: 0x191970,\n  mintcream: 0xf5fffa,\n  mistyrose: 0xffe4e1,\n  moccasin: 0xffe4b5,\n  navajowhite: 0xffdead,\n  navy: 0x000080,\n  oldlace: 0xfdf5e6,\n  olive: 0x808000,\n  olivedrab: 0x6b8e23,\n  orange: 0xffa500,\n  orangered: 0xff4500,\n  orchid: 0xda70d6,\n  palegoldenrod: 0xeee8aa,\n  palegreen: 0x98fb98,\n  paleturquoise: 0xafeeee,\n  palevioletred: 0xdb7093,\n  papayawhip: 0xffefd5,\n  peachpuff: 0xffdab9,\n  peru: 0xcd853f,\n  pink: 0xffc0cb,\n  plum: 0xdda0dd,\n  powderblue: 0xb0e0e6,\n  purple: 0x800080,\n  rebeccapurple: 0x663399,\n  red: 0xff0000,\n  rosybrown: 0xbc8f8f,\n  royalblue: 0x4169e1,\n  saddlebrown: 0x8b4513,\n  salmon: 0xfa8072,\n  sandybrown: 0xf4a460,\n  seagreen: 0x2e8b57,\n  seashell: 0xfff5ee,\n  sienna: 0xa0522d,\n  silver: 0xc0c0c0,\n  skyblue: 0x87ceeb,\n  slateblue: 0x6a5acd,\n  slategray: 0x708090,\n  slategrey: 0x708090,\n  snow: 0xfffafa,\n  springgreen: 0x00ff7f,\n  steelblue: 0x4682b4,\n  tan: 0xd2b48c,\n  teal: 0x008080,\n  thistle: 0xd8bfd8,\n  tomato: 0xff6347,\n  turquoise: 0x40e0d0,\n  violet: 0xee82ee,\n  wheat: 0xf5deb3,\n  white: 0xffffff,\n  whitesmoke: 0xf5f5f5,\n  yellow: 0xffff00,\n  yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n  copy(channels) {\n    return Object.assign(new this.constructor, this, channels);\n  },\n  displayable() {\n    return this.rgb().displayable();\n  },\n  hex: color_formatHex, // Deprecated! Use color.formatHex.\n  formatHex: color_formatHex,\n  formatHex8: color_formatHex8,\n  formatHsl: color_formatHsl,\n  formatRgb: color_formatRgb,\n  toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n  return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n  return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n  return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n  return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n  var m, l;\n  format = (format + \"\").trim().toLowerCase();\n  return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n      : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n      : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n      : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n      : null) // invalid hex\n      : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n      : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n      : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n      : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n      : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n      : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n      : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n      : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n      : null;\n}\n\nfunction rgbn(n) {\n  return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n  if (a <= 0) r = g = b = NaN;\n  return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n  if (!(o instanceof Color)) o = color(o);\n  if (!o) return new Rgb;\n  o = o.rgb();\n  return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n  return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n  this.r = +r;\n  this.g = +g;\n  this.b = +b;\n  this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n  brighter(k) {\n    k = k == null ? brighter : Math.pow(brighter, k);\n    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n  },\n  darker(k) {\n    k = k == null ? darker : Math.pow(darker, k);\n    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n  },\n  rgb() {\n    return this;\n  },\n  clamp() {\n    return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n  },\n  displayable() {\n    return (-0.5 <= this.r && this.r < 255.5)\n        && (-0.5 <= this.g && this.g < 255.5)\n        && (-0.5 <= this.b && this.b < 255.5)\n        && (0 <= this.opacity && this.opacity <= 1);\n  },\n  hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n  formatHex: rgb_formatHex,\n  formatHex8: rgb_formatHex8,\n  formatRgb: rgb_formatRgb,\n  toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n  const a = clampa(this.opacity);\n  return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n  return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n  return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n  value = clampi(value);\n  return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n  if (a <= 0) h = s = l = NaN;\n  else if (l <= 0 || l >= 1) h = s = NaN;\n  else if (s <= 0) h = NaN;\n  return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n  if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n  if (!(o instanceof Color)) o = color(o);\n  if (!o) return new Hsl;\n  if (o instanceof Hsl) return o;\n  o = o.rgb();\n  var r = o.r / 255,\n      g = o.g / 255,\n      b = o.b / 255,\n      min = Math.min(r, g, b),\n      max = Math.max(r, g, b),\n      h = NaN,\n      s = max - min,\n      l = (max + min) / 2;\n  if (s) {\n    if (r === max) h = (g - b) / s + (g < b) * 6;\n    else if (g === max) h = (b - r) / s + 2;\n    else h = (r - g) / s + 4;\n    s /= l < 0.5 ? max + min : 2 - max - min;\n    h *= 60;\n  } else {\n    s = l > 0 && l < 1 ? 0 : h;\n  }\n  return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n  return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n  this.h = +h;\n  this.s = +s;\n  this.l = +l;\n  this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n  brighter(k) {\n    k = k == null ? brighter : Math.pow(brighter, k);\n    return new Hsl(this.h, this.s, this.l * k, this.opacity);\n  },\n  darker(k) {\n    k = k == null ? darker : Math.pow(darker, k);\n    return new Hsl(this.h, this.s, this.l * k, this.opacity);\n  },\n  rgb() {\n    var h = this.h % 360 + (this.h < 0) * 360,\n        s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n        l = this.l,\n        m2 = l + (l < 0.5 ? l : 1 - l) * s,\n        m1 = 2 * l - m2;\n    return new Rgb(\n      hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n      hsl2rgb(h, m1, m2),\n      hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n      this.opacity\n    );\n  },\n  clamp() {\n    return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n  },\n  displayable() {\n    return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n        && (0 <= this.l && this.l <= 1)\n        && (0 <= this.opacity && this.opacity <= 1);\n  },\n  formatHsl() {\n    const a = clampa(this.opacity);\n    return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n  }\n}));\n\nfunction clamph(value) {\n  value = (value || 0) % 360;\n  return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n  return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n  return (h < 60 ? m1 + (m2 - m1) * h / 60\n      : h < 180 ? m2\n      : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n      : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n  var t2 = t1 * t1, t3 = t2 * t1;\n  return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n      + (4 - 6 * t2 + 3 * t3) * v1\n      + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n      + t3 * v3) / 6;\n}\n\nexport default function(values) {\n  var n = values.length - 1;\n  return function(t) {\n    var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n        v1 = values[i],\n        v2 = values[i + 1],\n        v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n        v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n    return basis((t - i / n) * n, v0, v1, v2, v3);\n  };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n  var n = values.length;\n  return function(t) {\n    var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n        v0 = values[(i + n - 1) % n],\n        v1 = values[i % n],\n        v2 = values[(i + 1) % n],\n        v3 = values[(i + 2) % n];\n    return basis((t - i / n) * n, v0, v1, v2, v3);\n  };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n  return function(t) {\n    return a + t * d;\n  };\n}\n\nfunction exponential(a, b, y) {\n  return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n    return Math.pow(a + t * b, y);\n  };\n}\n\nexport function hue(a, b) {\n  var d = b - a;\n  return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n  return (y = +y) === 1 ? nogamma : function(a, b) {\n    return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n  };\n}\n\nexport default function nogamma(a, b) {\n  var d = b - a;\n  return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n  var color = gamma(y);\n\n  function rgb(start, end) {\n    var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n        g = color(start.g, end.g),\n        b = color(start.b, end.b),\n        opacity = nogamma(start.opacity, end.opacity);\n    return function(t) {\n      start.r = r(t);\n      start.g = g(t);\n      start.b = b(t);\n      start.opacity = opacity(t);\n      return start + \"\";\n    };\n  }\n\n  rgb.gamma = rgbGamma;\n\n  return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n  return function(colors) {\n    var n = colors.length,\n        r = new Array(n),\n        g = new Array(n),\n        b = new Array(n),\n        i, color;\n    for (i = 0; i < n; ++i) {\n      color = colorRgb(colors[i]);\n      r[i] = color.r || 0;\n      g[i] = color.g || 0;\n      b[i] = color.b || 0;\n    }\n    r = spline(r);\n    g = spline(g);\n    b = spline(b);\n    color.opacity = 1;\n    return function(t) {\n      color.r = r(t);\n      color.g = g(t);\n      color.b = b(t);\n      return color + \"\";\n    };\n  };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n  if (!b) b = [];\n  var n = a ? Math.min(b.length, a.length) : 0,\n      c = b.slice(),\n      i;\n  return function(t) {\n    for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n    return c;\n  };\n}\n\nexport function isNumberArray(x) {\n  return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n  return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n  var nb = b ? b.length : 0,\n      na = a ? Math.min(nb, a.length) : 0,\n      x = new Array(na),\n      c = new Array(nb),\n      i;\n\n  for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n  for (; i < nb; ++i) c[i] = b[i];\n\n  return function(t) {\n    for (i = 0; i < na; ++i) c[i] = x[i](t);\n    return c;\n  };\n}\n","export default function(a, b) {\n  var d = new Date;\n  return a = +a, b = +b, function(t) {\n    return d.setTime(a * (1 - t) + b * t), d;\n  };\n}\n","export default function(a, b) {\n  return a = +a, b = +b, function(t) {\n    return a * (1 - t) + b * t;\n  };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n  var i = {},\n      c = {},\n      k;\n\n  if (a === null || typeof a !== \"object\") a = {};\n  if (b === null || typeof b !== \"object\") b = {};\n\n  for (k in b) {\n    if (k in a) {\n      i[k] = value(a[k], b[k]);\n    } else {\n      c[k] = b[k];\n    }\n  }\n\n  return function(t) {\n    for (k in i) c[k] = i[k](t);\n    return c;\n  };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n    reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n  return function() {\n    return b;\n  };\n}\n\nfunction one(b) {\n  return function(t) {\n    return b(t) + \"\";\n  };\n}\n\nexport default function(a, b) {\n  var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n      am, // current match in a\n      bm, // current match in b\n      bs, // string preceding current number in b, if any\n      i = -1, // index in s\n      s = [], // string constants and placeholders\n      q = []; // number interpolators\n\n  // Coerce inputs to strings.\n  a = a + \"\", b = b + \"\";\n\n  // Interpolate pairs of numbers in a & b.\n  while ((am = reA.exec(a))\n      && (bm = reB.exec(b))) {\n    if ((bs = bm.index) > bi) { // a string precedes the next number in b\n      bs = b.slice(bi, bs);\n      if (s[i]) s[i] += bs; // coalesce with previous string\n      else s[++i] = bs;\n    }\n    if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n      if (s[i]) s[i] += bm; // coalesce with previous string\n      else s[++i] = bm;\n    } else { // interpolate non-matching numbers\n      s[++i] = null;\n      q.push({i: i, x: number(am, bm)});\n    }\n    bi = reB.lastIndex;\n  }\n\n  // Add remains of b.\n  if (bi < b.length) {\n    bs = b.slice(bi);\n    if (s[i]) s[i] += bs; // coalesce with previous string\n    else s[++i] = bs;\n  }\n\n  // Special optimization for only a single match.\n  // Otherwise, interpolate each of the numbers and rejoin the string.\n  return s.length < 2 ? (q[0]\n      ? one(q[0].x)\n      : zero(b))\n      : (b = q.length, function(t) {\n          for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n          return s.join(\"\");\n        });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n  var t = typeof b, c;\n  return b == null || t === \"boolean\" ? constant(b)\n      : (t === \"number\" ? number\n      : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n      : b instanceof color ? rgb\n      : b instanceof Date ? date\n      : isNumberArray(b) ? numberArray\n      : Array.isArray(b) ? genericArray\n      : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n      : number)(a, b);\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n  translateX: 0,\n  translateY: 0,\n  rotate: 0,\n  skewX: 0,\n  scaleX: 1,\n  scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n  var scaleX, scaleY, skewX;\n  if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n  if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n  if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n  if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n  return {\n    translateX: e,\n    translateY: f,\n    rotate: Math.atan2(b, a) * degrees,\n    skewX: Math.atan(skewX) * degrees,\n    scaleX: scaleX,\n    scaleY: scaleY\n  };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n  const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n  return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n  if (value == null) return identity;\n  if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n  svgNode.setAttribute(\"transform\", value);\n  if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n  value = value.matrix;\n  return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n  function pop(s) {\n    return s.length ? s.pop() + \" \" : \"\";\n  }\n\n  function translate(xa, ya, xb, yb, s, q) {\n    if (xa !== xb || ya !== yb) {\n      var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n      q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n    } else if (xb || yb) {\n      s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n    }\n  }\n\n  function rotate(a, b, s, q) {\n    if (a !== b) {\n      if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n      q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n    } else if (b) {\n      s.push(pop(s) + \"rotate(\" + b + degParen);\n    }\n  }\n\n  function skewX(a, b, s, q) {\n    if (a !== b) {\n      q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n    } else if (b) {\n      s.push(pop(s) + \"skewX(\" + b + degParen);\n    }\n  }\n\n  function scale(xa, ya, xb, yb, s, q) {\n    if (xa !== xb || ya !== yb) {\n      var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n      q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n    } else if (xb !== 1 || yb !== 1) {\n      s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n    }\n  }\n\n  return function(a, b) {\n    var s = [], // string constants and placeholders\n        q = []; // number interpolators\n    a = parse(a), b = parse(b);\n    translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n    rotate(a.rotate, b.rotate, s, q);\n    skewX(a.skewX, b.skewX, s, q);\n    scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n    a = b = null; // gc\n    return function(t) {\n      var i = -1, n = q.length, o;\n      while (++i < n) s[(o = q[i]).i] = o.x(t);\n      return s.join(\"\");\n    };\n  };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n  return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n  return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n  return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n  // p0 = [ux0, uy0, w0]\n  // p1 = [ux1, uy1, w1]\n  function zoom(p0, p1) {\n    var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n        ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n        dx = ux1 - ux0,\n        dy = uy1 - uy0,\n        d2 = dx * dx + dy * dy,\n        i,\n        S;\n\n    // Special case for u0 ≅ u1.\n    if (d2 < epsilon2) {\n      S = Math.log(w1 / w0) / rho;\n      i = function(t) {\n        return [\n          ux0 + t * dx,\n          uy0 + t * dy,\n          w0 * Math.exp(rho * t * S)\n        ];\n      }\n    }\n\n    // General case.\n    else {\n      var d1 = Math.sqrt(d2),\n          b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n          b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n          r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n          r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n      S = (r1 - r0) / rho;\n      i = function(t) {\n        var s = t * S,\n            coshr0 = cosh(r0),\n            u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n        return [\n          ux0 + u * dx,\n          uy0 + u * dy,\n          w0 * coshr0 / cosh(rho * s + r0)\n        ];\n      }\n    }\n\n    i.duration = S * 1000 * rho / Math.SQRT2;\n\n    return i;\n  }\n\n  zoom.rho = function(_) {\n    var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n    return zoomRho(_1, _2, _4);\n  };\n\n  return zoom;\n})(Math.SQRT2, 2, 4);\n","var frame = 0, // is an animation frame pending?\n    timeout = 0, // is a timeout pending?\n    interval = 0, // are any timers active?\n    pokeDelay = 1000, // how frequently we check for clock skew\n    taskHead,\n    taskTail,\n    clockLast = 0,\n    clockNow = 0,\n    clockSkew = 0,\n    clock = typeof performance === \"object\" && performance.now ? performance : Date,\n    setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n  return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n  clockNow = 0;\n}\n\nexport function Timer() {\n  this._call =\n  this._time =\n  this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n  constructor: Timer,\n  restart: function(callback, delay, time) {\n    if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n    time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n    if (!this._next && taskTail !== this) {\n      if (taskTail) taskTail._next = this;\n      else taskHead = this;\n      taskTail = this;\n    }\n    this._call = callback;\n    this._time = time;\n    sleep();\n  },\n  stop: function() {\n    if (this._call) {\n      this._call = null;\n      this._time = Infinity;\n      sleep();\n    }\n  }\n};\n\nexport function timer(callback, delay, time) {\n  var t = new Timer;\n  t.restart(callback, delay, time);\n  return t;\n}\n\nexport function timerFlush() {\n  now(); // Get the current time, if not already set.\n  ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n  var t = taskHead, e;\n  while (t) {\n    if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n    t = t._next;\n  }\n  --frame;\n}\n\nfunction wake() {\n  clockNow = (clockLast = clock.now()) + clockSkew;\n  frame = timeout = 0;\n  try {\n    timerFlush();\n  } finally {\n    frame = 0;\n    nap();\n    clockNow = 0;\n  }\n}\n\nfunction poke() {\n  var now = clock.now(), delay = now - clockLast;\n  if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n  var t0, t1 = taskHead, t2, time = Infinity;\n  while (t1) {\n    if (t1._call) {\n      if (time > t1._time) time = t1._time;\n      t0 = t1, t1 = t1._next;\n    } else {\n      t2 = t1._next, t1._next = null;\n      t1 = t0 ? t0._next = t2 : taskHead = t2;\n    }\n  }\n  taskTail = t0;\n  sleep(time);\n}\n\nfunction sleep(time) {\n  if (frame) return; // Soonest alarm already set, or will be.\n  if (timeout) timeout = clearTimeout(timeout);\n  var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n  if (delay > 24) {\n    if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n    if (interval) interval = clearInterval(interval);\n  } else {\n    if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n    frame = 1, setFrame(wake);\n  }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n  var t = new Timer;\n  delay = delay == null ? 0 : +delay;\n  t.restart(elapsed => {\n    t.stop();\n    callback(elapsed + delay);\n  }, delay, time);\n  return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n  var schedules = node.__transition;\n  if (!schedules) node.__transition = {};\n  else if (id in schedules) return;\n  create(node, id, {\n    name: name,\n    index: index, // For context during callback.\n    group: group, // For context during callback.\n    on: emptyOn,\n    tween: emptyTween,\n    time: timing.time,\n    delay: timing.delay,\n    duration: timing.duration,\n    ease: timing.ease,\n    timer: null,\n    state: CREATED\n  });\n}\n\nexport function init(node, id) {\n  var schedule = get(node, id);\n  if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n  return schedule;\n}\n\nexport function set(node, id) {\n  var schedule = get(node, id);\n  if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n  return schedule;\n}\n\nexport function get(node, id) {\n  var schedule = node.__transition;\n  if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n  return schedule;\n}\n\nfunction create(node, id, self) {\n  var schedules = node.__transition,\n      tween;\n\n  // Initialize the self timer when the transition is created.\n  // Note the actual delay is not known until the first callback!\n  schedules[id] = self;\n  self.timer = timer(schedule, 0, self.time);\n\n  function schedule(elapsed) {\n    self.state = SCHEDULED;\n    self.timer.restart(start, self.delay, self.time);\n\n    // If the elapsed delay is less than our first sleep, start immediately.\n    if (self.delay <= elapsed) start(elapsed - self.delay);\n  }\n\n  function start(elapsed) {\n    var i, j, n, o;\n\n    // If the state is not SCHEDULED, then we previously errored on start.\n    if (self.state !== SCHEDULED) return stop();\n\n    for (i in schedules) {\n      o = schedules[i];\n      if (o.name !== self.name) continue;\n\n      // While this element already has a starting transition during this frame,\n      // defer starting an interrupting transition until that transition has a\n      // chance to tick (and possibly end); see d3/d3-transition#54!\n      if (o.state === STARTED) return timeout(start);\n\n      // Interrupt the active transition, if any.\n      if (o.state === RUNNING) {\n        o.state = ENDED;\n        o.timer.stop();\n        o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n        delete schedules[i];\n      }\n\n      // Cancel any pre-empted transitions.\n      else if (+i < id) {\n        o.state = ENDED;\n        o.timer.stop();\n        o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n        delete schedules[i];\n      }\n    }\n\n    // Defer the first tick to end of the current frame; see d3/d3#1576.\n    // Note the transition may be canceled after start and before the first tick!\n    // Note this must be scheduled before the start event; see d3/d3-transition#16!\n    // Assuming this is successful, subsequent callbacks go straight to tick.\n    timeout(function() {\n      if (self.state === STARTED) {\n        self.state = RUNNING;\n        self.timer.restart(tick, self.delay, self.time);\n        tick(elapsed);\n      }\n    });\n\n    // Dispatch the start event.\n    // Note this must be done before the tween are initialized.\n    self.state = STARTING;\n    self.on.call(\"start\", node, node.__data__, self.index, self.group);\n    if (self.state !== STARTING) return; // interrupted\n    self.state = STARTED;\n\n    // Initialize the tween, deleting null tween.\n    tween = new Array(n = self.tween.length);\n    for (i = 0, j = -1; i < n; ++i) {\n      if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n        tween[++j] = o;\n      }\n    }\n    tween.length = j + 1;\n  }\n\n  function tick(elapsed) {\n    var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n        i = -1,\n        n = tween.length;\n\n    while (++i < n) {\n      tween[i].call(node, t);\n    }\n\n    // Dispatch the end event.\n    if (self.state === ENDING) {\n      self.on.call(\"end\", node, node.__data__, self.index, self.group);\n      stop();\n    }\n  }\n\n  function stop() {\n    self.state = ENDED;\n    self.timer.stop();\n    delete schedules[id];\n    for (var i in schedules) return; // eslint-disable-line no-unused-vars\n    delete node.__transition;\n  }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n  var schedules = node.__transition,\n      schedule,\n      active,\n      empty = true,\n      i;\n\n  if (!schedules) return;\n\n  name = name == null ? null : name + \"\";\n\n  for (i in schedules) {\n    if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n    active = schedule.state > STARTING && schedule.state < ENDING;\n    schedule.state = ENDED;\n    schedule.timer.stop();\n    schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n    delete schedules[i];\n  }\n\n  if (empty) delete node.__transition;\n}\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n  return this.each(function() {\n    interrupt(this, name);\n  });\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n  var tween0, tween1;\n  return function() {\n    var schedule = set(this, id),\n        tween = schedule.tween;\n\n    // If this node shared tween with the previous node,\n    // just assign the updated shared tween and we’re done!\n    // Otherwise, copy-on-write.\n    if (tween !== tween0) {\n      tween1 = tween0 = tween;\n      for (var i = 0, n = tween1.length; i < n; ++i) {\n        if (tween1[i].name === name) {\n          tween1 = tween1.slice();\n          tween1.splice(i, 1);\n          break;\n        }\n      }\n    }\n\n    schedule.tween = tween1;\n  };\n}\n\nfunction tweenFunction(id, name, value) {\n  var tween0, tween1;\n  if (typeof value !== \"function\") throw new Error;\n  return function() {\n    var schedule = set(this, id),\n        tween = schedule.tween;\n\n    // If this node shared tween with the previous node,\n    // just assign the updated shared tween and we’re done!\n    // Otherwise, copy-on-write.\n    if (tween !== tween0) {\n      tween1 = (tween0 = tween).slice();\n      for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n        if (tween1[i].name === name) {\n          tween1[i] = t;\n          break;\n        }\n      }\n      if (i === n) tween1.push(t);\n    }\n\n    schedule.tween = tween1;\n  };\n}\n\nexport default function(name, value) {\n  var id = this._id;\n\n  name += \"\";\n\n  if (arguments.length < 2) {\n    var tween = get(this.node(), id).tween;\n    for (var i = 0, n = tween.length, t; i < n; ++i) {\n      if ((t = tween[i]).name === name) {\n        return t.value;\n      }\n    }\n    return null;\n  }\n\n  return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n  var id = transition._id;\n\n  transition.each(function() {\n    var schedule = set(this, id);\n    (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n  });\n\n  return function(node) {\n    return get(node, id).value[name];\n  };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n  var c;\n  return (typeof b === \"number\" ? interpolateNumber\n      : b instanceof color ? interpolateRgb\n      : (c = color(b)) ? (b = c, interpolateRgb)\n      : interpolateString)(a, b);\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n  return function() {\n    this.removeAttribute(name);\n  };\n}\n\nfunction attrRemoveNS(fullname) {\n  return function() {\n    this.removeAttributeNS(fullname.space, fullname.local);\n  };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = this.getAttribute(name);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = this.getAttributeNS(fullname.space, fullname.local);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction attrFunction(name, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0, value1 = value(this), string1;\n    if (value1 == null) return void this.removeAttribute(name);\n    string0 = this.getAttribute(name);\n    string1 = value1 + \"\";\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0, value1 = value(this), string1;\n    if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n    string0 = this.getAttributeNS(fullname.space, fullname.local);\n    string1 = value1 + \"\";\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nexport default function(name, value) {\n  var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n  return this.attrTween(name, typeof value === \"function\"\n      ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n      : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n      : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n  return function(t) {\n    this.setAttribute(name, i.call(this, t));\n  };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n  return function(t) {\n    this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n  };\n}\n\nfunction attrTweenNS(fullname, value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nfunction attrTween(name, value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(name, value) {\n  var key = \"attr.\" + name;\n  if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  var fullname = namespace(name);\n  return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n  return function() {\n    init(this, id).delay = +value.apply(this, arguments);\n  };\n}\n\nfunction delayConstant(id, value) {\n  return value = +value, function() {\n    init(this, id).delay = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each((typeof value === \"function\"\n          ? delayFunction\n          : delayConstant)(id, value))\n      : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n  return function() {\n    set(this, id).duration = +value.apply(this, arguments);\n  };\n}\n\nfunction durationConstant(id, value) {\n  return value = +value, function() {\n    set(this, id).duration = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each((typeof value === \"function\"\n          ? durationFunction\n          : durationConstant)(id, value))\n      : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n  if (typeof value !== \"function\") throw new Error;\n  return function() {\n    set(this, id).ease = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each(easeConstant(id, value))\n      : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (typeof v !== \"function\") throw new Error;\n    set(this, id).ease = v;\n  };\n}\n\nexport default function(value) {\n  if (typeof value !== \"function\") throw new Error;\n  return this.each(easeVarying(this._id, value));\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n  if (typeof match !== \"function\") match = matcher(match);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n      if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n        subgroup.push(node);\n      }\n    }\n  }\n\n  return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n  if (transition._id !== this._id) throw new Error;\n\n  for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n    for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group0[i] || group1[i]) {\n        merge[i] = node;\n      }\n    }\n  }\n\n  for (; j < m0; ++j) {\n    merges[j] = groups0[j];\n  }\n\n  return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n  return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n    var i = t.indexOf(\".\");\n    if (i >= 0) t = t.slice(0, i);\n    return !t || t === \"start\";\n  });\n}\n\nfunction onFunction(id, name, listener) {\n  var on0, on1, sit = start(name) ? init : set;\n  return function() {\n    var schedule = sit(this, id),\n        on = schedule.on;\n\n    // If this node shared a dispatch with the previous node,\n    // just assign the updated shared dispatch and we’re done!\n    // Otherwise, copy-on-write.\n    if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n    schedule.on = on1;\n  };\n}\n\nexport default function(name, listener) {\n  var id = this._id;\n\n  return arguments.length < 2\n      ? get(this.node(), id).on.on(name)\n      : this.each(onFunction(id, name, listener));\n}\n","function removeFunction(id) {\n  return function() {\n    var parent = this.parentNode;\n    for (var i in this.__transition) if (+i !== id) return;\n    if (parent) parent.removeChild(this);\n  };\n}\n\nexport default function() {\n  return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n  var name = this._name,\n      id = this._id;\n\n  if (typeof select !== \"function\") select = selector(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n      if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n        if (\"__data__\" in node) subnode.__data__ = node.__data__;\n        subgroup[i] = subnode;\n        schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n      }\n    }\n  }\n\n  return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n  var name = this._name,\n      id = this._id;\n\n  if (typeof select !== \"function\") select = selectorAll(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n          if (child = children[k]) {\n            schedule(child, name, id, k, children, inherit);\n          }\n        }\n        subgroups.push(children);\n        parents.push(node);\n      }\n    }\n  }\n\n  return new Transition(subgroups, parents, name, id);\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n  return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0 = style(this, name),\n        string1 = (this.style.removeProperty(name), style(this, name));\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, string10 = string1);\n  };\n}\n\nfunction styleRemove(name) {\n  return function() {\n    this.style.removeProperty(name);\n  };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = style(this, name);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction styleFunction(name, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0 = style(this, name),\n        value1 = value(this),\n        string1 = value1 + \"\";\n    if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nfunction styleMaybeRemove(id, name) {\n  var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n  return function() {\n    var schedule = set(this, id),\n        on = schedule.on,\n        listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n    // If this node shared a dispatch with the previous node,\n    // just assign the updated shared dispatch and we’re done!\n    // Otherwise, copy-on-write.\n    if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n    schedule.on = on1;\n  };\n}\n\nexport default function(name, value, priority) {\n  var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n  return value == null ? this\n      .styleTween(name, styleNull(name, i))\n      .on(\"end.style.\" + name, styleRemove(name))\n    : typeof value === \"function\" ? this\n      .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n      .each(styleMaybeRemove(this._id, name))\n    : this\n      .styleTween(name, styleConstant(name, i, value), priority)\n      .on(\"end.style.\" + name, null);\n}\n","function styleInterpolate(name, i, priority) {\n  return function(t) {\n    this.style.setProperty(name, i.call(this, t), priority);\n  };\n}\n\nfunction styleTween(name, value, priority) {\n  var t, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n    return t;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(name, value, priority) {\n  var key = \"style.\" + (name += \"\");\n  if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n  return function() {\n    this.textContent = value;\n  };\n}\n\nfunction textFunction(value) {\n  return function() {\n    var value1 = value(this);\n    this.textContent = value1 == null ? \"\" : value1;\n  };\n}\n\nexport default function(value) {\n  return this.tween(\"text\", typeof value === \"function\"\n      ? textFunction(tweenValue(this, \"text\", value))\n      : textConstant(value == null ? \"\" : value + \"\"));\n}\n","function textInterpolate(i) {\n  return function(t) {\n    this.textContent = i.call(this, t);\n  };\n}\n\nfunction textTween(value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(value) {\n  var key = \"text\";\n  if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  return this.tween(key, textTween(value));\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n  var name = this._name,\n      id0 = this._id,\n      id1 = newId();\n\n  for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        var inherit = get(node, id0);\n        schedule(node, name, id1, i, group, {\n          time: inherit.time + inherit.delay + inherit.duration,\n          delay: 0,\n          duration: inherit.duration,\n          ease: inherit.ease\n        });\n      }\n    }\n  }\n\n  return new Transition(groups, this._parents, name, id1);\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n  var on0, on1, that = this, id = that._id, size = that.size();\n  return new Promise(function(resolve, reject) {\n    var cancel = {value: reject},\n        end = {value: function() { if (--size === 0) resolve(); }};\n\n    that.each(function() {\n      var schedule = set(this, id),\n          on = schedule.on;\n\n      // If this node shared a dispatch with the previous node,\n      // just assign the updated shared dispatch and we’re done!\n      // Otherwise, copy-on-write.\n      if (on !== on0) {\n        on1 = (on0 = on).copy();\n        on1._.cancel.push(cancel);\n        on1._.interrupt.push(cancel);\n        on1._.end.push(end);\n      }\n\n      schedule.on = on1;\n    });\n\n    // The selection was empty, resolve end immediately\n    if (size === 0) resolve();\n  });\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n  this._groups = groups;\n  this._parents = parents;\n  this._name = name;\n  this._id = id;\n}\n\nexport default function transition(name) {\n  return selection().transition(name);\n}\n\nexport function newId() {\n  return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n  constructor: Transition,\n  select: transition_select,\n  selectAll: transition_selectAll,\n  selectChild: selection_prototype.selectChild,\n  selectChildren: selection_prototype.selectChildren,\n  filter: transition_filter,\n  merge: transition_merge,\n  selection: transition_selection,\n  transition: transition_transition,\n  call: selection_prototype.call,\n  nodes: selection_prototype.nodes,\n  node: selection_prototype.node,\n  size: selection_prototype.size,\n  empty: selection_prototype.empty,\n  each: selection_prototype.each,\n  on: transition_on,\n  attr: transition_attr,\n  attrTween: transition_attrTween,\n  style: transition_style,\n  styleTween: transition_styleTween,\n  text: transition_text,\n  textTween: transition_textTween,\n  remove: transition_remove,\n  tween: transition_tween,\n  delay: transition_delay,\n  duration: transition_duration,\n  ease: transition_ease,\n  easeVarying: transition_easeVarying,\n  end: transition_end,\n  [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n","export function cubicIn(t) {\n  return t * t * t;\n}\n\nexport function cubicOut(t) {\n  return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n  time: null, // Set on use.\n  delay: 0,\n  duration: 250,\n  ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n  var timing;\n  while (!(timing = node.__transition) || !(timing = timing[id])) {\n    if (!(node = node.parentNode)) {\n      throw new Error(`transition ${id} not found`);\n    }\n  }\n  return timing;\n}\n\nexport default function(name) {\n  var id,\n      timing;\n\n  if (name instanceof Transition) {\n    id = name._id, name = name._name;\n  } else {\n    id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n  }\n\n  for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        schedule(node, name, id, i, group, timing || inherit(node, id));\n      }\n    }\n  }\n\n  return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","export default x => () => x;\n","export default function ZoomEvent(type, {\n  sourceEvent,\n  target,\n  transform,\n  dispatch\n}) {\n  Object.defineProperties(this, {\n    type: {value: type, enumerable: true, configurable: true},\n    sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n    target: {value: target, enumerable: true, configurable: true},\n    transform: {value: transform, enumerable: true, configurable: true},\n    _: {value: dispatch}\n  });\n}\n","export function Transform(k, x, y) {\n  this.k = k;\n  this.x = x;\n  this.y = y;\n}\n\nTransform.prototype = {\n  constructor: Transform,\n  scale: function(k) {\n    return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n  },\n  translate: function(x, y) {\n    return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n  },\n  apply: function(point) {\n    return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n  },\n  applyX: function(x) {\n    return x * this.k + this.x;\n  },\n  applyY: function(y) {\n    return y * this.k + this.y;\n  },\n  invert: function(location) {\n    return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n  },\n  invertX: function(x) {\n    return (x - this.x) / this.k;\n  },\n  invertY: function(y) {\n    return (y - this.y) / this.k;\n  },\n  rescaleX: function(x) {\n    return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n  },\n  rescaleY: function(y) {\n    return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n  },\n  toString: function() {\n    return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n  }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n  while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n  return node.__zoom;\n}\n","export function nopropagation(event) {\n  event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n  event.preventDefault();\n  event.stopImmediatePropagation();\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {select, pointer} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport ZoomEvent from \"./event.js\";\nimport {Transform, identity} from \"./transform.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n  return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n  var e = this;\n  if (e instanceof SVGElement) {\n    e = e.ownerSVGElement || e;\n    if (e.hasAttribute(\"viewBox\")) {\n      e = e.viewBox.baseVal;\n      return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n    }\n    return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n  }\n  return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n  return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n  return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n  return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n  var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n      dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n      dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n      dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n  return transform.translate(\n    dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n    dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n  );\n}\n\nexport default function() {\n  var filter = defaultFilter,\n      extent = defaultExtent,\n      constrain = defaultConstrain,\n      wheelDelta = defaultWheelDelta,\n      touchable = defaultTouchable,\n      scaleExtent = [0, Infinity],\n      translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n      duration = 250,\n      interpolate = interpolateZoom,\n      listeners = dispatch(\"start\", \"zoom\", \"end\"),\n      touchstarting,\n      touchfirst,\n      touchending,\n      touchDelay = 500,\n      wheelDelay = 150,\n      clickDistance2 = 0,\n      tapDistance = 10;\n\n  function zoom(selection) {\n    selection\n        .property(\"__zoom\", defaultTransform)\n        .on(\"wheel.zoom\", wheeled, {passive: false})\n        .on(\"mousedown.zoom\", mousedowned)\n        .on(\"dblclick.zoom\", dblclicked)\n      .filter(touchable)\n        .on(\"touchstart.zoom\", touchstarted)\n        .on(\"touchmove.zoom\", touchmoved)\n        .on(\"touchend.zoom touchcancel.zoom\", touchended)\n        .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n  }\n\n  zoom.transform = function(collection, transform, point, event) {\n    var selection = collection.selection ? collection.selection() : collection;\n    selection.property(\"__zoom\", defaultTransform);\n    if (collection !== selection) {\n      schedule(collection, transform, point, event);\n    } else {\n      selection.interrupt().each(function() {\n        gesture(this, arguments)\n          .event(event)\n          .start()\n          .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n          .end();\n      });\n    }\n  };\n\n  zoom.scaleBy = function(selection, k, p, event) {\n    zoom.scaleTo(selection, function() {\n      var k0 = this.__zoom.k,\n          k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n      return k0 * k1;\n    }, p, event);\n  };\n\n  zoom.scaleTo = function(selection, k, p, event) {\n    zoom.transform(selection, function() {\n      var e = extent.apply(this, arguments),\n          t0 = this.__zoom,\n          p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n          p1 = t0.invert(p0),\n          k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n      return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n    }, p, event);\n  };\n\n  zoom.translateBy = function(selection, x, y, event) {\n    zoom.transform(selection, function() {\n      return constrain(this.__zoom.translate(\n        typeof x === \"function\" ? x.apply(this, arguments) : x,\n        typeof y === \"function\" ? y.apply(this, arguments) : y\n      ), extent.apply(this, arguments), translateExtent);\n    }, null, event);\n  };\n\n  zoom.translateTo = function(selection, x, y, p, event) {\n    zoom.transform(selection, function() {\n      var e = extent.apply(this, arguments),\n          t = this.__zoom,\n          p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n      return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n        typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n        typeof y === \"function\" ? -y.apply(this, arguments) : -y\n      ), e, translateExtent);\n    }, p, event);\n  };\n\n  function scale(transform, k) {\n    k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n    return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n  }\n\n  function translate(transform, p0, p1) {\n    var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n    return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n  }\n\n  function centroid(extent) {\n    return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n  }\n\n  function schedule(transition, transform, point, event) {\n    transition\n        .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n        .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n        .tween(\"zoom\", function() {\n          var that = this,\n              args = arguments,\n              g = gesture(that, args).event(event),\n              e = extent.apply(that, args),\n              p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n              w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n              a = that.__zoom,\n              b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n              i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n          return function(t) {\n            if (t === 1) t = b; // Avoid rounding error on end.\n            else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n            g.zoom(null, t);\n          };\n        });\n  }\n\n  function gesture(that, args, clean) {\n    return (!clean && that.__zooming) || new Gesture(that, args);\n  }\n\n  function Gesture(that, args) {\n    this.that = that;\n    this.args = args;\n    this.active = 0;\n    this.sourceEvent = null;\n    this.extent = extent.apply(that, args);\n    this.taps = 0;\n  }\n\n  Gesture.prototype = {\n    event: function(event) {\n      if (event) this.sourceEvent = event;\n      return this;\n    },\n    start: function() {\n      if (++this.active === 1) {\n        this.that.__zooming = this;\n        this.emit(\"start\");\n      }\n      return this;\n    },\n    zoom: function(key, transform) {\n      if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n      if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n      if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n      this.that.__zoom = transform;\n      this.emit(\"zoom\");\n      return this;\n    },\n    end: function() {\n      if (--this.active === 0) {\n        delete this.that.__zooming;\n        this.emit(\"end\");\n      }\n      return this;\n    },\n    emit: function(type) {\n      var d = select(this.that).datum();\n      listeners.call(\n        type,\n        this.that,\n        new ZoomEvent(type, {\n          sourceEvent: this.sourceEvent,\n          target: zoom,\n          type,\n          transform: this.that.__zoom,\n          dispatch: listeners\n        }),\n        d\n      );\n    }\n  };\n\n  function wheeled(event, ...args) {\n    if (!filter.apply(this, arguments)) return;\n    var g = gesture(this, args).event(event),\n        t = this.__zoom,\n        k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n        p = pointer(event);\n\n    // If the mouse is in the same location as before, reuse it.\n    // If there were recent wheel events, reset the wheel idle timeout.\n    if (g.wheel) {\n      if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n        g.mouse[1] = t.invert(g.mouse[0] = p);\n      }\n      clearTimeout(g.wheel);\n    }\n\n    // If this wheel event won’t trigger a transform change, ignore it.\n    else if (t.k === k) return;\n\n    // Otherwise, capture the mouse point and location at the start.\n    else {\n      g.mouse = [p, t.invert(p)];\n      interrupt(this);\n      g.start();\n    }\n\n    noevent(event);\n    g.wheel = setTimeout(wheelidled, wheelDelay);\n    g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n    function wheelidled() {\n      g.wheel = null;\n      g.end();\n    }\n  }\n\n  function mousedowned(event, ...args) {\n    if (touchending || !filter.apply(this, arguments)) return;\n    var currentTarget = event.currentTarget,\n        g = gesture(this, args, true).event(event),\n        v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n        p = pointer(event, currentTarget),\n        x0 = event.clientX,\n        y0 = event.clientY;\n\n    dragDisable(event.view);\n    nopropagation(event);\n    g.mouse = [p, this.__zoom.invert(p)];\n    interrupt(this);\n    g.start();\n\n    function mousemoved(event) {\n      noevent(event);\n      if (!g.moved) {\n        var dx = event.clientX - x0, dy = event.clientY - y0;\n        g.moved = dx * dx + dy * dy > clickDistance2;\n      }\n      g.event(event)\n       .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n    }\n\n    function mouseupped(event) {\n      v.on(\"mousemove.zoom mouseup.zoom\", null);\n      dragEnable(event.view, g.moved);\n      noevent(event);\n      g.event(event).end();\n    }\n  }\n\n  function dblclicked(event, ...args) {\n    if (!filter.apply(this, arguments)) return;\n    var t0 = this.__zoom,\n        p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n        p1 = t0.invert(p0),\n        k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n        t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n    noevent(event);\n    if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event);\n    else select(this).call(zoom.transform, t1, p0, event);\n  }\n\n  function touchstarted(event, ...args) {\n    if (!filter.apply(this, arguments)) return;\n    var touches = event.touches,\n        n = touches.length,\n        g = gesture(this, args, event.changedTouches.length === n).event(event),\n        started, i, t, p;\n\n    nopropagation(event);\n    for (i = 0; i < n; ++i) {\n      t = touches[i], p = pointer(t, this);\n      p = [p, this.__zoom.invert(p), t.identifier];\n      if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n      else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n    }\n\n    if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n    if (started) {\n      if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n      interrupt(this);\n      g.start();\n    }\n  }\n\n  function touchmoved(event, ...args) {\n    if (!this.__zooming) return;\n    var g = gesture(this, args).event(event),\n        touches = event.changedTouches,\n        n = touches.length, i, t, p, l;\n\n    noevent(event);\n    for (i = 0; i < n; ++i) {\n      t = touches[i], p = pointer(t, this);\n      if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n      else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n    }\n    t = g.that.__zoom;\n    if (g.touch1) {\n      var p0 = g.touch0[0], l0 = g.touch0[1],\n          p1 = g.touch1[0], l1 = g.touch1[1],\n          dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n          dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n      t = scale(t, Math.sqrt(dp / dl));\n      p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n      l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n    }\n    else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n    else return;\n\n    g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n  }\n\n  function touchended(event, ...args) {\n    if (!this.__zooming) return;\n    var g = gesture(this, args).event(event),\n        touches = event.changedTouches,\n        n = touches.length, i, t;\n\n    nopropagation(event);\n    if (touchending) clearTimeout(touchending);\n    touchending = setTimeout(function() { touchending = null; }, touchDelay);\n    for (i = 0; i < n; ++i) {\n      t = touches[i];\n      if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n      else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n    }\n    if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n    if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n    else {\n      g.end();\n      // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n      if (g.taps === 2) {\n        t = pointer(t, this);\n        if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n          var p = select(this).on(\"dblclick.zoom\");\n          if (p) p.apply(this, arguments);\n        }\n      }\n    }\n  }\n\n  zoom.wheelDelta = function(_) {\n    return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n  };\n\n  zoom.filter = function(_) {\n    return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n  };\n\n  zoom.touchable = function(_) {\n    return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n  };\n\n  zoom.extent = function(_) {\n    return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n  };\n\n  zoom.scaleExtent = function(_) {\n    return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n  };\n\n  zoom.translateExtent = function(_) {\n    return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n  };\n\n  zoom.constrain = function(_) {\n    return arguments.length ? (constrain = _, zoom) : constrain;\n  };\n\n  zoom.duration = function(_) {\n    return arguments.length ? (duration = +_, zoom) : duration;\n  };\n\n  zoom.interpolate = function(_) {\n    return arguments.length ? (interpolate = _, zoom) : interpolate;\n  };\n\n  zoom.on = function() {\n    var value = listeners.on.apply(listeners, arguments);\n    return value === listeners ? zoom : value;\n  };\n\n  zoom.clickDistance = function(_) {\n    return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n  };\n\n  zoom.tapDistance = function(_) {\n    return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n  };\n\n  return zoom;\n}\n","import { drag } from 'd3-drag';\nimport { select, pointer } from 'd3-selection';\nimport { zoom, zoomIdentity, zoomTransform } from 'd3-zoom';\nimport { interpolateZoom, interpolate } from 'd3-interpolate';\n\nconst errorMessages = {\n    error001: (lib = 'react') => `Seems like you have not used ${lib === 'svelte' ? 'SvelteFlowProvider' : 'ReactFlowProvider'} as an ancestor. Help: https://${lib}flow.dev/error#001`,\n    error002: () => \"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.\",\n    error003: (nodeType) => `Node type \"${nodeType}\" not found. Using fallback type \"default\".`,\n    error004: () => 'The parent container needs a width and a height to render the graph.',\n    error005: () => 'Only child nodes can use a parent extent.',\n    error006: () => \"Can't create edge. An edge needs a source and a target.\",\n    error007: (id) => `The old edge with id=${id} does not exist.`,\n    error009: (type) => `Marker type \"${type}\" doesn't exist.`,\n    error008: (handleType, { id, sourceHandle, targetHandle }) => `Couldn't create edge for ${handleType} handle id: \"${handleType === 'source' ? sourceHandle : targetHandle}\", edge id: ${id}.`,\n    error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.',\n    error011: (edgeType) => `Edge type \"${edgeType}\" not found. Using fallback type \"default\".`,\n    error012: (id) => `Node with id \"${id}\" does not exist, it may have been removed. This can happen when a node is deleted before the \"onNodeClick\" handler is called.`,\n    error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`,\n    error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.',\n    error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.',\n    error016: (id) => `Edge with id \"${id}\" does not exist, it may have been removed. This can happen when an edge is deleted before the \"onEdgeClick\" handler is called.`,\n};\nconst infiniteExtent = [\n    [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n    [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n];\nconst elementSelectionKeys = ['Enter', ' ', 'Escape'];\nconst defaultAriaLabelConfig = {\n    'node.a11yDescription.default': 'Press enter or space to select a node. Press delete to remove it and escape to cancel.',\n    'node.a11yDescription.keyboardDisabled': 'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.',\n    'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,\n    'edge.a11yDescription.default': 'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.',\n    // Control elements\n    'controls.ariaLabel': 'Control Panel',\n    'controls.zoomIn.ariaLabel': 'Zoom In',\n    'controls.zoomOut.ariaLabel': 'Zoom Out',\n    'controls.fitView.ariaLabel': 'Fit View',\n    'controls.interactive.ariaLabel': 'Toggle Interactivity',\n    // Mini map\n    'minimap.ariaLabel': 'Mini Map',\n    // Handle\n    'handle.ariaLabel': 'Handle',\n};\n\n/**\n * The `ConnectionMode` is used to set the mode of connection between nodes.\n * The `Strict` mode is the default one and only allows source to target edges.\n * `Loose` mode allows source to source and target to target edges as well.\n *\n * @public\n */\nvar ConnectionMode;\n(function (ConnectionMode) {\n    ConnectionMode[\"Strict\"] = \"strict\";\n    ConnectionMode[\"Loose\"] = \"loose\";\n})(ConnectionMode || (ConnectionMode = {}));\n/**\n * This enum is used to set the different modes of panning the viewport when the\n * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling\n * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict\n * scroll panning to only the vertical or horizontal axis, respectively.\n *\n * @public\n */\nvar PanOnScrollMode;\n(function (PanOnScrollMode) {\n    PanOnScrollMode[\"Free\"] = \"free\";\n    PanOnScrollMode[\"Vertical\"] = \"vertical\";\n    PanOnScrollMode[\"Horizontal\"] = \"horizontal\";\n})(PanOnScrollMode || (PanOnScrollMode = {}));\nvar SelectionMode;\n(function (SelectionMode) {\n    SelectionMode[\"Partial\"] = \"partial\";\n    SelectionMode[\"Full\"] = \"full\";\n})(SelectionMode || (SelectionMode = {}));\nconst initialConnection = {\n    inProgress: false,\n    isValid: null,\n    from: null,\n    fromHandle: null,\n    fromPosition: null,\n    fromNode: null,\n    to: null,\n    toHandle: null,\n    toPosition: null,\n    toNode: null,\n    pointer: null,\n};\n\n/**\n * If you set the `connectionLineType` prop on your [`<ReactFlow />`](/api-reference/react-flow#connection-connectionLineType)\n *component, it will dictate the style of connection line rendered when creating\n *new edges.\n *\n * @public\n *\n * @remarks If you choose to render a custom connection line component, this value will be\n *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props).\n */\nvar ConnectionLineType;\n(function (ConnectionLineType) {\n    ConnectionLineType[\"Bezier\"] = \"default\";\n    ConnectionLineType[\"Straight\"] = \"straight\";\n    ConnectionLineType[\"Step\"] = \"step\";\n    ConnectionLineType[\"SmoothStep\"] = \"smoothstep\";\n    ConnectionLineType[\"SimpleBezier\"] = \"simplebezier\";\n})(ConnectionLineType || (ConnectionLineType = {}));\n/**\n * Edges may optionally have a marker on either end. The MarkerType type enumerates\n * the options available to you when configuring a given marker.\n *\n * @public\n */\nvar MarkerType;\n(function (MarkerType) {\n    MarkerType[\"Arrow\"] = \"arrow\";\n    MarkerType[\"ArrowClosed\"] = \"arrowclosed\";\n})(MarkerType || (MarkerType = {}));\n\n/**\n * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a\n * component in the corners of a container, the `Position` enum is less precise and used\n * primarily in relation to edges and handles.\n *\n * @public\n */\nvar Position;\n(function (Position) {\n    Position[\"Left\"] = \"left\";\n    Position[\"Top\"] = \"top\";\n    Position[\"Right\"] = \"right\";\n    Position[\"Bottom\"] = \"bottom\";\n})(Position || (Position = {}));\nconst oppositePosition = {\n    [Position.Left]: Position.Right,\n    [Position.Right]: Position.Left,\n    [Position.Top]: Position.Bottom,\n    [Position.Bottom]: Position.Top,\n};\n\n/**\n * Test whether an object is usable as an Edge\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n */\nconst isEdgeBase = (element) => !!element && typeof element === 'object' && 'id' in element && 'source' in element && 'target' in element;\n/**\n * Test whether an object is usable as a Node\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n */\nconst isNodeBase = (element) => !!element && typeof element === 'object' && 'id' in element && 'position' in element && !('source' in element) && !('target' in element);\nconst isInternalNodeBase = (element) => !!element && typeof element === 'object' && 'id' in element && 'internals' in element && !('source' in element) && !('target' in element);\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _target_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the source is the given node.\n *\n * @example\n * ```ts\n *import { getOutgoers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const outgoers = getOutgoers(\n *  { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n *  nodes,\n *  edges,\n *);\n *```\n */\nconst getOutgoers = (node, nodes, edges) => {\n    if (!node.id) {\n        return [];\n    }\n    const outgoerIds = new Set();\n    edges.forEach((edge) => {\n        if (edge.source === node.id) {\n            outgoerIds.add(edge.target);\n        }\n    });\n    return nodes.filter((n) => outgoerIds.has(n.id));\n};\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _source_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the target is the given node.\n *\n * @example\n * ```ts\n *import { getIncomers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const incomers = getIncomers(\n *  { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n *  nodes,\n *  edges,\n *);\n *```\n */\nconst getIncomers = (node, nodes, edges) => {\n    if (!node.id) {\n        return [];\n    }\n    const incomersIds = new Set();\n    edges.forEach((edge) => {\n        if (edge.target === node.id) {\n            incomersIds.add(edge.source);\n        }\n    });\n    return nodes.filter((n) => incomersIds.has(n.id));\n};\nconst getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {\n    const { width, height } = getNodeDimensions(node);\n    const origin = node.origin ?? nodeOrigin;\n    const offsetX = width * origin[0];\n    const offsetY = height * origin[1];\n    return {\n        x: node.position.x - offsetX,\n        y: node.position.y - offsetY,\n    };\n};\n/**\n * Returns the bounding box that contains all the given nodes in an array. This can\n * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds)\n * to calculate the correct transform to fit the given nodes in a viewport.\n * @public\n * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.\n * @param nodes - Nodes to calculate the bounds for.\n * @returns Bounding box enclosing all nodes.\n *\n * @remarks This function was previously called `getRectOfNodes`\n *\n * @example\n * ```js\n *import { getNodesBounds } from '@xyflow/react';\n *\n *const nodes = [\n *  {\n *    id: 'a',\n *    position: { x: 0, y: 0 },\n *    data: { label: 'a' },\n *    width: 50,\n *    height: 25,\n *  },\n *  {\n *    id: 'b',\n *    position: { x: 100, y: 100 },\n *    data: { label: 'b' },\n *    width: 50,\n *    height: 25,\n *  },\n *];\n *\n *const bounds = getNodesBounds(nodes);\n *```\n */\nconst getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => {\n    if (process.env.NODE_ENV === 'development' && !params.nodeLookup) {\n        console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.');\n    }\n    if (nodes.length === 0) {\n        return { x: 0, y: 0, width: 0, height: 0 };\n    }\n    let hasNode = false;\n    const box = nodes.reduce((currBox, nodeOrId) => {\n        const isId = typeof nodeOrId === 'string';\n        let currentNode = !params.nodeLookup && !isId ? nodeOrId : undefined;\n        if (params.nodeLookup) {\n            currentNode = isId\n                ? params.nodeLookup.get(nodeOrId)\n                : !isInternalNodeBase(nodeOrId)\n                    ? params.nodeLookup.get(nodeOrId.id)\n                    : nodeOrId;\n        }\n        /*\n         * Skip ids/nodes that can't be resolved (e.g. a stale or already-removed id).\n         * Merging a phantom box at the origin would stretch the bounds to include\n         * (0, 0). This mirrors getInternalNodesBounds, which skips unmatched nodes.\n         */\n        if (!currentNode) {\n            return currBox;\n        }\n        hasNode = true;\n        return getBoundsOfBoxes(currBox, nodeToBox(currentNode, params.nodeOrigin));\n    }, { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity });\n    return hasNode ? boxToRect(box) : { x: 0, y: 0, width: 0, height: 0 };\n};\n/**\n * Determines a bounding box that contains all given nodes in an array\n * @internal\n */\nconst getInternalNodesBounds = (nodeLookup, params = {}) => {\n    let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity };\n    let hasVisibleNodes = false;\n    nodeLookup.forEach((node) => {\n        if (params.filter === undefined || params.filter(node)) {\n            box = getBoundsOfBoxes(box, nodeToBox(node));\n            hasVisibleNodes = true;\n        }\n    });\n    return hasVisibleNodes ? boxToRect(box) : { x: 0, y: 0, width: 0, height: 0 };\n};\nconst getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = false, \n// set excludeNonSelectableNodes if you want to pay attention to the nodes \"selectable\" attribute\nexcludeNonSelectableNodes = false) => {\n    // viewport in flow coordinates, as scalars to avoid a Rect allocation per node\n    const paneX = (rect.x - tx) / tScale;\n    const paneY = (rect.y - ty) / tScale;\n    const paneWidth = rect.width / tScale;\n    const paneHeight = rect.height / tScale;\n    const visibleNodes = [];\n    for (const node of nodes.values()) {\n        const { measured, selectable = true, hidden = false } = node;\n        if ((excludeNonSelectableNodes && !selectable) || hidden) {\n            continue;\n        }\n        const width = measured.width ?? node.width ?? node.initialWidth ?? 0;\n        const height = measured.height ?? node.height ?? node.initialHeight ?? 0;\n        const { x, y } = node.internals.positionAbsolute;\n        const overlappingArea = getRectsOverlappingArea(paneX, paneY, paneWidth, paneHeight, x, y, width, height);\n        const area = width * height;\n        const partiallyVisible = partially && overlappingArea > 0;\n        const forceInitialRender = !node.internals.handleBounds;\n        const isVisible = forceInitialRender || partiallyVisible || overlappingArea >= area;\n        if (isVisible || node.dragging) {\n            visibleNodes.push(node);\n        }\n    }\n    return visibleNodes;\n};\n/**\n * This utility filters an array of edges, keeping only those where either the source or target\n * node is present in the given array of nodes.\n * @public\n * @param nodes - Nodes you want to get the connected edges for.\n * @param edges - All edges.\n * @returns Array of edges that connect any of the given nodes with each other.\n *\n * @example\n * ```js\n *import { getConnectedEdges } from '@xyflow/react';\n *\n *const nodes = [\n *  { id: 'a', position: { x: 0, y: 0 } },\n *  { id: 'b', position: { x: 100, y: 0 } },\n *];\n *\n *const edges = [\n *  { id: 'a->c', source: 'a', target: 'c' },\n *  { id: 'c->d', source: 'c', target: 'd' },\n *];\n *\n *const connectedEdges = getConnectedEdges(nodes, edges);\n * // => [{ id: 'a->c', source: 'a', target: 'c' }]\n *```\n */\nconst getConnectedEdges = (nodes, edges) => {\n    const nodeIds = new Set();\n    nodes.forEach((node) => {\n        nodeIds.add(node.id);\n    });\n    return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target));\n};\nfunction getFitViewNodes(nodeLookup, options) {\n    const fitViewNodes = new Map();\n    const optionNodeIds = options?.nodes ? new Set(options.nodes.map((node) => node.id)) : null;\n    nodeLookup.forEach((n) => {\n        let isVisible;\n        if (options?.includeHiddenNodes) {\n            /*\n             * when hidden nodes are included they were never rendered, so they have no\n             * measured size. Fall back to the declared dimensions (same fallback as\n             * nodeToBox) so a hidden node with an intrinsic size still contributes to\n             * the fit bounds instead of being dropped by a measured-only check. (#5841)\n             */\n            const { width, height } = getNodeDimensions(n);\n            isVisible = width > 0 && height > 0;\n        }\n        else {\n            isVisible = Boolean(n.measured.width && n.measured.height && !n.hidden);\n        }\n        if (isVisible && (!optionNodeIds || optionNodeIds.has(n.id))) {\n            fitViewNodes.set(n.id, n);\n        }\n    });\n    return fitViewNodes;\n}\nasync function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {\n    if (nodes.size === 0) {\n        return true;\n    }\n    const nodesToFit = getFitViewNodes(nodes, options);\n    const bounds = getInternalNodesBounds(nodesToFit);\n    const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);\n    await panZoom.setViewport(viewport, {\n        duration: options?.duration,\n        ease: options?.ease,\n        interpolate: options?.interpolate,\n    });\n    return true;\n}\n/**\n * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin.\n *\n * @internal\n * @returns position, positionAbsolute\n */\nfunction calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError, }) {\n    const node = nodeLookup.get(nodeId);\n    const parentNode = node.parentId ? nodeLookup.get(node.parentId) : undefined;\n    const { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 };\n    const origin = node.origin ?? nodeOrigin;\n    let extent = node.extent || nodeExtent;\n    if (node.extent === 'parent' && !node.expandParent) {\n        if (!parentNode) {\n            onError?.('005', errorMessages['error005']());\n        }\n        else {\n            const { width: parentWidth, height: parentHeight } = getNodeDimensions(parentNode);\n            if (parentWidth && parentHeight) {\n                extent = [\n                    [parentX, parentY],\n                    [parentX + parentWidth, parentY + parentHeight],\n                ];\n            }\n        }\n    }\n    else if (parentNode && isCoordinateExtent(node.extent)) {\n        extent = [\n            [node.extent[0][0] + parentX, node.extent[0][1] + parentY],\n            [node.extent[1][0] + parentX, node.extent[1][1] + parentY],\n        ];\n    }\n    const positionAbsolute = isCoordinateExtent(extent)\n        ? clampPosition(nextPosition, extent, node.measured)\n        : nextPosition;\n    if (node.measured.width === undefined || node.measured.height === undefined) {\n        onError?.('015', errorMessages['error015']());\n    }\n    return {\n        position: {\n            x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0],\n            y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1],\n        },\n        positionAbsolute,\n    };\n}\n/**\n * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted\n * @internal\n * @param param.nodesToRemove - The nodes to remove\n * @param param.edgesToRemove - The edges to remove\n * @param param.nodes - All nodes\n * @param param.edges - All edges\n * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted\n * @returns nodes: nodes that can be deleted, edges: edges that can be deleted\n */\nasync function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nodes, edges, onBeforeDelete, }) {\n    const nodeIds = new Set(nodesToRemove.map((node) => node.id));\n    const matchingNodes = [];\n    for (const node of nodes) {\n        if (node.deletable === false) {\n            continue;\n        }\n        const isIncluded = nodeIds.has(node.id);\n        const parentHit = !isIncluded && node.parentId && matchingNodes.find((n) => n.id === node.parentId);\n        if (isIncluded || parentHit) {\n            matchingNodes.push(node);\n        }\n    }\n    const edgeIds = new Set(edgesToRemove.map((edge) => edge.id));\n    const deletableEdges = edges.filter((edge) => edge.deletable !== false);\n    const connectedEdges = getConnectedEdges(matchingNodes, deletableEdges);\n    const matchingEdges = connectedEdges;\n    for (const edge of deletableEdges) {\n        const isIncluded = edgeIds.has(edge.id);\n        if (isIncluded && !matchingEdges.find((e) => e.id === edge.id)) {\n            matchingEdges.push(edge);\n        }\n    }\n    if (!onBeforeDelete) {\n        return {\n            edges: matchingEdges,\n            nodes: matchingNodes,\n        };\n    }\n    const onBeforeDeleteResult = await onBeforeDelete({\n        nodes: matchingNodes,\n        edges: matchingEdges,\n    });\n    if (typeof onBeforeDeleteResult === 'boolean') {\n        return onBeforeDeleteResult ? { edges: matchingEdges, nodes: matchingNodes } : { edges: [], nodes: [] };\n    }\n    return onBeforeDeleteResult;\n}\n\nconst clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max);\nconst clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({\n    x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)),\n    y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0)),\n});\nfunction clampPositionToParent(childPosition, childDimensions, parent) {\n    const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent);\n    const { x: parentX, y: parentY } = parent.internals.positionAbsolute;\n    return clampPosition(childPosition, [\n        [parentX, parentY],\n        [parentX + parentWidth, parentY + parentHeight],\n    ], childDimensions);\n}\n/**\n * Calculates the velocity of panning when the mouse is close to the edge of the canvas\n * @internal\n * @param value - One dimensional poition of the mouse (x or y)\n * @param min - Minimal position on canvas before panning starts\n * @param max - Maximal position on canvas before panning starts\n * @returns - A number between 0 and 1 that represents the velocity of panning\n */\nconst calcAutoPanVelocity = (value, min, max) => {\n    if (value < min) {\n        return clamp(Math.abs(value - min), 1, min) / min;\n    }\n    else if (value > max) {\n        return -clamp(Math.abs(value - max), 1, min) / min;\n    }\n    return 0;\n};\nconst calcAutoPan = (pos, bounds, speed = 15, distance = 40) => {\n    const xMovement = calcAutoPanVelocity(pos.x, distance, bounds.width - distance) * speed;\n    const yMovement = calcAutoPanVelocity(pos.y, distance, bounds.height - distance) * speed;\n    return [xMovement, yMovement];\n};\nconst getBoundsOfBoxes = (box1, box2) => ({\n    x: Math.min(box1.x, box2.x),\n    y: Math.min(box1.y, box2.y),\n    x2: Math.max(box1.x2, box2.x2),\n    y2: Math.max(box1.y2, box2.y2),\n});\nconst rectToBox = ({ x, y, width, height }) => ({\n    x,\n    y,\n    x2: x + width,\n    y2: y + height,\n});\nconst boxToRect = ({ x, y, x2, y2 }) => ({\n    x,\n    y,\n    width: x2 - x,\n    height: y2 - y,\n});\nconst nodeToRect = (node, nodeOrigin = [0, 0]) => {\n    const { x, y } = isInternalNodeBase(node)\n        ? node.internals.positionAbsolute\n        : getNodePositionWithOrigin(node, nodeOrigin);\n    return {\n        x,\n        y,\n        width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n        height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n    };\n};\nconst nodeToBox = (node, nodeOrigin = [0, 0]) => {\n    const { x, y } = isInternalNodeBase(node)\n        ? node.internals.positionAbsolute\n        : getNodePositionWithOrigin(node, nodeOrigin);\n    return {\n        x,\n        y,\n        x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),\n        y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0),\n    };\n};\nconst getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2)));\nconst getRectsOverlappingArea = (aX, aY, aWidth, aHeight, bX, bY, bWidth, bHeight) => {\n    const xOverlap = Math.max(0, Math.min(aX + aWidth, bX + bWidth) - Math.max(aX, bX));\n    const yOverlap = Math.max(0, Math.min(aY + aHeight, bY + bHeight) - Math.max(aY, bY));\n    return Math.ceil(xOverlap * yOverlap);\n};\nconst getOverlappingArea = (rectA, rectB) => getRectsOverlappingArea(rectA.x, rectA.y, rectA.width, rectA.height, rectB.x, rectB.y, rectB.width, rectB.height);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isRectObject = (obj) => isNumeric(obj.width) && isNumeric(obj.height) && isNumeric(obj.x) && isNumeric(obj.y);\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nconst isNumeric = (n) => !isNaN(n) && isFinite(n);\nconst createDevWarn = (lib, helpUrl) => (id, message) => {\n    if (process.env.NODE_ENV === 'development') {\n        console.warn(`[${lib}]: ${message} Help: ${helpUrl}error#${id}`);\n    }\n};\nconst snapPosition = (position, snapGrid = [1, 1]) => {\n    return {\n        x: snapGrid[0] * Math.round(position.x / snapGrid[0]),\n        y: snapGrid[1] * Math.round(position.y / snapGrid[1]),\n    };\n};\nconst pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = false, snapGrid = [1, 1]) => {\n    const position = {\n        x: (x - tx) / tScale,\n        y: (y - ty) / tScale,\n    };\n    return snapToGrid ? snapPosition(position, snapGrid) : position;\n};\nconst rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {\n    return {\n        x: x * tScale + tx,\n        y: y * tScale + ty,\n    };\n};\n/**\n * Parses a single padding value to a number\n * @internal\n * @param padding - Padding to parse\n * @param viewport - Width or height of the viewport\n * @returns The padding in pixels\n */\nfunction parsePadding(padding, viewport) {\n    if (typeof padding === 'number') {\n        return Math.floor((viewport - viewport / (1 + padding)) * 0.5);\n    }\n    if (typeof padding === 'string' && padding.endsWith('px')) {\n        const paddingValue = parseFloat(padding);\n        if (!Number.isNaN(paddingValue)) {\n            return Math.floor(paddingValue);\n        }\n    }\n    if (typeof padding === 'string' && padding.endsWith('%')) {\n        const paddingValue = parseFloat(padding);\n        if (!Number.isNaN(paddingValue)) {\n            return Math.floor(viewport * paddingValue * 0.01);\n        }\n    }\n    console.error(`The padding value \"${padding}\" is invalid. Please provide a number or a string with a valid unit (px or %).`);\n    return 0;\n}\n/**\n * Parses the paddings to an object with top, right, bottom, left, x and y paddings\n * @internal\n * @param padding - Padding to parse\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the paddings in pixels\n */\nfunction parsePaddings(padding, width, height) {\n    if (typeof padding === 'string' || typeof padding === 'number') {\n        const paddingY = parsePadding(padding, height);\n        const paddingX = parsePadding(padding, width);\n        return {\n            top: paddingY,\n            right: paddingX,\n            bottom: paddingY,\n            left: paddingX,\n            x: paddingX * 2,\n            y: paddingY * 2,\n        };\n    }\n    if (typeof padding === 'object') {\n        const top = parsePadding(padding.top ?? padding.y ?? 0, height);\n        const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);\n        const left = parsePadding(padding.left ?? padding.x ?? 0, width);\n        const right = parsePadding(padding.right ?? padding.x ?? 0, width);\n        return { top, right, bottom, left, x: left + right, y: top + bottom };\n    }\n    return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };\n}\n/**\n * Calculates the resulting paddings if the new viewport is applied\n * @internal\n * @param bounds - Bounds to fit inside viewport\n * @param x - X position of the viewport\n * @param y - Y position of the viewport\n * @param zoom - Zoom level of the viewport\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the minimum padding required to fit the bounds inside the viewport\n */\nfunction calculateAppliedPaddings(bounds, x, y, zoom, width, height) {\n    const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);\n    const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);\n    const right = width - boundRight;\n    const bottom = height - boundBottom;\n    return {\n        left: Math.floor(left),\n        top: Math.floor(top),\n        right: Math.floor(right),\n        bottom: Math.floor(bottom),\n    };\n}\n/**\n * Returns a viewport that encloses the given bounds with padding.\n * @public\n * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}\n * @param bounds - Bounds to fit inside viewport.\n * @param width - Width of the viewport.\n * @param height  - Height of the viewport.\n * @param minZoom - Minimum zoom level of the resulting viewport.\n * @param maxZoom - Maximum zoom level of the resulting viewport.\n * @param padding - Padding around the bounds.\n * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}.\n * @example\n * const { x, y, zoom } = getViewportForBounds(\n * { x: 0, y: 0, width: 100, height: 100},\n * 1200, 800, 0.5, 2);\n */\nconst getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {\n    // First we resolve all the paddings to actual pixel values\n    const p = parsePaddings(padding, width, height);\n    const xZoom = (width - p.x) / bounds.width;\n    const yZoom = (height - p.y) / bounds.height;\n    // We calculate the new x, y, zoom for a centered view\n    const zoom = Math.min(xZoom, yZoom);\n    const clampedZoom = clamp(zoom, minZoom, maxZoom);\n    const boundsCenterX = bounds.x + bounds.width / 2;\n    const boundsCenterY = bounds.y + bounds.height / 2;\n    const x = width / 2 - boundsCenterX * clampedZoom;\n    const y = height / 2 - boundsCenterY * clampedZoom;\n    // Then we calculate the minimum padding, to respect asymmetric paddings\n    const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);\n    // We only want to have an offset if the newPadding is smaller than the required padding\n    const offset = {\n        left: Math.min(newPadding.left - p.left, 0),\n        top: Math.min(newPadding.top - p.top, 0),\n        right: Math.min(newPadding.right - p.right, 0),\n        bottom: Math.min(newPadding.bottom - p.bottom, 0),\n    };\n    return {\n        x: x - offset.left + offset.right,\n        y: y - offset.top + offset.bottom,\n        zoom: clampedZoom,\n    };\n};\nconst isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;\nfunction isCoordinateExtent(extent) {\n    return extent !== undefined && extent !== null && extent !== 'parent';\n}\nfunction getNodeDimensions(node) {\n    return {\n        width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n        height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n    };\n}\nfunction nodeHasDimensions(node) {\n    return ((node.measured?.width ?? node.width ?? node.initialWidth) !== undefined &&\n        (node.measured?.height ?? node.height ?? node.initialHeight) !== undefined);\n}\n/**\n * Convert child position to absolute position\n *\n * @internal\n * @param position\n * @param parentId\n * @param nodeLookup\n * @param nodeOrigin\n * @returns an internal node with an absolute position\n */\nfunction evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) {\n    const positionAbsolute = { ...position };\n    const parent = nodeLookup.get(parentId);\n    if (parent) {\n        const origin = parent.origin || nodeOrigin;\n        positionAbsolute.x += parent.internals.positionAbsolute.x - (dimensions.width ?? 0) * origin[0];\n        positionAbsolute.y += parent.internals.positionAbsolute.y - (dimensions.height ?? 0) * origin[1];\n    }\n    return positionAbsolute;\n}\nfunction areSetsEqual(a, b) {\n    if (a.size !== b.size) {\n        return false;\n    }\n    for (const item of a) {\n        if (!b.has(item)) {\n            return false;\n        }\n    }\n    return true;\n}\n/**\n * Polyfill for Promise.withResolvers until we can use it in all browsers\n * @internal\n */\nfunction withResolvers() {\n    let resolve;\n    let reject;\n    const promise = new Promise((res, rej) => {\n        resolve = res;\n        reject = rej;\n    });\n    return { promise, resolve, reject };\n}\nfunction mergeAriaLabelConfig(partial) {\n    return { ...defaultAriaLabelConfig, ...(partial || {}) };\n}\nfunction isAttributionVisible(library) {\n    if (typeof document === 'undefined')\n        return true;\n    const pane = document.querySelector(`.${library}-flow__pane`);\n    if (!pane || !pane.isConnected)\n        return true;\n    const paneStyle = getComputedStyle(pane);\n    if (paneStyle.display === 'none')\n        return true;\n    if (paneStyle.visibility === 'hidden' || paneStyle.visibility === 'collapse')\n        return true;\n    if (paneStyle.opacity === '0')\n        return true;\n    if (paneStyle.width === '0' && paneStyle.height === '0')\n        return true;\n    const paneRect = pane.getBoundingClientRect();\n    if (paneRect.width === 0 && paneRect.height === 0)\n        return true;\n    const attr = document.querySelector(`.${library}-flow__attribution`);\n    if (!attr || !attr.isConnected)\n        return false;\n    const style = getComputedStyle(attr);\n    if (style.display === 'none')\n        return false;\n    if (style.visibility === 'hidden' || style.visibility === 'collapse')\n        return false;\n    if (style.opacity === '0')\n        return false;\n    const rect = attr.getBoundingClientRect();\n    if (rect.width === 0 && rect.height === 0)\n        return false;\n    return true;\n}\n\nlet warningDisplayed = false;\nfunction handleAttributionWarning(library) {\n    if (warningDisplayed || process.env.NODE_ENV !== 'development') {\n        return;\n    }\n    warningDisplayed = true;\n    const framework = `${library.charAt(0).toUpperCase() + library.slice(1)} Flow`;\n    setTimeout(() => {\n        if (!isAttributionVisible(library)) {\n            console.warn(`${framework}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${framework} Pro: https://${library}flow.dev/remove-attr\\n%cYou can ignore this warning if you are subscribed.`, 'font-style: italic;');\n        }\n    }, 1000);\n}\n\n/**\n * @internal\n */\nfunction areConnectionMapsEqual(a, b) {\n    if (!a && !b) {\n        return true;\n    }\n    if (!a || !b || a.size !== b.size) {\n        return false;\n    }\n    if (!a.size && !b.size) {\n        return true;\n    }\n    for (const key of a.keys()) {\n        if (!b.has(key)) {\n            return false;\n        }\n    }\n    return true;\n}\n/**\n * We call the callback for all connections in a that are not in b\n *\n * @internal\n */\nfunction handleConnectionChange(a, b, cb) {\n    if (!cb) {\n        return;\n    }\n    const diff = [];\n    a.forEach((connection, key) => {\n        if (!b?.has(key)) {\n            diff.push(connection);\n        }\n    });\n    if (diff.length) {\n        cb(diff);\n    }\n}\nfunction getConnectionStatus(isValid) {\n    return isValid === null ? null : isValid ? 'valid' : 'invalid';\n}\n\nfunction getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform, containerBounds }) {\n    const { x, y } = getEventPosition(event);\n    const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform);\n    const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;\n    // we need the snapped position in order to be able to skip unnecessary drag events\n    return {\n        xSnapped,\n        ySnapped,\n        ...pointerPos,\n    };\n}\nconst getDimensions = (node) => ({\n    width: node.offsetWidth,\n    height: node.offsetHeight,\n});\nconst getHostForElement = (element) => element?.getRootNode?.() || window?.document;\nconst inputTags = ['INPUT', 'SELECT', 'TEXTAREA'];\nfunction isInputDOMNode(event) {\n    // using composed path for handling shadow dom\n    const target = (event.composedPath?.()?.[0] || event.target);\n    if (target?.nodeType !== 1 /* Node.ELEMENT_NODE */)\n        return false;\n    const isInput = inputTags.includes(target.nodeName) || target.hasAttribute('contenteditable');\n    // when an input field is focused we don't want to trigger deletion or movement of nodes\n    return isInput || !!target.closest('.nokey');\n}\nconst isMouseEvent = (event) => 'clientX' in event;\nconst getEventPosition = (event, bounds) => {\n    const isMouse = isMouseEvent(event);\n    const evtX = isMouse ? event.clientX : event.touches?.[0].clientX;\n    const evtY = isMouse ? event.clientY : event.touches?.[0].clientY;\n    return {\n        x: evtX - (bounds?.left ?? 0),\n        y: evtY - (bounds?.top ?? 0),\n    };\n};\n/*\n * The handle bounds are calculated relative to the node element.\n * We store them in the internals object of the node in order to avoid\n * unnecessary recalculations.\n */\nconst getHandleBounds = (type, nodeElement, nodeBounds, zoom, nodeId) => {\n    const handles = nodeElement.querySelectorAll(`.${type}`);\n    if (!handles || !handles.length) {\n        return null;\n    }\n    return Array.from(handles).map((handle) => {\n        const handleBounds = handle.getBoundingClientRect();\n        return {\n            id: handle.getAttribute('data-handleid'),\n            type,\n            nodeId,\n            position: handle.getAttribute('data-handlepos'),\n            x: (handleBounds.left - nodeBounds.left) / zoom,\n            y: (handleBounds.top - nodeBounds.top) / zoom,\n            ...getDimensions(handle),\n        };\n    });\n};\n\nfunction getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }) {\n    /*\n     * cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate\n     * https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve\n     */\n    const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125;\n    const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125;\n    const offsetX = Math.abs(centerX - sourceX);\n    const offsetY = Math.abs(centerY - sourceY);\n    return [centerX, centerY, offsetX, offsetY];\n}\nfunction calculateControlOffset(distance, curvature) {\n    if (distance >= 0) {\n        return 0.5 * distance;\n    }\n    return curvature * 25 * Math.sqrt(-distance);\n}\nfunction getControlWithCurvature({ pos, x1, y1, x2, y2, c }) {\n    switch (pos) {\n        case Position.Left:\n            return [x1 - calculateControlOffset(x1 - x2, c), y1];\n        case Position.Right:\n            return [x1 + calculateControlOffset(x2 - x1, c), y1];\n        case Position.Top:\n            return [x1, y1 - calculateControlOffset(y1 - y2, c)];\n        case Position.Bottom:\n            return [x1, y1 + calculateControlOffset(y2 - y1, c)];\n    }\n}\n/**\n * The `getBezierPath` util returns everything you need to render a bezier edge\n *between two nodes.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n *  const source = { x: 0, y: 20 };\n *  const target = { x: 150, y: 100 };\n *\n *  const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({\n *    sourceX: source.x,\n *    sourceY: source.y,\n *    sourcePosition: Position.Right,\n *    targetX: target.x,\n *    targetY: target.y,\n *    targetPosition: Position.Left,\n *});\n *```\n *\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to\n *work with multiple edge paths at once.\n */\nfunction getBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, curvature = 0.25, }) {\n    const [sourceControlX, sourceControlY] = getControlWithCurvature({\n        pos: sourcePosition,\n        x1: sourceX,\n        y1: sourceY,\n        x2: targetX,\n        y2: targetY,\n        c: curvature,\n    });\n    const [targetControlX, targetControlY] = getControlWithCurvature({\n        pos: targetPosition,\n        x1: targetX,\n        y1: targetY,\n        x2: sourceX,\n        y2: sourceY,\n        c: curvature,\n    });\n    const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n        sourceX,\n        sourceY,\n        targetX,\n        targetY,\n        sourceControlX,\n        sourceControlY,\n        targetControlX,\n        targetControlY,\n    });\n    return [\n        `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n        labelX,\n        labelY,\n        offsetX,\n        offsetY,\n    ];\n}\n\n// this is used for straight edges and simple smoothstep edges (LTR, RTL, BTT, TTB)\nfunction getEdgeCenter({ sourceX, sourceY, targetX, targetY, }) {\n    const xOffset = Math.abs(targetX - sourceX) / 2;\n    const centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset;\n    const yOffset = Math.abs(targetY - sourceY) / 2;\n    const centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset;\n    return [centerX, centerY, xOffset, yOffset];\n}\n/**\n * Returns the z-index for an edge based on the node it connects and whether it is selected.\n * By default, edges are rendered below nodes. This behaviour is different for edges that are\n * connected to nodes with a parent, as they are rendered above the parent node.\n */\nfunction getElevatedEdgeZIndex({ sourceNode, targetNode, selected = false, zIndex = 0, elevateOnSelect = false, zIndexMode = 'basic', }) {\n    if (zIndexMode === 'manual') {\n        return zIndex;\n    }\n    const edgeZ = elevateOnSelect && selected ? zIndex + 1000 : zIndex;\n    const nodeZ = Math.max(sourceNode.parentId || (elevateOnSelect && sourceNode.selected) ? sourceNode.internals.z : 0, targetNode.parentId || (elevateOnSelect && targetNode.selected) ? targetNode.internals.z : 0);\n    return edgeZ + nodeZ;\n}\nfunction isEdgeVisible({ sourceNode, targetNode, width, height, transform }) {\n    const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode));\n    if (edgeBox.x === edgeBox.x2) {\n        edgeBox.x2 += 1;\n    }\n    if (edgeBox.y === edgeBox.y2) {\n        edgeBox.y2 += 1;\n    }\n    const viewRect = {\n        x: -transform[0] / transform[2],\n        y: -transform[1] / transform[2],\n        width: width / transform[2],\n        height: height / transform[2],\n    };\n    return getOverlappingArea(viewRect, boxToRect(edgeBox)) > 0;\n}\n/**\n * The default edge ID generator function. Generates an ID based on the source, target, and handles.\n * @public\n * @param params - The connection or edge to generate an ID for.\n * @returns The generated edge ID.\n */\nconst getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`;\nconst connectionExists = (edge, edges) => {\n    return edges.some((el) => el.source === edge.source &&\n        el.target === edge.target &&\n        (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle)) &&\n        (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle)));\n};\n/**\n * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.\n * @public\n * @param edgeParams - Either an `Edge` or a `Connection` you want to add.\n * @param edges - The array of all current edges.\n * @param options - Optional configuration object.\n * @returns A new array of edges with the new edge added.\n *\n * @remarks If an edge with the same `target` and `source` already exists (and the same\n *`targetHandle` and `sourceHandle` if those are set), then this util won't add\n *a new edge even if the `id` property is different.\n *\n */\nconst addEdge = (edgeParams, edges, options = {}) => {\n    if (!edgeParams.source || !edgeParams.target) {\n        options.onError?.('006', errorMessages['error006']());\n        return edges;\n    }\n    const edgeIdGenerator = options.getEdgeId || getEdgeId;\n    let edge;\n    if (isEdgeBase(edgeParams)) {\n        edge = { ...edgeParams };\n    }\n    else {\n        edge = {\n            ...edgeParams,\n            id: edgeIdGenerator(edgeParams),\n        };\n    }\n    if (connectionExists(edge, edges)) {\n        return edges;\n    }\n    if (edge.sourceHandle === null) {\n        delete edge.sourceHandle;\n    }\n    if (edge.targetHandle === null) {\n        delete edge.targetHandle;\n    }\n    return edges.concat(edge);\n};\n/**\n * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties.\n *This searches your edge array for an edge with a matching `id` and updates its\n *properties with the connection you provide.\n * @public\n * @param oldEdge - The edge you want to update.\n * @param newConnection - The new connection you want to update the edge with.\n * @param edges - The array of all current edges.\n * @returns The updated edges array.\n *\n * @example\n * ```js\n *const onReconnect = useCallback(\n *  (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]);\n *```\n */\nconst reconnectEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId: true }) => {\n    const { id: oldEdgeId, ...rest } = oldEdge;\n    if (!newConnection.source || !newConnection.target) {\n        options.onError?.('006', errorMessages['error006']());\n        return edges;\n    }\n    const foundEdge = edges.find((e) => e.id === oldEdge.id);\n    if (!foundEdge) {\n        options.onError?.('007', errorMessages['error007'](oldEdgeId));\n        return edges;\n    }\n    const edgeIdGenerator = options.getEdgeId || getEdgeId;\n    // Remove old edge and create the new edge with parameters of old edge.\n    const edge = {\n        ...rest,\n        id: options.shouldReplaceId ? edgeIdGenerator(newConnection) : oldEdgeId,\n        source: newConnection.source,\n        target: newConnection.target,\n        sourceHandle: newConnection.sourceHandle,\n        targetHandle: newConnection.targetHandle,\n    };\n    return edges.filter((e) => e.id !== oldEdgeId).concat(edge);\n};\n\n/**\n * Calculates the straight line path between two points.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n *  const source = { x: 0, y: 20 };\n *  const target = { x: 150, y: 100 };\n *\n *  const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({\n *    sourceX: source.x,\n *    sourceY: source.y,\n *    sourcePosition: Position.Right,\n *    targetX: target.x,\n *    targetY: target.y,\n *    targetPosition: Position.Left,\n *  });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getStraightPath({ sourceX, sourceY, targetX, targetY, }) {\n    const [labelX, labelY, offsetX, offsetY] = getEdgeCenter({\n        sourceX,\n        sourceY,\n        targetX,\n        targetY,\n    });\n    return [`M ${sourceX},${sourceY}L ${targetX},${targetY}`, labelX, labelY, offsetX, offsetY];\n}\n\nconst handleDirections = {\n    [Position.Left]: { x: -1, y: 0 },\n    [Position.Right]: { x: 1, y: 0 },\n    [Position.Top]: { x: 0, y: -1 },\n    [Position.Bottom]: { x: 0, y: 1 },\n};\nconst getDirection = ({ source, sourcePosition = Position.Bottom, target, }) => {\n    if (sourcePosition === Position.Left || sourcePosition === Position.Right) {\n        return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 };\n    }\n    return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 };\n};\nconst distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));\n/*\n * With this function we try to mimic an orthogonal edge routing behaviour\n * It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges\n */\nfunction getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, stepPosition, }) {\n    const sourceDir = handleDirections[sourcePosition];\n    const targetDir = handleDirections[targetPosition];\n    const sourceGapped = { x: source.x + sourceDir.x * offset, y: source.y + sourceDir.y * offset };\n    const targetGapped = { x: target.x + targetDir.x * offset, y: target.y + targetDir.y * offset };\n    const dir = getDirection({\n        source: sourceGapped,\n        sourcePosition,\n        target: targetGapped,\n    });\n    const dirAccessor = dir.x !== 0 ? 'x' : 'y';\n    const currDir = dir[dirAccessor];\n    let points = [];\n    let centerX, centerY;\n    const sourceGapOffset = { x: 0, y: 0 };\n    const targetGapOffset = { x: 0, y: 0 };\n    const [, , defaultOffsetX, defaultOffsetY] = getEdgeCenter({\n        sourceX: source.x,\n        sourceY: source.y,\n        targetX: target.x,\n        targetY: target.y,\n    });\n    // opposite handle positions, default case\n    if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) {\n        if (dirAccessor === 'x') {\n            // Primary direction is horizontal, so stepPosition affects X coordinate\n            centerX = center.x ?? sourceGapped.x + (targetGapped.x - sourceGapped.x) * stepPosition;\n            centerY = center.y ?? (sourceGapped.y + targetGapped.y) / 2;\n        }\n        else {\n            // Primary direction is vertical, so stepPosition affects Y coordinate\n            centerX = center.x ?? (sourceGapped.x + targetGapped.x) / 2;\n            centerY = center.y ?? sourceGapped.y + (targetGapped.y - sourceGapped.y) * stepPosition;\n        }\n        /*\n         *    --->\n         *    |\n         * >---\n         */\n        const verticalSplit = [\n            { x: centerX, y: sourceGapped.y },\n            { x: centerX, y: targetGapped.y },\n        ];\n        /*\n         *    |\n         *  ---\n         *  |\n         */\n        const horizontalSplit = [\n            { x: sourceGapped.x, y: centerY },\n            { x: targetGapped.x, y: centerY },\n        ];\n        if (sourceDir[dirAccessor] === currDir) {\n            points = dirAccessor === 'x' ? verticalSplit : horizontalSplit;\n        }\n        else {\n            points = dirAccessor === 'x' ? horizontalSplit : verticalSplit;\n        }\n    }\n    else {\n        // sourceTarget means we take x from source and y from target, targetSource is the opposite\n        const sourceTarget = [{ x: sourceGapped.x, y: targetGapped.y }];\n        const targetSource = [{ x: targetGapped.x, y: sourceGapped.y }];\n        // this handles edges with same handle positions\n        if (dirAccessor === 'x') {\n            points = sourceDir.x === currDir ? targetSource : sourceTarget;\n        }\n        else {\n            points = sourceDir.y === currDir ? sourceTarget : targetSource;\n        }\n        if (sourcePosition === targetPosition) {\n            const diff = Math.abs(source[dirAccessor] - target[dirAccessor]);\n            // if an edge goes from right to right for example (sourcePosition === targetPosition) and the distance between source.x and target.x is less than the offset, the added point and the gapped source/target will overlap. This leads to a weird edge path. To avoid this we add a gapOffset to the source/target\n            if (diff <= offset) {\n                const gapOffset = Math.min(offset - 1, offset - diff);\n                if (sourceDir[dirAccessor] === currDir) {\n                    sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset;\n                }\n                else {\n                    targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset;\n                }\n            }\n        }\n        // these are conditions for handling mixed handle positions like Right -> Bottom for example\n        if (sourcePosition !== targetPosition) {\n            const dirAccessorOpposite = dirAccessor === 'x' ? 'y' : 'x';\n            const isSameDir = sourceDir[dirAccessor] === targetDir[dirAccessorOpposite];\n            const sourceGtTargetOppo = sourceGapped[dirAccessorOpposite] > targetGapped[dirAccessorOpposite];\n            const sourceLtTargetOppo = sourceGapped[dirAccessorOpposite] < targetGapped[dirAccessorOpposite];\n            const flipSourceTarget = (sourceDir[dirAccessor] === 1 && ((!isSameDir && sourceGtTargetOppo) || (isSameDir && sourceLtTargetOppo))) ||\n                (sourceDir[dirAccessor] !== 1 && ((!isSameDir && sourceLtTargetOppo) || (isSameDir && sourceGtTargetOppo)));\n            if (flipSourceTarget) {\n                points = dirAccessor === 'x' ? sourceTarget : targetSource;\n            }\n        }\n        const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };\n        const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };\n        const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x));\n        const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y));\n        // we want to place the label on the longest segment of the edge\n        if (maxXDistance >= maxYDistance) {\n            centerX = (sourceGapPoint.x + targetGapPoint.x) / 2;\n            centerY = points[0].y;\n        }\n        else {\n            centerX = points[0].x;\n            centerY = (sourceGapPoint.y + targetGapPoint.y) / 2;\n        }\n    }\n    const gappedSource = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };\n    const gappedTarget = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };\n    const pathPoints = [\n        source,\n        // we only want to add the gapped source/target if they are different from the first/last point to avoid duplicates which can cause issues with the bends\n        ...(gappedSource.x !== points[0].x || gappedSource.y !== points[0].y ? [gappedSource] : []),\n        ...points,\n        ...(gappedTarget.x !== points[points.length - 1].x || gappedTarget.y !== points[points.length - 1].y\n            ? [gappedTarget]\n            : []),\n        target,\n    ];\n    return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY];\n}\nfunction getBend(a, b, c, size) {\n    const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size);\n    const { x, y } = b;\n    // no bend\n    if ((a.x === x && x === c.x) || (a.y === y && y === c.y)) {\n        return `L${x} ${y}`;\n    }\n    // first segment is horizontal\n    if (a.y === y) {\n        const xDir = a.x < c.x ? -1 : 1;\n        const yDir = a.y < c.y ? 1 : -1;\n        return `L ${x + bendSize * xDir},${y}Q ${x},${y} ${x},${y + bendSize * yDir}`;\n    }\n    const xDir = a.x < c.x ? 1 : -1;\n    const yDir = a.y < c.y ? -1 : 1;\n    return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;\n}\n/**\n * The `getSmoothStepPath` util returns everything you need to render a stepped path\n * between two nodes. The `borderRadius` property can be used to choose how rounded\n * the corners of those steps are.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n *  const source = { x: 0, y: 20 };\n *  const target = { x: 150, y: 100 };\n *\n *  const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({\n *    sourceX: source.x,\n *    sourceY: source.y,\n *    sourcePosition: Position.Right,\n *    targetX: target.x,\n *    targetY: target.y,\n *    targetPosition: Position.Left,\n *  });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20, stepPosition = 0.5, }) {\n    const [points, labelX, labelY, offsetX, offsetY] = getPoints({\n        source: { x: sourceX, y: sourceY },\n        sourcePosition,\n        target: { x: targetX, y: targetY },\n        targetPosition,\n        center: { x: centerX, y: centerY },\n        offset,\n        stepPosition,\n    });\n    let path = `M${points[0].x} ${points[0].y}`;\n    for (let i = 1; i < points.length - 1; i++) {\n        path += getBend(points[i - 1], points[i], points[i + 1], borderRadius);\n    }\n    path += `L${points[points.length - 1].x} ${points[points.length - 1].y}`;\n    return [path, labelX, labelY, offsetX, offsetY];\n}\n\nfunction isNodeInitialized(node) {\n    return (node &&\n        !!(node.internals.handleBounds || node.handles?.length) &&\n        !!(node.measured.width || node.width || node.initialWidth));\n}\nfunction getEdgePosition(params) {\n    const { sourceNode, targetNode } = params;\n    if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) {\n        return null;\n    }\n    const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles);\n    const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles);\n    const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle);\n    const targetHandle = getHandle$1(\n    // when connection type is loose we can define all handles as sources and connect source -> source\n    params.connectionMode === ConnectionMode.Strict\n        ? targetHandleBounds?.target ?? []\n        : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []), params.targetHandle);\n    if (!sourceHandle || !targetHandle) {\n        params.onError?.('008', errorMessages['error008'](!sourceHandle ? 'source' : 'target', {\n            id: params.id,\n            sourceHandle: params.sourceHandle,\n            targetHandle: params.targetHandle,\n        }));\n        return null;\n    }\n    const sourcePosition = sourceHandle?.position || Position.Bottom;\n    const targetPosition = targetHandle?.position || Position.Top;\n    const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition);\n    const target = getHandlePosition(targetNode, targetHandle, targetPosition);\n    return {\n        sourceX: source.x,\n        sourceY: source.y,\n        targetX: target.x,\n        targetY: target.y,\n        sourcePosition,\n        targetPosition,\n    };\n}\nfunction toHandleBounds(handles) {\n    if (!handles) {\n        return null;\n    }\n    const source = [];\n    const target = [];\n    for (const handle of handles) {\n        handle.width = handle.width ?? 1;\n        handle.height = handle.height ?? 1;\n        if (handle.type === 'source') {\n            source.push(handle);\n        }\n        else if (handle.type === 'target') {\n            target.push(handle);\n        }\n    }\n    return {\n        source,\n        target,\n    };\n}\nfunction getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) {\n    const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x;\n    const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y;\n    const { width, height } = handle ?? getNodeDimensions(node);\n    if (center) {\n        return { x: x + width / 2, y: y + height / 2 };\n    }\n    const position = handle?.position ?? fallbackPosition;\n    switch (position) {\n        case Position.Top:\n            return { x: x + width / 2, y };\n        case Position.Right:\n            return { x: x + width, y: y + height / 2 };\n        case Position.Bottom:\n            return { x: x + width / 2, y: y + height };\n        case Position.Left:\n            return { x, y: y + height / 2 };\n    }\n}\nfunction getHandle$1(bounds, handleId) {\n    if (!bounds) {\n        return null;\n    }\n    // if no handleId is given, we use the first handle, otherwise we check for the id\n    return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null;\n}\n\nfunction getMarkerId(marker, id) {\n    if (!marker) {\n        return '';\n    }\n    if (typeof marker === 'string') {\n        return marker;\n    }\n    const idPrefix = id ? `${id}__` : '';\n    return `${idPrefix}${Object.keys(marker)\n        .sort()\n        .map((key) => `${key}=${marker[key]}`)\n        .join('&')}`;\n}\nfunction createMarkerIds(edges, { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }) {\n    const ids = new Set();\n    return edges\n        .reduce((markers, edge) => {\n        [edge.markerStart || defaultMarkerStart, edge.markerEnd || defaultMarkerEnd].forEach((marker) => {\n            if (marker && typeof marker === 'object') {\n                const markerId = getMarkerId(marker, id);\n                if (!ids.has(markerId)) {\n                    markers.push({ id: markerId, color: marker.color || defaultColor, ...marker });\n                    ids.add(markerId);\n                }\n            }\n        });\n        return markers;\n    }, [])\n        .sort((a, b) => a.id.localeCompare(b.id));\n}\n\nfunction getNodeToolbarTransform(nodeRect, viewport, position, offset, align) {\n    let alignmentOffset = 0.5;\n    if (align === 'start') {\n        alignmentOffset = 0;\n    }\n    else if (align === 'end') {\n        alignmentOffset = 1;\n    }\n    /*\n     * position === Position.Top\n     * we set the x any y position of the toolbar based on the nodes position\n     */\n    let pos = [\n        (nodeRect.x + nodeRect.width * alignmentOffset) * viewport.zoom + viewport.x,\n        nodeRect.y * viewport.zoom + viewport.y - offset,\n    ];\n    // and than shift it based on the alignment. The shift values are in %.\n    let shift = [-100 * alignmentOffset, -100];\n    switch (position) {\n        case Position.Right:\n            pos = [\n                (nodeRect.x + nodeRect.width) * viewport.zoom + viewport.x + offset,\n                (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n            ];\n            shift = [0, -100 * alignmentOffset];\n            break;\n        case Position.Bottom:\n            pos[1] = (nodeRect.y + nodeRect.height) * viewport.zoom + viewport.y + offset;\n            shift[1] = 0;\n            break;\n        case Position.Left:\n            pos = [\n                nodeRect.x * viewport.zoom + viewport.x - offset,\n                (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n            ];\n            shift = [-100, -100 * alignmentOffset];\n            break;\n    }\n    return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift[0]}%, ${shift[1]}%)`;\n}\n\nconst alignXToPercent = {\n    left: 0,\n    center: 50,\n    right: 100,\n};\nconst alignYToPercent = {\n    top: 0,\n    center: 50,\n    bottom: 100,\n};\nfunction getEdgeToolbarTransform(x, y, zoom, alignX = 'center', alignY = 'center') {\n    return `translate(${x}px, ${y}px) scale(${1 / zoom}) translate(${-(alignXToPercent[alignX] ?? 50)}%, ${-(alignYToPercent[alignY] ?? 50)}%)`;\n}\n\nconst SELECTED_NODE_Z = 1000;\nconst ROOT_PARENT_Z_INCREMENT = 10;\nconst defaultOptions = {\n    nodeOrigin: [0, 0],\n    nodeExtent: infiniteExtent,\n    elevateNodesOnSelect: true,\n    zIndexMode: 'basic',\n    defaults: {},\n};\nconst adoptUserNodesDefaultOptions = {\n    ...defaultOptions,\n    checkEquality: true,\n};\nfunction mergeObjects(base, incoming) {\n    const result = { ...base };\n    for (const key in incoming) {\n        if (incoming[key] !== undefined) {\n            // typecast is safe here, because we check for undefined\n            result[key] = incoming[key];\n        }\n    }\n    return result;\n}\nfunction updateAbsolutePositions(nodeLookup, parentLookup, options) {\n    const _options = mergeObjects(defaultOptions, options);\n    for (const node of nodeLookup.values()) {\n        if (node.parentId) {\n            updateChildNode(node, nodeLookup, parentLookup, _options);\n        }\n        else {\n            const positionWithOrigin = getNodePositionWithOrigin(node, _options.nodeOrigin);\n            const extent = isCoordinateExtent(node.extent) ? node.extent : _options.nodeExtent;\n            const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(node));\n            node.internals.positionAbsolute = clampedPosition;\n        }\n    }\n}\nfunction parseHandles(userNode, internalNode) {\n    if (!userNode.handles) {\n        return !userNode.measured ? undefined : internalNode?.internals.handleBounds;\n    }\n    const source = [];\n    const target = [];\n    for (const handle of userNode.handles) {\n        const handleBounds = {\n            id: handle.id,\n            width: handle.width ?? 1,\n            height: handle.height ?? 1,\n            nodeId: userNode.id,\n            x: handle.x,\n            y: handle.y,\n            position: handle.position,\n            type: handle.type,\n        };\n        if (handle.type === 'source') {\n            source.push(handleBounds);\n        }\n        else if (handle.type === 'target') {\n            target.push(handleBounds);\n        }\n    }\n    return {\n        source,\n        target,\n    };\n}\nfunction isManualZIndexMode(zIndexMode) {\n    return zIndexMode === 'manual';\n}\nfunction adoptUserNodes(nodes, nodeLookup, parentLookup, options = {}) {\n    const _options = mergeObjects(adoptUserNodesDefaultOptions, options);\n    const rootParentIndex = { i: 0 };\n    const tmpLookup = new Map(nodeLookup);\n    const selectedNodeZ = _options?.elevateNodesOnSelect && !isManualZIndexMode(_options.zIndexMode) ? SELECTED_NODE_Z : 0;\n    let nodesInitialized = nodes.length > 0;\n    let hasSelectedNodes = false;\n    nodeLookup.clear();\n    parentLookup.clear();\n    for (const userNode of nodes) {\n        let internalNode = tmpLookup.get(userNode.id);\n        if (_options.checkEquality && userNode === internalNode?.internals.userNode) {\n            nodeLookup.set(userNode.id, internalNode);\n        }\n        else {\n            const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin);\n            const extent = isCoordinateExtent(userNode.extent) ? userNode.extent : _options.nodeExtent;\n            const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(userNode));\n            internalNode = {\n                ..._options.defaults,\n                ...userNode,\n                measured: {\n                    width: userNode.measured?.width,\n                    height: userNode.measured?.height,\n                },\n                internals: {\n                    positionAbsolute: clampedPosition,\n                    // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured\n                    handleBounds: parseHandles(userNode, internalNode),\n                    z: calculateZ(userNode, selectedNodeZ, _options.zIndexMode),\n                    userNode,\n                },\n            };\n            nodeLookup.set(userNode.id, internalNode);\n        }\n        if ((internalNode.measured === undefined ||\n            internalNode.measured.width === undefined ||\n            internalNode.measured.height === undefined) &&\n            !internalNode.hidden) {\n            nodesInitialized = false;\n        }\n        if (userNode.parentId) {\n            updateChildNode(internalNode, nodeLookup, parentLookup, options, rootParentIndex);\n        }\n        hasSelectedNodes ||= userNode.selected ?? false;\n    }\n    return { nodesInitialized, hasSelectedNodes };\n}\nfunction updateParentLookup(node, parentLookup) {\n    if (!node.parentId) {\n        return;\n    }\n    const childNodes = parentLookup.get(node.parentId);\n    if (childNodes) {\n        childNodes.set(node.id, node);\n    }\n    else {\n        parentLookup.set(node.parentId, new Map([[node.id, node]]));\n    }\n}\n/**\n * Updates positionAbsolute and zIndex of a child node and the parentLookup.\n */\nfunction updateChildNode(node, nodeLookup, parentLookup, options, rootParentIndex) {\n    const { elevateNodesOnSelect, nodeOrigin, nodeExtent, zIndexMode } = mergeObjects(defaultOptions, options);\n    const parentId = node.parentId;\n    const parentNode = nodeLookup.get(parentId);\n    if (!parentNode) {\n        console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);\n        return;\n    }\n    updateParentLookup(node, parentLookup);\n    // We just want to set the rootParentIndex for the first child\n    if (rootParentIndex &&\n        !parentNode.parentId &&\n        parentNode.internals.rootParentIndex === undefined &&\n        zIndexMode === 'auto') {\n        parentNode.internals.rootParentIndex = ++rootParentIndex.i;\n        parentNode.internals.z = parentNode.internals.z + rootParentIndex.i * ROOT_PARENT_Z_INCREMENT;\n    }\n    // But we need to update rootParentIndex.i also when parent has not been updated\n    if (rootParentIndex && parentNode.internals.rootParentIndex !== undefined) {\n        rootParentIndex.i = parentNode.internals.rootParentIndex;\n    }\n    const selectedNodeZ = elevateNodesOnSelect && !isManualZIndexMode(zIndexMode) ? SELECTED_NODE_Z : 0;\n    const { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ, zIndexMode);\n    const { positionAbsolute } = node.internals;\n    const positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y;\n    if (positionChanged || z !== node.internals.z) {\n        // we create a new object to mark the node as updated\n        nodeLookup.set(node.id, {\n            ...node,\n            internals: {\n                ...node.internals,\n                positionAbsolute: positionChanged ? { x, y } : positionAbsolute,\n                z,\n            },\n        });\n    }\n}\nfunction calculateZ(node, selectedNodeZ, zIndexMode) {\n    const zIndex = isNumeric(node.zIndex) ? node.zIndex : 0;\n    if (isManualZIndexMode(zIndexMode)) {\n        return zIndex;\n    }\n    return zIndex + (node.selected ? selectedNodeZ : 0);\n}\nfunction calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, selectedNodeZ, zIndexMode) {\n    const { x: parentX, y: parentY } = parentNode.internals.positionAbsolute;\n    const childDimensions = getNodeDimensions(childNode);\n    const positionWithOrigin = getNodePositionWithOrigin(childNode, nodeOrigin);\n    const clampedPosition = isCoordinateExtent(childNode.extent)\n        ? clampPosition(positionWithOrigin, childNode.extent, childDimensions)\n        : positionWithOrigin;\n    let absolutePosition = clampPosition({ x: parentX + clampedPosition.x, y: parentY + clampedPosition.y }, nodeExtent, childDimensions);\n    if (childNode.extent === 'parent') {\n        absolutePosition = clampPositionToParent(absolutePosition, childDimensions, parentNode);\n    }\n    const childZ = calculateZ(childNode, selectedNodeZ, zIndexMode);\n    const parentZ = parentNode.internals.z ?? 0;\n    return {\n        x: absolutePosition.x,\n        y: absolutePosition.y,\n        z: parentZ >= childZ ? parentZ + 1 : childZ,\n    };\n}\nfunction handleExpandParent(children, nodeLookup, parentLookup, nodeOrigin = [0, 0]) {\n    const changes = [];\n    const parentExpansions = new Map();\n    // determine the expanded rectangle the child nodes would take for each parent\n    for (const child of children) {\n        const parent = nodeLookup.get(child.parentId);\n        if (!parent) {\n            continue;\n        }\n        const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent);\n        const expandedRect = getBoundsOfRects(parentRect, child.rect);\n        parentExpansions.set(child.parentId, { expandedRect, parent });\n    }\n    if (parentExpansions.size > 0) {\n        parentExpansions.forEach(({ expandedRect, parent }, parentId) => {\n            // determine the position & dimensions of the parent\n            const positionAbsolute = parent.internals.positionAbsolute;\n            const dimensions = getNodeDimensions(parent);\n            const origin = parent.origin ?? nodeOrigin;\n            // determine how much the parent expands in width and position\n            const xChange = expandedRect.x < positionAbsolute.x ? Math.round(Math.abs(positionAbsolute.x - expandedRect.x)) : 0;\n            const yChange = expandedRect.y < positionAbsolute.y ? Math.round(Math.abs(positionAbsolute.y - expandedRect.y)) : 0;\n            const newWidth = Math.max(dimensions.width, Math.round(expandedRect.width));\n            const newHeight = Math.max(dimensions.height, Math.round(expandedRect.height));\n            const widthChange = (newWidth - dimensions.width) * origin[0];\n            const heightChange = (newHeight - dimensions.height) * origin[1];\n            // We need to correct the position of the parent node if the origin is not [0,0]\n            if (xChange > 0 || yChange > 0 || widthChange || heightChange) {\n                changes.push({\n                    id: parentId,\n                    type: 'position',\n                    position: {\n                        x: parent.position.x - xChange + widthChange,\n                        y: parent.position.y - yChange + heightChange,\n                    },\n                });\n                /*\n                 * We move all child nodes in the oppsite direction\n                 * so the x,y changes of the parent do not move the children\n                 */\n                parentLookup.get(parentId)?.forEach((childNode) => {\n                    if (!children.some((child) => child.id === childNode.id)) {\n                        changes.push({\n                            id: childNode.id,\n                            type: 'position',\n                            position: {\n                                x: childNode.position.x + xChange,\n                                y: childNode.position.y + yChange,\n                            },\n                        });\n                    }\n                });\n            }\n            // We need to correct the dimensions of the parent node if the origin is not [0,0]\n            if (dimensions.width < expandedRect.width || dimensions.height < expandedRect.height || xChange || yChange) {\n                changes.push({\n                    id: parentId,\n                    type: 'dimensions',\n                    setAttributes: true,\n                    dimensions: {\n                        width: newWidth + (xChange ? origin[0] * xChange - widthChange : 0),\n                        height: newHeight + (yChange ? origin[1] * yChange - heightChange : 0),\n                    },\n                });\n            }\n        });\n    }\n    return changes;\n}\nfunction updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, zIndexMode) {\n    const viewportNode = domNode?.querySelector('.xyflow__viewport');\n    let updatedInternals = false;\n    if (!viewportNode) {\n        return { changes: [], updatedInternals };\n    }\n    const changes = [];\n    const style = window.getComputedStyle(viewportNode);\n    const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n    // in this array we collect nodes, that might trigger changes (like expanding parent)\n    const parentExpandChildren = [];\n    for (const update of updates.values()) {\n        const node = nodeLookup.get(update.id);\n        if (!node) {\n            continue;\n        }\n        if (node.hidden) {\n            nodeLookup.set(node.id, {\n                ...node,\n                internals: {\n                    ...node.internals,\n                    handleBounds: undefined,\n                },\n            });\n            updatedInternals = true;\n            continue;\n        }\n        const dimensions = getDimensions(update.nodeElement);\n        const dimensionChanged = node.measured.width !== dimensions.width || node.measured.height !== dimensions.height;\n        const doUpdate = !!(dimensions.width &&\n            dimensions.height &&\n            (dimensionChanged || !node.internals.handleBounds || update.force));\n        if (doUpdate) {\n            const nodeBounds = update.nodeElement.getBoundingClientRect();\n            const extent = isCoordinateExtent(node.extent) ? node.extent : nodeExtent;\n            let { positionAbsolute } = node.internals;\n            if (node.parentId && node.extent === 'parent') {\n                const parentNode = nodeLookup.get(node.parentId);\n                if (parentNode) {\n                    positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, parentNode);\n                }\n            }\n            else if (extent) {\n                positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);\n            }\n            const newNode = {\n                ...node,\n                measured: dimensions,\n                internals: {\n                    ...node.internals,\n                    positionAbsolute,\n                    handleBounds: {\n                        source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id),\n                        target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id),\n                    },\n                },\n            };\n            nodeLookup.set(node.id, newNode);\n            if (node.parentId) {\n                updateChildNode(newNode, nodeLookup, parentLookup, { nodeOrigin, zIndexMode });\n            }\n            updatedInternals = true;\n            if (dimensionChanged) {\n                changes.push({\n                    id: node.id,\n                    type: 'dimensions',\n                    dimensions,\n                });\n                if (node.expandParent && node.parentId) {\n                    parentExpandChildren.push({\n                        id: node.id,\n                        parentId: node.parentId,\n                        rect: nodeToRect(newNode, nodeOrigin),\n                    });\n                }\n            }\n        }\n    }\n    if (parentExpandChildren.length > 0) {\n        const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);\n        changes.push(...parentExpandChanges);\n    }\n    return { changes, updatedInternals };\n}\nasync function panBy({ delta, panZoom, transform, translateExtent, width, height, }) {\n    if (!panZoom || (!delta.x && !delta.y)) {\n        return false;\n    }\n    const nextViewport = await panZoom.setViewportConstrained({\n        x: transform[0] + delta.x,\n        y: transform[1] + delta.y,\n        zoom: transform[2],\n    }, [\n        [0, 0],\n        [width, height],\n    ], translateExtent);\n    const transformChanged = !!nextViewport &&\n        (nextViewport.x !== transform[0] || nextViewport.y !== transform[1] || nextViewport.k !== transform[2]);\n    return transformChanged;\n}\n/**\n * this function adds the connection to the connectionLookup\n * at the following keys: nodeId-type-handleId, nodeId-type and nodeId\n * @param type type of the connection\n * @param connection connection that should be added to the lookup\n * @param connectionKey at which key the connection should be added\n * @param connectionLookup reference to the connection lookup\n * @param nodeId nodeId of the connection\n * @param handleId handleId of the connection\n */\nfunction addConnectionToLookup(type, connection, connectionKey, connectionLookup, nodeId, handleId) {\n    /*\n     * We add the connection to the connectionLookup at the following keys\n     * 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId\n     * If the key already exists, we add the connection to the existing map\n     */\n    let key = nodeId;\n    const nodeMap = connectionLookup.get(key) || new Map();\n    connectionLookup.set(key, nodeMap.set(connectionKey, connection));\n    key = `${nodeId}-${type}`;\n    const typeMap = connectionLookup.get(key) || new Map();\n    connectionLookup.set(key, typeMap.set(connectionKey, connection));\n    if (handleId) {\n        key = `${nodeId}-${type}-${handleId}`;\n        const handleMap = connectionLookup.get(key) || new Map();\n        connectionLookup.set(key, handleMap.set(connectionKey, connection));\n    }\n}\nfunction updateConnectionLookup(connectionLookup, edgeLookup, edges) {\n    connectionLookup.clear();\n    edgeLookup.clear();\n    for (const edge of edges) {\n        const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge;\n        const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle };\n        const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`;\n        const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`;\n        addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle);\n        addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle);\n        edgeLookup.set(edge.id, edge);\n    }\n}\n\nfunction shallowNodeData(a, b) {\n    if (a === null || b === null) {\n        return false;\n    }\n    const _a = Array.isArray(a) ? a : [a];\n    const _b = Array.isArray(b) ? b : [b];\n    if (_a.length !== _b.length) {\n        return false;\n    }\n    for (let i = 0; i < _a.length; i++) {\n        if (_a[i].id !== _b[i].id || _a[i].type !== _b[i].type || !Object.is(_a[i].data, _b[i].data)) {\n            return false;\n        }\n    }\n    return true;\n}\n\nfunction isParentSelected(node, nodeLookup) {\n    if (!node.parentId) {\n        return false;\n    }\n    const parentNode = nodeLookup.get(node.parentId);\n    if (!parentNode) {\n        return false;\n    }\n    if (parentNode.selected) {\n        return true;\n    }\n    return isParentSelected(parentNode, nodeLookup);\n}\nfunction hasSelector(target, selector, domNode) {\n    let current = target;\n    do {\n        if (current?.matches?.(selector))\n            return true;\n        if (current === domNode)\n            return false;\n        current = current?.parentElement;\n    } while (current);\n    return false;\n}\n// looks for all selected nodes and created a NodeDragItem for each of them\nfunction getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId) {\n    const dragItems = new Map();\n    for (const [id, node] of nodeLookup) {\n        if ((node.selected || node.id === nodeId) &&\n            (!node.parentId || !isParentSelected(node, nodeLookup)) &&\n            (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'))) {\n            const internalNode = nodeLookup.get(id);\n            if (internalNode) {\n                dragItems.set(id, {\n                    id,\n                    position: internalNode.position || { x: 0, y: 0 },\n                    distance: {\n                        x: mousePos.x - internalNode.internals.positionAbsolute.x,\n                        y: mousePos.y - internalNode.internals.positionAbsolute.y,\n                    },\n                    extent: internalNode.extent,\n                    parentId: internalNode.parentId,\n                    origin: internalNode.origin,\n                    expandParent: internalNode.expandParent,\n                    internals: {\n                        positionAbsolute: internalNode.internals.positionAbsolute || { x: 0, y: 0 },\n                    },\n                    measured: {\n                        width: internalNode.measured.width ?? 0,\n                        height: internalNode.measured.height ?? 0,\n                    },\n                });\n            }\n        }\n    }\n    return dragItems;\n}\n/*\n * returns two params:\n * 1. the dragged node (or the first of the list, if we are dragging a node selection)\n * 2. array of selected nodes (for multi selections)\n */\nfunction getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true, }) {\n    const nodesFromDragItems = [];\n    for (const [id, dragItem] of dragItems) {\n        const node = nodeLookup.get(id)?.internals.userNode;\n        if (node) {\n            nodesFromDragItems.push({\n                ...node,\n                position: dragItem.position,\n                dragging,\n            });\n        }\n    }\n    if (!nodeId) {\n        return [nodesFromDragItems[0], nodesFromDragItems];\n    }\n    const node = nodeLookup.get(nodeId)?.internals.userNode;\n    return [\n        !node\n            ? nodesFromDragItems[0]\n            : {\n                ...node,\n                position: dragItems.get(nodeId)?.position || node.position,\n                dragging,\n            },\n        nodesFromDragItems,\n    ];\n}\n/**\n * If a selection is being dragged we want to apply the same snap offset to all nodes in the selection.\n * This function calculates the snap offset based on the first node in the selection.\n */\nfunction calculateSnapOffset({ dragItems, snapGrid, x, y, }) {\n    const refDragItem = dragItems.values().next().value;\n    if (!refDragItem) {\n        return null;\n    }\n    const refPos = {\n        x: x - refDragItem.distance.x,\n        y: y - refDragItem.distance.y,\n    };\n    const refPosSnapped = snapPosition(refPos, snapGrid);\n    return {\n        x: refPosSnapped.x - refPos.x,\n        y: refPosSnapped.y - refPos.y,\n    };\n}\n\nfunction XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {\n    let lastPos = { x: null, y: null };\n    let autoPanId = 0;\n    let dragItems = new Map();\n    let autoPanStarted = false;\n    let mousePosition = { x: 0, y: 0 };\n    let containerBounds = null;\n    let dragStarted = false;\n    let d3Selection = null;\n    let abortDrag = false; // prevents unintentional dragging on multitouch\n    let nodePositionsChanged = false;\n    // we store the last drag event to be able to use it in the update function\n    let dragEvent = null;\n    // public functions\n    function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {\n        d3Selection = select(domNode);\n        function updateNodes({ x, y }) {\n            const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();\n            lastPos = { x, y };\n            let hasChange = false;\n            const isMultiDrag = dragItems.size > 1;\n            const nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null;\n            const multiDragSnapOffset = isMultiDrag && snapToGrid\n                ? calculateSnapOffset({\n                    dragItems,\n                    snapGrid,\n                    x,\n                    y,\n                })\n                : null;\n            for (const [id, dragItem] of dragItems) {\n                /*\n                 * if the node is not in the nodeLookup anymore, it was probably deleted while dragging\n                 */\n                if (!nodeLookup.has(id)) {\n                    continue;\n                }\n                let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };\n                if (snapToGrid) {\n                    nextPosition = multiDragSnapOffset\n                        ? {\n                            x: Math.round(nextPosition.x + multiDragSnapOffset.x),\n                            y: Math.round(nextPosition.y + multiDragSnapOffset.y),\n                        }\n                        : snapPosition(nextPosition, snapGrid);\n                }\n                let adjustedNodeExtent = null;\n                if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {\n                    const { positionAbsolute } = dragItem.internals;\n                    const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0];\n                    const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0];\n                    const y1 = positionAbsolute.y - nodesBox.y + nodeExtent[0][1];\n                    const y2 = positionAbsolute.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];\n                    adjustedNodeExtent = [\n                        [x1, y1],\n                        [x2, y2],\n                    ];\n                }\n                const { position, positionAbsolute } = calculateNodePosition({\n                    nodeId: id,\n                    nextPosition,\n                    nodeLookup,\n                    nodeExtent: adjustedNodeExtent ? adjustedNodeExtent : nodeExtent,\n                    nodeOrigin,\n                    onError,\n                });\n                // we want to make sure that we only fire a change event when there is a change\n                hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y;\n                dragItem.position = position;\n                dragItem.internals.positionAbsolute = positionAbsolute;\n            }\n            nodePositionsChanged = nodePositionsChanged || hasChange;\n            if (!hasChange) {\n                return;\n            }\n            updateNodePositions(dragItems, true);\n            if (dragEvent && (onDrag || onNodeDrag || (!nodeId && onSelectionDrag))) {\n                const [currentNode, currentNodes] = getEventHandlerParams({\n                    nodeId,\n                    dragItems,\n                    nodeLookup,\n                });\n                onDrag?.(dragEvent, dragItems, currentNode, currentNodes);\n                onNodeDrag?.(dragEvent, currentNode, currentNodes);\n                if (!nodeId) {\n                    onSelectionDrag?.(dragEvent, currentNodes);\n                }\n            }\n        }\n        async function autoPan() {\n            if (!containerBounds) {\n                return;\n            }\n            const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems();\n            if (!autoPanOnNodeDrag) {\n                autoPanStarted = false;\n                cancelAnimationFrame(autoPanId);\n                return;\n            }\n            const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);\n            if (xMovement !== 0 || yMovement !== 0) {\n                lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2];\n                lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2];\n                if (await panBy({ x: xMovement, y: yMovement })) {\n                    updateNodes(lastPos);\n                }\n            }\n            autoPanId = requestAnimationFrame(autoPan);\n        }\n        function startDrag(event) {\n            const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges, } = getStoreItems();\n            dragStarted = true;\n            if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) {\n                if (!nodeLookup.get(nodeId)?.selected) {\n                    // we need to reset selected nodes when selectNodesOnDrag=false\n                    unselectNodesAndEdges();\n                }\n            }\n            if (isSelectable && selectNodesOnDrag && nodeId) {\n                onNodeMouseDown?.(nodeId);\n            }\n            const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n            lastPos = pointerPos;\n            dragItems = getDragItems(nodeLookup, nodesDraggable, pointerPos, nodeId);\n            if (dragItems.size > 0 && (onDragStart || onNodeDragStart || (!nodeId && onSelectionDragStart))) {\n                const [currentNode, currentNodes] = getEventHandlerParams({\n                    nodeId,\n                    dragItems,\n                    nodeLookup,\n                });\n                onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n                onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes);\n                if (!nodeId) {\n                    onSelectionDragStart?.(event.sourceEvent, currentNodes);\n                }\n            }\n        }\n        const d3DragInstance = drag()\n            .clickDistance(nodeClickDistance)\n            .on('start', (event) => {\n            const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();\n            containerBounds = domNode?.getBoundingClientRect() || null;\n            abortDrag = false;\n            nodePositionsChanged = false;\n            dragEvent = event.sourceEvent;\n            if (nodeDragThreshold === 0) {\n                startDrag(event);\n            }\n            const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n            lastPos = pointerPos;\n            mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n        })\n            .on('drag', (event) => {\n            const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems();\n            const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n            dragEvent = event.sourceEvent;\n            if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) ||\n                // if user deletes a node while dragging, we need to abort the drag to prevent errors\n                (nodeId && !nodeLookup.has(nodeId))) {\n                abortDrag = true;\n            }\n            if (abortDrag) {\n                return;\n            }\n            if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) {\n                autoPanStarted = true;\n                autoPan();\n            }\n            if (!dragStarted) {\n                // Calculate distance in client coordinates for consistent drag threshold behavior across zoom levels\n                const currentMousePosition = getEventPosition(event.sourceEvent, containerBounds);\n                const x = currentMousePosition.x - mousePosition.x;\n                const y = currentMousePosition.y - mousePosition.y;\n                const distance = Math.sqrt(x * x + y * y);\n                if (distance > nodeDragThreshold) {\n                    startDrag(event);\n                }\n            }\n            // skip events without movement\n            if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) {\n                mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n                updateNodes(pointerPos);\n            }\n        })\n            .on('end', (event) => {\n            if (!dragStarted || abortDrag) {\n                if (abortDrag && dragItems.size > 0) {\n                    getStoreItems().updateNodePositions(dragItems, false);\n                }\n                return;\n            }\n            autoPanStarted = false;\n            dragStarted = false;\n            cancelAnimationFrame(autoPanId);\n            if (dragItems.size > 0) {\n                const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems();\n                if (nodePositionsChanged) {\n                    updateNodePositions(dragItems, false);\n                    nodePositionsChanged = false;\n                }\n                if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) {\n                    const [currentNode, currentNodes] = getEventHandlerParams({\n                        nodeId,\n                        dragItems,\n                        nodeLookup,\n                        dragging: false,\n                    });\n                    onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n                    onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes);\n                    if (!nodeId) {\n                        onSelectionDragStop?.(event.sourceEvent, currentNodes);\n                    }\n                }\n            }\n        })\n            .filter((event) => {\n            const target = event.target;\n            const isDraggable = !event.button &&\n                (!noDragClassName || !hasSelector(target, `.${noDragClassName}`, domNode)) &&\n                (!handleSelector || hasSelector(target, handleSelector, domNode));\n            return isDraggable;\n        });\n        d3Selection.call(d3DragInstance);\n    }\n    function destroy() {\n        d3Selection?.on('.drag', null);\n    }\n    return {\n        update,\n        destroy,\n    };\n}\n\nfunction getNodesWithinDistance(position, nodeLookup, distance) {\n    const nodes = [];\n    const rect = {\n        x: position.x - distance,\n        y: position.y - distance,\n        width: distance * 2,\n        height: distance * 2,\n    };\n    for (const node of nodeLookup.values()) {\n        if (getOverlappingArea(rect, nodeToRect(node)) > 0) {\n            nodes.push(node);\n        }\n    }\n    return nodes;\n}\n/*\n * this distance is used for the area around the user pointer\n * while doing a connection for finding the closest nodes\n */\nconst ADDITIONAL_DISTANCE = 250;\nfunction getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {\n    let closestHandles = [];\n    let minDistance = Infinity;\n    const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE);\n    for (const node of closeNodes) {\n        const allHandles = [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n        for (const handle of allHandles) {\n            // if the handle is the same as the fromHandle we skip it\n            if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) {\n                continue;\n            }\n            // determine absolute position of the handle\n            const { x, y } = getHandlePosition(node, handle, handle.position, true);\n            const distance = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2));\n            if (distance > connectionRadius) {\n                continue;\n            }\n            if (distance < minDistance) {\n                closestHandles = [{ ...handle, x, y }];\n                minDistance = distance;\n            }\n            else if (distance === minDistance) {\n                // when multiple handles are on the same distance we collect all of them\n                closestHandles.push({ ...handle, x, y });\n            }\n        }\n    }\n    if (!closestHandles.length) {\n        return null;\n    }\n    // when multiple handles overlay each other we prefer the opposite handle\n    if (closestHandles.length > 1) {\n        const oppositeHandleType = fromHandle.type === 'source' ? 'target' : 'source';\n        return closestHandles.find((handle) => handle.type === oppositeHandleType) ?? closestHandles[0];\n    }\n    return closestHandles[0];\n}\nfunction getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) {\n    const node = nodeLookup.get(nodeId);\n    if (!node) {\n        return null;\n    }\n    const handles = connectionMode === 'strict'\n        ? node.internals.handleBounds?.[handleType]\n        : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n    const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null;\n    return handle && withAbsolutePosition\n        ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) }\n        : handle;\n}\nfunction getHandleType(edgeUpdaterType, handleDomNode) {\n    if (edgeUpdaterType) {\n        return edgeUpdaterType;\n    }\n    else if (handleDomNode?.classList.contains('target')) {\n        return 'target';\n    }\n    else if (handleDomNode?.classList.contains('source')) {\n        return 'source';\n    }\n    return null;\n}\nfunction isConnectionValid(isInsideConnectionRadius, isHandleValid) {\n    let isValid = null;\n    if (isHandleValid) {\n        isValid = true;\n    }\n    else if (isInsideConnectionRadius && !isHandleValid) {\n        isValid = false;\n    }\n    return isValid;\n}\n\nconst alwaysValid = () => true;\nfunction onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode, }) {\n    // when xyflow is used inside a shadow root we can't use document\n    const doc = getHostForElement(event.target);\n    let autoPanId = 0;\n    let closestHandle;\n    const { x, y } = getEventPosition(event);\n    const handleType = getHandleType(edgeUpdaterType, handleDomNode);\n    const containerBounds = domNode?.getBoundingClientRect();\n    let connectionStarted = false;\n    if (!containerBounds || !handleType) {\n        return;\n    }\n    const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode);\n    if (!fromHandleInternal) {\n        return;\n    }\n    let position = getEventPosition(event, containerBounds);\n    let autoPanStarted = false;\n    let connection = null;\n    let isValid = false;\n    let resultHandleDomNode = null;\n    // when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas\n    function autoPan() {\n        if (!autoPanOnConnect || !containerBounds) {\n            return;\n        }\n        const [x, y] = calcAutoPan(position, containerBounds, autoPanSpeed);\n        panBy({ x, y });\n        autoPanId = requestAnimationFrame(autoPan);\n    }\n    // Stays the same for all consecutive pointermove events\n    const fromHandle = {\n        ...fromHandleInternal,\n        nodeId,\n        type: handleType,\n        position: fromHandleInternal.position,\n    };\n    const fromInternalNode = nodeLookup.get(nodeId);\n    const from = getHandlePosition(fromInternalNode, fromHandle, Position.Left, true);\n    let previousConnection = {\n        inProgress: true,\n        isValid: null,\n        from,\n        fromHandle,\n        fromPosition: fromHandle.position,\n        fromNode: fromInternalNode,\n        to: position,\n        toHandle: null,\n        toPosition: oppositePosition[fromHandle.position],\n        toNode: null,\n        pointer: position,\n    };\n    function startConnection() {\n        connectionStarted = true;\n        updateConnection(previousConnection);\n        onConnectStart?.(event, { nodeId, handleId, handleType });\n    }\n    if (dragThreshold === 0) {\n        startConnection();\n    }\n    function onPointerMove(event) {\n        if (!connectionStarted) {\n            const { x: evtX, y: evtY } = getEventPosition(event);\n            const dx = evtX - x;\n            const dy = evtY - y;\n            const nextConnectionStarted = dx * dx + dy * dy > dragThreshold * dragThreshold;\n            if (!nextConnectionStarted) {\n                return;\n            }\n            startConnection();\n        }\n        if (!getFromHandle() || !fromHandle) {\n            onPointerUp(event);\n            return;\n        }\n        const transform = getTransform();\n        position = getEventPosition(event, containerBounds);\n        closestHandle = getClosestHandle(pointToRendererPoint(position, transform, false, [1, 1]), connectionRadius, nodeLookup, fromHandle);\n        if (!autoPanStarted) {\n            autoPan();\n            autoPanStarted = true;\n        }\n        const result = isValidHandle(event, {\n            handle: closestHandle,\n            connectionMode,\n            fromNodeId: nodeId,\n            fromHandleId: handleId,\n            fromType: isTarget ? 'target' : 'source',\n            isValidConnection,\n            doc,\n            lib,\n            flowId,\n            nodeLookup,\n        });\n        resultHandleDomNode = result.handleDomNode;\n        connection = result.connection;\n        isValid = isConnectionValid(!!closestHandle, result.isValid);\n        const fromInternalNode = nodeLookup.get(nodeId);\n        const from = fromInternalNode\n            ? getHandlePosition(fromInternalNode, fromHandle, Position.Left, true)\n            : previousConnection.from;\n        const newConnection = {\n            ...previousConnection,\n            from,\n            isValid,\n            to: result.toHandle && isValid\n                ? rendererPointToPoint({ x: result.toHandle.x, y: result.toHandle.y }, transform)\n                : position,\n            toHandle: result.toHandle,\n            toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position],\n            toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null,\n            pointer: position,\n        };\n        updateConnection(newConnection);\n        previousConnection = newConnection;\n    }\n    function onPointerUp(event) {\n        // Prevent multi-touch aborting connection\n        if ('touches' in event && event.touches.length > 0) {\n            return;\n        }\n        if (connectionStarted) {\n            if ((closestHandle || resultHandleDomNode) && connection && isValid) {\n                onConnect?.(connection);\n            }\n            /*\n             * it's important to get a fresh reference from the store here\n             * in order to get the latest state of onConnectEnd\n             */\n            // eslint-disable-next-line @typescript-eslint/no-unused-vars\n            const { inProgress, ...connectionState } = previousConnection;\n            const finalConnectionState = {\n                ...connectionState,\n                toPosition: previousConnection.toHandle ? previousConnection.toPosition : null,\n            };\n            onConnectEnd?.(event, finalConnectionState);\n            if (edgeUpdaterType) {\n                onReconnectEnd?.(event, finalConnectionState);\n            }\n        }\n        cancelConnection();\n        cancelAnimationFrame(autoPanId);\n        autoPanStarted = false;\n        isValid = false;\n        connection = null;\n        resultHandleDomNode = null;\n        doc.removeEventListener('mousemove', onPointerMove);\n        doc.removeEventListener('mouseup', onPointerUp);\n        doc.removeEventListener('touchmove', onPointerMove);\n        doc.removeEventListener('touchend', onPointerUp);\n    }\n    doc.addEventListener('mousemove', onPointerMove);\n    doc.addEventListener('mouseup', onPointerUp);\n    doc.addEventListener('touchmove', onPointerMove);\n    doc.addEventListener('touchend', onPointerUp);\n}\n// checks if  and returns connection in form of an object { source: 123, target: 312 }\nfunction isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup, }) {\n    const isTarget = fromType === 'target';\n    const handleDomNode = handle\n        ? doc.querySelector(`.${lib}-flow__handle[data-id=\"${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}\"]`)\n        : null;\n    const { x, y } = getEventPosition(event);\n    const handleBelow = doc.elementFromPoint(x, y);\n    /*\n     * we always want to prioritize the handle below the mouse cursor over the closest distance handle,\n     * because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor\n     */\n    const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;\n    const result = {\n        handleDomNode: handleToCheck,\n        isValid: false,\n        connection: null,\n        toHandle: null,\n    };\n    if (handleToCheck) {\n        const handleType = getHandleType(undefined, handleToCheck);\n        const handleNodeId = handleToCheck.getAttribute('data-nodeid');\n        const handleId = handleToCheck.getAttribute('data-handleid');\n        const connectable = handleToCheck.classList.contains('connectable');\n        const connectableEnd = handleToCheck.classList.contains('connectableend');\n        if (!handleNodeId || !handleType) {\n            return result;\n        }\n        const connection = {\n            source: isTarget ? handleNodeId : fromNodeId,\n            sourceHandle: isTarget ? handleId : fromHandleId,\n            target: isTarget ? fromNodeId : handleNodeId,\n            targetHandle: isTarget ? fromHandleId : handleId,\n        };\n        result.connection = connection;\n        const isConnectable = connectable && connectableEnd;\n        // in strict mode we don't allow target to target or source to source connections\n        const isValid = isConnectable &&\n            (connectionMode === ConnectionMode.Strict\n                ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')\n                : handleNodeId !== fromNodeId || handleId !== fromHandleId);\n        result.isValid = isValid && isValidConnection(connection);\n        result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true);\n    }\n    return result;\n}\nconst XYHandle = {\n    onPointerDown,\n    isValid: isValidHandle,\n};\n\nfunction XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {\n    const selection = select(domNode);\n    function update({ translateExtent, width, height, zoomStep = 1, pannable = true, zoomable = true, inversePan = false, }) {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const zoomHandler = (event) => {\n            if (event.sourceEvent.type !== 'wheel' || !panZoom) {\n                return;\n            }\n            const transform = getTransform();\n            const factor = event.sourceEvent.ctrlKey && isMacOs() ? 10 : 1;\n            const pinchDelta = -event.sourceEvent.deltaY *\n                (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) *\n                zoomStep;\n            const nextZoom = transform[2] * Math.pow(2, pinchDelta * factor);\n            panZoom.scaleTo(nextZoom);\n        };\n        let panStart = [0, 0];\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const panStartHandler = (event) => {\n            if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') {\n                panStart = [\n                    event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n                    event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n                ];\n            }\n        };\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const panHandler = (event) => {\n            const transform = getTransform();\n            if ((event.sourceEvent.type !== 'mousemove' && event.sourceEvent.type !== 'touchmove') || !panZoom) {\n                return;\n            }\n            const panCurrent = [\n                event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n                event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n            ];\n            const panDelta = [panCurrent[0] - panStart[0], panCurrent[1] - panStart[1]];\n            panStart = panCurrent;\n            const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1);\n            const position = {\n                x: transform[0] - panDelta[0] * moveScale,\n                y: transform[1] - panDelta[1] * moveScale,\n            };\n            const extent = [\n                [0, 0],\n                [width, height],\n            ];\n            panZoom.setViewportConstrained({\n                x: position.x,\n                y: position.y,\n                zoom: transform[2],\n            }, extent, translateExtent);\n        };\n        const zoomAndPanHandler = zoom()\n            .on('start', panStartHandler)\n            // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n            // @ts-ignore\n            .on('zoom', pannable ? panHandler : null)\n            // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n            // @ts-ignore\n            .on('zoom.wheel', zoomable ? zoomHandler : null);\n        selection.call(zoomAndPanHandler, {});\n    }\n    function destroy() {\n        selection.on('zoom', null);\n    }\n    return {\n        update,\n        destroy,\n        pointer,\n    };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst transformToViewport = (transform) => ({\n    x: transform.x,\n    y: transform.y,\n    zoom: transform.k,\n});\nconst viewportToTransform = ({ x, y, zoom }) => zoomIdentity.translate(x, y).scale(zoom);\nconst isWrappedWithClass = (event, className) => event.target.closest(`.${className}`);\nconst isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2);\n// taken from d3-ease: https://github.com/d3/d3-ease/blob/main/src/cubic.js\nconst defaultEase = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\nconst getD3Transition = (selection, duration = 0, ease = defaultEase, onEnd = () => { }) => {\n    const hasDuration = typeof duration === 'number' && duration > 0;\n    if (!hasDuration) {\n        onEnd();\n    }\n    return hasDuration ? selection.transition().duration(duration).ease(ease).on('end', onEnd) : selection;\n};\nconst wheelDelta = (event) => {\n    const factor = event.ctrlKey && isMacOs() ? 10 : 1;\n    return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * factor;\n};\n\nfunction createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }) {\n    return (event) => {\n        if (isWrappedWithClass(event, noWheelClassName)) {\n            if (event.ctrlKey) {\n                event.preventDefault(); // stop native page zoom for pinch zooming\n            }\n            return false;\n        }\n        event.preventDefault();\n        event.stopImmediatePropagation();\n        const currentZoom = d3Selection.property('__zoom').k || 1;\n        // macos sets ctrlKey=true for pinch gesture on a trackpad\n        if (event.ctrlKey && zoomOnPinch) {\n            const point = pointer(event);\n            const pinchDelta = wheelDelta(event);\n            const zoom = currentZoom * Math.pow(2, pinchDelta);\n            // @ts-ignore\n            d3Zoom.scaleTo(d3Selection, zoom, point, event);\n            return;\n        }\n        /*\n         * increase scroll speed in firefox\n         * firefox: deltaMode === 1; chrome: deltaMode === 0\n         */\n        const deltaNormalize = event.deltaMode === 1 ? 20 : 1;\n        let deltaX = panOnScrollMode === PanOnScrollMode.Vertical ? 0 : event.deltaX * deltaNormalize;\n        let deltaY = panOnScrollMode === PanOnScrollMode.Horizontal ? 0 : event.deltaY * deltaNormalize;\n        // this enables vertical scrolling with shift + scroll on windows\n        if (!isMacOs() && event.shiftKey && panOnScrollMode !== PanOnScrollMode.Vertical) {\n            deltaX = event.deltaY * deltaNormalize;\n            deltaY = 0;\n        }\n        d3Zoom.translateBy(d3Selection, -(deltaX / currentZoom) * panOnScrollSpeed, -(deltaY / currentZoom) * panOnScrollSpeed, \n        // @ts-ignore\n        { internal: true });\n        const nextViewport = transformToViewport(d3Selection.property('__zoom'));\n        clearTimeout(zoomPanValues.panScrollTimeout);\n        /*\n         * for pan on scroll we need to handle the event calls on our own\n         * we can't use the start, zoom and end events from d3-zoom\n         * because start and move gets called on every scroll event and not once at the beginning\n         */\n        if (!zoomPanValues.isPanScrolling) {\n            zoomPanValues.isPanScrolling = true;\n            onPanZoomStart?.(event, nextViewport);\n        }\n        else {\n            onPanZoom?.(event, nextViewport);\n        }\n        zoomPanValues.panScrollTimeout = setTimeout(() => {\n            onPanZoomEnd?.(event, nextViewport);\n            zoomPanValues.isPanScrolling = false;\n        }, 150);\n    };\n}\nfunction createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {\n    return function (event, d) {\n        const isWheel = event.type === 'wheel';\n        // we still want to enable pinch zooming even if preventScrolling is set to false\n        const preventZoom = !preventScrolling && isWheel && !event.ctrlKey;\n        const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);\n        // if user is pinch zooming above a nowheel element, we don't want the browser to zoom\n        if (event.ctrlKey && isWheel && hasNoWheelClass) {\n            event.preventDefault();\n        }\n        if (preventZoom || hasNoWheelClass) {\n            return null;\n        }\n        event.preventDefault();\n        d3ZoomHandler.call(this, event, d);\n    };\n}\nfunction createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {\n    return (event) => {\n        if (event.sourceEvent?.internal) {\n            return;\n        }\n        const viewport = transformToViewport(event.transform);\n        // we need to remember it here, because it's always 0 in the \"zoom\" event\n        zoomPanValues.mouseButton = event.sourceEvent?.button || 0;\n        zoomPanValues.isZoomingOrPanning = true;\n        zoomPanValues.prevViewport = viewport;\n        if (event.sourceEvent?.type === 'mousedown') {\n            onDraggingChange(true);\n        }\n        if (onPanZoomStart) {\n            onPanZoomStart?.(event.sourceEvent, viewport);\n        }\n    };\n}\nfunction createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }) {\n    return (event) => {\n        zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0));\n        if (!event.sourceEvent?.sync) {\n            onTransformChange([event.transform.x, event.transform.y, event.transform.k]);\n        }\n        if (onPanZoom && !event.sourceEvent?.internal) {\n            onPanZoom?.(event.sourceEvent, transformToViewport(event.transform));\n        }\n    };\n}\nfunction createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }) {\n    return (event) => {\n        if (event.sourceEvent?.internal) {\n            return;\n        }\n        zoomPanValues.isZoomingOrPanning = false;\n        if (onPaneContextMenu &&\n            isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) &&\n            !zoomPanValues.usedRightMouseButton &&\n            event.sourceEvent) {\n            onPaneContextMenu(event.sourceEvent);\n        }\n        zoomPanValues.usedRightMouseButton = false;\n        onDraggingChange(false);\n        if (onPanZoomEnd) {\n            const viewport = transformToViewport(event.transform);\n            zoomPanValues.prevViewport = viewport;\n            clearTimeout(zoomPanValues.timerId);\n            zoomPanValues.timerId = setTimeout(() => {\n                onPanZoomEnd?.(event.sourceEvent, viewport);\n            }, \n            // we need a setTimeout for panOnScroll to suppress multiple end events fired during scroll\n            panOnScroll ? 150 : 0);\n        }\n    };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction createFilter({ panActivationKeyPressed, zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, connectionInProgress, }) {\n    return (event) => {\n        const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;\n        const pinchZoom = zoomOnPinch && event.ctrlKey;\n        const isWheelEvent = event.type === 'wheel';\n        if (event.button === 1 &&\n            event.type === 'mousedown' &&\n            (isWrappedWithClass(event, `${lib}-flow__node`) ||\n                isWrappedWithClass(event, `${lib}-flow__edge`) ||\n                isWrappedWithClass(event, `${lib}-flow__selection`) ||\n                isWrappedWithClass(event, `${lib}-flow__nodesselection`))) {\n            return true;\n        }\n        // if all interactions are disabled, we prevent all zoom events\n        if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) {\n            return false;\n        }\n        // during a selection we prevent all other interactions\n        if (userSelectionActive) {\n            return false;\n        }\n        // we want to disable pinch-zooming while making a connection\n        if (connectionInProgress && !isWheelEvent) {\n            return false;\n        }\n        // if the target element is inside an element with the nowheel class, we prevent zooming\n        if (isWrappedWithClass(event, noWheelClassName) && isWheelEvent) {\n            return false;\n        }\n        // if the target element is inside an element with the nopan class, we prevent panning\n        if (isWrappedWithClass(event, noPanClassName) &&\n            (!isWheelEvent || (panOnScroll && isWheelEvent && !zoomActivationKeyPressed))) {\n            return false;\n        }\n        if (!zoomOnPinch && event.ctrlKey && isWheelEvent) {\n            return false;\n        }\n        if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) {\n            event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom\n            return false;\n        }\n        // when there is no scroll handling enabled, we prevent all wheel events\n        if (!zoomScroll && !panOnScroll && !pinchZoom && isWheelEvent) {\n            return false;\n        }\n        // if the pane is not movable, we prevent dragging it with mousestart or touchstart\n        if (!panOnDrag && (event.type === 'mousedown' || event.type === 'touchstart')) {\n            return false;\n        }\n        // if the pane is only movable using allowed clicks\n        if (Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === 'mousedown') {\n            return false;\n        }\n        // We only allow right clicks if pan on drag is set to right click\n        const buttonAllowed = (Array.isArray(panOnDrag) && panOnDrag.includes(event.button)) || !event.button || event.button <= 1;\n        // d3-zoom rejects Ctrl-modified mouse drags by default because Ctrl+wheel is\n        // commonly used for pinch zooming. Allow the drag when Control is the\n        // configured pan activation key, while retaining the wheel safeguard.\n        return (!event.ctrlKey || isWheelEvent || panActivationKeyPressed) && buttonAllowed;\n    };\n}\n\nfunction XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }) {\n    const zoomPanValues = {\n        isZoomingOrPanning: false,\n        usedRightMouseButton: false,\n        prevViewport: { },\n        mouseButton: 0,\n        timerId: undefined,\n        panScrollTimeout: undefined,\n        isPanScrolling: false,\n    };\n    const bbox = domNode.getBoundingClientRect();\n    /*\n     * Cache the pane extent and refresh it from a ResizeObserver. Otherwise d3-zoom falls back to its\n     * defaultExtent, which reads clientWidth/clientHeight and forces a synchronous layout while panning\n     * and pinching. The observer is never disconnected on purpose: destroy() also runs to pause zooming\n     * during a user selection, so disconnecting there would leave the cache stale. It becomes unreachable\n     * and is garbage collected with the pane on unmount.\n     */\n    let cachedExtent = [\n        [0, 0],\n        [bbox.width, bbox.height],\n    ];\n    const extentResizeObserver = typeof ResizeObserver !== 'undefined'\n        ? new ResizeObserver((entries) => {\n            const entry = entries[0];\n            if (entry) {\n                cachedExtent = [\n                    [0, 0],\n                    [entry.contentRect.width, entry.contentRect.height],\n                ];\n            }\n        })\n        : null;\n    extentResizeObserver?.observe(domNode);\n    const d3ZoomInstance = zoom()\n        .extent(() => cachedExtent)\n        .scaleExtent([minZoom, maxZoom])\n        .translateExtent(translateExtent);\n    const d3Selection = select(domNode).call(d3ZoomInstance);\n    setViewportConstrained({\n        x: viewport.x,\n        y: viewport.y,\n        zoom: clamp(viewport.zoom, minZoom, maxZoom),\n    }, [\n        [0, 0],\n        [bbox.width, bbox.height],\n    ], translateExtent);\n    const d3ZoomHandler = d3Selection.on('wheel.zoom');\n    const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom');\n    d3ZoomInstance.wheelDelta(wheelDelta);\n    async function setTransform(transform, options) {\n        if (d3Selection) {\n            return new Promise((resolve) => {\n                d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), transform);\n            });\n        }\n        return false;\n    }\n    // public functions\n    function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, panActivationKeyPressed = false, zoomActivationKeyPressed, lib, onTransformChange, connectionInProgress, paneClickDistance, selectionOnDrag, }) {\n        if (userSelectionActive && !zoomPanValues.isZoomingOrPanning) {\n            destroy();\n        }\n        const isPanOnScroll = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive;\n        d3ZoomInstance.clickDistance(selectionOnDrag ? Infinity : !isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance);\n        const wheelHandler = isPanOnScroll\n            ? createPanOnScrollHandler({\n                zoomPanValues,\n                noWheelClassName,\n                d3Selection,\n                d3Zoom: d3ZoomInstance,\n                panOnScrollMode,\n                panOnScrollSpeed,\n                zoomOnPinch,\n                onPanZoomStart,\n                onPanZoom,\n                onPanZoomEnd,\n            })\n            : createZoomOnScrollHandler({\n                noWheelClassName,\n                preventScrolling,\n                d3ZoomHandler,\n            });\n        d3Selection.on('wheel.zoom', wheelHandler, { passive: false });\n        // pan zoom start\n        const startHandler = createPanZoomStartHandler({\n            zoomPanValues,\n            onDraggingChange,\n            onPanZoomStart,\n        });\n        d3ZoomInstance.on('start', startHandler);\n        // pan zoom\n        const panZoomHandler = createPanZoomHandler({\n            zoomPanValues,\n            panOnDrag,\n            onPaneContextMenu: !!onPaneContextMenu,\n            onPanZoom,\n            onTransformChange,\n        });\n        d3ZoomInstance.on('zoom', panZoomHandler);\n        // pan zoom end\n        const panZoomEndHandler = createPanZoomEndHandler({\n            zoomPanValues,\n            panOnDrag,\n            panOnScroll,\n            onPaneContextMenu,\n            onPanZoomEnd,\n            onDraggingChange,\n        });\n        d3ZoomInstance.on('end', panZoomEndHandler);\n        const filter = createFilter({\n            panActivationKeyPressed,\n            zoomActivationKeyPressed,\n            panOnDrag,\n            zoomOnScroll,\n            panOnScroll,\n            zoomOnDoubleClick,\n            zoomOnPinch,\n            userSelectionActive,\n            noPanClassName,\n            noWheelClassName,\n            lib,\n            connectionInProgress,\n        });\n        d3ZoomInstance.filter(filter);\n        /*\n         * We cannot add zoomOnDoubleClick to the filter above because\n         * double tapping on touch screens circumvents the filter and\n         * dblclick.zoom is fired on the selection directly\n         */\n        if (zoomOnDoubleClick) {\n            d3Selection.on('dblclick.zoom', d3DblClickZoomHandler);\n        }\n        else {\n            d3Selection.on('dblclick.zoom', null);\n        }\n    }\n    function destroy() {\n        d3ZoomInstance.on('zoom', null);\n    }\n    async function setViewportConstrained(viewport, extent, translateExtent) {\n        const nextTransform = viewportToTransform(viewport);\n        const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent);\n        if (contrainedTransform) {\n            await setTransform(contrainedTransform);\n        }\n        return contrainedTransform;\n    }\n    async function setViewport(viewport, options) {\n        const nextTransform = viewportToTransform(viewport);\n        await setTransform(nextTransform, options);\n        return nextTransform;\n    }\n    function syncViewport(viewport) {\n        if (d3Selection) {\n            const nextTransform = viewportToTransform(viewport);\n            const currentTransform = d3Selection.property('__zoom');\n            if (currentTransform.k !== viewport.zoom ||\n                currentTransform.x !== viewport.x ||\n                currentTransform.y !== viewport.y) {\n                // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n                // @ts-ignore\n                d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true });\n            }\n        }\n    }\n    function getViewport() {\n        const transform = d3Selection ? zoomTransform(d3Selection.node()) : { x: 0, y: 0, k: 1 };\n        return { x: transform.x, y: transform.y, zoom: transform.k };\n    }\n    async function scaleTo(zoom, options) {\n        if (d3Selection) {\n            return new Promise((resolve) => {\n                d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleTo(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), zoom);\n            });\n        }\n        return false;\n    }\n    async function scaleBy(factor, options) {\n        if (d3Selection) {\n            return new Promise((resolve) => {\n                d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleBy(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), factor);\n            });\n        }\n        return false;\n    }\n    function setScaleExtent(scaleExtent) {\n        d3ZoomInstance?.scaleExtent(scaleExtent);\n    }\n    function setTranslateExtent(translateExtent) {\n        d3ZoomInstance?.translateExtent(translateExtent);\n    }\n    function setClickDistance(distance) {\n        const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance;\n        d3ZoomInstance?.clickDistance(validDistance);\n    }\n    return {\n        update,\n        destroy,\n        setViewport,\n        setViewportConstrained,\n        getViewport,\n        scaleTo,\n        scaleBy,\n        setScaleExtent,\n        setTranslateExtent,\n        syncViewport,\n        setClickDistance,\n    };\n}\n\n/**\n * Used to determine the variant of the resize control\n *\n * @public\n */\nvar ResizeControlVariant;\n(function (ResizeControlVariant) {\n    ResizeControlVariant[\"Line\"] = \"line\";\n    ResizeControlVariant[\"Handle\"] = \"handle\";\n})(ResizeControlVariant || (ResizeControlVariant = {}));\nconst XY_RESIZER_HANDLE_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\nconst XY_RESIZER_LINE_POSITIONS = ['top', 'right', 'bottom', 'left'];\n\n/**\n * Get all connecting edges for a given set of nodes\n * @param width - new width of the node\n * @param prevWidth - previous width of the node\n * @param height - new height of the node\n * @param prevHeight - previous height of the node\n * @param affectsX - whether to invert the resize direction for the x axis\n * @param affectsY - whether to invert the resize direction for the y axis\n * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease\n */\nfunction getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }) {\n    const deltaWidth = width - prevWidth;\n    const deltaHeight = height - prevHeight;\n    const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0];\n    if (deltaWidth && affectsX) {\n        direction[0] = direction[0] * -1;\n    }\n    if (deltaHeight && affectsY) {\n        direction[1] = direction[1] * -1;\n    }\n    return direction;\n}\n/**\n * Parses the control position that is being dragged to dimensions that are being resized\n * @param controlPosition - position of the control that is being dragged\n * @returns isHorizontal, isVertical, affectsX, affectsY,\n */\nfunction getControlDirection(controlPosition) {\n    const isHorizontal = controlPosition.includes('right') || controlPosition.includes('left');\n    const isVertical = controlPosition.includes('bottom') || controlPosition.includes('top');\n    const affectsX = controlPosition.includes('left');\n    const affectsY = controlPosition.includes('top');\n    return {\n        isHorizontal,\n        isVertical,\n        affectsX,\n        affectsY,\n    };\n}\nfunction getLowerExtentClamp(lowerExtent, lowerBound) {\n    return Math.max(0, lowerBound - lowerExtent);\n}\nfunction getUpperExtentClamp(upperExtent, upperBound) {\n    return Math.max(0, upperExtent - upperBound);\n}\nfunction getSizeClamp(size, minSize, maxSize) {\n    return Math.max(0, minSize - size, size - maxSize);\n}\nfunction xor(a, b) {\n    return a ? !b : b;\n}\n/**\n * Calculates new width & height and x & y of node after resize based on pointer position\n * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize,\n * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed\n * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes\n * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio!\n * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the\n * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio,\n * the resize amount is always kept in distX & distY amount (the distance in mouse movement)\n * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values.\n * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0],\n * then calculating the restrictions as usual\n * @param startValues - starting values of resize\n * @param controlDirection - dimensions affected by the resize\n * @param pointerPosition - the current pointer position corrected for snapping\n * @param boundaries - minimum and maximum dimensions of the node\n * @param keepAspectRatio - prevent changes of asprect ratio\n * @returns x, y, width and height of the node after resize\n */\nfunction getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, extent, childExtent) {\n    let { affectsX, affectsY } = controlDirection;\n    const { isHorizontal, isVertical } = controlDirection;\n    const isDiagonal = isHorizontal && isVertical;\n    const { xSnapped, ySnapped } = pointerPosition;\n    const { minWidth, maxWidth, minHeight, maxHeight } = boundaries;\n    const { x: startX, y: startY, width: startWidth, height: startHeight, aspectRatio } = startValues;\n    let distX = Math.floor(isHorizontal ? xSnapped - startValues.pointerX : 0);\n    let distY = Math.floor(isVertical ? ySnapped - startValues.pointerY : 0);\n    const newWidth = startWidth + (affectsX ? -distX : distX);\n    const newHeight = startHeight + (affectsY ? -distY : distY);\n    const originOffsetX = -nodeOrigin[0] * startWidth;\n    const originOffsetY = -nodeOrigin[1] * startHeight;\n    // Check if maxWidth, minWWidth, maxHeight, minHeight are restricting the resize\n    let clampX = getSizeClamp(newWidth, minWidth, maxWidth);\n    let clampY = getSizeClamp(newHeight, minHeight, maxHeight);\n    // Check if extent is restricting the resize\n    if (extent) {\n        let xExtentClamp = 0;\n        let yExtentClamp = 0;\n        if (affectsX && distX < 0) {\n            xExtentClamp = getLowerExtentClamp(startX + distX + originOffsetX, extent[0][0]);\n        }\n        else if (!affectsX && distX > 0) {\n            xExtentClamp = getUpperExtentClamp(startX + newWidth + originOffsetX, extent[1][0]);\n        }\n        if (affectsY && distY < 0) {\n            yExtentClamp = getLowerExtentClamp(startY + distY + originOffsetY, extent[0][1]);\n        }\n        else if (!affectsY && distY > 0) {\n            yExtentClamp = getUpperExtentClamp(startY + newHeight + originOffsetY, extent[1][1]);\n        }\n        clampX = Math.max(clampX, xExtentClamp);\n        clampY = Math.max(clampY, yExtentClamp);\n    }\n    // Check if the child extent is restricting the resize\n    if (childExtent) {\n        let xExtentClamp = 0;\n        let yExtentClamp = 0;\n        if (affectsX && distX > 0) {\n            xExtentClamp = getUpperExtentClamp(startX + distX, childExtent[0][0]);\n        }\n        else if (!affectsX && distX < 0) {\n            xExtentClamp = getLowerExtentClamp(startX + newWidth, childExtent[1][0]);\n        }\n        if (affectsY && distY > 0) {\n            yExtentClamp = getUpperExtentClamp(startY + distY, childExtent[0][1]);\n        }\n        else if (!affectsY && distY < 0) {\n            yExtentClamp = getLowerExtentClamp(startY + newHeight, childExtent[1][1]);\n        }\n        clampX = Math.max(clampX, xExtentClamp);\n        clampY = Math.max(clampY, yExtentClamp);\n    }\n    // Check if the aspect ratio resizing of the other side is restricting the resize\n    if (keepAspectRatio) {\n        if (isHorizontal) {\n            // Check if the max dimensions might be restricting the resize\n            const aspectHeightClamp = getSizeClamp(newWidth / aspectRatio, minHeight, maxHeight) * aspectRatio;\n            clampX = Math.max(clampX, aspectHeightClamp);\n            // Check if the extent is restricting the resize\n            if (extent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startY + originOffsetY + newWidth / aspectRatio, extent[1][1]) * aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getLowerExtentClamp(startY + originOffsetY + (affectsX ? distX : -distX) / aspectRatio, extent[0][1]) *\n                            aspectRatio;\n                }\n                clampX = Math.max(clampX, aspectExtentClamp);\n            }\n            // Check if the child extent is restricting the resize\n            if (childExtent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n                    aspectExtentClamp = getLowerExtentClamp(startY + newWidth / aspectRatio, childExtent[1][1]) * aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startY + (affectsX ? distX : -distX) / aspectRatio, childExtent[0][1]) * aspectRatio;\n                }\n                clampX = Math.max(clampX, aspectExtentClamp);\n            }\n        }\n        // Do the same thing for vertical resizing\n        if (isVertical) {\n            const aspectWidthClamp = getSizeClamp(newHeight * aspectRatio, minWidth, maxWidth) / aspectRatio;\n            clampY = Math.max(clampY, aspectWidthClamp);\n            if (extent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startX + newHeight * aspectRatio + originOffsetX, extent[1][0]) / aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getLowerExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio + originOffsetX, extent[0][0]) /\n                            aspectRatio;\n                }\n                clampY = Math.max(clampY, aspectExtentClamp);\n            }\n            if (childExtent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n                    aspectExtentClamp = getLowerExtentClamp(startX + newHeight * aspectRatio, childExtent[1][0]) / aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio, childExtent[0][0]) / aspectRatio;\n                }\n                clampY = Math.max(clampY, aspectExtentClamp);\n            }\n        }\n    }\n    distY = distY + (distY < 0 ? clampY : -clampY);\n    distX = distX + (distX < 0 ? clampX : -clampX);\n    if (keepAspectRatio) {\n        if (isDiagonal) {\n            if (newWidth > newHeight * aspectRatio) {\n                distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio;\n            }\n            else {\n                distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio;\n            }\n        }\n        else {\n            if (isHorizontal) {\n                distY = distX / aspectRatio;\n                affectsY = affectsX;\n            }\n            else {\n                distX = distY * aspectRatio;\n                affectsX = affectsY;\n            }\n        }\n    }\n    const x = affectsX ? startX + distX : startX;\n    const y = affectsY ? startY + distY : startY;\n    return {\n        width: startWidth + (affectsX ? -distX : distX),\n        height: startHeight + (affectsY ? -distY : distY),\n        x: nodeOrigin[0] * distX * (!affectsX ? 1 : -1) + x,\n        y: nodeOrigin[1] * distY * (!affectsY ? 1 : -1) + y,\n    };\n}\n\nconst initPrevValues = { width: 0, height: 0, x: 0, y: 0 };\nconst initStartValues = {\n    ...initPrevValues,\n    pointerX: 0,\n    pointerY: 0,\n    aspectRatio: 1,\n};\nfunction nodeToChildExtent(child, parent, nodeOrigin) {\n    const x = parent.position.x + child.position.x;\n    const y = parent.position.y + child.position.y;\n    const width = child.measured.width ?? 0;\n    const height = child.measured.height ?? 0;\n    const originOffsetX = nodeOrigin[0] * width;\n    const originOffsetY = nodeOrigin[1] * height;\n    return [\n        [x - originOffsetX, y - originOffsetY],\n        [x + width - originOffsetX, y + height - originOffsetY],\n    ];\n}\nfunction XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {\n    const selection = select(domNode);\n    let params = {\n        controlDirection: getControlDirection('bottom-right'),\n        boundaries: {\n            minWidth: 0,\n            minHeight: 0,\n            maxWidth: Number.MAX_VALUE,\n            maxHeight: Number.MAX_VALUE,\n        },\n        resizeDirection: undefined,\n        keepAspectRatio: false,\n    };\n    function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize, }) {\n        let prevValues = { ...initPrevValues };\n        let startValues = { ...initStartValues };\n        params = {\n            boundaries,\n            resizeDirection,\n            keepAspectRatio,\n            controlDirection: getControlDirection(controlPosition),\n        };\n        let node = undefined;\n        let containerBounds = null;\n        let childNodes = [];\n        let parentNode = undefined; // Needed to fix expandParent\n        let nodeExtent = undefined;\n        let childExtent = undefined;\n        // we only want to trigger onResizeEnd if onResize was actually called\n        let resizeDetected = false;\n        const dragHandler = drag()\n            .on('start', (event) => {\n            const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems();\n            node = nodeLookup.get(nodeId);\n            if (!node) {\n                return;\n            }\n            containerBounds = paneDomNode?.getBoundingClientRect() ?? null;\n            const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, {\n                transform,\n                snapGrid,\n                snapToGrid,\n                containerBounds,\n            });\n            prevValues = {\n                width: node.measured.width ?? 0,\n                height: node.measured.height ?? 0,\n                x: node.position.x ?? 0,\n                y: node.position.y ?? 0,\n            };\n            startValues = {\n                ...prevValues,\n                pointerX: xSnapped,\n                pointerY: ySnapped,\n                aspectRatio: prevValues.width / prevValues.height,\n            };\n            parentNode = undefined;\n            nodeExtent = isCoordinateExtent(node.extent) ? node.extent : undefined;\n            if (node.parentId && (node.extent === 'parent' || node.expandParent)) {\n                parentNode = nodeLookup.get(node.parentId);\n            }\n            if (parentNode && node.extent === 'parent') {\n                nodeExtent = [\n                    [0, 0],\n                    [parentNode.measured.width, parentNode.measured.height],\n                ];\n            }\n            /*\n             * Collect all child nodes to correct their relative positions when top/left changes\n             * Determine largest minimal extent the parent node is allowed to resize to\n             */\n            childNodes = [];\n            childExtent = undefined;\n            for (const [childId, child] of nodeLookup) {\n                if (child.parentId === nodeId) {\n                    childNodes.push({\n                        id: childId,\n                        position: { ...child.position },\n                        extent: child.extent,\n                    });\n                    if (child.extent === 'parent' || child.expandParent) {\n                        const extent = nodeToChildExtent(child, node, child.origin ?? nodeOrigin);\n                        if (childExtent) {\n                            childExtent = [\n                                [Math.min(extent[0][0], childExtent[0][0]), Math.min(extent[0][1], childExtent[0][1])],\n                                [Math.max(extent[1][0], childExtent[1][0]), Math.max(extent[1][1], childExtent[1][1])],\n                            ];\n                        }\n                        else {\n                            childExtent = extent;\n                        }\n                    }\n                }\n            }\n            onResizeStart?.(event, { ...prevValues });\n        })\n            .on('drag', (event) => {\n            const { transform, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems();\n            const pointerPosition = getPointerPosition(event.sourceEvent, {\n                transform,\n                snapGrid,\n                snapToGrid,\n                containerBounds,\n            });\n            const childChanges = [];\n            if (!node) {\n                return;\n            }\n            const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues;\n            const change = {};\n            const nodeOrigin = node.origin ?? storeNodeOrigin;\n            const { width, height, x, y } = getDimensionsAfterResize(startValues, params.controlDirection, pointerPosition, params.boundaries, params.keepAspectRatio, nodeOrigin, nodeExtent, childExtent);\n            const isWidthChange = width !== prevWidth;\n            const isHeightChange = height !== prevHeight;\n            const isXPosChange = x !== prevX && isWidthChange;\n            const isYPosChange = y !== prevY && isHeightChange;\n            if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange) {\n                return;\n            }\n            if (isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) {\n                change.x = isXPosChange ? x : prevValues.x;\n                change.y = isYPosChange ? y : prevValues.y;\n                prevValues.x = change.x;\n                prevValues.y = change.y;\n                /*\n                 * when top/left changes, correct the relative positions of child nodes\n                 * so that they stay in the same position\n                 */\n                if (childNodes.length > 0) {\n                    const xChange = x - prevX;\n                    const yChange = y - prevY;\n                    for (const childNode of childNodes) {\n                        childNode.position = {\n                            x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth),\n                            y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight),\n                        };\n                        childChanges.push(childNode);\n                    }\n                }\n            }\n            if (isWidthChange || isHeightChange) {\n                change.width =\n                    isWidthChange && (!params.resizeDirection || params.resizeDirection === 'horizontal')\n                        ? width\n                        : prevValues.width;\n                change.height =\n                    isHeightChange && (!params.resizeDirection || params.resizeDirection === 'vertical')\n                        ? height\n                        : prevValues.height;\n                prevValues.width = change.width;\n                prevValues.height = change.height;\n            }\n            // Fix expandParent when resizing from top/left\n            if (parentNode && node.expandParent) {\n                const xLimit = nodeOrigin[0] * (change.width ?? 0);\n                if (change.x && change.x < xLimit) {\n                    prevValues.x = xLimit;\n                    startValues.x = startValues.x - (change.x - xLimit);\n                }\n                const yLimit = nodeOrigin[1] * (change.height ?? 0);\n                if (change.y && change.y < yLimit) {\n                    prevValues.y = yLimit;\n                    startValues.y = startValues.y - (change.y - yLimit);\n                }\n            }\n            const direction = getResizeDirection({\n                width: prevValues.width,\n                prevWidth,\n                height: prevValues.height,\n                prevHeight,\n                affectsX: params.controlDirection.affectsX,\n                affectsY: params.controlDirection.affectsY,\n            });\n            const nextValues = { ...prevValues, direction };\n            const callResize = shouldResize?.(event, nextValues);\n            if (callResize === false) {\n                return;\n            }\n            resizeDetected = true;\n            onResize?.(event, nextValues);\n            onChange(change, childChanges);\n        })\n            .on('end', (event) => {\n            if (!resizeDetected) {\n                return;\n            }\n            onResizeEnd?.(event, { ...prevValues });\n            onEnd?.({ ...prevValues });\n            resizeDetected = false;\n        });\n        selection.call(dragHandler);\n    }\n    function destroy() {\n        selection.on('.drag', null);\n    }\n    return {\n        update,\n        destroy,\n    };\n}\n\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createDevWarn, createMarkerIds, defaultAriaLabelConfig, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgeId, getEdgePosition, getEdgeToolbarTransform, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getRectsOverlappingArea, getSmoothStepPath, getStraightPath, getViewportForBounds, handleAttributionWarning, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isAttributionVisible, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isManualZIndexMode, isMouseEvent, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers };\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n  useState = React.useState,\n  useEffect = React.useEffect,\n  useLayoutEffect = React.useLayoutEffect,\n  useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n  var value = getSnapshot(),\n    _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n    inst = _useState[0].inst,\n    forceUpdate = _useState[1];\n  useLayoutEffect(\n    function () {\n      inst.value = value;\n      inst.getSnapshot = getSnapshot;\n      checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n    },\n    [subscribe, value, getSnapshot]\n  );\n  useEffect(\n    function () {\n      checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n      return subscribe(function () {\n        checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n      });\n    },\n    [subscribe]\n  );\n  useDebugValue(value);\n  return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n  var latestGetSnapshot = inst.getSnapshot;\n  inst = inst.value;\n  try {\n    var nextValue = latestGetSnapshot();\n    return !objectIs(inst, nextValue);\n  } catch (error) {\n    return !0;\n  }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n  return getSnapshot();\n}\nvar shim =\n  \"undefined\" === typeof window ||\n  \"undefined\" === typeof window.document ||\n  \"undefined\" === typeof window.document.createElement\n    ? useSyncExternalStore$1\n    : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n  void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n  (function () {\n    function is(x, y) {\n      return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n    }\n    function useSyncExternalStore$2(subscribe, getSnapshot) {\n      didWarnOld18Alpha ||\n        void 0 === React.startTransition ||\n        ((didWarnOld18Alpha = !0),\n        console.error(\n          \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n        ));\n      var value = getSnapshot();\n      if (!didWarnUncachedGetSnapshot) {\n        var cachedValue = getSnapshot();\n        objectIs(value, cachedValue) ||\n          (console.error(\n            \"The result of getSnapshot should be cached to avoid an infinite loop\"\n          ),\n          (didWarnUncachedGetSnapshot = !0));\n      }\n      cachedValue = useState({\n        inst: { value: value, getSnapshot: getSnapshot }\n      });\n      var inst = cachedValue[0].inst,\n        forceUpdate = cachedValue[1];\n      useLayoutEffect(\n        function () {\n          inst.value = value;\n          inst.getSnapshot = getSnapshot;\n          checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n        },\n        [subscribe, value, getSnapshot]\n      );\n      useEffect(\n        function () {\n          checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n          return subscribe(function () {\n            checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n          });\n        },\n        [subscribe]\n      );\n      useDebugValue(value);\n      return value;\n    }\n    function checkIfSnapshotChanged(inst) {\n      var latestGetSnapshot = inst.getSnapshot;\n      inst = inst.value;\n      try {\n        var nextValue = latestGetSnapshot();\n        return !objectIs(inst, nextValue);\n      } catch (error) {\n        return !0;\n      }\n    }\n    function useSyncExternalStore$1(subscribe, getSnapshot) {\n      return getSnapshot();\n    }\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n    var React = require(\"react\"),\n      objectIs = \"function\" === typeof Object.is ? Object.is : is,\n      useState = React.useState,\n      useEffect = React.useEffect,\n      useLayoutEffect = React.useLayoutEffect,\n      useDebugValue = React.useDebugValue,\n      didWarnOld18Alpha = !1,\n      didWarnUncachedGetSnapshot = !1,\n      shim =\n        \"undefined\" === typeof window ||\n        \"undefined\" === typeof window.document ||\n        \"undefined\" === typeof window.document.createElement\n          ? useSyncExternalStore$1\n          : useSyncExternalStore$2;\n    exports.useSyncExternalStore =\n      void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n  })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n  shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n  useSyncExternalStore = shim.useSyncExternalStore,\n  useRef = React.useRef,\n  useEffect = React.useEffect,\n  useMemo = React.useMemo,\n  useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n  subscribe,\n  getSnapshot,\n  getServerSnapshot,\n  selector,\n  isEqual\n) {\n  var instRef = useRef(null);\n  if (null === instRef.current) {\n    var inst = { hasValue: !1, value: null };\n    instRef.current = inst;\n  } else inst = instRef.current;\n  instRef = useMemo(\n    function () {\n      function memoizedSelector(nextSnapshot) {\n        if (!hasMemo) {\n          hasMemo = !0;\n          memoizedSnapshot = nextSnapshot;\n          nextSnapshot = selector(nextSnapshot);\n          if (void 0 !== isEqual && inst.hasValue) {\n            var currentSelection = inst.value;\n            if (isEqual(currentSelection, nextSnapshot))\n              return (memoizedSelection = currentSelection);\n          }\n          return (memoizedSelection = nextSnapshot);\n        }\n        currentSelection = memoizedSelection;\n        if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n        var nextSelection = selector(nextSnapshot);\n        if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n          return (memoizedSnapshot = nextSnapshot), currentSelection;\n        memoizedSnapshot = nextSnapshot;\n        return (memoizedSelection = nextSelection);\n      }\n      var hasMemo = !1,\n        memoizedSnapshot,\n        memoizedSelection,\n        maybeGetServerSnapshot =\n          void 0 === getServerSnapshot ? null : getServerSnapshot;\n      return [\n        function () {\n          return memoizedSelector(getSnapshot());\n        },\n        null === maybeGetServerSnapshot\n          ? void 0\n          : function () {\n              return memoizedSelector(maybeGetServerSnapshot());\n            }\n      ];\n    },\n    [getSnapshot, getServerSnapshot, selector, isEqual]\n  );\n  var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n  useEffect(\n    function () {\n      inst.hasValue = !0;\n      inst.value = value;\n    },\n    [value]\n  );\n  useDebugValue(value);\n  return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n  (function () {\n    function is(x, y) {\n      return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n    }\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n    var React = require(\"react\"),\n      shim = require(\"use-sync-external-store/shim\"),\n      objectIs = \"function\" === typeof Object.is ? Object.is : is,\n      useSyncExternalStore = shim.useSyncExternalStore,\n      useRef = React.useRef,\n      useEffect = React.useEffect,\n      useMemo = React.useMemo,\n      useDebugValue = React.useDebugValue;\n    exports.useSyncExternalStoreWithSelector = function (\n      subscribe,\n      getSnapshot,\n      getServerSnapshot,\n      selector,\n      isEqual\n    ) {\n      var instRef = useRef(null);\n      if (null === instRef.current) {\n        var inst = { hasValue: !1, value: null };\n        instRef.current = inst;\n      } else inst = instRef.current;\n      instRef = useMemo(\n        function () {\n          function memoizedSelector(nextSnapshot) {\n            if (!hasMemo) {\n              hasMemo = !0;\n              memoizedSnapshot = nextSnapshot;\n              nextSnapshot = selector(nextSnapshot);\n              if (void 0 !== isEqual && inst.hasValue) {\n                var currentSelection = inst.value;\n                if (isEqual(currentSelection, nextSnapshot))\n                  return (memoizedSelection = currentSelection);\n              }\n              return (memoizedSelection = nextSnapshot);\n            }\n            currentSelection = memoizedSelection;\n            if (objectIs(memoizedSnapshot, nextSnapshot))\n              return currentSelection;\n            var nextSelection = selector(nextSnapshot);\n            if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n              return (memoizedSnapshot = nextSnapshot), currentSelection;\n            memoizedSnapshot = nextSnapshot;\n            return (memoizedSelection = nextSelection);\n          }\n          var hasMemo = !1,\n            memoizedSnapshot,\n            memoizedSelection,\n            maybeGetServerSnapshot =\n              void 0 === getServerSnapshot ? null : getServerSnapshot;\n          return [\n            function () {\n              return memoizedSelector(getSnapshot());\n            },\n            null === maybeGetServerSnapshot\n              ? void 0\n              : function () {\n                  return memoizedSelector(maybeGetServerSnapshot());\n                }\n          ];\n        },\n        [getSnapshot, getServerSnapshot, selector, isEqual]\n      );\n      var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n      useEffect(\n        function () {\n          inst.hasValue = !0;\n          inst.value = value;\n        },\n        [value]\n      );\n      useDebugValue(value);\n      return value;\n    };\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n  })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","const createStoreImpl = (createState) => {\n  let state;\n  const listeners = /* @__PURE__ */ new Set();\n  const setState = (partial, replace) => {\n    const nextState = typeof partial === \"function\" ? partial(state) : partial;\n    if (!Object.is(nextState, state)) {\n      const previousState = state;\n      state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n      listeners.forEach((listener) => listener(state, previousState));\n    }\n  };\n  const getState = () => state;\n  const getInitialState = () => initialState;\n  const subscribe = (listener) => {\n    listeners.add(listener);\n    return () => listeners.delete(listener);\n  };\n  const destroy = () => {\n    if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n      console.warn(\n        \"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.\"\n      );\n    }\n    listeners.clear();\n  };\n  const api = { setState, getState, getInitialState, subscribe, destroy };\n  const initialState = state = createState(setState, getState, api);\n  return api;\n};\nconst createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;\nvar vanilla = (createState) => {\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n    console.warn(\n      \"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'.\"\n    );\n  }\n  return createStore(createState);\n};\n\nexport { createStore, vanilla as default };\n","import ReactExports from 'react';\nimport useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js';\nimport { createStore } from 'zustand/vanilla';\n\nconst { useDebugValue } = ReactExports;\nconst { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;\nconst identity = (arg) => arg;\nfunction useStoreWithEqualityFn(api, selector = identity, equalityFn) {\n  const slice = useSyncExternalStoreWithSelector(\n    api.subscribe,\n    api.getState,\n    api.getServerState || api.getInitialState,\n    selector,\n    equalityFn\n  );\n  useDebugValue(slice);\n  return slice;\n}\nconst createWithEqualityFnImpl = (createState, defaultEqualityFn) => {\n  const api = createStore(createState);\n  const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn);\n  Object.assign(useBoundStoreWithEqualityFn, api);\n  return useBoundStoreWithEqualityFn;\n};\nconst createWithEqualityFn = (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl;\n\nexport { createWithEqualityFn, useStoreWithEqualityFn };\n","function shallow$1(objA, objB) {\n  if (Object.is(objA, objB)) {\n    return true;\n  }\n  if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n    return false;\n  }\n  if (objA instanceof Map && objB instanceof Map) {\n    if (objA.size !== objB.size) return false;\n    for (const [key, value] of objA) {\n      if (!Object.is(value, objB.get(key))) {\n        return false;\n      }\n    }\n    return true;\n  }\n  if (objA instanceof Set && objB instanceof Set) {\n    if (objA.size !== objB.size) return false;\n    for (const value of objA) {\n      if (!objB.has(value)) {\n        return false;\n      }\n    }\n    return true;\n  }\n  const keysA = Object.keys(objA);\n  if (keysA.length !== Object.keys(objB).length) {\n    return false;\n  }\n  for (const keyA of keysA) {\n    if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) {\n      return false;\n    }\n  }\n  return true;\n}\n\nvar shallow = (objA, objB) => {\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n    console.warn(\n      \"[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`.\"\n    );\n  }\n  return shallow$1(objA, objB);\n};\n\nexport { shallow as default, shallow$1 as shallow };\n","\"use client\"\nimport { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react';\nimport cc from 'classcat';\nimport { errorMessages, handleAttributionWarning, infiniteExtent, mergeAriaLabelConfig, isInputDOMNode, rendererPointToPoint, pointToRendererPoint, getViewportForBounds, createDevWarn, addEdge as addEdge$1, reconnectEdge as reconnectEdge$1, isNodeBase, isEdgeBase, withResolvers, getNodesBounds, isRectObject, getOverlappingArea, nodeToRect, getElementsToRemove, evaluateAbsolutePosition, getDimensions, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, calcAutoPan, getNodesInside, areSetsEqual, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, getHostForElement, XYHandle, isMouseEvent, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, defaultAriaLabelConfig, initialConnection, panBy, getHandlePosition, handleExpandParent, updateNodeInternals, updateAbsolutePositions, fitViewport, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform, getEdgeToolbarTransform } from '@xyflow/system';\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from '@xyflow/system';\nimport { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional';\nimport { shallow } from 'zustand/shallow';\nimport { createPortal } from 'react-dom';\n\nconst StoreContext = createContext(null);\nconst Provider$1 = StoreContext.Provider;\n\nconst zustandErrorMessage = errorMessages['error001']('react');\n/**\n * This hook can be used to subscribe to internal state changes of the React Flow\n * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand)\n * state management library, so you should check out their docs for more details.\n *\n * @public\n * @param selector - A selector function that returns a slice of the flow's internal state.\n * Extracting or transforming just the state you need is a good practice to avoid unnecessary\n * re-renders.\n * @param equalityFn - A function to compare the previous and next value. This is incredibly useful\n * for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing\n * `zustand/shallow`, but you can be as granular as you like.\n * @returns The selected state slice.\n *\n * @example\n * ```ts\n * const nodes = useStore((state) => state.nodes);\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\nfunction useStore(selector, equalityFn) {\n    const store = useContext(StoreContext);\n    if (store === null) {\n        throw new Error(zustandErrorMessage);\n    }\n    return useStoreWithEqualityFn(store, selector, equalityFn);\n}\n/**\n * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions.\n *\n * @returns The store object.\n * @example\n * ```ts\n * const store = useStoreApi();\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\nfunction useStoreApi() {\n    const store = useContext(StoreContext);\n    if (store === null) {\n        throw new Error(zustandErrorMessage);\n    }\n    return useMemo(() => ({\n        getState: store.getState,\n        setState: store.setState,\n        subscribe: store.subscribe,\n    }), [store]);\n}\n\nconst style = { display: 'none' };\nconst ariaLiveStyle = {\n    position: 'absolute',\n    width: 1,\n    height: 1,\n    margin: -1,\n    border: 0,\n    padding: 0,\n    overflow: 'hidden',\n    clip: 'rect(0px, 0px, 0px, 0px)',\n    clipPath: 'inset(100%)',\n};\nconst ARIA_NODE_DESC_KEY = 'react-flow__node-desc';\nconst ARIA_EDGE_DESC_KEY = 'react-flow__edge-desc';\nconst ARIA_LIVE_MESSAGE = 'react-flow__aria-live';\nconst ariaLiveSelector = (s) => s.ariaLiveMessage;\nconst ariaLabelConfigSelector = (s) => s.ariaLabelConfig;\nfunction AriaLiveMessage({ rfId }) {\n    const ariaLiveMessage = useStore(ariaLiveSelector);\n    return (jsx(\"div\", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, \"aria-live\": \"assertive\", \"aria-atomic\": \"true\", style: ariaLiveStyle, children: ariaLiveMessage }));\n}\nfunction A11yDescriptions({ rfId, disableKeyboardA11y }) {\n    const ariaLabelConfig = useStore(ariaLabelConfigSelector);\n    return (jsxs(Fragment, { children: [jsx(\"div\", { id: `${ARIA_NODE_DESC_KEY}-${rfId}`, style: style, children: disableKeyboardA11y\n                    ? ariaLabelConfig['node.a11yDescription.default']\n                    : ariaLabelConfig['node.a11yDescription.keyboardDisabled'] }), jsx(\"div\", { id: `${ARIA_EDGE_DESC_KEY}-${rfId}`, style: style, children: ariaLabelConfig['edge.a11yDescription.default'] }), !disableKeyboardA11y && jsx(AriaLiveMessage, { rfId: rfId })] }));\n}\n\n/**\n * The `<Panel />` component helps you position content above the viewport.\n * It is used internally by the [`<MiniMap />`](/api-reference/components/minimap)\n * and [`<Controls />`](/api-reference/components/controls) components.\n *\n * @public\n *\n * @example\n * ```jsx\n *import { ReactFlow, Background, Panel } from '@xyflow/react';\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[]} fitView>\n *      <Panel position=\"top-left\">top-left</Panel>\n *      <Panel position=\"top-center\">top-center</Panel>\n *      <Panel position=\"top-right\">top-right</Panel>\n *      <Panel position=\"bottom-left\">bottom-left</Panel>\n *      <Panel position=\"bottom-center\">bottom-center</Panel>\n *      <Panel position=\"bottom-right\">bottom-right</Panel>\n *    </ReactFlow>\n *  );\n *}\n *```\n */\nconst Panel = forwardRef(({ position = 'top-left', children, className, style, ...rest }, ref) => {\n    const positionClasses = `${position}`.split('-');\n    return (jsx(\"div\", { className: cc(['react-flow__panel', className, ...positionClasses]), style: style, ref: ref, ...rest, children: children }));\n});\nPanel.displayName = 'Panel';\n\nconst link = `https://reactflow.dev${process.env.NODE_ENV === 'production' ? '?utm_source=attribution' : '/attribution'}`;\n/**\n * React Flow is independent and entirely funded by its users.\n * If you hide the attribution, please support our work by subscribing to React Flow Pro: https://reactflow.dev/remove-attribution\n */\nfunction Attribution({ proOptions, position = 'bottom-right' }) {\n    useEffect(() => {\n        if (process.env.NODE_ENV !== 'development') {\n            return;\n        }\n        handleAttributionWarning('react');\n    }, []);\n    if (proOptions?.hideAttribution) {\n        return null;\n    }\n    return (jsx(Panel, { position: position, className: \"react-flow__attribution\", \"data-message\": `Please only hide this attribution when you are subscribed to React Flow Pro: ${link}`, children: jsx(\"a\", { href: link, target: \"_blank\", rel: \"noopener noreferrer\", \"aria-label\": \"React Flow attribution\", children: \"React Flow\" }) }));\n}\n\nconst selector$l = (s) => {\n    const selectedNodes = [];\n    const selectedEdges = [];\n    for (const [, node] of s.nodeLookup) {\n        if (node.selected) {\n            selectedNodes.push(node.internals.userNode);\n        }\n    }\n    for (const [, edge] of s.edgeLookup) {\n        if (edge.selected) {\n            selectedEdges.push(edge);\n        }\n    }\n    return { selectedNodes, selectedEdges };\n};\nconst selectId = (obj) => obj.id;\nfunction areEqual$1(a, b) {\n    return (shallow(a.selectedNodes.map(selectId), b.selectedNodes.map(selectId)) &&\n        shallow(a.selectedEdges.map(selectId), b.selectedEdges.map(selectId)));\n}\nfunction SelectionListenerInner({ onSelectionChange, }) {\n    const store = useStoreApi();\n    const { selectedNodes, selectedEdges } = useStore(selector$l, areEqual$1);\n    useEffect(() => {\n        const params = { nodes: selectedNodes, edges: selectedEdges };\n        onSelectionChange?.(params);\n        store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params));\n    }, [selectedNodes, selectedEdges, onSelectionChange]);\n    return null;\n}\nconst changeSelector = (s) => !!s.onSelectionChangeHandlers;\nfunction SelectionListener({ onSelectionChange, }) {\n    const storeHasSelectionChangeHandlers = useStore(changeSelector);\n    if (onSelectionChange || storeHasSelectionChangeHandlers) {\n        return jsx(SelectionListenerInner, { onSelectionChange: onSelectionChange });\n    }\n    return null;\n}\n\nconst defaultNodeOrigin = [0, 0];\nconst defaultViewport = { x: 0, y: 0, zoom: 1 };\n\n/*\n * This component helps us to update the store with the values coming from the user.\n * We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`)\n * and values that have a dedicated setter function in the store (like `setNodes`).\n */\n// These fields exist in the global store, and we need to keep them up to date\nconst reactFlowFieldsToTrack = [\n    'nodes',\n    'edges',\n    'defaultNodes',\n    'defaultEdges',\n    'onConnect',\n    'onConnectStart',\n    'onConnectEnd',\n    'onClickConnectStart',\n    'onClickConnectEnd',\n    'nodesDraggable',\n    'autoPanOnNodeFocus',\n    'nodesConnectable',\n    'nodesFocusable',\n    'edgesFocusable',\n    'edgesReconnectable',\n    'elevateNodesOnSelect',\n    'elevateEdgesOnSelect',\n    'minZoom',\n    'maxZoom',\n    'nodeExtent',\n    'onNodesChange',\n    'onEdgesChange',\n    'elementsSelectable',\n    'connectionMode',\n    'snapGrid',\n    'snapToGrid',\n    'translateExtent',\n    'connectOnClick',\n    'defaultEdgeOptions',\n    'fitView',\n    'fitViewOptions',\n    'onNodesDelete',\n    'onEdgesDelete',\n    'onDelete',\n    'onNodeDrag',\n    'onNodeDragStart',\n    'onNodeDragStop',\n    'onSelectionDrag',\n    'onSelectionDragStart',\n    'onSelectionDragStop',\n    'onMoveStart',\n    'onMove',\n    'onMoveEnd',\n    'noPanClassName',\n    'nodeOrigin',\n    'autoPanOnConnect',\n    'autoPanOnNodeDrag',\n    'onError',\n    'connectionRadius',\n    'isValidConnection',\n    'selectNodesOnDrag',\n    'nodeDragThreshold',\n    'connectionDragThreshold',\n    'onBeforeDelete',\n    'debug',\n    'autoPanSpeed',\n    'ariaLabelConfig',\n    'zIndexMode',\n];\n// rfId doesn't exist in ReactFlowProps, but it's one of the fields we want to update\nconst fieldsToTrack = [...reactFlowFieldsToTrack, 'rfId'];\nconst selector$k = (s) => ({\n    setNodes: s.setNodes,\n    setEdges: s.setEdges,\n    setMinZoom: s.setMinZoom,\n    setMaxZoom: s.setMaxZoom,\n    setTranslateExtent: s.setTranslateExtent,\n    setNodeExtent: s.setNodeExtent,\n    reset: s.reset,\n    setDefaultNodesAndEdges: s.setDefaultNodesAndEdges,\n});\nconst initPrevValues = {\n    /*\n     * these are values that are also passed directly to other components\n     * than the StoreUpdater. We can reduce the number of setStore calls\n     * by setting the same values here as prev fields.\n     */\n    translateExtent: infiniteExtent,\n    nodeOrigin: defaultNodeOrigin,\n    minZoom: 0.5,\n    maxZoom: 2,\n    elementsSelectable: true,\n    noPanClassName: 'nopan',\n    rfId: '1',\n};\nfunction StoreUpdater(props) {\n    const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, } = useStore(selector$k, shallow);\n    const store = useStoreApi();\n    useEffect(() => {\n        setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges);\n        return () => {\n            // when we reset the store we also need to reset the previous fields\n            previousFields.current = initPrevValues;\n            reset();\n        };\n    }, []);\n    const previousFields = useRef(initPrevValues);\n    useEffect(() => {\n        for (const fieldName of fieldsToTrack) {\n            const fieldValue = props[fieldName];\n            const previousFieldValue = previousFields.current[fieldName];\n            if (fieldValue === previousFieldValue)\n                continue;\n            if (typeof props[fieldName] === 'undefined')\n                continue;\n            // Custom handling with dedicated setters for some fields\n            if (fieldName === 'nodes')\n                setNodes(fieldValue);\n            else if (fieldName === 'edges')\n                setEdges(fieldValue);\n            else if (fieldName === 'minZoom')\n                setMinZoom(fieldValue);\n            else if (fieldName === 'maxZoom')\n                setMaxZoom(fieldValue);\n            else if (fieldName === 'translateExtent')\n                setTranslateExtent(fieldValue);\n            else if (fieldName === 'nodeExtent')\n                setNodeExtent(fieldValue);\n            else if (fieldName === 'ariaLabelConfig')\n                store.setState({ ariaLabelConfig: mergeAriaLabelConfig(fieldValue) });\n            // Renamed fields\n            else if (fieldName === 'fitView')\n                store.setState({ fitViewQueued: fieldValue });\n            else if (fieldName === 'fitViewOptions')\n                store.setState({ fitViewOptions: fieldValue });\n            // General case\n            else\n                store.setState({ [fieldName]: fieldValue });\n        }\n        previousFields.current = props;\n    }, \n    // Only re-run the effect if one of the fields we track changes\n    fieldsToTrack.map((fieldName) => props[fieldName]));\n    return null;\n}\n\nfunction getMediaQuery() {\n    if (typeof window === 'undefined' || !window.matchMedia) {\n        return null;\n    }\n    return window.matchMedia('(prefers-color-scheme: dark)');\n}\n/**\n * Hook for receiving the current color mode class 'dark' or 'light'.\n *\n * @internal\n * @param colorMode - The color mode to use ('dark', 'light' or 'system')\n */\nfunction useColorModeClass(colorMode) {\n    const [colorModeClass, setColorModeClass] = useState(colorMode === 'system' ? null : colorMode);\n    useEffect(() => {\n        if (colorMode !== 'system') {\n            setColorModeClass(colorMode);\n            return;\n        }\n        const mediaQuery = getMediaQuery();\n        const updateColorModeClass = () => setColorModeClass(mediaQuery?.matches ? 'dark' : 'light');\n        updateColorModeClass();\n        mediaQuery?.addEventListener('change', updateColorModeClass);\n        return () => {\n            mediaQuery?.removeEventListener('change', updateColorModeClass);\n        };\n    }, [colorMode]);\n    return colorModeClass !== null ? colorModeClass : getMediaQuery()?.matches ? 'dark' : 'light';\n}\n\nconst defaultDoc = typeof document !== 'undefined' ? document : null;\n/**\n * This hook lets you listen for specific key codes and tells you whether they are\n * currently pressed or not.\n *\n * @public\n * @param options - Options\n *\n * @example\n * ```tsx\n *import { useKeyPress } from '@xyflow/react';\n *\n *export default function () {\n *  const spacePressed = useKeyPress('Space');\n *  const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']);\n *\n *  return (\n *    <div>\n *     {spacePressed && <p>Space pressed!</p>}\n *     {cmdAndSPressed && <p>Cmd + S pressed!</p>}\n *    </div>\n *  );\n *}\n *```\n */\nfunction useKeyPress(\n/**\n * The key code (string or array of strings) specifies which key(s) should trigger\n * an action.\n *\n * A **string** can represent:\n * - A **single key**, e.g. `'a'`\n * - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'`\n *\n * An  **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']`\n * means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`.\n * @default null\n */\nkeyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true }) {\n    const [keyPressed, setKeyPressed] = useState(false);\n    // we need to remember if a modifier key is pressed in order to track it\n    const modifierPressed = useRef(false);\n    // we need to remember the pressed keys in order to support combinations\n    const pressedKeys = useRef(new Set([]));\n    /*\n     * keyCodes = array with single keys [['a']] or key combinations [['a', 's']]\n     * keysToWatch = array with all keys flattened ['a', 'd', 'ShiftLeft']\n     * used to check if we store event.code or event.key. When the code is in the list of keysToWatch\n     * we use the code otherwise the key. Explainer: When you press the left \"command\" key, the code is \"MetaLeft\"\n     * and the key is \"Meta\". We want users to be able to pass keys and codes so we assume that the key is meant when\n     * we can't find it in the list of keysToWatch.\n     */\n    const [keyCodes, keysToWatch] = useMemo(() => {\n        if (keyCode !== null) {\n            const keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode];\n            const keys = keyCodeArr\n                .filter((kc) => typeof kc === 'string')\n                /*\n                 * we first replace all '+' with '\\n'  which we will use to split the keys on\n                 * then we replace '\\n\\n' with '\\n+', this way we can also support the combination 'key++'\n                 * in the end we simply split on '\\n' to get the key array\n                 */\n                .map((kc) => kc.replace(/\\+/g, '\\n').replace('\\n\\n', '\\n+').split('\\n'));\n            const keysFlat = keys.reduce((res, item) => res.concat(...item), []);\n            return [keys, keysFlat];\n        }\n        return [[], []];\n    }, [keyCode]);\n    useEffect(() => {\n        const target = options?.target ?? defaultDoc;\n        const actInsideInputWithModifier = options?.actInsideInputWithModifier ?? true;\n        if (keyCode !== null) {\n            const downHandler = (event) => {\n                modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n                const preventAction = (!modifierPressed.current || (modifierPressed.current && !actInsideInputWithModifier)) &&\n                    isInputDOMNode(event);\n                if (preventAction) {\n                    return false;\n                }\n                const keyOrCode = useKeyOrCode(event.code, keysToWatch);\n                pressedKeys.current.add(event[keyOrCode]);\n                if (isMatchingKey(keyCodes, pressedKeys.current, false)) {\n                    const target = (event.composedPath?.()?.[0] || event.target);\n                    const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A';\n                    if (options.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) {\n                        event.preventDefault();\n                    }\n                    setKeyPressed(true);\n                }\n            };\n            const upHandler = (event) => {\n                const keyOrCode = useKeyOrCode(event.code, keysToWatch);\n                if (isMatchingKey(keyCodes, pressedKeys.current, true)) {\n                    setKeyPressed(false);\n                    pressedKeys.current.clear();\n                }\n                else {\n                    pressedKeys.current.delete(event[keyOrCode]);\n                }\n                // fix for Mac: when cmd key is pressed, keyup is not triggered for any other key, see: https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key\n                if (event.key === 'Meta') {\n                    pressedKeys.current.clear();\n                }\n                modifierPressed.current = false;\n            };\n            const resetHandler = () => {\n                pressedKeys.current.clear();\n                setKeyPressed(false);\n            };\n            target?.addEventListener('keydown', downHandler);\n            target?.addEventListener('keyup', upHandler);\n            window.addEventListener('blur', resetHandler);\n            window.addEventListener('contextmenu', resetHandler);\n            return () => {\n                target?.removeEventListener('keydown', downHandler);\n                target?.removeEventListener('keyup', upHandler);\n                window.removeEventListener('blur', resetHandler);\n                window.removeEventListener('contextmenu', resetHandler);\n            };\n        }\n    }, [keyCode, setKeyPressed]);\n    return keyPressed;\n}\n// utils\nfunction isMatchingKey(keyCodes, pressedKeys, isUp) {\n    return (keyCodes\n        /*\n         * we only want to compare same sizes of keyCode definitions\n         * and pressed keys. When the user specified 'Meta' as a key somewhere\n         * this would also be truthy without this filter when user presses 'Meta' + 'r'\n         */\n        .filter((keys) => isUp || keys.length === pressedKeys.size)\n        /*\n         * since we want to support multiple possibilities only one of the\n         * combinations need to be part of the pressed keys\n         */\n        .some((keys) => keys.every((k) => pressedKeys.has(k))));\n}\nfunction useKeyOrCode(eventCode, keysToWatch) {\n    return keysToWatch.includes(eventCode) ? 'code' : 'key';\n}\n\n/**\n * Hook for getting viewport helper functions.\n *\n * @internal\n * @returns viewport helper functions\n */\nconst useViewportHelper = () => {\n    const store = useStoreApi();\n    return useMemo(() => {\n        return {\n            zoomIn: async (options) => {\n                const { panZoom } = store.getState();\n                return panZoom ? panZoom.scaleBy(1.2, options) : false;\n            },\n            zoomOut: async (options) => {\n                const { panZoom } = store.getState();\n                return panZoom ? panZoom.scaleBy(1 / 1.2, options) : false;\n            },\n            zoomTo: async (zoomLevel, options) => {\n                const { panZoom } = store.getState();\n                return panZoom ? panZoom.scaleTo(zoomLevel, options) : false;\n            },\n            getZoom: () => store.getState().transform[2],\n            setViewport: async (viewport, options) => {\n                const { transform: [tX, tY, tZoom], panZoom, } = store.getState();\n                if (!panZoom) {\n                    return false;\n                }\n                await panZoom.setViewport({\n                    x: viewport.x ?? tX,\n                    y: viewport.y ?? tY,\n                    zoom: viewport.zoom ?? tZoom,\n                }, options);\n                return true;\n            },\n            getViewport: () => {\n                const [x, y, zoom] = store.getState().transform;\n                return { x, y, zoom };\n            },\n            setCenter: async (x, y, options) => {\n                return store.getState().setCenter(x, y, options);\n            },\n            fitBounds: async (bounds, options) => {\n                const { width, height, minZoom, maxZoom, panZoom } = store.getState();\n                const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1);\n                if (!panZoom) {\n                    return false;\n                }\n                await panZoom.setViewport(viewport, {\n                    duration: options?.duration,\n                    ease: options?.ease,\n                    interpolate: options?.interpolate,\n                });\n                return true;\n            },\n            screenToFlowPosition: (clientPosition, options = {}) => {\n                const { transform, snapGrid, snapToGrid, domNode } = store.getState();\n                if (!domNode) {\n                    return clientPosition;\n                }\n                const { x: domX, y: domY } = domNode.getBoundingClientRect();\n                const correctedPosition = {\n                    x: clientPosition.x - domX,\n                    y: clientPosition.y - domY,\n                };\n                const _snapGrid = options.snapGrid ?? snapGrid;\n                const _snapToGrid = options.snapToGrid ?? snapToGrid;\n                return pointToRendererPoint(correctedPosition, transform, _snapToGrid, _snapGrid);\n            },\n            flowToScreenPosition: (flowPosition) => {\n                const { transform, domNode } = store.getState();\n                if (!domNode) {\n                    return flowPosition;\n                }\n                const { x: domX, y: domY } = domNode.getBoundingClientRect();\n                const rendererPosition = rendererPointToPoint(flowPosition, transform);\n                return {\n                    x: rendererPosition.x + domX,\n                    y: rendererPosition.y + domY,\n                };\n            },\n        };\n    }, []);\n};\n\n/*\n * This function applies changes to nodes or edges that are triggered by React Flow internally.\n * When you drag a node for example, React Flow will send a position change update.\n * This function then applies the changes and returns the updated elements.\n */\nfunction applyChanges(changes, elements) {\n    const updatedElements = [];\n    /*\n     * By storing a map of changes for each element, we can a quick lookup as we\n     * iterate over the elements array!\n     */\n    const changesMap = new Map();\n    const addItemChanges = [];\n    for (const change of changes) {\n        if (change.type === 'add') {\n            addItemChanges.push(change);\n            continue;\n        }\n        else if (change.type === 'remove' || change.type === 'replace') {\n            /*\n             * For a 'remove' change we can safely ignore any other changes queued for\n             * the same element, it's going to be removed anyway!\n             */\n            changesMap.set(change.id, [change]);\n        }\n        else {\n            const elementChanges = changesMap.get(change.id);\n            if (elementChanges) {\n                /*\n                 * If we have some changes queued already, we can do a mutable update of\n                 * that array and save ourselves some copying.\n                 */\n                elementChanges.push(change);\n            }\n            else {\n                changesMap.set(change.id, [change]);\n            }\n        }\n    }\n    for (const element of elements) {\n        const changes = changesMap.get(element.id);\n        /*\n         * When there are no changes for an element we can just push it unmodified,\n         * no need to copy it.\n         */\n        if (!changes) {\n            updatedElements.push(element);\n            continue;\n        }\n        // If we have a 'remove' change queued, it'll be the only change in the array\n        if (changes[0].type === 'remove') {\n            continue;\n        }\n        if (changes[0].type === 'replace') {\n            updatedElements.push({ ...changes[0].item });\n            continue;\n        }\n        /**\n         * For other types of changes, we want to start with a shallow copy of the\n         * object so React knows this element has changed. Sequential changes will\n         * each _mutate_ this object, so there's only ever one copy.\n         */\n        const updatedElement = { ...element };\n        for (const change of changes) {\n            applyChange(change, updatedElement);\n        }\n        updatedElements.push(updatedElement);\n    }\n    /*\n     * we need to wait for all changes to be applied before adding new items\n     * to be able to add them at the correct index\n     */\n    if (addItemChanges.length) {\n        addItemChanges.forEach((change) => {\n            if (change.index !== undefined) {\n                updatedElements.splice(change.index, 0, { ...change.item });\n            }\n            else {\n                updatedElements.push({ ...change.item });\n            }\n        });\n    }\n    return updatedElements;\n}\n// Applies a single change to an element. This is a *mutable* update.\nfunction applyChange(change, element) {\n    switch (change.type) {\n        case 'select': {\n            element.selected = change.selected;\n            break;\n        }\n        case 'position': {\n            if (typeof change.position !== 'undefined') {\n                element.position = change.position;\n            }\n            if (typeof change.dragging !== 'undefined') {\n                element.dragging = change.dragging;\n            }\n            break;\n        }\n        case 'dimensions': {\n            if (typeof change.dimensions !== 'undefined') {\n                element.measured = {\n                    ...change.dimensions,\n                };\n                if (change.setAttributes) {\n                    if (change.setAttributes === true || change.setAttributes === 'width') {\n                        element.width = change.dimensions.width;\n                    }\n                    if (change.setAttributes === true || change.setAttributes === 'height') {\n                        element.height = change.dimensions.height;\n                    }\n                }\n            }\n            if (typeof change.resizing === 'boolean') {\n                element.resizing = change.resizing;\n            }\n            break;\n        }\n    }\n}\n/**\n * Drop in function that applies node changes to an array of nodes.\n * @public\n * @param changes - Array of changes to apply.\n * @param nodes - Array of nodes to apply the changes to.\n * @returns Array of updated nodes.\n * @example\n *```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react';\n *\n *export default function Flow() {\n *  const [nodes, setNodes] = useState<Node[]>([]);\n *  const [edges, setEdges] = useState<Edge[]>([]);\n *  const onNodesChange: OnNodesChange = useCallback(\n *    (changes) => {\n *      setNodes((oldNodes) => applyNodeChanges(changes, oldNodes));\n *    },\n *    [setNodes],\n *  );\n *\n *  return (\n *    <ReactFlow nodes={nodes} edges={edges} onNodesChange={onNodesChange} />\n *  );\n *}\n *```\n * @remarks Various events on the <ReactFlow /> component can produce an {@link NodeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\nfunction applyNodeChanges(changes, nodes) {\n    return applyChanges(changes, nodes);\n}\n/**\n * Drop in function that applies edge changes to an array of edges.\n * @public\n * @param changes - Array of changes to apply.\n * @param edges - Array of edge to apply the changes to.\n * @returns Array of updated edges.\n * @example\n * ```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyEdgeChanges } from '@xyflow/react';\n *\n *export default function Flow() {\n *  const [nodes, setNodes] = useState([]);\n *  const [edges, setEdges] = useState([]);\n *  const onEdgesChange = useCallback(\n *    (changes) => {\n *      setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges));\n *    },\n *    [setEdges],\n *  );\n *\n *  return (\n *    <ReactFlow nodes={nodes} edges={edges} onEdgesChange={onEdgesChange} />\n *  );\n *}\n *```\n * @remarks Various events on the <ReactFlow /> component can produce an {@link EdgeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\nfunction applyEdgeChanges(changes, edges) {\n    return applyChanges(changes, edges);\n}\nfunction createSelectionChange(id, selected) {\n    return {\n        id,\n        type: 'select',\n        selected,\n    };\n}\nfunction getSelectionChanges(items, selectedIds = new Set(), mutateItem = false) {\n    const changes = [];\n    for (const [id, item] of items) {\n        const willBeSelected = selectedIds.has(id);\n        // we don't want to set all items to selected=false on the first selection\n        if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) {\n            if (mutateItem) {\n                /*\n                 * this hack is needed for nodes. When the user dragged a node, it's selected.\n                 * When another node gets dragged, we need to deselect the previous one,\n                 * in order to have only one selected node at a time - the onNodesChange callback comes too late here :/\n                 */\n                item.selected = willBeSelected;\n            }\n            changes.push(createSelectionChange(item.id, willBeSelected));\n        }\n    }\n    return changes;\n}\nfunction getElementsDiffChanges({ items = [], lookup, }) {\n    const changes = [];\n    const itemsLookup = new Map(items.map((item) => [item.id, item]));\n    for (const [index, item] of items.entries()) {\n        const lookupItem = lookup.get(item.id);\n        const storeItem = lookupItem?.internals?.userNode ?? lookupItem;\n        if (storeItem !== undefined && storeItem !== item) {\n            changes.push({ id: item.id, item: item, type: 'replace' });\n        }\n        if (storeItem === undefined) {\n            changes.push({ item: item, type: 'add', index });\n        }\n    }\n    for (const [id] of lookup) {\n        const nextNode = itemsLookup.get(id);\n        if (nextNode === undefined) {\n            changes.push({ id, type: 'remove' });\n        }\n    }\n    return changes;\n}\nfunction elementToRemoveChange(item) {\n    return {\n        id: item.id,\n        type: 'remove',\n    };\n}\n\nconst defaultOnError = createDevWarn('React Flow', 'https://reactflow.dev/');\nfunction addEdge(edgeParams, edges, options = {}) {\n    return addEdge$1(edgeParams, edges, {\n        ...options,\n        onError: options.onError ?? defaultOnError,\n    });\n}\nfunction reconnectEdge(oldEdge, newConnection, edges, options = { shouldReplaceId: true }) {\n    return reconnectEdge$1(oldEdge, newConnection, edges, {\n        ...options,\n        onError: options.onError ?? defaultOnError,\n    });\n}\n\n/**\n * Test whether an object is usable as an [`Node`](/api-reference/types/node).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Node`](/api-reference/types/node) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test.\n * @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript,\n * this function acts as a type guard and will narrow the type of the value to `Node` if it returns\n * `true`.\n *\n * @example\n * ```js\n *import { isNode } from '@xyflow/react';\n *\n *if (isNode(node)) {\n * // ...\n *}\n *```\n */\nconst isNode = (element) => isNodeBase(element);\n/**\n * Test whether an object is usable as an [`Edge`](/api-reference/types/edge).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Edge`](/api-reference/types/edge) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript,\n * this function acts as a type guard and will narrow the type of the value to `Edge` if it returns\n * `true`.\n *\n * @example\n * ```js\n *import { isEdge } from '@xyflow/react';\n *\n *if (isEdge(edge)) {\n * // ...\n *}\n *```\n */\nconst isEdge = (element) => isEdgeBase(element);\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nfunction fixedForwardRef(render) {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return forwardRef(render);\n}\n\n// we need this hook to prevent a warning when using react-flow in SSR\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\n/**\n * This hook returns a queue that can be used to batch updates.\n *\n * @param runQueue - a function that gets called when the queue is flushed\n * @internal\n *\n * @returns a Queue object\n */\nfunction useQueue(runQueue) {\n    /*\n     * Because we're using a ref above, we need some way to let React know when to\n     * actually process the queue. We increment this number any time we mutate the\n     * queue, creating a new state to trigger the layout effect below.\n     * Using a boolean dirty flag here instead would lead to issues related to\n     * automatic batching. (https://github.com/xyflow/xyflow/issues/4779)\n     */\n    const [serial, setSerial] = useState(BigInt(0));\n    /*\n     * A reference of all the batched updates to process before the next render. We\n     * want a reference here so multiple synchronous calls to `setNodes` etc can be\n     * batched together.\n     */\n    const [queue] = useState(() => createQueue(() => setSerial(n => n + BigInt(1))));\n    /*\n     * Layout effects are guaranteed to run before the next render which means we\n     * shouldn't run into any issues with stale state or weird issues that come from\n     * rendering things one frame later than expected (we used to use `setTimeout`).\n     */\n    useIsomorphicLayoutEffect(() => {\n        const queueItems = queue.get();\n        if (queueItems.length) {\n            runQueue(queueItems);\n            queue.reset();\n        }\n    }, [serial]);\n    return queue;\n}\nfunction createQueue(cb) {\n    let queue = [];\n    return {\n        get: () => queue,\n        reset: () => {\n            queue = [];\n        },\n        push: (item) => {\n            queue.push(item);\n            cb();\n        },\n    };\n}\n\nconst BatchContext = createContext(null);\n/**\n * This is a context provider that holds and processes the node and edge update queues\n * that are needed to handle setNodes, addNodes, setEdges and addEdges.\n *\n * @internal\n */\nfunction BatchProvider({ children, }) {\n    const store = useStoreApi();\n    const nodeQueueHandler = useCallback((queueItems) => {\n        const { nodes = [], setNodes, hasDefaultNodes, onNodesChange, nodeLookup, fitViewQueued, onNodesChangeMiddlewareMap, } = store.getState();\n        /*\n         * This is essentially an `Array.reduce` in imperative clothing. Processing\n         * this queue is a relatively hot path so we'd like to avoid the overhead of\n         * array methods where we can.\n         */\n        let next = nodes;\n        for (const payload of queueItems) {\n            next = typeof payload === 'function' ? payload(next) : payload;\n        }\n        let changes = getElementsDiffChanges({\n            items: next,\n            lookup: nodeLookup,\n        });\n        for (const middleware of onNodesChangeMiddlewareMap.values()) {\n            changes = middleware(changes);\n        }\n        if (hasDefaultNodes) {\n            setNodes(next);\n        }\n        // We only want to fire onNodesChange if there are changes to the nodes\n        if (changes.length > 0) {\n            onNodesChange?.(changes);\n        }\n        else if (fitViewQueued) {\n            // If there are no changes to the nodes, we still need to call setNodes\n            // to trigger a re-render and fitView.\n            window.requestAnimationFrame(() => {\n                const { fitViewQueued, nodes, setNodes } = store.getState();\n                if (fitViewQueued) {\n                    setNodes(nodes);\n                }\n            });\n        }\n    }, []);\n    const nodeQueue = useQueue(nodeQueueHandler);\n    const edgeQueueHandler = useCallback((queueItems) => {\n        const { edges = [], setEdges, hasDefaultEdges, onEdgesChange, edgeLookup } = store.getState();\n        let next = edges;\n        for (const payload of queueItems) {\n            next = typeof payload === 'function' ? payload(next) : payload;\n        }\n        if (hasDefaultEdges) {\n            setEdges(next);\n        }\n        else if (onEdgesChange) {\n            onEdgesChange(getElementsDiffChanges({\n                items: next,\n                lookup: edgeLookup,\n            }));\n        }\n    }, []);\n    const edgeQueue = useQueue(edgeQueueHandler);\n    const value = useMemo(() => ({ nodeQueue, edgeQueue }), []);\n    return jsx(BatchContext.Provider, { value: value, children: children });\n}\nfunction useBatchContext() {\n    const batchContext = useContext(BatchContext);\n    if (!batchContext) {\n        throw new Error('useBatchContext must be used within a BatchProvider');\n    }\n    return batchContext;\n}\n\nconst selector$j = (s) => !!s.panZoom;\n/**\n * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow.\n *\n * @public\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { useReactFlow } from '@xyflow/react';\n *\n *export function NodeCounter() {\n *  const reactFlow = useReactFlow();\n *  const [count, setCount] = useState(0);\n *  const countNodes = useCallback(() => {\n *    setCount(reactFlow.getNodes().length);\n *    // you need to pass it as a dependency if you are using it with useEffect or useCallback\n *    // because at the first render, it's not initialized yet and some functions might not work.\n *  }, [reactFlow]);\n *\n *  return (\n *    <div>\n *      <button onClick={countNodes}>Update count</button>\n *      <p>There are {count} nodes in the flow.</p>\n *    </div>\n *  );\n *}\n *```\n */\nfunction useReactFlow() {\n    const viewportHelper = useViewportHelper();\n    const store = useStoreApi();\n    const batchContext = useBatchContext();\n    const viewportInitialized = useStore(selector$j);\n    const generalHelper = useMemo(() => {\n        const getInternalNode = (id) => store.getState().nodeLookup.get(id);\n        const setNodes = (payload) => {\n            batchContext.nodeQueue.push(payload);\n        };\n        const setEdges = (payload) => {\n            batchContext.edgeQueue.push(payload);\n        };\n        const getNodeRect = (node) => {\n            const { nodeLookup, nodeOrigin } = store.getState();\n            const nodeToUse = isNode(node) ? node : nodeLookup.get(node.id);\n            const position = nodeToUse.parentId\n                ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin)\n                : nodeToUse.position;\n            const nodeWithPosition = {\n                ...nodeToUse,\n                position,\n                width: nodeToUse.measured?.width ?? nodeToUse.width,\n                height: nodeToUse.measured?.height ?? nodeToUse.height,\n            };\n            return nodeToRect(nodeWithPosition);\n        };\n        const updateNode = (id, nodeUpdate, options = { replace: false }) => {\n            setNodes((prevNodes) => prevNodes.map((node) => {\n                if (node.id === id) {\n                    const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n                    return options.replace && isNode(nextNode) ? nextNode : { ...node, ...nextNode };\n                }\n                return node;\n            }));\n        };\n        const updateEdge = (id, edgeUpdate, options = { replace: false }) => {\n            setEdges((prevEdges) => prevEdges.map((edge) => {\n                if (edge.id === id) {\n                    const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge) : edgeUpdate;\n                    return options.replace && isEdge(nextEdge) ? nextEdge : { ...edge, ...nextEdge };\n                }\n                return edge;\n            }));\n        };\n        return {\n            getNodes: () => store.getState().nodes.map((n) => ({ ...n })),\n            getNode: (id) => getInternalNode(id)?.internals.userNode,\n            getInternalNode,\n            getEdges: () => {\n                const { edges = [] } = store.getState();\n                return edges.map((e) => ({ ...e }));\n            },\n            getEdge: (id) => store.getState().edgeLookup.get(id),\n            setNodes,\n            setEdges,\n            addNodes: (payload) => {\n                const newNodes = Array.isArray(payload) ? payload : [payload];\n                batchContext.nodeQueue.push((nodes) => [...nodes, ...newNodes]);\n            },\n            addEdges: (payload) => {\n                const newEdges = Array.isArray(payload) ? payload : [payload];\n                batchContext.edgeQueue.push((edges) => [...edges, ...newEdges]);\n            },\n            toObject: () => {\n                const { nodes = [], edges = [], transform } = store.getState();\n                const [x, y, zoom] = transform;\n                return {\n                    nodes: nodes.map((n) => ({ ...n })),\n                    edges: edges.map((e) => ({ ...e })),\n                    viewport: {\n                        x,\n                        y,\n                        zoom,\n                    },\n                };\n            },\n            deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => {\n                const { nodes, edges, onNodesDelete, onEdgesDelete, triggerNodeChanges, triggerEdgeChanges, onDelete, onBeforeDelete, } = store.getState();\n                const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n                    nodesToRemove,\n                    edgesToRemove,\n                    nodes,\n                    edges,\n                    onBeforeDelete,\n                });\n                const hasMatchingEdges = matchingEdges.length > 0;\n                const hasMatchingNodes = matchingNodes.length > 0;\n                if (hasMatchingEdges) {\n                    const edgeChanges = matchingEdges.map(elementToRemoveChange);\n                    onEdgesDelete?.(matchingEdges);\n                    triggerEdgeChanges(edgeChanges);\n                }\n                if (hasMatchingNodes) {\n                    const nodeChanges = matchingNodes.map(elementToRemoveChange);\n                    onNodesDelete?.(matchingNodes);\n                    triggerNodeChanges(nodeChanges);\n                }\n                if (hasMatchingNodes || hasMatchingEdges) {\n                    onDelete?.({ nodes: matchingNodes, edges: matchingEdges });\n                }\n                return { deletedNodes: matchingNodes, deletedEdges: matchingEdges };\n            },\n            /**\n             * Partial is defined as \"the 2 nodes/areas are intersecting partially\".\n             * If a is contained in b or b is contained in a, they are both\n             * considered fully intersecting.\n             */\n            getIntersectingNodes: (nodeOrRect, partially = true, nodes) => {\n                const isRect = isRectObject(nodeOrRect);\n                const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n                const hasNodesOption = nodes !== undefined;\n                if (!nodeRect) {\n                    return [];\n                }\n                return (nodes || store.getState().nodes).filter((n) => {\n                    const internalNode = store.getState().nodeLookup.get(n.id);\n                    if (internalNode && !isRect && (n.id === nodeOrRect.id || !internalNode.internals.positionAbsolute)) {\n                        return false;\n                    }\n                    const currNodeRect = nodeToRect(hasNodesOption ? n : internalNode);\n                    const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n                    const partiallyVisible = partially && overlappingArea > 0;\n                    return (partiallyVisible ||\n                        overlappingArea >= currNodeRect.width * currNodeRect.height ||\n                        overlappingArea >= nodeRect.width * nodeRect.height);\n                });\n            },\n            isNodeIntersecting: (nodeOrRect, area, partially = true) => {\n                const isRect = isRectObject(nodeOrRect);\n                const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n                if (!nodeRect) {\n                    return false;\n                }\n                const overlappingArea = getOverlappingArea(nodeRect, area);\n                const partiallyVisible = partially && overlappingArea > 0;\n                return (partiallyVisible ||\n                    overlappingArea >= area.width * area.height ||\n                    overlappingArea >= nodeRect.width * nodeRect.height);\n            },\n            updateNode,\n            updateNodeData: (id, dataUpdate, options = { replace: false }) => {\n                updateNode(id, (node) => {\n                    const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n                    return options.replace ? { ...node, data: nextData } : { ...node, data: { ...node.data, ...nextData } };\n                }, options);\n            },\n            updateEdge,\n            updateEdgeData: (id, dataUpdate, options = { replace: false }) => {\n                updateEdge(id, (edge) => {\n                    const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate;\n                    return options.replace ? { ...edge, data: nextData } : { ...edge, data: { ...edge.data, ...nextData } };\n                }, options);\n            },\n            getNodesBounds: (nodes) => {\n                const { nodeLookup, nodeOrigin } = store.getState();\n                return getNodesBounds(nodes, { nodeLookup, nodeOrigin });\n            },\n            getHandleConnections: ({ type, id, nodeId }) => Array.from(store\n                .getState()\n                .connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`)\n                ?.values() ?? []),\n            getNodeConnections: ({ type, handleId, nodeId }) => Array.from(store\n                .getState()\n                .connectionLookup.get(`${nodeId}${type ? (handleId ? `-${type}-${handleId}` : `-${type}`) : ''}`)\n                ?.values() ?? []),\n            fitView: async (options) => {\n                // We either create a new Promise or reuse the existing one\n                // Even if fitView is called multiple times in a row, we only end up with a single Promise\n                const fitViewResolver = store.getState().fitViewResolver ?? withResolvers();\n                // We schedule a fitView by setting fitViewQueued and triggering a setNodes\n                store.setState({ fitViewQueued: true, fitViewOptions: options, fitViewResolver });\n                batchContext.nodeQueue.push((nodes) => [...nodes]);\n                return fitViewResolver.promise;\n            },\n        };\n    }, []);\n    return useMemo(() => {\n        return {\n            ...generalHelper,\n            ...viewportHelper,\n            viewportInitialized,\n        };\n    }, [viewportInitialized]);\n}\n\nconst selected = (item) => item.selected;\nconst win$1 = typeof window !== 'undefined' ? window : undefined;\n/**\n * Hook for handling global key events.\n *\n * @internal\n */\nfunction useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode, }) {\n    const store = useStoreApi();\n    const { deleteElements } = useReactFlow();\n    const deleteKeyPressed = useKeyPress(deleteKeyCode, { actInsideInputWithModifier: false });\n    const multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode, { target: win$1 });\n    useEffect(() => {\n        if (deleteKeyPressed) {\n            const { edges, nodes } = store.getState();\n            deleteElements({ nodes: nodes.filter(selected), edges: edges.filter(selected) });\n            store.setState({ nodesSelectionActive: false });\n        }\n    }, [deleteKeyPressed]);\n    useEffect(() => {\n        store.setState({ multiSelectionActive: multiSelectionKeyPressed });\n    }, [multiSelectionKeyPressed]);\n}\n\n/**\n * Hook for handling resize events.\n *\n * @internal\n */\nfunction useResizeHandler(domNode) {\n    const store = useStoreApi();\n    useEffect(() => {\n        const updateDimensions = () => {\n            if (!domNode.current || !(domNode.current.checkVisibility?.() ?? true)) {\n                return false;\n            }\n            const size = getDimensions(domNode.current);\n            if (size.height === 0 || size.width === 0) {\n                store.getState().onError?.('004', errorMessages['error004']());\n            }\n            store.setState({ width: size.width || 500, height: size.height || 500 });\n        };\n        if (domNode.current) {\n            updateDimensions();\n            window.addEventListener('resize', updateDimensions);\n            const resizeObserver = new ResizeObserver(() => updateDimensions());\n            resizeObserver.observe(domNode.current);\n            return () => {\n                window.removeEventListener('resize', updateDimensions);\n                if (resizeObserver && domNode.current) {\n                    resizeObserver.unobserve(domNode.current);\n                }\n            };\n        }\n    }, []);\n}\n\nconst containerStyle = {\n    position: 'absolute',\n    width: '100%',\n    height: '100%',\n    top: 0,\n    left: 0,\n};\n\nconst selector$i = (s) => ({\n    userSelectionActive: s.userSelectionActive,\n    lib: s.lib,\n    connectionInProgress: s.connection.inProgress,\n});\nfunction ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panActivationKeyPressed, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = true, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, selectionOnDrag, }) {\n    const store = useStoreApi();\n    const zoomPane = useRef(null);\n    const { userSelectionActive, lib, connectionInProgress } = useStore(selector$i, shallow);\n    const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);\n    const panZoom = useRef();\n    useResizeHandler(zoomPane);\n    const onTransformChange = useCallback((transform) => {\n        onViewportChange?.({ x: transform[0], y: transform[1], zoom: transform[2] });\n        if (!isControlledViewport) {\n            store.setState({ transform });\n        }\n    }, [onViewportChange, isControlledViewport]);\n    useEffect(() => {\n        if (zoomPane.current) {\n            panZoom.current = XYPanZoom({\n                domNode: zoomPane.current,\n                minZoom,\n                maxZoom,\n                translateExtent,\n                viewport: defaultViewport,\n                onDraggingChange: (paneDragging) => store.setState((prevState) => (prevState.paneDragging === paneDragging ? prevState : { paneDragging })),\n                onPanZoomStart: (event, vp) => {\n                    const { onViewportChangeStart, onMoveStart } = store.getState();\n                    onMoveStart?.(event, vp);\n                    onViewportChangeStart?.(vp);\n                },\n                onPanZoom: (event, vp) => {\n                    const { onViewportChange, onMove } = store.getState();\n                    onMove?.(event, vp);\n                    onViewportChange?.(vp);\n                },\n                onPanZoomEnd: (event, vp) => {\n                    const { onViewportChangeEnd, onMoveEnd } = store.getState();\n                    onMoveEnd?.(event, vp);\n                    onViewportChangeEnd?.(vp);\n                },\n            });\n            const { x, y, zoom } = panZoom.current.getViewport();\n            store.setState({\n                panZoom: panZoom.current,\n                transform: [x, y, zoom],\n                domNode: zoomPane.current.closest('.react-flow'),\n            });\n            return () => {\n                panZoom.current?.destroy();\n            };\n        }\n    }, []);\n    useEffect(() => {\n        panZoom.current?.update({\n            onPaneContextMenu,\n            zoomOnScroll,\n            zoomOnPinch,\n            panOnScroll,\n            panActivationKeyPressed,\n            panOnScrollSpeed,\n            panOnScrollMode,\n            zoomOnDoubleClick,\n            panOnDrag,\n            zoomActivationKeyPressed,\n            preventScrolling,\n            noPanClassName,\n            userSelectionActive,\n            noWheelClassName,\n            lib,\n            onTransformChange,\n            connectionInProgress,\n            selectionOnDrag,\n            paneClickDistance,\n        });\n    }, [\n        onPaneContextMenu,\n        zoomOnScroll,\n        zoomOnPinch,\n        panOnScroll,\n        panActivationKeyPressed,\n        panOnScrollSpeed,\n        panOnScrollMode,\n        zoomOnDoubleClick,\n        panOnDrag,\n        zoomActivationKeyPressed,\n        preventScrolling,\n        noPanClassName,\n        userSelectionActive,\n        noWheelClassName,\n        lib,\n        onTransformChange,\n        connectionInProgress,\n        selectionOnDrag,\n        paneClickDistance,\n    ]);\n    return (jsx(\"div\", { className: \"react-flow__renderer\", ref: zoomPane, style: containerStyle, children: children }));\n}\n\nconst selector$h = (s) => ({\n    userSelectionActive: s.userSelectionActive,\n    userSelectionRect: s.userSelectionRect,\n});\nfunction UserSelection() {\n    const { userSelectionActive, userSelectionRect } = useStore(selector$h, shallow);\n    const isActive = userSelectionActive && userSelectionRect;\n    if (!isActive) {\n        return null;\n    }\n    return (jsx(\"div\", { className: \"react-flow__selection react-flow__container\", style: {\n            width: userSelectionRect.width,\n            height: userSelectionRect.height,\n            transform: `translate(${userSelectionRect.x}px, ${userSelectionRect.y}px)`,\n        } }));\n}\n\nconst wrapHandler = (handler, containerRef) => {\n    return (event) => {\n        if (event.target !== containerRef.current) {\n            return;\n        }\n        handler?.(event);\n    };\n};\nconst selector$g = (s) => ({\n    userSelectionActive: s.userSelectionActive,\n    elementsSelectable: s.elementsSelectable,\n    dragging: s.paneDragging,\n    panBy: s.panBy,\n    autoPanSpeed: s.autoPanSpeed,\n});\nfunction Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, autoPanOnSelection, paneClickDistance, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) {\n    const autoPanId = useRef(0);\n    const store = useStoreApi();\n    const { userSelectionActive, elementsSelectable, dragging, panBy, autoPanSpeed } = useStore(selector$g, shallow);\n    const isSelectionEnabled = elementsSelectable && (isSelecting || userSelectionActive);\n    const container = useRef(null);\n    const containerBounds = useRef();\n    const selectedNodeIds = useRef(new Set());\n    const selectedEdgeIds = useRef(new Set());\n    const connectionEndedOnPane = useRef(false);\n    // Used to prevent click events when the user lets go of the selectionKey during a selection\n    const selectionInProgress = useRef(false);\n    // Used for auto pan when approaching the edges of the container during selection\n    const position = useRef({ x: 0, y: 0 });\n    const autoPanStarted = useRef(false);\n    const onClick = (event) => {\n        // We prevent click events when the user let go of the selectionKey during a selection\n        // We also prevent click events when a connection is in progress\n        if (selectionInProgress.current || connectionEndedOnPane.current || store.getState().connection.inProgress) {\n            selectionInProgress.current = false;\n            connectionEndedOnPane.current = false;\n            return;\n        }\n        onPaneClick?.(event);\n        store.getState().resetSelectedElements();\n        store.setState({ nodesSelectionActive: false });\n    };\n    const onContextMenu = (event) => {\n        if (Array.isArray(panOnDrag) && panOnDrag?.includes(2)) {\n            event.preventDefault();\n            return;\n        }\n        onPaneContextMenu?.(event);\n    };\n    const onWheel = onPaneScroll ? (event) => onPaneScroll(event) : undefined;\n    const onClickCapture = (event) => {\n        if (selectionInProgress.current) {\n            event.stopPropagation();\n            selectionInProgress.current = false;\n        }\n    };\n    // We are using capture here in order to prevent other pointer events\n    // to be able to create a selection above a node or an edge\n    const onPointerDownCapture = (event) => {\n        // Mouse button arrays only restrict mouse input. Let touch panning handle this gesture\n        // unless the user explicitly activated selection with the selection key.\n        if (event.pointerType === 'touch' && panOnDrag !== false && !selectionKeyPressed) {\n            return;\n        }\n        const { domNode, transform } = store.getState();\n        containerBounds.current = domNode?.getBoundingClientRect();\n        if (!containerBounds.current)\n            return;\n        const eventTargetIsContainer = event.target === container.current;\n        // if a child element has the 'nokey' class, we don't want to swallow the event and don't start a selection\n        const isNoKeyEvent = !eventTargetIsContainer && !!event.target.closest('.nokey');\n        const isSelectionActive = (selectionOnDrag && eventTargetIsContainer) || selectionKeyPressed;\n        if (isNoKeyEvent || !isSelecting || !isSelectionActive || event.button !== 0 || !event.isPrimary) {\n            return;\n        }\n        event.target?.setPointerCapture?.(event.pointerId);\n        selectionInProgress.current = false;\n        const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);\n        const userSelectionStartPosition = pointToRendererPoint({ x, y }, transform);\n        store.setState({\n            userSelectionRect: {\n                width: 0,\n                height: 0,\n                startX: userSelectionStartPosition.x,\n                startY: userSelectionStartPosition.y,\n                x,\n                y,\n            },\n        });\n        if (!eventTargetIsContainer) {\n            event.stopPropagation();\n            event.preventDefault();\n        }\n    };\n    // We commit the user selection rectangle to the store on auto-panning or pointer move during selection.\n    function commitUserSelectionRect(mouseX, mouseY) {\n        const { userSelectionRect } = store.getState();\n        if (!userSelectionRect) {\n            return;\n        }\n        const { transform, nodeLookup, edgeLookup, connectionLookup, triggerNodeChanges, triggerEdgeChanges, defaultEdgeOptions, } = store.getState();\n        const userStartPosition = { x: userSelectionRect.startX, y: userSelectionRect.startY };\n        const { x: screenStartX, y: screenStartY } = rendererPointToPoint(userStartPosition, transform);\n        // This has to be in screen coordinates, not in flow coordinates.\n        // We store the selection rectangle in userSelectionStartPosition coordinates to be able to\n        // fix the start position of the selection rectangle when we are auto-panning.\n        const nextUserSelectRect = {\n            startX: userStartPosition.x,\n            startY: userStartPosition.y,\n            x: mouseX < screenStartX ? mouseX : screenStartX,\n            y: mouseY < screenStartY ? mouseY : screenStartY,\n            width: Math.abs(mouseX - screenStartX),\n            height: Math.abs(mouseY - screenStartY),\n        };\n        const prevSelectedNodeIds = selectedNodeIds.current;\n        const prevSelectedEdgeIds = selectedEdgeIds.current;\n        selectedNodeIds.current = new Set(getNodesInside(nodeLookup, nextUserSelectRect, transform, selectionMode === SelectionMode.Partial, true).map((node) => node.id));\n        selectedEdgeIds.current = new Set();\n        const edgesSelectable = defaultEdgeOptions?.selectable ?? true;\n        // We look for all edges connected to the selected nodes\n        for (const nodeId of selectedNodeIds.current) {\n            const connections = connectionLookup.get(nodeId);\n            if (!connections)\n                continue;\n            for (const { edgeId } of connections.values()) {\n                const edge = edgeLookup.get(edgeId);\n                if (edge && (edge.selectable ?? edgesSelectable)) {\n                    selectedEdgeIds.current.add(edgeId);\n                }\n            }\n        }\n        if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.current)) {\n            const changes = getSelectionChanges(nodeLookup, selectedNodeIds.current, true);\n            triggerNodeChanges(changes);\n        }\n        if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.current)) {\n            const changes = getSelectionChanges(edgeLookup, selectedEdgeIds.current);\n            triggerEdgeChanges(changes);\n        }\n        store.setState({\n            userSelectionRect: nextUserSelectRect,\n            userSelectionActive: true,\n            nodesSelectionActive: false,\n        });\n    }\n    function autoPan() {\n        if (!autoPanOnSelection || !containerBounds.current) {\n            return;\n        }\n        const [x, y] = calcAutoPan(position.current, containerBounds.current, autoPanSpeed);\n        panBy({ x, y }).then((panned) => {\n            if (!selectionInProgress.current || !panned) {\n                autoPanId.current = requestAnimationFrame(autoPan);\n                return;\n            }\n            const { x: mx, y: my } = position.current;\n            commitUserSelectionRect(mx, my);\n            autoPanId.current = requestAnimationFrame(autoPan);\n        });\n    }\n    const cleanupAutoPan = () => {\n        cancelAnimationFrame(autoPanId.current);\n        autoPanId.current = 0;\n        autoPanStarted.current = false;\n    };\n    useEffect(() => {\n        return () => cleanupAutoPan();\n    }, []);\n    const onPointerMove = (event) => {\n        const { userSelectionRect, transform, resetSelectedElements } = store.getState();\n        if (!containerBounds.current || !userSelectionRect) {\n            return;\n        }\n        const { x: mouseX, y: mouseY } = getEventPosition(event.nativeEvent, containerBounds.current);\n        position.current = { x: mouseX, y: mouseY };\n        const screenStart = rendererPointToPoint({ x: userSelectionRect.startX, y: userSelectionRect.startY }, transform);\n        if (!selectionInProgress.current) {\n            const requiredDistance = selectionKeyPressed ? 0 : paneClickDistance;\n            const distance = Math.hypot(mouseX - screenStart.x, mouseY - screenStart.y);\n            if (distance <= requiredDistance) {\n                return;\n            }\n            resetSelectedElements();\n            onSelectionStart?.(event);\n        }\n        selectionInProgress.current = true;\n        if (!autoPanStarted.current) {\n            autoPan();\n            autoPanStarted.current = true;\n        }\n        commitUserSelectionRect(mouseX, mouseY);\n    };\n    const onPointerUp = (event) => {\n        if (!isSelectionEnabled) {\n            if (event.target === container.current && store.getState().connection.inProgress) {\n                connectionEndedOnPane.current = true;\n            }\n            return;\n        }\n        if (event.button !== 0) {\n            return;\n        }\n        event.target?.releasePointerCapture?.(event.pointerId);\n        /*\n         * We only want to trigger click functions when in selection mode if\n         * the user did not move the mouse.\n         */\n        if (!userSelectionActive && event.target === container.current && store.getState().userSelectionRect) {\n            onClick?.(event);\n        }\n        store.setState({\n            userSelectionActive: false,\n            userSelectionRect: null,\n        });\n        if (selectionInProgress.current) {\n            onSelectionEnd?.(event);\n            store.setState({\n                nodesSelectionActive: selectedNodeIds.current.size > 0,\n            });\n        }\n        cleanupAutoPan();\n    };\n    const onPointerCancel = (event) => {\n        event.target?.releasePointerCapture?.(event.pointerId);\n        cleanupAutoPan();\n    };\n    const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0));\n    return (jsxs(\"div\", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: isSelectionEnabled ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: isSelectionEnabled ? undefined : onPaneMouseEnter, onPointerMove: isSelectionEnabled ? onPointerMove : onPaneMouseMove, onPointerUp: onPointerUp, onPointerCancel: isSelectionEnabled ? onPointerCancel : undefined, onPointerDownCapture: isSelectionEnabled ? onPointerDownCapture : undefined, onClickCapture: isSelectionEnabled ? onClickCapture : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] }));\n}\n\n/*\n * this handler is called by\n * 1. the click handler when node is not draggable or selectNodesOnDrag = false\n * or\n * 2. the on drag start handler when node is draggable and selectNodesOnDrag = true\n */\nfunction handleNodeClick({ id, store, unselect = false, nodeRef, }) {\n    const { addSelectedNodes, unselectNodesAndEdges, multiSelectionActive, nodeLookup, onError } = store.getState();\n    const node = nodeLookup.get(id);\n    if (!node) {\n        onError?.('012', errorMessages['error012'](id));\n        return;\n    }\n    store.setState({ nodesSelectionActive: false });\n    if (!node.selected) {\n        addSelectedNodes([id]);\n    }\n    else if (unselect || (node.selected && multiSelectionActive)) {\n        unselectNodesAndEdges({ nodes: [node], edges: [] });\n        requestAnimationFrame(() => nodeRef?.current?.blur());\n    }\n}\n\n/**\n * Hook for calling XYDrag helper from @xyflow/system.\n *\n * @internal\n */\nfunction useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance, }) {\n    const store = useStoreApi();\n    const [dragging, setDragging] = useState(false);\n    const xyDrag = useRef();\n    useEffect(() => {\n        if (disabled) {\n            return;\n        }\n        xyDrag.current = XYDrag({\n            getStoreItems: () => store.getState(),\n            onNodeMouseDown: (id) => {\n                handleNodeClick({\n                    id,\n                    store,\n                    nodeRef,\n                });\n            },\n            onDragStart: () => {\n                setDragging(true);\n            },\n            onDragStop: () => {\n                setDragging(false);\n            },\n        });\n        return () => {\n            xyDrag.current?.destroy();\n            xyDrag.current = undefined;\n        };\n    }, [disabled, store, nodeRef]);\n    useEffect(() => {\n        if (disabled || !nodeRef.current || !xyDrag.current) {\n            return;\n        }\n        xyDrag.current.update({\n            noDragClassName,\n            handleSelector,\n            domNode: nodeRef.current,\n            isSelectable,\n            nodeId,\n            nodeClickDistance,\n        });\n    }, [noDragClassName, handleSelector, disabled, isSelectable, nodeRef, nodeId, nodeClickDistance]);\n    return dragging;\n}\n\nconst selectedAndDraggable = (nodesDraggable) => (n) => n.selected && (n.draggable || (nodesDraggable && typeof n.draggable === 'undefined'));\n/**\n * Hook for updating node positions by passing a direction and factor\n *\n * @internal\n * @returns function for updating node positions\n */\nfunction useMoveSelectedNodes() {\n    const store = useStoreApi();\n    const moveSelectedNodes = useCallback((params) => {\n        const { nodeExtent, snapToGrid, snapGrid, nodesDraggable, onError, updateNodePositions, nodeLookup, nodeOrigin } = store.getState();\n        const nodeUpdates = new Map();\n        const isSelected = selectedAndDraggable(nodesDraggable);\n        /*\n         * by default a node moves 5px on each key press\n         * if snap grid is enabled, we use that for the velocity\n         */\n        const xVelo = snapToGrid ? snapGrid[0] : 5;\n        const yVelo = snapToGrid ? snapGrid[1] : 5;\n        const xDiff = params.direction.x * xVelo * params.factor;\n        const yDiff = params.direction.y * yVelo * params.factor;\n        for (const [, node] of nodeLookup) {\n            if (!isSelected(node)) {\n                continue;\n            }\n            let nextPosition = {\n                x: node.internals.positionAbsolute.x + xDiff,\n                y: node.internals.positionAbsolute.y + yDiff,\n            };\n            if (snapToGrid) {\n                nextPosition = snapPosition(nextPosition, snapGrid);\n            }\n            const { position, positionAbsolute } = calculateNodePosition({\n                nodeId: node.id,\n                nextPosition,\n                nodeLookup,\n                nodeExtent,\n                nodeOrigin,\n                onError,\n            });\n            node.position = position;\n            node.internals.positionAbsolute = positionAbsolute;\n            nodeUpdates.set(node.id, node);\n        }\n        updateNodePositions(nodeUpdates);\n    }, []);\n    return moveSelectedNodes;\n}\n\nconst NodeIdContext = createContext(null);\nconst Provider = NodeIdContext.Provider;\nNodeIdContext.Consumer;\n/**\n * You can use this hook to get the id of the node it is used inside. It is useful\n * if you need the node's id deeper in the render tree but don't want to manually\n * drill down the id as a prop.\n *\n * @public\n * @returns The id for a node in the flow.\n *\n * @example\n *```jsx\n *import { useNodeId } from '@xyflow/react';\n *\n *export default function CustomNode() {\n *  return (\n *    <div>\n *      <span>This node has an id of </span>\n *      <NodeIdDisplay />\n *    </div>\n *  );\n *}\n *\n *function NodeIdDisplay() {\n *  const nodeId = useNodeId();\n *\n *  return <span>{nodeId}</span>;\n *}\n *```\n */\nconst useNodeId = () => {\n    const nodeId = useContext(NodeIdContext);\n    return nodeId;\n};\n\nconst selector$f = (s) => ({\n    connectOnClick: s.connectOnClick,\n    noPanClassName: s.noPanClassName,\n    rfId: s.rfId,\n});\nconst HandleConfigContext = createContext(null);\n/*\n * `connectOnClick`, `noPanClassName` and `rfId` are the same for every handle, so they are\n * shared through context from a single store subscription.\n */\nfunction HandleConfigProvider({ children }) {\n    const config = useStore(selector$f, shallow);\n    return jsx(HandleConfigContext.Provider, { value: config, children: children });\n}\nfunction useHandleConfig() {\n    const config = useContext(HandleConfigContext);\n    if (!config) {\n        throw new Error('useHandleConfig must be used within a HandleConfigProvider');\n    }\n    return config;\n}\n\n/*\n * While no connection is in progress every handle has this same state, so we return a\n * shared reference rather than allocating + shallow-comparing one per handle on every\n * store update. `isPossibleEndHandle` matches what the selector computes when idle.\n */\nconst idleConnectingState = {\n    connectingFrom: false,\n    connectingTo: false,\n    clickConnecting: false,\n    isPossibleEndHandle: true,\n    connectionInProcess: false,\n    clickConnectionInProcess: false,\n    valid: false,\n};\nconst connectingSelector = (nodeId, handleId, type) => (state) => {\n    const { connectionClickStartHandle: clickHandle, connectionMode, connection } = state;\n    const { fromHandle, toHandle, isValid } = connection;\n    if (!fromHandle && !clickHandle) {\n        return idleConnectingState;\n    }\n    const connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type;\n    return {\n        connectingFrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === type,\n        connectingTo,\n        clickConnecting: clickHandle?.nodeId === nodeId && clickHandle?.id === handleId && clickHandle?.type === type,\n        isPossibleEndHandle: connectionMode === ConnectionMode.Strict\n            ? fromHandle?.type !== type\n            : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id,\n        connectionInProcess: !!fromHandle,\n        clickConnectionInProcess: !!clickHandle,\n        valid: connectingTo && isValid,\n    };\n};\nfunction HandleComponent({ type = 'source', position = Position.Top, isValidConnection, isConnectable = true, isConnectableStart = true, isConnectableEnd = true, id, onConnect, children, className, onMouseDown, onTouchStart, ...rest }, ref) {\n    const handleId = id || null;\n    const isTarget = type === 'target';\n    const store = useStoreApi();\n    const nodeId = useNodeId();\n    const { connectOnClick, noPanClassName, rfId } = useHandleConfig();\n    const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, clickConnectionInProcess, valid, } = useStore(connectingSelector(nodeId, handleId, type), shallow);\n    if (!nodeId) {\n        store.getState().onError?.('010', errorMessages['error010']());\n    }\n    const onConnectExtended = (params) => {\n        const { defaultEdgeOptions, onConnect: onConnectAction, hasDefaultEdges } = store.getState();\n        const edgeParams = {\n            ...defaultEdgeOptions,\n            ...params,\n        };\n        if (hasDefaultEdges) {\n            const { edges, setEdges, onError } = store.getState();\n            setEdges(addEdge(edgeParams, edges, { onError }));\n        }\n        onConnectAction?.(edgeParams);\n        onConnect?.(edgeParams);\n    };\n    const onPointerDown = (event) => {\n        if (!nodeId) {\n            return;\n        }\n        const isMouseTriggered = isMouseEvent(event.nativeEvent);\n        if (isConnectableStart &&\n            ((isMouseTriggered && event.button === 0) || !isMouseTriggered)) {\n            const currentStore = store.getState();\n            XYHandle.onPointerDown(event.nativeEvent, {\n                handleDomNode: event.currentTarget,\n                autoPanOnConnect: currentStore.autoPanOnConnect,\n                connectionMode: currentStore.connectionMode,\n                connectionRadius: currentStore.connectionRadius,\n                domNode: currentStore.domNode,\n                nodeLookup: currentStore.nodeLookup,\n                lib: currentStore.lib,\n                isTarget,\n                handleId,\n                nodeId,\n                flowId: currentStore.rfId,\n                panBy: currentStore.panBy,\n                cancelConnection: currentStore.cancelConnection,\n                onConnectStart: currentStore.onConnectStart,\n                onConnectEnd: (...args) => store.getState().onConnectEnd?.(...args),\n                updateConnection: currentStore.updateConnection,\n                onConnect: onConnectExtended,\n                isValidConnection: isValidConnection || ((...args) => store.getState().isValidConnection?.(...args) ?? true),\n                getTransform: () => store.getState().transform,\n                getFromHandle: () => store.getState().connection.fromHandle,\n                autoPanSpeed: currentStore.autoPanSpeed,\n                dragThreshold: currentStore.connectionDragThreshold,\n            });\n        }\n        if (isMouseTriggered) {\n            onMouseDown?.(event);\n        }\n        else {\n            onTouchStart?.(event);\n        }\n    };\n    const onClick = (event) => {\n        const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, nodeLookup, connection: connectionState, } = store.getState();\n        if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) {\n            return;\n        }\n        if (!connectionClickStartHandle) {\n            onClickConnectStart?.(event.nativeEvent, { nodeId, handleId, handleType: type });\n            store.setState({ connectionClickStartHandle: { nodeId, type, id: handleId } });\n            return;\n        }\n        const doc = getHostForElement(event.target);\n        const isValidConnectionHandler = isValidConnection || isValidConnectionStore;\n        const { connection, isValid } = XYHandle.isValid(event.nativeEvent, {\n            handle: {\n                nodeId,\n                id: handleId,\n                type,\n            },\n            connectionMode,\n            fromNodeId: connectionClickStartHandle.nodeId,\n            fromHandleId: connectionClickStartHandle.id || null,\n            fromType: connectionClickStartHandle.type,\n            isValidConnection: isValidConnectionHandler,\n            flowId,\n            doc,\n            lib,\n            nodeLookup,\n        });\n        if (isValid && connection) {\n            onConnectExtended(connection);\n        }\n        const connectionClone = structuredClone(connectionState);\n        delete connectionClone.inProgress;\n        connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;\n        onClickConnectEnd?.(event, connectionClone);\n        store.setState({ connectionClickStartHandle: null });\n    };\n    return (jsx(\"div\", { \"data-handleid\": handleId, \"data-nodeid\": nodeId, \"data-handlepos\": position, \"data-id\": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([\n            'react-flow__handle',\n            `react-flow__handle-${position}`,\n            'nodrag',\n            noPanClassName,\n            className,\n            {\n                source: !isTarget,\n                target: isTarget,\n                connectable: isConnectable,\n                connectablestart: isConnectableStart,\n                connectableend: isConnectableEnd,\n                clickconnecting: clickConnecting,\n                connectingfrom: connectingFrom,\n                connectingto: connectingTo,\n                valid,\n                /*\n                 * shows where you can start a connection from\n                 * and where you can end it while connecting\n                 */\n                connectionindicator: isConnectable &&\n                    (!connectionInProcess || isPossibleEndHandle) &&\n                    (connectionInProcess || clickConnectionInProcess ? isConnectableEnd : isConnectableStart),\n            },\n        ]), onMouseDown: onPointerDown, onTouchStart: onPointerDown, onClick: connectOnClick ? onClick : undefined, ref: ref, ...rest, children: children }));\n}\n/**\n * The `<Handle />` component is used in your [custom nodes](/learn/customization/custom-nodes)\n * to define connection points.\n *\n *@public\n *\n *@example\n *\n *```jsx\n *import { Handle, Position } from '@xyflow/react';\n *\n *export function CustomNode({ data }) {\n *  return (\n *    <>\n *      <div style={{ padding: '10px 20px' }}>\n *        {data.label}\n *      </div>\n *\n *      <Handle type=\"target\" position={Position.Left} />\n *      <Handle type=\"source\" position={Position.Right} />\n *    </>\n *  );\n *};\n *```\n */\nconst Handle = memo(fixedForwardRef(HandleComponent));\n\nfunction InputNode({ data, isConnectable, sourcePosition = Position.Bottom }) {\n    return (jsxs(Fragment, { children: [data?.label, jsx(Handle, { type: \"source\", position: sourcePosition, isConnectable: isConnectable })] }));\n}\n\nfunction DefaultNode({ data, isConnectable, targetPosition = Position.Top, sourcePosition = Position.Bottom, }) {\n    return (jsxs(Fragment, { children: [jsx(Handle, { type: \"target\", position: targetPosition, isConnectable: isConnectable }), data?.label, jsx(Handle, { type: \"source\", position: sourcePosition, isConnectable: isConnectable })] }));\n}\n\nfunction GroupNode() {\n    return null;\n}\n\nfunction OutputNode({ data, isConnectable, targetPosition = Position.Top }) {\n    return (jsxs(Fragment, { children: [jsx(Handle, { type: \"target\", position: targetPosition, isConnectable: isConnectable }), data?.label] }));\n}\n\nconst arrowKeyDiffs = {\n    ArrowUp: { x: 0, y: -1 },\n    ArrowDown: { x: 0, y: 1 },\n    ArrowLeft: { x: -1, y: 0 },\n    ArrowRight: { x: 1, y: 0 },\n};\nconst builtinNodeTypes = {\n    input: InputNode,\n    default: DefaultNode,\n    output: OutputNode,\n    group: GroupNode,\n};\nfunction getNodeInlineStyleDimensions(node) {\n    if (node.internals.handleBounds === undefined) {\n        return {\n            width: node.width ?? node.initialWidth ?? node.style?.width,\n            height: node.height ?? node.initialHeight ?? node.style?.height,\n        };\n    }\n    return {\n        width: node.width ?? node.style?.width,\n        height: node.height ?? node.style?.height,\n    };\n}\n\nconst selector$e = (s) => {\n    const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, {\n        filter: (node) => !!node.selected,\n    });\n    return {\n        width: isNumeric(width) ? width : null,\n        height: isNumeric(height) ? height : null,\n        userSelectionActive: s.userSelectionActive,\n        transformString: `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]}) translate(${x}px,${y}px)`,\n    };\n};\nfunction NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }) {\n    const store = useStoreApi();\n    const { width, height, transformString, userSelectionActive } = useStore(selector$e, shallow);\n    const moveSelectedNodes = useMoveSelectedNodes();\n    const nodeRef = useRef(null);\n    useEffect(() => {\n        if (!disableKeyboardA11y) {\n            nodeRef.current?.focus({\n                preventScroll: true,\n            });\n        }\n    }, [disableKeyboardA11y]);\n    const shouldRender = !userSelectionActive && width !== null && height !== null;\n    useDrag({\n        nodeRef,\n        disabled: !shouldRender,\n    });\n    if (!shouldRender) {\n        return null;\n    }\n    const onContextMenu = onSelectionContextMenu\n        ? (event) => {\n            const selectedNodes = store.getState().nodes.filter((n) => n.selected);\n            onSelectionContextMenu(event, selectedNodes);\n        }\n        : undefined;\n    const onKeyDown = (event) => {\n        if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n            event.preventDefault();\n            moveSelectedNodes({\n                direction: arrowKeyDiffs[event.key],\n                factor: event.shiftKey ? 4 : 1,\n            });\n        }\n    };\n    return (jsx(\"div\", { className: cc(['react-flow__nodesselection', 'react-flow__container', noPanClassName]), style: {\n            transform: transformString,\n        }, children: jsx(\"div\", { ref: nodeRef, className: \"react-flow__nodesselection-rect\", onContextMenu: onContextMenu, tabIndex: disableKeyboardA11y ? undefined : -1, onKeyDown: disableKeyboardA11y ? undefined : onKeyDown, style: {\n                width,\n                height,\n            } }) }));\n}\n\nconst win = typeof window !== 'undefined' ? window : undefined;\nconst selector$d = (s) => {\n    return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive };\n};\nfunction FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, autoPanOnSelection, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }) {\n    const { nodesSelectionActive, userSelectionActive } = useStore(selector$d, shallow);\n    const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win });\n    const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win });\n    const panOnDrag = panActivationKeyPressed || _panOnDrag;\n    const panOnScroll = panActivationKeyPressed || _panOnScroll;\n    const _selectionOnDrag = selectionOnDrag && panOnDrag !== true;\n    const isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;\n    useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode });\n    return (jsx(ZoomPane, { onPaneContextMenu: onPaneContextMenu, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, panOnScroll: panOnScroll, panActivationKeyPressed: panActivationKeyPressed, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, zoomOnDoubleClick: zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, zoomActivationKeyCode: zoomActivationKeyCode, preventScrolling: preventScrolling, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, onViewportChange: onViewportChange, isControlledViewport: isControlledViewport, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: jsxs(Pane, { onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, panOnDrag: panOnDrag, autoPanOnSelection: autoPanOnSelection, isSelecting: !!isSelecting, selectionMode: selectionMode, selectionKeyPressed: selectionKeyPressed, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: [children, nodesSelectionActive && (jsx(NodesSelection, { onSelectionContextMenu: onSelectionContextMenu, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y }))] }) }));\n}\nFlowRendererComponent.displayName = 'FlowRenderer';\nconst FlowRenderer = memo(FlowRendererComponent);\n\nconst selector$c = (onlyRenderVisible) => (s) => {\n    return onlyRenderVisible\n        ? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true).map((node) => node.id)\n        : Array.from(s.nodeLookup.keys());\n};\n/**\n * Hook for getting the visible node ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible node ids\n */\nfunction useVisibleNodeIds(onlyRenderVisible) {\n    const nodeIds = useStore(useCallback(selector$c(onlyRenderVisible), [onlyRenderVisible]), shallow);\n    return nodeIds;\n}\n\nconst selector$b = (s) => s.updateNodeInternals;\nfunction useResizeObserver() {\n    const updateNodeInternals = useStore(selector$b);\n    const [resizeObserver] = useState(() => {\n        if (typeof ResizeObserver === 'undefined') {\n            return null;\n        }\n        return new ResizeObserver((entries) => {\n            const updates = new Map();\n            entries.forEach((entry) => {\n                const id = entry.target.getAttribute('data-id');\n                updates.set(id, {\n                    id,\n                    nodeElement: entry.target,\n                    force: true,\n                });\n            });\n            updateNodeInternals(updates);\n        });\n    });\n    useEffect(() => {\n        return () => {\n            resizeObserver?.disconnect();\n        };\n    }, [resizeObserver]);\n    return resizeObserver;\n}\n\n/**\n * Hook to handle the resize observation + internal updates for the passed node.\n *\n * @internal\n * @returns nodeRef - reference to the node element\n */\nfunction useNodeObserver({ node, nodeType, hasDimensions, resizeObserver, }) {\n    const store = useStoreApi();\n    const nodeRef = useRef(null);\n    const observedNode = useRef(null);\n    const prevSourcePosition = useRef(node.sourcePosition);\n    const prevTargetPosition = useRef(node.targetPosition);\n    const prevType = useRef(nodeType);\n    const isInitialized = hasDimensions && !!node.internals.handleBounds;\n    useEffect(() => {\n        if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) {\n            if (observedNode.current) {\n                resizeObserver?.unobserve(observedNode.current);\n            }\n            resizeObserver?.observe(nodeRef.current);\n            observedNode.current = nodeRef.current;\n        }\n    }, [isInitialized, node.hidden]);\n    useEffect(() => {\n        return () => {\n            if (observedNode.current) {\n                resizeObserver?.unobserve(observedNode.current);\n                observedNode.current = null;\n            }\n        };\n    }, []);\n    useEffect(() => {\n        if (nodeRef.current) {\n            /*\n             * when the user programmatically changes the source or handle position, we need to update the internals\n             * to make sure the edges are updated correctly\n             */\n            const typeChanged = prevType.current !== nodeType;\n            const sourcePosChanged = prevSourcePosition.current !== node.sourcePosition;\n            const targetPosChanged = prevTargetPosition.current !== node.targetPosition;\n            if (typeChanged || sourcePosChanged || targetPosChanged) {\n                prevType.current = nodeType;\n                prevSourcePosition.current = node.sourcePosition;\n                prevTargetPosition.current = node.targetPosition;\n                store\n                    .getState()\n                    .updateNodeInternals(new Map([[node.id, { id: node.id, nodeElement: nodeRef.current, force: true }]]));\n            }\n        }\n    }, [node.id, nodeType, node.sourcePosition, node.targetPosition]);\n    return nodeRef;\n}\n\nfunction NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError, }) {\n    const { node, internals, isParent } = useStore((s) => {\n        const node = s.nodeLookup.get(id);\n        const isParent = s.parentLookup.has(id);\n        return {\n            node,\n            internals: node.internals,\n            isParent,\n        };\n    }, shallow);\n    let nodeType = node.type || 'default';\n    let NodeComponent = nodeTypes?.[nodeType] || builtinNodeTypes[nodeType];\n    if (NodeComponent === undefined) {\n        onError?.('003', errorMessages['error003'](nodeType));\n        nodeType = 'default';\n        NodeComponent = nodeTypes?.['default'] || builtinNodeTypes.default;\n    }\n    const isDraggable = !!(node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'));\n    const isSelectable = !!(node.selectable || (elementsSelectable && typeof node.selectable === 'undefined'));\n    const isConnectable = !!(node.connectable || (nodesConnectable && typeof node.connectable === 'undefined'));\n    const isFocusable = !!(node.focusable || (nodesFocusable && typeof node.focusable === 'undefined'));\n    const store = useStoreApi();\n    const hasDimensions = nodeHasDimensions(node);\n    const nodeRef = useNodeObserver({ node, nodeType, hasDimensions, resizeObserver });\n    const dragging = useDrag({\n        nodeRef,\n        disabled: node.hidden || !isDraggable,\n        noDragClassName,\n        handleSelector: node.dragHandle,\n        nodeId: id,\n        isSelectable,\n        nodeClickDistance,\n    });\n    const moveSelectedNodes = useMoveSelectedNodes();\n    if (node.hidden) {\n        return null;\n    }\n    const nodeDimensions = getNodeDimensions(node);\n    const inlineDimensions = getNodeInlineStyleDimensions(node);\n    const hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave;\n    const onMouseEnterHandler = onMouseEnter\n        ? (event) => onMouseEnter(event, { ...internals.userNode })\n        : undefined;\n    const onMouseMoveHandler = onMouseMove\n        ? (event) => onMouseMove(event, { ...internals.userNode })\n        : undefined;\n    const onMouseLeaveHandler = onMouseLeave\n        ? (event) => onMouseLeave(event, { ...internals.userNode })\n        : undefined;\n    const onContextMenuHandler = onContextMenu\n        ? (event) => onContextMenu(event, { ...internals.userNode })\n        : undefined;\n    const onDoubleClickHandler = onDoubleClick\n        ? (event) => onDoubleClick(event, { ...internals.userNode })\n        : undefined;\n    const onSelectNodeHandler = (event) => {\n        const { selectNodesOnDrag, nodeDragThreshold } = store.getState();\n        if (isSelectable && (!selectNodesOnDrag || !isDraggable || nodeDragThreshold > 0)) {\n            /*\n             * this handler gets called by XYDrag on drag start when selectNodesOnDrag=true\n             * here we only need to call it when selectNodesOnDrag=false\n             */\n            handleNodeClick({\n                id,\n                store,\n                nodeRef,\n            });\n        }\n        if (onClick) {\n            onClick(event, { ...internals.userNode });\n        }\n    };\n    const onKeyDown = (event) => {\n        if (isInputDOMNode(event.nativeEvent) || disableKeyboardA11y) {\n            return;\n        }\n        if (elementSelectionKeys.includes(event.key) && isSelectable) {\n            const unselect = event.key === 'Escape';\n            handleNodeClick({\n                id,\n                store,\n                unselect,\n                nodeRef,\n            });\n        }\n        else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n            // prevent default scrolling behavior on arrow key press when node is moved\n            event.preventDefault();\n            const { ariaLabelConfig } = store.getState();\n            store.setState({\n                ariaLiveMessage: ariaLabelConfig['node.a11yDescription.ariaLiveMessage']({\n                    direction: event.key.replace('Arrow', '').toLowerCase(),\n                    x: ~~internals.positionAbsolute.x,\n                    y: ~~internals.positionAbsolute.y,\n                }),\n            });\n            moveSelectedNodes({\n                direction: arrowKeyDiffs[event.key],\n                factor: event.shiftKey ? 4 : 1,\n            });\n        }\n    };\n    const onFocus = () => {\n        if (disableKeyboardA11y || !nodeRef.current?.matches(':focus-visible')) {\n            return;\n        }\n        const { transform, width, height, autoPanOnNodeFocus, setCenter } = store.getState();\n        if (!autoPanOnNodeFocus) {\n            return;\n        }\n        const withinViewport = getNodesInside(new Map([[id, node]]), { x: 0, y: 0, width, height }, transform, true).length > 0;\n        if (!withinViewport) {\n            setCenter(node.position.x + nodeDimensions.width / 2, node.position.y + nodeDimensions.height / 2, {\n                zoom: transform[2],\n            });\n        }\n    };\n    return (jsx(\"div\", { className: cc([\n            'react-flow__node',\n            `react-flow__node-${nodeType}`,\n            {\n                // this is overwritable by passing `nopan` as a class name\n                [noPanClassName]: isDraggable,\n            },\n            node.className,\n            {\n                selected: node.selected,\n                selectable: isSelectable,\n                parent: isParent,\n                draggable: isDraggable,\n                dragging,\n            },\n        ]), ref: nodeRef, style: {\n            zIndex: internals.z,\n            transform: `translate(${internals.positionAbsolute.x}px,${internals.positionAbsolute.y}px)`,\n            pointerEvents: hasPointerEvents ? 'all' : 'none',\n            visibility: hasDimensions ? 'visible' : 'hidden',\n            ...node.style,\n            ...inlineDimensions,\n        }, \"data-id\": id, \"data-testid\": `rf__node-${id}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, onFocus: isFocusable ? onFocus : undefined, role: node.ariaRole ?? (isFocusable ? 'group' : undefined), \"aria-roledescription\": \"node\", \"aria-describedby\": disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${rfId}`, \"aria-label\": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id, children: jsx(NodeComponent, { id: id, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? false, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? true, isConnectable: isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging: dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) }));\n}\nvar NodeWrapper$1 = memo(NodeWrapper);\n\nconst selector$a = (s) => ({\n    nodesConnectable: s.nodesConnectable,\n    nodesFocusable: s.nodesFocusable,\n    elementsSelectable: s.elementsSelectable,\n    onError: s.onError,\n});\nfunction NodeRendererComponent(props) {\n    const { nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$a, shallow);\n    const nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements);\n    const resizeObserver = useResizeObserver();\n    return (jsx(\"div\", { className: \"react-flow__nodes\", style: containerStyle, children: nodeIds.map((nodeId) => {\n            return (\n            /*\n             * The split of responsibilities between NodeRenderer and\n             * NodeComponentWrapper may appear weird. However, it’s designed to\n             * minimize the cost of updates when individual nodes change.\n             *\n             * For example, when you’re dragging a single node, that node gets\n             * updated multiple times per second. If `NodeRenderer` were to update\n             * every time, it would have to re-run the `nodes.map()` loop every\n             * time. This gets pricey with hundreds of nodes, especially if every\n             * loop cycle does more than just rendering a JSX element!\n             *\n             * As a result of this choice, we took the following implementation\n             * decisions:\n             * - NodeRenderer subscribes *only* to node IDs – and therefore\n             *   rerender *only* when visible nodes are added or removed.\n             * - NodeRenderer performs all operations the result of which can be\n             *   shared between nodes (such as creating the `ResizeObserver`\n             *   instance, or subscribing to `selector`). This means extra prop\n             *   drilling into `NodeComponentWrapper`, but it means we need to run\n             *   these operations only once – instead of once per node.\n             * - Any operations that you’d normally write inside `nodes.map` are\n             *   moved into `NodeComponentWrapper`. This ensures they are\n             *   memorized – so if `NodeRenderer` *has* to rerender, it only\n             *   needs to regenerate the list of nodes, nothing else.\n             */\n            jsx(NodeWrapper$1, { id: nodeId, nodeTypes: props.nodeTypes, nodeExtent: props.nodeExtent, onClick: props.onNodeClick, onMouseEnter: props.onNodeMouseEnter, onMouseMove: props.onNodeMouseMove, onMouseLeave: props.onNodeMouseLeave, onContextMenu: props.onNodeContextMenu, onDoubleClick: props.onNodeDoubleClick, noDragClassName: props.noDragClassName, noPanClassName: props.noPanClassName, rfId: props.rfId, disableKeyboardA11y: props.disableKeyboardA11y, resizeObserver: resizeObserver, nodesDraggable: props.nodesDraggable ?? true, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, elementsSelectable: elementsSelectable, nodeClickDistance: props.nodeClickDistance, onError: onError }, nodeId));\n        }) }));\n}\nNodeRendererComponent.displayName = 'NodeRenderer';\nconst NodeRenderer = memo(NodeRendererComponent);\n\n/**\n * Hook for getting the visible edge ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible edge ids\n */\nfunction useVisibleEdgeIds(onlyRenderVisible) {\n    const edgeIds = useStore(useCallback((s) => {\n        if (!onlyRenderVisible) {\n            return s.edges.map((edge) => edge.id);\n        }\n        const visibleEdgeIds = [];\n        if (s.width && s.height) {\n            for (const edge of s.edges) {\n                const sourceNode = s.nodeLookup.get(edge.source);\n                const targetNode = s.nodeLookup.get(edge.target);\n                if (sourceNode &&\n                    targetNode &&\n                    isEdgeVisible({\n                        sourceNode,\n                        targetNode,\n                        width: s.width,\n                        height: s.height,\n                        transform: s.transform,\n                    })) {\n                    visibleEdgeIds.push(edge.id);\n                }\n            }\n        }\n        return visibleEdgeIds;\n    }, [onlyRenderVisible]), shallow);\n    return edgeIds;\n}\n\nconst ArrowSymbol = ({ color = 'none', strokeWidth = 1 }) => {\n    const style = {\n        strokeWidth,\n        ...(color && { stroke: color }),\n    };\n    return (jsx(\"polyline\", { className: \"arrow\", style: style, strokeLinecap: \"round\", fill: \"none\", strokeLinejoin: \"round\", points: \"-5,-4 0,0 -5,4\" }));\n};\nconst ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }) => {\n    const style = {\n        strokeWidth,\n        ...(color && { stroke: color, fill: color }),\n    };\n    return (jsx(\"polyline\", { className: \"arrowclosed\", style: style, strokeLinecap: \"round\", strokeLinejoin: \"round\", points: \"-5,-4 0,0 -5,4 -5,-4\" }));\n};\nconst MarkerSymbols = {\n    [MarkerType.Arrow]: ArrowSymbol,\n    [MarkerType.ArrowClosed]: ArrowClosedSymbol,\n};\nfunction useMarkerSymbol(type) {\n    const store = useStoreApi();\n    const symbol = useMemo(() => {\n        const symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type);\n        if (!symbolExists) {\n            store.getState().onError?.('009', errorMessages['error009'](type));\n            return null;\n        }\n        return MarkerSymbols[type];\n    }, [type]);\n    return symbol;\n}\n\nconst Marker = ({ id, type, color, width = 12.5, height = 12.5, markerUnits = 'strokeWidth', strokeWidth, orient = 'auto-start-reverse', }) => {\n    const Symbol = useMarkerSymbol(type);\n    if (!Symbol) {\n        return null;\n    }\n    return (jsx(\"marker\", { className: \"react-flow__arrowhead\", id: id, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: \"-10 -10 20 20\", markerUnits: markerUnits, orient: orient, refX: \"0\", refY: \"0\", children: jsx(Symbol, { color: color, strokeWidth: strokeWidth }) }));\n};\n/*\n * when you have multiple flows on a page and you hide the first one, the other ones have no markers anymore\n * when they do have markers with the same ids. To prevent this the user can pass a unique id to the react flow wrapper\n * that we can then use for creating our unique marker ids\n */\nconst MarkerDefinitions = ({ defaultColor, rfId }) => {\n    const edges = useStore((s) => s.edges);\n    const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);\n    const markers = useMemo(() => {\n        const markers = createMarkerIds(edges, {\n            id: rfId,\n            defaultColor,\n            defaultMarkerStart: defaultEdgeOptions?.markerStart,\n            defaultMarkerEnd: defaultEdgeOptions?.markerEnd,\n        });\n        return markers;\n    }, [edges, defaultEdgeOptions, rfId, defaultColor]);\n    if (!markers.length) {\n        return null;\n    }\n    return (jsx(\"svg\", { className: \"react-flow__marker\", \"aria-hidden\": \"true\", children: jsx(\"defs\", { children: markers.map((marker) => (jsx(Marker, { id: marker.id, type: marker.type, color: marker.color, width: marker.width, height: marker.height, markerUnits: marker.markerUnits, strokeWidth: marker.strokeWidth, orient: marker.orient }, marker.id))) }) }));\n};\nMarkerDefinitions.displayName = 'MarkerDefinitions';\nvar MarkerDefinitions$1 = memo(MarkerDefinitions);\n\nfunction EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = true, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children, className, ...rest }) {\n    const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 });\n    const edgeTextClasses = cc(['react-flow__edge-textwrapper', className]);\n    const edgeTextRef = useRef(null);\n    useEffect(() => {\n        if (edgeTextRef.current) {\n            const textBbox = edgeTextRef.current.getBBox();\n            setEdgeTextBbox({\n                x: textBbox.x,\n                y: textBbox.y,\n                width: textBbox.width,\n                height: textBbox.height,\n            });\n        }\n    }, [label]);\n    if (!label) {\n        return null;\n    }\n    return (jsxs(\"g\", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? 'visible' : 'hidden', ...rest, children: [labelShowBg && (jsx(\"rect\", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: \"react-flow__edge-textbg\", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius })), jsx(\"text\", { className: \"react-flow__edge-text\", y: edgeTextBbox.height / 2, dy: \"0.3em\", ref: edgeTextRef, style: labelStyle, children: label }), children] }));\n}\nEdgeTextComponent.displayName = 'EdgeText';\n/**\n * You can use the `<EdgeText />` component as a helper component to display text\n * within your custom edges.\n *\n * @public\n *\n * @example\n * ```jsx\n * import { EdgeText } from '@xyflow/react';\n *\n * export function CustomEdgeLabel({ label }) {\n *   return (\n *     <EdgeText\n *       x={100}\n *       y={100}\n *       label={label}\n *       labelStyle={{ fill: 'white' }}\n *       labelShowBg\n *       labelBgStyle={{ fill: 'red' }}\n *       labelBgPadding={[2, 4]}\n *       labelBgBorderRadius={2}\n *     />\n *   );\n * }\n *```\n */\nconst EdgeText = memo(EdgeTextComponent);\n\n/**\n * The `<BaseEdge />` component gets used internally for all the edges. It can be\n * used inside a custom edge and handles the invisible helper edge and the edge label\n * for you.\n *\n * @public\n * @example\n * ```jsx\n *import { BaseEdge } from '@xyflow/react';\n *\n *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) {\n *  const [edgePath] = getStraightPath({\n *    sourceX,\n *    sourceY,\n *    targetX,\n *    targetY,\n *  });\n *\n *  return <BaseEdge path={edgePath} {...props} />;\n *}\n *```\n *\n * @remarks If you want to use an edge marker with the [`<BaseEdge />`](/api-reference/components/base-edge) component,\n * you can pass the `markerStart` or `markerEnd` props passed to your custom edge\n * through to the [`<BaseEdge />`](/api-reference/components/base-edge) component.\n * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type.\n */\nfunction BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) {\n    return (jsxs(Fragment, { children: [jsx(\"path\", { ...props, d: path, fill: \"none\", className: cc(['react-flow__edge-path', props.className]) }), interactionWidth ? (jsx(\"path\", { d: path, fill: \"none\", strokeOpacity: 0, strokeWidth: interactionWidth, className: \"react-flow__edge-interaction\" })) : null, label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] }));\n}\n\nfunction getControl({ pos, x1, y1, x2, y2 }) {\n    if (pos === Position.Left || pos === Position.Right) {\n        return [0.5 * (x1 + x2), y1];\n    }\n    return [x1, 0.5 * (y1 + y2)];\n}\n/**\n * The `getSimpleBezierPath` util returns everything you need to render a simple\n * bezier edge between two nodes.\n * @public\n * @returns\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n */\nfunction getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, }) {\n    const [sourceControlX, sourceControlY] = getControl({\n        pos: sourcePosition,\n        x1: sourceX,\n        y1: sourceY,\n        x2: targetX,\n        y2: targetY,\n    });\n    const [targetControlX, targetControlY] = getControl({\n        pos: targetPosition,\n        x1: targetX,\n        y1: targetY,\n        x2: sourceX,\n        y2: sourceY,\n    });\n    const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n        sourceX,\n        sourceY,\n        targetX,\n        targetY,\n        sourceControlX,\n        sourceControlY,\n        targetControlX,\n        targetControlY,\n    });\n    return [\n        `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n        labelX,\n        labelY,\n        offsetX,\n        offsetY,\n    ];\n}\nfunction createSimpleBezierEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => {\n        const [path, labelX, labelY] = getSimpleBezierPath({\n            sourceX,\n            sourceY,\n            sourcePosition,\n            targetX,\n            targetY,\n            targetPosition,\n        });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\nconst SimpleBezierEdge = createSimpleBezierEdge({ isInternal: false });\nconst SimpleBezierEdgeInternal = createSimpleBezierEdge({ isInternal: true });\nSimpleBezierEdge.displayName = 'SimpleBezierEdge';\nSimpleBezierEdgeInternal.displayName = 'SimpleBezierEdgeInternal';\n\nfunction createSmoothStepEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition = Position.Bottom, targetPosition = Position.Top, markerEnd, markerStart, pathOptions, interactionWidth, }) => {\n        const [path, labelX, labelY] = getSmoothStepPath({\n            sourceX,\n            sourceY,\n            sourcePosition,\n            targetX,\n            targetY,\n            targetPosition,\n            borderRadius: pathOptions?.borderRadius,\n            offset: pathOptions?.offset,\n            stepPosition: pathOptions?.stepPosition,\n        });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a smooth step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { SmoothStepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n *   return (\n *     <SmoothStepEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *       sourcePosition={sourcePosition}\n *       targetPosition={targetPosition}\n *     />\n *   );\n * }\n * ```\n */\nconst SmoothStepEdge = createSmoothStepEdge({ isInternal: false });\n/**\n * @internal\n */\nconst SmoothStepEdgeInternal = createSmoothStepEdge({ isInternal: true });\nSmoothStepEdge.displayName = 'SmoothStepEdge';\nSmoothStepEdgeInternal.displayName = 'SmoothStepEdgeInternal';\n\nfunction createStepEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, ...props }) => {\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset]) }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n *   return (\n *     <StepEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *       sourcePosition={sourcePosition}\n *       targetPosition={targetPosition}\n *     />\n *   );\n * }\n * ```\n */\nconst StepEdge = createStepEdge({ isInternal: false });\n/**\n * @internal\n */\nconst StepEdgeInternal = createStepEdge({ isInternal: true });\nStepEdge.displayName = 'StepEdge';\nStepEdgeInternal.displayName = 'StepEdgeInternal';\n\nfunction createStraightEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => {\n        const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a straight line.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StraightEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY }) {\n *   return (\n *     <StraightEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *     />\n *   );\n * }\n * ```\n */\nconst StraightEdge = createStraightEdge({ isInternal: false });\n/**\n * @internal\n */\nconst StraightEdgeInternal = createStraightEdge({ isInternal: true });\nStraightEdge.displayName = 'StraightEdge';\nStraightEdgeInternal.displayName = 'StraightEdgeInternal';\n\nfunction createBezierEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition = Position.Bottom, targetPosition = Position.Top, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }) => {\n        const [path, labelX, labelY] = getBezierPath({\n            sourceX,\n            sourceY,\n            sourcePosition,\n            targetX,\n            targetY,\n            targetPosition,\n            curvature: pathOptions?.curvature,\n        });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a bezier curve.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { BezierEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n *   return (\n *     <BezierEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *       sourcePosition={sourcePosition}\n *       targetPosition={targetPosition}\n *     />\n *   );\n * }\n * ```\n */\nconst BezierEdge = createBezierEdge({ isInternal: false });\n/**\n * @internal\n */\nconst BezierEdgeInternal = createBezierEdge({ isInternal: true });\nBezierEdge.displayName = 'BezierEdge';\nBezierEdgeInternal.displayName = 'BezierEdgeInternal';\n\nconst builtinEdgeTypes = {\n    default: BezierEdgeInternal,\n    straight: StraightEdgeInternal,\n    step: StepEdgeInternal,\n    smoothstep: SmoothStepEdgeInternal,\n    simplebezier: SimpleBezierEdgeInternal,\n};\nconst nullPosition = {\n    sourceX: null,\n    sourceY: null,\n    targetX: null,\n    targetY: null,\n    sourcePosition: null,\n    targetPosition: null,\n    zIndex: undefined,\n};\n\nconst shiftX = (x, shift, position) => {\n    if (position === Position.Left)\n        return x - shift;\n    if (position === Position.Right)\n        return x + shift;\n    return x;\n};\nconst shiftY = (y, shift, position) => {\n    if (position === Position.Top)\n        return y - shift;\n    if (position === Position.Bottom)\n        return y + shift;\n    return y;\n};\nconst EdgeUpdaterClassName = 'react-flow__edgeupdater';\n/**\n * @internal\n */\nfunction EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type, }) {\n    return (jsx(\"circle\", { onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseOut: onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: \"transparent\", fill: \"transparent\" }));\n}\n\nfunction EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, onReconnect, onReconnectStart, onReconnectEnd, setReconnecting, setUpdateHover, }) {\n    const store = useStoreApi();\n    const handleEdgeUpdater = (event, oppositeHandle) => {\n        // avoid triggering edge updater if mouse btn is not left\n        if (event.button !== 0) {\n            return;\n        }\n        const { autoPanOnConnect, domNode, connectionMode, connectionRadius, lib, onConnectStart, cancelConnection, nodeLookup, rfId: flowId, panBy, updateConnection, } = store.getState();\n        const isTarget = oppositeHandle.type === 'target';\n        const _onReconnectEnd = (evt, connectionState) => {\n            setReconnecting(false);\n            onReconnectEnd?.(evt, edge, oppositeHandle.type, connectionState);\n        };\n        const onConnectEdge = (connection) => onReconnect?.(edge, connection);\n        const _onConnectStart = (_event, params) => {\n            setReconnecting(true);\n            onReconnectStart?.(event, edge, oppositeHandle.type);\n            onConnectStart?.(_event, params);\n        };\n        XYHandle.onPointerDown(event.nativeEvent, {\n            autoPanOnConnect,\n            connectionMode,\n            connectionRadius,\n            domNode,\n            handleId: oppositeHandle.id,\n            nodeId: oppositeHandle.nodeId,\n            nodeLookup,\n            isTarget,\n            edgeUpdaterType: oppositeHandle.type,\n            lib,\n            flowId,\n            cancelConnection,\n            panBy,\n            isValidConnection: (...args) => store.getState().isValidConnection?.(...args) ?? true,\n            onConnect: onConnectEdge,\n            onConnectStart: _onConnectStart,\n            onConnectEnd: (...args) => store.getState().onConnectEnd?.(...args),\n            onReconnectEnd: _onReconnectEnd,\n            updateConnection,\n            getTransform: () => store.getState().transform,\n            getFromHandle: () => store.getState().connection.fromHandle,\n            dragThreshold: store.getState().connectionDragThreshold,\n            handleDomNode: event.currentTarget,\n        });\n    };\n    const onReconnectSourceMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.target, id: edge.targetHandle ?? null, type: 'target' });\n    const onReconnectTargetMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.source, id: edge.sourceHandle ?? null, type: 'source' });\n    const onReconnectMouseEnter = () => setUpdateHover(true);\n    const onReconnectMouseOut = () => setUpdateHover(false);\n    return (jsxs(Fragment, { children: [(isReconnectable === true || isReconnectable === 'source') && (jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: \"source\" })), (isReconnectable === true || isReconnectable === 'target') && (jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: \"target\" }))] }));\n}\n\nfunction EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y, }) {\n    let edge = useStore((s) => s.edgeLookup.get(id));\n    const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);\n    edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge;\n    let edgeType = edge.type || 'default';\n    let EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType];\n    if (EdgeComponent === undefined) {\n        onError?.('011', errorMessages['error011'](edgeType));\n        edgeType = 'default';\n        EdgeComponent = edgeTypes?.['default'] || builtinEdgeTypes.default;\n    }\n    const isFocusable = !!(edge.focusable || (edgesFocusable && typeof edge.focusable === 'undefined'));\n    const isReconnectable = typeof onReconnect !== 'undefined' &&\n        (edge.reconnectable || (edgesReconnectable && typeof edge.reconnectable === 'undefined'));\n    const isSelectable = !!(edge.selectable || (elementsSelectable && typeof edge.selectable === 'undefined'));\n    const edgeRef = useRef(null);\n    const [updateHover, setUpdateHover] = useState(false);\n    const [reconnecting, setReconnecting] = useState(false);\n    const store = useStoreApi();\n    const { zIndex = edge.zIndex, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, } = useStore(useCallback((store) => {\n        const sourceNode = store.nodeLookup.get(edge.source);\n        const targetNode = store.nodeLookup.get(edge.target);\n        if (!sourceNode || !targetNode) {\n            return nullPosition;\n        }\n        const edgePosition = getEdgePosition({\n            id,\n            sourceNode,\n            targetNode,\n            sourceHandle: edge.sourceHandle || null,\n            targetHandle: edge.targetHandle || null,\n            connectionMode: store.connectionMode,\n            onError,\n        });\n        const zIndex = getElevatedEdgeZIndex({\n            selected: edge.selected,\n            zIndex: edge.zIndex,\n            sourceNode,\n            targetNode,\n            elevateOnSelect: store.elevateEdgesOnSelect,\n            zIndexMode: store.zIndexMode,\n        });\n        return {\n            ...(edgePosition || nullPosition),\n            zIndex,\n        };\n    }, [edge.source, edge.target, edge.sourceHandle, edge.targetHandle, edge.selected, edge.zIndex, onError]), shallow);\n    const markerStartUrl = useMemo(() => (edge.markerStart ? `url('#${getMarkerId(edge.markerStart, rfId)}')` : undefined), [edge.markerStart, rfId]);\n    const markerEndUrl = useMemo(() => (edge.markerEnd ? `url('#${getMarkerId(edge.markerEnd, rfId)}')` : undefined), [edge.markerEnd, rfId]);\n    if (edge.hidden || sourceX === null || sourceY === null || targetX === null || targetY === null) {\n        return null;\n    }\n    const onEdgeClick = (event) => {\n        const { addSelectedEdges, unselectNodesAndEdges, multiSelectionActive } = store.getState();\n        if (isSelectable) {\n            store.setState({ nodesSelectionActive: false });\n            if (edge.selected && multiSelectionActive) {\n                unselectNodesAndEdges({ nodes: [], edges: [edge] });\n                edgeRef.current?.blur();\n            }\n            else {\n                addSelectedEdges([id]);\n            }\n        }\n        if (onClick) {\n            onClick(event, edge);\n        }\n    };\n    const onEdgeDoubleClick = onDoubleClick\n        ? (event) => {\n            onDoubleClick(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeContextMenu = onContextMenu\n        ? (event) => {\n            onContextMenu(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeMouseEnter = onMouseEnter\n        ? (event) => {\n            onMouseEnter(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeMouseMove = onMouseMove\n        ? (event) => {\n            onMouseMove(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeMouseLeave = onMouseLeave\n        ? (event) => {\n            onMouseLeave(event, { ...edge });\n        }\n        : undefined;\n    const onKeyDown = (event) => {\n        if (!disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable) {\n            const { unselectNodesAndEdges, addSelectedEdges } = store.getState();\n            const unselect = event.key === 'Escape';\n            if (unselect) {\n                edgeRef.current?.blur();\n                unselectNodesAndEdges({ edges: [edge] });\n            }\n            else {\n                addSelectedEdges([id]);\n            }\n        }\n    };\n    return (jsx(\"svg\", { style: { zIndex }, children: jsxs(\"g\", { className: cc([\n                'react-flow__edge',\n                `react-flow__edge-${edgeType}`,\n                edge.className,\n                noPanClassName,\n                {\n                    selected: edge.selected,\n                    animated: edge.animated,\n                    inactive: !isSelectable && !onClick,\n                    updating: updateHover,\n                    selectable: isSelectable,\n                },\n            ]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, role: edge.ariaRole ?? (isFocusable ? 'group' : 'img'), \"aria-roledescription\": \"edge\", \"data-id\": id, \"data-testid\": `rf__edge-${id}`, \"aria-label\": edge.ariaLabel === null ? undefined : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, \"aria-describedby\": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && (jsx(EdgeComponent, { id: id, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? true, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: 'pathOptions' in edge ? edge.pathOptions : undefined, interactionWidth: edge.interactionWidth })), isReconnectable && (jsx(EdgeUpdateAnchors, { edge: edge, isReconnectable: isReconnectable, reconnectRadius: reconnectRadius, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, setUpdateHover: setUpdateHover, setReconnecting: setReconnecting }))] }) }));\n}\nvar EdgeWrapper$1 = memo(EdgeWrapper);\n\nconst selector$9 = (s) => ({\n    edgesFocusable: s.edgesFocusable,\n    edgesReconnectable: s.edgesReconnectable,\n    elementsSelectable: s.elementsSelectable,\n    connectionMode: s.connectionMode,\n    onError: s.onError,\n});\nfunction EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }) {\n    const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$9, shallow);\n    const edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);\n    return (jsxs(\"div\", { className: \"react-flow__edges\", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId: rfId }), edgeIds.map((id) => {\n                return (jsx(EdgeWrapper$1, { id: id, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, noPanClassName: noPanClassName, onReconnect: onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius: reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, rfId: rfId, onError: onError, edgeTypes: edgeTypes, disableKeyboardA11y: disableKeyboardA11y }, id));\n            })] }));\n}\nEdgeRendererComponent.displayName = 'EdgeRenderer';\nconst EdgeRenderer = memo(EdgeRendererComponent);\n\nconst toTransformString = (transform) => `translate(${transform[0]}px,${transform[1]}px) scale(${transform[2]})`;\nfunction Viewport({ children }) {\n    const store = useStoreApi();\n    const viewportRef = useRef(null);\n    // seed the transform for first paint and SSR without subscribing, so we don't re-render on pan/zoom\n    const [initialTransform] = useState(() => store.getState().transform);\n    // transform changes every pan/zoom frame, so write it to the DOM directly to keep React out of the hot path\n    useIsomorphicLayoutEffect(() => {\n        let prevTransform = null;\n        const applyTransform = () => {\n            const transform = store.getState().transform;\n            // store.subscribe fires on every update, so only touch the DOM when x, y or zoom actually changed\n            if (prevTransform &&\n                transform[0] === prevTransform[0] &&\n                transform[1] === prevTransform[1] &&\n                transform[2] === prevTransform[2]) {\n                return;\n            }\n            prevTransform = transform;\n            if (viewportRef.current) {\n                viewportRef.current.style.transform = toTransformString(transform);\n            }\n        };\n        applyTransform();\n        return store.subscribe(applyTransform);\n    }, [store]);\n    return (jsx(\"div\", { ref: viewportRef, className: \"react-flow__viewport xyflow__viewport react-flow__container\", style: { transform: toTransformString(initialTransform) }, children: children }));\n}\n\n/**\n * Hook for calling onInit handler.\n *\n * @internal\n */\nfunction useOnInitHandler(onInit) {\n    const rfInstance = useReactFlow();\n    const isInitialized = useRef(false);\n    useEffect(() => {\n        if (!isInitialized.current && rfInstance.viewportInitialized && onInit) {\n            setTimeout(() => onInit(rfInstance), 1);\n            isInitialized.current = true;\n        }\n    }, [onInit, rfInstance.viewportInitialized]);\n}\n\nconst selector$8 = (state) => state.panZoom?.syncViewport;\n/**\n * Hook for syncing the viewport with the panzoom instance.\n *\n * @internal\n * @param viewport\n */\nfunction useViewportSync(viewport) {\n    const syncViewport = useStore(selector$8);\n    const store = useStoreApi();\n    useEffect(() => {\n        if (viewport) {\n            syncViewport?.(viewport);\n            store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] });\n        }\n    }, [viewport, syncViewport]);\n    return null;\n}\n\nfunction storeSelector$1(s) {\n    return s.connection.inProgress\n        ? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) }\n        : { ...s.connection };\n}\nfunction getSelector(connectionSelector) {\n    if (connectionSelector) {\n        const combinedSelector = (s) => {\n            const connection = storeSelector$1(s);\n            return connectionSelector(connection);\n        };\n        return combinedSelector;\n    }\n    return storeSelector$1;\n}\n/**\n * The `useConnection` hook returns the current connection when there is an active\n * connection interaction. If no connection interaction is active, it returns null\n * for every property. A typical use case for this hook is to colorize handles\n * based on a certain condition (e.g. if the connection is valid or not).\n *\n * @public\n * @param connectionSelector - An optional selector function used to extract a slice of the\n * `ConnectionState` data. Using a selector can prevent component re-renders where data you don't\n * otherwise care about might change. If a selector is not provided, the entire `ConnectionState`\n * object is returned unchanged.\n * @example\n *\n * ```tsx\n *import { useConnection } from '@xyflow/react';\n *\n *function App() {\n *  const connection = useConnection();\n *\n *  return (\n *    <div> {connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'}\n *\n *   </div>\n *   );\n * }\n * ```\n *\n * @returns ConnectionState\n */\nfunction useConnection(connectionSelector) {\n    const combinedSelector = getSelector(connectionSelector);\n    return useStore(combinedSelector, shallow);\n}\n\nconst selector$7 = (s) => ({\n    nodesConnectable: s.nodesConnectable,\n    isValid: s.connection.isValid,\n    inProgress: s.connection.inProgress,\n    width: s.width,\n    height: s.height,\n});\nfunction ConnectionLineWrapper({ containerStyle, style, type, component, }) {\n    const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow);\n    const renderConnection = !!(width && nodesConnectable && inProgress);\n    if (!renderConnection) {\n        return null;\n    }\n    return (jsx(\"svg\", { style: containerStyle, width: width, height: height, className: \"react-flow__connectionline react-flow__container\", children: jsx(\"g\", { className: cc(['react-flow__connection', getConnectionStatus(isValid)]), children: jsx(ConnectionLine, { style: style, type: type, CustomComponent: component, isValid: isValid }) }) }));\n}\nconst ConnectionLine = ({ style, type = ConnectionLineType.Bezier, CustomComponent, isValid, }) => {\n    const { inProgress, from, fromNode, fromHandle, fromPosition, to, toNode, toHandle, toPosition, pointer } = useConnection();\n    if (!inProgress) {\n        return;\n    }\n    if (CustomComponent) {\n        return (jsx(CustomComponent, { connectionLineType: type, connectionLineStyle: style, fromNode: fromNode, fromHandle: fromHandle, fromX: from.x, fromY: from.y, toX: to.x, toY: to.y, fromPosition: fromPosition, toPosition: toPosition, connectionStatus: getConnectionStatus(isValid), toNode: toNode, toHandle: toHandle, pointer: pointer }));\n    }\n    let path = '';\n    const pathParams = {\n        sourceX: from.x,\n        sourceY: from.y,\n        sourcePosition: fromPosition,\n        targetX: to.x,\n        targetY: to.y,\n        targetPosition: toPosition,\n    };\n    switch (type) {\n        case ConnectionLineType.Bezier:\n            [path] = getBezierPath(pathParams);\n            break;\n        case ConnectionLineType.SimpleBezier:\n            [path] = getSimpleBezierPath(pathParams);\n            break;\n        case ConnectionLineType.Step:\n            [path] = getSmoothStepPath({\n                ...pathParams,\n                borderRadius: 0,\n            });\n            break;\n        case ConnectionLineType.SmoothStep:\n            [path] = getSmoothStepPath(pathParams);\n            break;\n        default:\n            [path] = getStraightPath(pathParams);\n    }\n    return jsx(\"path\", { d: path, fill: \"none\", className: \"react-flow__connection-path\", style: style });\n};\nConnectionLine.displayName = 'ConnectionLine';\n\nconst emptyTypes = {};\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction useNodeOrEdgeTypesWarning(nodeOrEdgeTypes = emptyTypes) {\n    const typesRef = useRef(nodeOrEdgeTypes);\n    const store = useStoreApi();\n    useEffect(() => {\n        if (process.env.NODE_ENV === 'development') {\n            const usedKeys = new Set([...Object.keys(typesRef.current), ...Object.keys(nodeOrEdgeTypes)]);\n            for (const key of usedKeys) {\n                if (typesRef.current[key] !== nodeOrEdgeTypes[key]) {\n                    store.getState().onError?.('002', errorMessages['error002']());\n                    break;\n                }\n            }\n            typesRef.current = nodeOrEdgeTypes;\n        }\n    }, [nodeOrEdgeTypes]);\n}\n\nfunction useStylesLoadedWarning() {\n    const store = useStoreApi();\n    const checked = useRef(false);\n    useEffect(() => {\n        if (process.env.NODE_ENV === 'development') {\n            if (!checked.current) {\n                const pane = document.querySelector('.react-flow__pane');\n                if (pane && !(window.getComputedStyle(pane).zIndex === '1')) {\n                    store.getState().onError?.('013', errorMessages['error013']('react'));\n                }\n                checked.current = true;\n            }\n        }\n    }, []);\n}\n\nfunction GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, autoPanOnSelection, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, nodesDraggable, }) {\n    useNodeOrEdgeTypesWarning(nodeTypes);\n    useNodeOrEdgeTypesWarning(edgeTypes);\n    useStylesLoadedWarning();\n    useOnInitHandler(onInit);\n    useViewportSync(viewport);\n    return (jsx(FlowRenderer, { onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, paneClickDistance: paneClickDistance, deleteKeyCode: deleteKeyCode, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, autoPanOnSelection: autoPanOnSelection, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onSelectionContextMenu: onSelectionContextMenu, preventScrolling: preventScrolling, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, onViewportChange: onViewportChange, isControlledViewport: !!viewport, children: jsxs(Viewport, { children: [jsx(EdgeRenderer, { edgeTypes: edgeTypes, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onlyRenderVisibleElements: onlyRenderVisibleElements, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, rfId: rfId }), jsx(ConnectionLineWrapper, { style: connectionLineStyle, type: connectionLineType, component: connectionLineComponent, containerStyle: connectionLineContainerStyle }), jsx(\"div\", { className: \"react-flow__edgelabel-renderer\" }), jsx(NodeRenderer, { nodeTypes: nodeTypes, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, nodeClickDistance: nodeClickDistance, onlyRenderVisibleElements: onlyRenderVisibleElements, noPanClassName: noPanClassName, noDragClassName: noDragClassName, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, rfId: rfId, nodesDraggable: nodesDraggable }), jsx(\"div\", { className: \"react-flow__viewport-portal\" })] }) }));\n}\nGraphViewComponent.displayName = 'GraphView';\nconst GraphView = memo(GraphViewComponent);\n\nconst devWarn = createDevWarn('React Flow', 'https://reactflow.dev/');\nconst getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom = 0.5, maxZoom = 2, nodeOrigin, nodeExtent, zIndexMode = 'basic', } = {}) => {\n    const nodeLookup = new Map();\n    const parentLookup = new Map();\n    const connectionLookup = new Map();\n    const edgeLookup = new Map();\n    const storeEdges = defaultEdges ?? edges ?? [];\n    const storeNodes = defaultNodes ?? nodes ?? [];\n    const storeNodeOrigin = nodeOrigin ?? [0, 0];\n    const storeNodeExtent = nodeExtent ?? infiniteExtent;\n    updateConnectionLookup(connectionLookup, edgeLookup, storeEdges);\n    const { nodesInitialized } = adoptUserNodes(storeNodes, nodeLookup, parentLookup, {\n        nodeOrigin: storeNodeOrigin,\n        nodeExtent: storeNodeExtent,\n        zIndexMode,\n    });\n    let transform = [0, 0, 1];\n    if (fitView && width && height) {\n        const bounds = getInternalNodesBounds(nodeLookup, {\n            filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight)),\n        });\n        const { x, y, zoom } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1);\n        transform = [x, y, zoom];\n    }\n    return {\n        rfId: '1',\n        width: width ?? 0,\n        height: height ?? 0,\n        transform,\n        nodes: storeNodes,\n        nodesInitialized,\n        nodeLookup,\n        parentLookup,\n        edges: storeEdges,\n        edgeLookup,\n        connectionLookup,\n        onNodesChange: null,\n        onEdgesChange: null,\n        hasDefaultNodes: defaultNodes !== undefined,\n        hasDefaultEdges: defaultEdges !== undefined,\n        panZoom: null,\n        minZoom,\n        maxZoom,\n        translateExtent: infiniteExtent,\n        nodeExtent: storeNodeExtent,\n        nodesSelectionActive: false,\n        userSelectionActive: false,\n        userSelectionRect: null,\n        connectionMode: ConnectionMode.Strict,\n        domNode: null,\n        paneDragging: false,\n        noPanClassName: 'nopan',\n        nodeOrigin: storeNodeOrigin,\n        nodeDragThreshold: 1,\n        connectionDragThreshold: 1,\n        snapGrid: [15, 15],\n        snapToGrid: false,\n        nodesDraggable: true,\n        nodesConnectable: true,\n        nodesFocusable: true,\n        edgesFocusable: true,\n        edgesReconnectable: true,\n        elementsSelectable: true,\n        elevateNodesOnSelect: true,\n        elevateEdgesOnSelect: true,\n        selectNodesOnDrag: true,\n        multiSelectionActive: false,\n        fitViewQueued: fitView ?? false,\n        fitViewOptions,\n        fitViewResolver: null,\n        connection: { ...initialConnection },\n        connectionClickStartHandle: null,\n        connectOnClick: true,\n        ariaLiveMessage: '',\n        autoPanOnConnect: true,\n        autoPanOnNodeDrag: true,\n        autoPanOnNodeFocus: true,\n        autoPanSpeed: 15,\n        connectionRadius: 20,\n        onError: devWarn,\n        isValidConnection: undefined,\n        onSelectionChangeHandlers: [],\n        lib: 'react',\n        debug: false,\n        ariaLabelConfig: defaultAriaLabelConfig,\n        zIndexMode,\n        defaultEdgeOptions: undefined,\n        onNodesChangeMiddlewareMap: new Map(),\n        onEdgesChangeMiddlewareMap: new Map(),\n        onNodesDelete: undefined,\n        onEdgesDelete: undefined,\n        onDelete: undefined,\n        onBeforeDelete: undefined,\n        onViewportChangeStart: undefined,\n        onViewportChange: undefined,\n        onViewportChangeEnd: undefined,\n        onNodeDragStart: undefined,\n        onNodeDrag: undefined,\n        onNodeDragStop: undefined,\n        onSelectionDragStart: undefined,\n        onSelectionDrag: undefined,\n        onSelectionDragStop: undefined,\n        onMoveStart: undefined,\n        onMove: undefined,\n        onMoveEnd: undefined,\n        onConnect: undefined,\n        onConnectStart: undefined,\n        onConnectEnd: undefined,\n        onClickConnectStart: undefined,\n        onClickConnectEnd: undefined,\n    };\n};\n\nconst createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, zIndexMode, }) => createWithEqualityFn((set, get) => {\n    async function resolveFitView() {\n        const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get();\n        if (!panZoom) {\n            return;\n        }\n        await fitViewport({\n            nodes: nodeLookup,\n            width,\n            height,\n            panZoom,\n            minZoom,\n            maxZoom,\n        }, fitViewOptions);\n        fitViewResolver?.resolve(true);\n        /**\n         * wait for the fitViewport to resolve before deleting the resolver,\n         * we want to reuse the old resolver if the user calls fitView again in the mean time\n         */\n        set({ fitViewResolver: null });\n    }\n    return {\n        ...getInitialState({\n            nodes,\n            edges,\n            width,\n            height,\n            fitView,\n            fitViewOptions,\n            minZoom,\n            maxZoom,\n            nodeOrigin,\n            nodeExtent,\n            defaultNodes,\n            defaultEdges,\n            zIndexMode,\n        }),\n        setNodes: (nodes) => {\n            const { nodeLookup, parentLookup, nodeOrigin, nodeExtent, elevateNodesOnSelect, fitViewQueued, zIndexMode, nodesSelectionActive, } = get();\n            /*\n             * setNodes() is called exclusively in response to user actions:\n             * - either when the `<ReactFlow nodes>` prop is updated in the controlled ReactFlow setup,\n             * - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup.\n             *\n             * When this happens, we take the note objects passed by the user and extend them with fields\n             * relevant for internal React Flow operations.\n             */\n            const { nodesInitialized, hasSelectedNodes } = adoptUserNodes(nodes, nodeLookup, parentLookup, {\n                nodeOrigin,\n                nodeExtent,\n                elevateNodesOnSelect,\n                checkEquality: true,\n                zIndexMode,\n            });\n            const nextNodesSelectionActive = nodesSelectionActive && hasSelectedNodes;\n            if (fitViewQueued && nodesInitialized) {\n                resolveFitView();\n                set({\n                    nodes,\n                    nodesInitialized,\n                    fitViewQueued: false,\n                    fitViewOptions: undefined,\n                    nodesSelectionActive: nextNodesSelectionActive\n                });\n            }\n            else {\n                set({ nodes, nodesInitialized, nodesSelectionActive: nextNodesSelectionActive });\n            }\n        },\n        setEdges: (edges) => {\n            const { connectionLookup, edgeLookup } = get();\n            updateConnectionLookup(connectionLookup, edgeLookup, edges);\n            set({ edges });\n        },\n        setDefaultNodesAndEdges: (nodes, edges) => {\n            if (nodes) {\n                const { setNodes } = get();\n                setNodes(nodes);\n                set({ hasDefaultNodes: true });\n            }\n            if (edges) {\n                const { setEdges } = get();\n                setEdges(edges);\n                set({ hasDefaultEdges: true });\n            }\n        },\n        /*\n         * Every node gets registered at a ResizeObserver. Whenever a node\n         * changes its dimensions, this function is called to measure the\n         * new dimensions and update the nodes.\n         */\n        updateNodeInternals: (updates) => {\n            const { triggerNodeChanges, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, debug, fitViewQueued, zIndexMode, } = get();\n            const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, zIndexMode);\n            if (!updatedInternals) {\n                return;\n            }\n            updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent, zIndexMode });\n            if (fitViewQueued) {\n                resolveFitView();\n                set({ fitViewQueued: false, fitViewOptions: undefined });\n            }\n            else {\n                // we always want to trigger useStore calls whenever updateNodeInternals is called\n                set({});\n            }\n            if (changes?.length > 0) {\n                if (debug) {\n                    console.log('React Flow: trigger node changes', changes);\n                }\n                triggerNodeChanges?.(changes);\n            }\n        },\n        updateNodePositions: (nodeDragItems, dragging = false) => {\n            const parentExpandChildren = [];\n            let changes = [];\n            const { nodeLookup, triggerNodeChanges, connection, updateConnection, onNodesChangeMiddlewareMap } = get();\n            for (const [id, dragItem] of nodeDragItems) {\n                // we are using the nodelookup to be sure to use the current expandParent and parentId value\n                const node = nodeLookup.get(id);\n                const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position);\n                const change = {\n                    id,\n                    type: 'position',\n                    position: expandParent\n                        ? {\n                            x: Math.max(0, dragItem.position.x),\n                            y: Math.max(0, dragItem.position.y),\n                        }\n                        : dragItem.position,\n                    dragging,\n                };\n                if (node && connection.inProgress && connection.fromNode.id === node.id) {\n                    const updatedFrom = getHandlePosition(node, connection.fromHandle, Position.Left, true);\n                    updateConnection({ ...connection, from: updatedFrom });\n                }\n                if (expandParent && node.parentId) {\n                    parentExpandChildren.push({\n                        id,\n                        parentId: node.parentId,\n                        rect: {\n                            ...dragItem.internals.positionAbsolute,\n                            width: dragItem.measured.width ?? 0,\n                            height: dragItem.measured.height ?? 0,\n                        },\n                    });\n                }\n                changes.push(change);\n            }\n            if (parentExpandChildren.length > 0) {\n                const { parentLookup, nodeOrigin } = get();\n                const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);\n                changes.push(...parentExpandChanges);\n            }\n            for (const middleware of onNodesChangeMiddlewareMap.values()) {\n                changes = middleware(changes);\n            }\n            triggerNodeChanges(changes);\n        },\n        triggerNodeChanges: (changes) => {\n            const { onNodesChange, setNodes, nodes, hasDefaultNodes, debug } = get();\n            if (changes?.length) {\n                if (hasDefaultNodes) {\n                    const updatedNodes = applyNodeChanges(changes, nodes);\n                    setNodes(updatedNodes);\n                }\n                if (debug) {\n                    console.log('React Flow: trigger node changes', changes);\n                }\n                onNodesChange?.(changes);\n            }\n        },\n        triggerEdgeChanges: (changes) => {\n            const { onEdgesChange, setEdges, edges, hasDefaultEdges, debug } = get();\n            if (changes?.length) {\n                if (hasDefaultEdges) {\n                    const updatedEdges = applyEdgeChanges(changes, edges);\n                    setEdges(updatedEdges);\n                }\n                if (debug) {\n                    console.log('React Flow: trigger edge changes', changes);\n                }\n                onEdgesChange?.(changes);\n            }\n        },\n        addSelectedNodes: (selectedNodeIds) => {\n            const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n            if (multiSelectionActive) {\n                const nodeChanges = selectedNodeIds.map((nodeId) => createSelectionChange(nodeId, true));\n                triggerNodeChanges(nodeChanges);\n                return;\n            }\n            triggerNodeChanges(getSelectionChanges(nodeLookup, new Set([...selectedNodeIds]), true));\n            triggerEdgeChanges(getSelectionChanges(edgeLookup));\n        },\n        addSelectedEdges: (selectedEdgeIds) => {\n            const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n            if (multiSelectionActive) {\n                const changedEdges = selectedEdgeIds.map((edgeId) => createSelectionChange(edgeId, true));\n                triggerEdgeChanges(changedEdges);\n                return;\n            }\n            triggerEdgeChanges(getSelectionChanges(edgeLookup, new Set([...selectedEdgeIds])));\n            triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(), true));\n        },\n        unselectNodesAndEdges: ({ nodes, edges } = {}) => {\n            const { edges: storeEdges, nodes: storeNodes, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n            const nodesToUnselect = nodes ? nodes : storeNodes;\n            const edgesToUnselect = edges ? edges : storeEdges;\n            const nodeChanges = [];\n            for (const node of nodesToUnselect) {\n                if (!node.selected) {\n                    continue; // skip changing nodes that are not selected\n                }\n                const internalNode = nodeLookup.get(node.id);\n                if (internalNode) {\n                    /*\n                     * we need to unselect the internal node that was selected previously before we\n                     * send the change to the user to prevent it to be selected while dragging the new node\n                     */\n                    internalNode.selected = false;\n                }\n                nodeChanges.push(createSelectionChange(node.id, false));\n            }\n            const edgeChanges = [];\n            for (const edge of edgesToUnselect) {\n                if (!edge.selected) {\n                    continue; // skip changing edges that are not selected\n                }\n                edgeChanges.push(createSelectionChange(edge.id, false));\n            }\n            triggerNodeChanges(nodeChanges);\n            triggerEdgeChanges(edgeChanges);\n        },\n        setMinZoom: (minZoom) => {\n            const { panZoom, maxZoom } = get();\n            panZoom?.setScaleExtent([minZoom, maxZoom]);\n            set({ minZoom });\n        },\n        setMaxZoom: (maxZoom) => {\n            const { panZoom, minZoom } = get();\n            panZoom?.setScaleExtent([minZoom, maxZoom]);\n            set({ maxZoom });\n        },\n        setTranslateExtent: (translateExtent) => {\n            get().panZoom?.setTranslateExtent(translateExtent);\n            set({ translateExtent });\n        },\n        resetSelectedElements: () => {\n            const { edges, nodes, triggerNodeChanges, triggerEdgeChanges, elementsSelectable } = get();\n            if (!elementsSelectable) {\n                return;\n            }\n            const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []);\n            const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []);\n            triggerNodeChanges(nodeChanges);\n            triggerEdgeChanges(edgeChanges);\n        },\n        setNodeExtent: (nextNodeExtent) => {\n            const { nodes, nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, nodeExtent, zIndexMode } = get();\n            if (nextNodeExtent[0][0] === nodeExtent[0][0] &&\n                nextNodeExtent[0][1] === nodeExtent[0][1] &&\n                nextNodeExtent[1][0] === nodeExtent[1][0] &&\n                nextNodeExtent[1][1] === nodeExtent[1][1]) {\n                return;\n            }\n            adoptUserNodes(nodes, nodeLookup, parentLookup, {\n                nodeOrigin,\n                nodeExtent: nextNodeExtent,\n                elevateNodesOnSelect,\n                checkEquality: false,\n                zIndexMode,\n            });\n            set({ nodeExtent: nextNodeExtent });\n        },\n        panBy: (delta) => {\n            const { transform, width, height, panZoom, translateExtent } = get();\n            return panBy({ delta, panZoom, transform, translateExtent, width, height });\n        },\n        setCenter: async (x, y, options) => {\n            const { width, height, maxZoom, panZoom } = get();\n            if (!panZoom) {\n                return false;\n            }\n            const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : maxZoom;\n            await panZoom.setViewport({\n                x: width / 2 - x * nextZoom,\n                y: height / 2 - y * nextZoom,\n                zoom: nextZoom,\n            }, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate });\n            return true;\n        },\n        cancelConnection: () => {\n            set({\n                connection: { ...initialConnection },\n            });\n        },\n        updateConnection: (connection) => {\n            set({ connection });\n        },\n        reset: () => set({ ...getInitialState() }),\n    };\n}, Object.is);\n\n/**\n * The `<ReactFlowProvider />` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#)\n * that makes it possible to access a flow's internal state outside of the\n * [`<ReactFlow />`](/api-reference/react-flow) component. Many of the hooks we\n * provide rely on this component to work.\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlowProvider>\n *      <ReactFlow nodes={...} edges={...} />\n *      <Sidebar />\n *    </ReactFlowProvider>\n *  );\n *}\n *\n *function Sidebar() {\n *  // This hook will only work if the component it's used in is a child of a\n *  // <ReactFlowProvider />.\n *  const nodes = useNodes()\n *\n *  return <aside>do something with nodes</aside>;\n *}\n *```\n *\n * @remarks If you're using a router and want your flow's state to persist across routes,\n * it's vital that you place the `<ReactFlowProvider />` component _outside_ of\n * your router. If you have multiple flows on the same page you will need to use a separate\n * `<ReactFlowProvider />` for each flow.\n */\nfunction ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, zIndexMode, children, }) {\n    const [store] = useState(() => createStore({\n        nodes,\n        edges,\n        defaultNodes,\n        defaultEdges,\n        width,\n        height,\n        fitView,\n        minZoom,\n        maxZoom,\n        fitViewOptions,\n        nodeOrigin,\n        nodeExtent,\n        zIndexMode,\n    }));\n    return (jsx(Provider$1, { value: store, children: jsx(BatchProvider, { children: jsx(HandleConfigProvider, { children: children }) }) }));\n}\n\nfunction Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, zIndexMode, }) {\n    const isWrapped = useContext(StoreContext);\n    if (isWrapped) {\n        /*\n         * we need to wrap it with a fragment because it's not allowed for children to be a ReactNode\n         * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051\n         */\n        return jsx(Fragment, { children: children });\n    }\n    return (jsx(ReactFlowProvider, { initialNodes: nodes, initialEdges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, initialWidth: width, initialHeight: height, fitView: fitView, initialFitViewOptions: fitViewOptions, initialMinZoom: minZoom, initialMaxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, zIndexMode: zIndexMode, children: children }));\n}\n\nconst wrapperStyle = {\n    width: '100%',\n    height: '100%',\n    overflow: 'hidden',\n    position: 'relative',\n    zIndex: 0,\n};\nfunction ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 1, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect = true, elevateEdgesOnSelect = false, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanOnSelection = true, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, connectionDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, onScroll, ariaLabelConfig, zIndexMode = 'basic', ...rest }, ref) {\n    const rfId = id || '1';\n    const colorModeClassName = useColorModeClass(colorMode);\n    // Undo scroll events, preventing viewport from shifting when nodes outside of it are focused\n    const wrapperOnScroll = useCallback((e) => {\n        e.currentTarget.scrollTo({ top: 0, left: 0, behavior: 'instant' });\n        onScroll?.(e);\n    }, [onScroll]);\n    return (jsx(\"div\", { \"data-testid\": \"rf__wrapper\", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, role: \"application\", children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, zIndexMode: zIndexMode, children: [jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, autoPanOnNodeFocus: autoPanOnNodeFocus, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, connectionDragThreshold: connectionDragThreshold, onBeforeDelete: onBeforeDelete, debug: debug, ariaLabelConfig: ariaLabelConfig, zIndexMode: zIndexMode }), jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, autoPanOnSelection: autoPanOnSelection, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange, nodesDraggable: nodesDraggable }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));\n}\n/**\n * The `<ReactFlow />` component is the heart of your React Flow application.\n * It renders your nodes and edges and handles user interaction\n *\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (<ReactFlow\n *    nodes={...}\n *    edges={...}\n *    onNodesChange={...}\n *    ...\n *  />);\n *}\n *```\n */\nvar index = fixedForwardRef(ReactFlow);\n\nconst selector$6 = (s) => s.domNode?.querySelector('.react-flow__edgelabel-renderer');\n/**\n * Edges are SVG-based. If you want to render more complex labels you can use the\n * `<EdgeLabelRenderer />` component to access a div based renderer. This component\n * is a portal that renders the label in a `<div />` that is positioned on top of\n * the edges. You can see an example usage of the component in the\n * [edge label renderer example](/examples/edges/edge-label-renderer).\n * @public\n *\n * @example\n * ```jsx\n * import React from 'react';\n * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react';\n *\n * export function CustomEdge({ id, data, ...props }) {\n *   const [edgePath, labelX, labelY] = getBezierPath(props);\n *\n *   return (\n *     <>\n *       <BaseEdge id={id} path={edgePath} />\n *       <EdgeLabelRenderer>\n *         <div\n *           style={{\n *             position: 'absolute',\n *             transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,\n *             background: '#ffcc00',\n *             padding: 10,\n *         }}\n *           className=\"nodrag nopan\"\n *         >\n *          {data.label}\n *         </div>\n *       </EdgeLabelRenderer>\n *     </>\n *   );\n * };\n * ```\n *\n * @remarks The `<EdgeLabelRenderer />` has no pointer events by default. If you want to\n * add mouse interactions you need to set the style `pointerEvents: all` and add\n * the `nopan` class on the label or the element you want to interact with.\n */\nfunction EdgeLabelRenderer({ children }) {\n    const edgeLabelRenderer = useStore(selector$6);\n    if (!edgeLabelRenderer) {\n        return null;\n    }\n    return createPortal(children, edgeLabelRenderer);\n}\n\nconst selector$5 = (s) => s.domNode?.querySelector('.react-flow__viewport-portal');\n/**\n * The `<ViewportPortal />` component can be used to add components to the same viewport\n * of the flow where nodes and edges are rendered. This is useful when you want to render\n * your own components that are adhere to the same coordinate system as the nodes & edges\n * and are also affected by zooming and panning\n * @public\n * @example\n *\n * ```jsx\n *import React from 'react';\n *import { ViewportPortal } from '@xyflow/react';\n *\n *export default function () {\n *  return (\n *    <ViewportPortal>\n *      <div\n *        style={{ transform: 'translate(100px, 100px)', position: 'absolute' }}\n *      >\n *        This div is positioned at [100, 100] on the flow.\n *      </div>\n *    </ViewportPortal>\n *  );\n *}\n *```\n */\nfunction ViewportPortal({ children }) {\n    const viewPortalDiv = useStore(selector$5);\n    if (!viewPortalDiv) {\n        return null;\n    }\n    return createPortal(children, viewPortalDiv);\n}\n\n/**\n * When you programmatically add or remove handles to a node or update a node's\n * handle position, you need to let React Flow know about it using this hook. This\n * will update the internal dimensions of the node and properly reposition handles\n * on the canvas if necessary.\n *\n * @public\n * @returns Use this function to tell React Flow to update the internal state of one or more nodes\n * that you have changed programmatically.\n *\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { Handle, useUpdateNodeInternals } from '@xyflow/react';\n *\n *export default function RandomHandleNode({ id }) {\n *  const updateNodeInternals = useUpdateNodeInternals();\n *  const [handleCount, setHandleCount] = useState(0);\n *  const randomizeHandleCount = useCallback(() => {\n *   setHandleCount(Math.floor(Math.random() * 10));\n *    updateNodeInternals(id);\n *  }, [id, updateNodeInternals]);\n *\n *  return (\n *    <>\n *      {Array.from({ length: handleCount }).map((_, index) => (\n *        <Handle\n *          key={index}\n *          type=\"target\"\n *          position=\"left\"\n *          id={`handle-${index}`}\n *        />\n *      ))}\n *\n *      <div>\n *        <button onClick={randomizeHandleCount}>Randomize handle count</button>\n *        <p>There are {handleCount} handles on this node.</p>\n *      </div>\n *    </>\n *  );\n *}\n *```\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\nfunction useUpdateNodeInternals() {\n    const store = useStoreApi();\n    return useCallback((id) => {\n        const { domNode, updateNodeInternals } = store.getState();\n        const updateIds = Array.isArray(id) ? id : [id];\n        const updates = new Map();\n        updateIds.forEach((updateId) => {\n            const nodeElement = domNode?.querySelector(`.react-flow__node[data-id=\"${updateId}\"]`);\n            if (nodeElement) {\n                updates.set(updateId, { id: updateId, nodeElement, force: true });\n            }\n        });\n        requestAnimationFrame(() => updateNodeInternals(updates, { triggerFitView: false }));\n    }, []);\n}\n\nconst nodesSelector = (state) => state.nodes;\n/**\n * This hook returns an array of the current nodes. Components that use this hook\n * will re-render **whenever any node changes**, including when a node is selected\n * or moved.\n *\n * @public\n * @returns An array of all nodes currently in the flow.\n *\n * @example\n * ```jsx\n *import { useNodes } from '@xyflow/react';\n *\n *export default function() {\n *  const nodes = useNodes();\n *\n *  return <div>There are currently {nodes.length} nodes!</div>;\n *}\n *```\n */\nfunction useNodes() {\n    const nodes = useStore(nodesSelector, shallow);\n    return nodes;\n}\n\nconst edgesSelector = (state) => state.edges;\n/**\n * This hook returns an array of the current edges. Components that use this hook\n * will re-render **whenever any edge changes**.\n *\n * @public\n * @returns An array of all edges currently in the flow.\n *\n * @example\n * ```tsx\n *import { useEdges } from '@xyflow/react';\n *\n *export default function () {\n *  const edges = useEdges();\n *\n *  return <div>There are currently {edges.length} edges!</div>;\n *}\n *```\n */\nfunction useEdges() {\n    const edges = useStore(edgesSelector, shallow);\n    return edges;\n}\n\nconst viewportSelector = (state) => ({\n    x: state.transform[0],\n    y: state.transform[1],\n    zoom: state.transform[2],\n});\n/**\n * The `useViewport` hook is a convenient way to read the current state of the\n * {@link Viewport} in a component. Components that use this hook\n * will re-render **whenever the viewport changes**.\n *\n * @public\n * @returns The current viewport.\n *\n * @example\n *\n *```jsx\n *import { useViewport } from '@xyflow/react';\n *\n *export default function ViewportDisplay() {\n *  const { x, y, zoom } = useViewport();\n *\n *  return (\n *    <div>\n *      <p>\n *        The viewport is currently at ({x}, {y}) and zoomed to {zoom}.\n *      </p>\n *    </div>\n *  );\n *}\n *```\n *\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\nfunction useViewport() {\n    const viewport = useStore(viewportSelector, shallow);\n    return viewport;\n}\n\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @returns\n * - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your\n * `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,\n * for example.\n * - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of\n * nodes or a callback that receives the current array of nodes and returns a new array of nodes.\n * This is the same as the second element of the tuple returned by React's `useState` hook.\n * - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes\n * state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your\n * `<ReactFlow />` component.\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n *  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n *  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n *  return (\n *    <ReactFlow\n *      nodes={nodes}\n *      edges={edges}\n *      onNodesChange={onNodesChange}\n *      onEdgesChange={onEdgesChange}\n *    />\n *  );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\nfunction useNodesState(initialNodes) {\n    const [nodes, setNodes] = useState(initialNodes);\n    const onNodesChange = useCallback((changes) => setNodes((nds) => applyNodeChanges(changes, nds)), []);\n    return [nodes, setNodes, onNodesChange];\n}\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @returns\n * - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your\n * `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,\n * for example.\n *\n * - `setEdges`: A function that you can use to update the edges. You can pass it a new array of\n * edges or a callback that receives the current array of edges and returns a new array of edges.\n * This is the same as the second element of the tuple returned by React's `useState` hook.\n *\n * - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges\n * state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your\n * `<ReactFlow />` component.\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n *  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n *  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n *  return (\n *    <ReactFlow\n *      nodes={nodes}\n *      edges={edges}\n *      onNodesChange={onNodesChange}\n *      onEdgesChange={onEdgesChange}\n *    />\n *  );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\nfunction useEdgesState(initialEdges) {\n    const [edges, setEdges] = useState(initialEdges);\n    const onEdgesChange = useCallback((changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), []);\n    return [edges, setEdges, onEdgesChange];\n}\n\n/**\n * The `useOnViewportChange` hook lets you listen for changes to the viewport such\n * as panning and zooming. You can provide a callback for each phase of a viewport\n * change: `onStart`, `onChange`, and `onEnd`.\n *\n * @public\n * @example\n * ```jsx\n *import { useCallback } from 'react';\n *import { useOnViewportChange } from '@xyflow/react';\n *\n *function ViewportChangeLogger() {\n *  useOnViewportChange({\n *    onStart: (viewport: Viewport) => console.log('start', viewport),\n *    onChange: (viewport: Viewport) => console.log('change', viewport),\n *    onEnd: (viewport: Viewport) => console.log('end', viewport),\n *  });\n *\n *  return null;\n *}\n *```\n */\nfunction useOnViewportChange({ onStart, onChange, onEnd }) {\n    const store = useStoreApi();\n    useEffect(() => {\n        store.setState({ onViewportChangeStart: onStart });\n    }, [onStart]);\n    useEffect(() => {\n        store.setState({ onViewportChange: onChange });\n    }, [onChange]);\n    useEffect(() => {\n        store.setState({ onViewportChangeEnd: onEnd });\n    }, [onEnd]);\n}\n\n/**\n * This hook lets you listen for changes to both node and edge selection. As the\n *name implies, the callback you provide will be called whenever the selection of\n *_either_ nodes or edges changes.\n *\n * @public\n * @example\n * ```jsx\n *import { useState } from 'react';\n *import { ReactFlow, useOnSelectionChange } from '@xyflow/react';\n *\n *function SelectionDisplay() {\n *  const [selectedNodes, setSelectedNodes] = useState([]);\n *  const [selectedEdges, setSelectedEdges] = useState([]);\n *\n *  // the passed handler has to be memoized, otherwise the hook will not work correctly\n *  const onChange = useCallback(({ nodes, edges }) => {\n *    setSelectedNodes(nodes.map((node) => node.id));\n *    setSelectedEdges(edges.map((edge) => edge.id));\n *  }, []);\n *\n *  useOnSelectionChange({\n *    onChange,\n *  });\n *\n *  return (\n *    <div>\n *      <p>Selected nodes: {selectedNodes.join(', ')}</p>\n *      <p>Selected edges: {selectedEdges.join(', ')}</p>\n *    </div>\n *  );\n *}\n *```\n *\n * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly.\n */\nfunction useOnSelectionChange({ onChange, }) {\n    const store = useStoreApi();\n    useEffect(() => {\n        const nextOnSelectionChangeHandlers = [...store.getState().onSelectionChangeHandlers, onChange];\n        store.setState({ onSelectionChangeHandlers: nextOnSelectionChangeHandlers });\n        return () => {\n            const nextHandlers = store.getState().onSelectionChangeHandlers.filter((fn) => fn !== onChange);\n            store.setState({ onSelectionChangeHandlers: nextHandlers });\n        };\n    }, [onChange]);\n}\n\nconst selector$4 = (options) => (s) => {\n    if (!options.includeHiddenNodes) {\n        return s.nodesInitialized;\n    }\n    if (s.nodeLookup.size === 0) {\n        return false;\n    }\n    for (const [, { internals }] of s.nodeLookup) {\n        if (internals.handleBounds === undefined || !nodeHasDimensions(internals.userNode)) {\n            return false;\n        }\n    }\n    return true;\n};\n/**\n * This hook tells you whether all the nodes in a flow have been measured and given\n *a width and height. When you add a node to the flow, this hook will return\n *`false` and then `true` again once the node has been measured.\n *\n * @public\n * @returns Whether or not the nodes have been initialized by the `<ReactFlow />` component and\n * given a width and height.\n *\n * @example\n * ```jsx\n *import { useReactFlow, useNodesInitialized } from '@xyflow/react';\n *import { useEffect, useState } from 'react';\n *\n *const options = {\n *  includeHiddenNodes: false,\n *};\n *\n *export default function useLayout() {\n *  const { getNodes } = useReactFlow();\n *  const nodesInitialized = useNodesInitialized(options);\n *  const [layoutedNodes, setLayoutedNodes] = useState(getNodes());\n *\n *  useEffect(() => {\n *    if (nodesInitialized) {\n *      setLayoutedNodes(yourLayoutingFunction(getNodes()));\n *    }\n *  }, [nodesInitialized]);\n *\n *  return layoutedNodes;\n *}\n *```\n */\nfunction useNodesInitialized(options = {\n    includeHiddenNodes: false,\n}) {\n    const initialized = useStore(selector$4(options));\n    return initialized;\n}\n\n/**\n * Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.\n *\n * @public\n * @deprecated Use `useNodeConnections` instead.\n * @returns An array with handle connections.\n */\nfunction useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }) {\n    console.warn('[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections');\n    const _nodeId = useNodeId();\n    const currentNodeId = nodeId ?? _nodeId;\n    const prevConnections = useRef(null);\n    const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}-${type}${id ? `-${id}` : ''}`), areConnectionMapsEqual);\n    useEffect(() => {\n        // @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n        if (prevConnections.current && prevConnections.current !== connections) {\n            const _connections = connections ?? new Map();\n            handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n            handleConnectionChange(_connections, prevConnections.current, onConnect);\n        }\n        prevConnections.current = connections ?? new Map();\n    }, [connections, onConnect, onDisconnect]);\n    return useMemo(() => Array.from(connections?.values() ?? []), [connections]);\n}\n\nconst error014 = errorMessages['error014']();\n/**\n * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID.\n *\n * @public\n * @returns An array with connections.\n *\n * @example\n * ```jsx\n *import { useNodeConnections } from '@xyflow/react';\n *\n *export default function () {\n *  const connections = useNodeConnections({\n *    handleType: 'target',\n *    handleId: 'my-handle',\n *  });\n *\n *  return (\n *    <div>There are currently {connections.length} incoming connections!</div>\n *  );\n *}\n *```\n */\nfunction useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, } = {}) {\n    const nodeId = useNodeId();\n    const currentNodeId = id ?? nodeId;\n    if (!currentNodeId) {\n        throw new Error(error014);\n    }\n    const prevConnections = useRef(null);\n    const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}${handleType ? (handleId ? `-${handleType}-${handleId}` : `-${handleType}`) : ''}`), areConnectionMapsEqual);\n    useEffect(() => {\n        // @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n        if (prevConnections.current && prevConnections.current !== connections) {\n            const _connections = connections ?? new Map();\n            handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n            handleConnectionChange(_connections, prevConnections.current, onConnect);\n        }\n        prevConnections.current = connections ?? new Map();\n    }, [connections, onConnect, onDisconnect]);\n    return useMemo(() => Array.from(connections?.values() ?? []), [connections]);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction useNodesData(nodeIds) {\n    const nodesData = useStore(useCallback((s) => {\n        const data = [];\n        const isArrayOfIds = Array.isArray(nodeIds);\n        const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds];\n        for (const nodeId of _nodeIds) {\n            const node = s.nodeLookup.get(nodeId);\n            if (node) {\n                data.push({\n                    id: node.id,\n                    type: node.type,\n                    data: node.data,\n                });\n            }\n        }\n        return isArrayOfIds ? data : data[0] ?? null;\n    }, [nodeIds]), shallowNodeData);\n    return nodesData;\n}\n\n/**\n * This hook returns the internal representation of a specific node.\n * Components that use this hook will re-render **whenever the node changes**,\n * including when a node is selected or moved.\n *\n * @public\n * @param id - The ID of a node you want to observe.\n * @returns The `InternalNode` object for the node with the given ID.\n *\n * @example\n * ```tsx\n *import { useInternalNode } from '@xyflow/react';\n *\n *export default function () {\n *  const internalNode = useInternalNode('node-1');\n *  const absolutePosition = internalNode.internals.positionAbsolute;\n *\n *  return (\n *    <div>\n *      The absolute position of the node is at:\n *      <p>x: {absolutePosition.x}</p>\n *      <p>y: {absolutePosition.y}</p>\n *    </div>\n *  );\n *}\n *```\n */\nfunction useInternalNode(id) {\n    const node = useStore(useCallback((s) => s.nodeLookup.get(id), [id]), shallow);\n    return node;\n}\n\n/**\n * Registers a middleware function to transform node changes.\n *\n * @public\n * @param fn - Middleware function. Should be memoized with useCallback to avoid re-registration.\n */\nfunction experimental_useOnNodesChangeMiddleware(fn) {\n    const store = useStoreApi();\n    const [symbol] = useState(() => Symbol());\n    useEffect(() => {\n        const { onNodesChangeMiddlewareMap } = store.getState();\n        onNodesChangeMiddlewareMap.set(symbol, fn);\n    }, [fn]);\n    useEffect(() => {\n        const { onNodesChangeMiddlewareMap } = store.getState();\n        return () => {\n            onNodesChangeMiddlewareMap.delete(symbol);\n        };\n    }, []);\n}\n\n/**\n * Registers a middleware function to transform edge changes.\n *\n * @public\n * @param fn - Middleware function. Should be memoized with useCallback to avoid re-registration.\n */\nfunction experimental_useOnEdgesChangeMiddleware(fn) {\n    const store = useStoreApi();\n    const [symbol] = useState(() => Symbol());\n    useEffect(() => {\n        const { onEdgesChangeMiddlewareMap } = store.getState();\n        onEdgesChangeMiddlewareMap.set(symbol, fn);\n    }, [fn]);\n    useEffect(() => {\n        const { onEdgesChangeMiddlewareMap } = store.getState();\n        return () => {\n            onEdgesChangeMiddlewareMap.delete(symbol);\n        };\n    }, []);\n}\n\nfunction LinePattern({ dimensions, lineWidth, variant, className }) {\n    return (jsx(\"path\", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(['react-flow__background-pattern', variant, className]) }));\n}\nfunction DotPattern({ radius, className }) {\n    return (jsx(\"circle\", { cx: radius, cy: radius, r: radius, className: cc(['react-flow__background-pattern', 'dots', className]) }));\n}\n\n/**\n * The three variants are exported as an enum for convenience. You can either import\n * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string\n * value directly.\n * @public\n */\nvar BackgroundVariant;\n(function (BackgroundVariant) {\n    BackgroundVariant[\"Lines\"] = \"lines\";\n    BackgroundVariant[\"Dots\"] = \"dots\";\n    BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n\nconst defaultSize = {\n    [BackgroundVariant.Dots]: 1,\n    [BackgroundVariant.Lines]: 1,\n    [BackgroundVariant.Cross]: 6,\n};\nconst selector$3 = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` });\nfunction BackgroundComponent({ id, variant = BackgroundVariant.Dots, \n// only used for dots and cross\ngap = 20, \n// only used for lines and cross\nsize, lineWidth = 1, offset = 0, color, bgColor, style, className, patternClassName, }) {\n    const ref = useRef(null);\n    const { transform, patternId } = useStore(selector$3, shallow);\n    const patternSize = size || defaultSize[variant];\n    const isDots = variant === BackgroundVariant.Dots;\n    const isCross = variant === BackgroundVariant.Cross;\n    const gapXY = Array.isArray(gap) ? gap : [gap, gap];\n    const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1];\n    const scaledSize = patternSize * transform[2];\n    const offsetXY = Array.isArray(offset) ? offset : [offset, offset];\n    const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap;\n    const scaledOffset = [\n        offsetXY[0] * transform[2] + patternDimensions[0] / 2,\n        offsetXY[1] * transform[2] + patternDimensions[1] / 2,\n    ];\n    const _patternId = `${patternId}${id ? id : ''}`;\n    return (jsxs(\"svg\", { className: cc(['react-flow__background', className]), style: {\n            ...style,\n            ...containerStyle,\n            '--xy-background-color-props': bgColor,\n            '--xy-background-pattern-color-props': color,\n        }, ref: ref, \"data-testid\": \"rf__background\", children: [jsx(\"pattern\", { id: _patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: \"userSpaceOnUse\", patternTransform: `translate(-${scaledOffset[0]},-${scaledOffset[1]})`, children: isDots ? (jsx(DotPattern, { radius: scaledSize / 2, className: patternClassName })) : (jsx(LinePattern, { dimensions: patternDimensions, lineWidth: lineWidth, variant: variant, className: patternClassName })) }), jsx(\"rect\", { x: \"0\", y: \"0\", width: \"100%\", height: \"100%\", fill: `url(#${_patternId})` })] }));\n}\nBackgroundComponent.displayName = 'Background';\n/**\n * The `<Background />` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross.\n *\n * @example\n *\n * A simple example of how to use the Background component.\n *\n * ```tsx\n * import { useState } from 'react';\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n *\n * export default function Flow() {\n *   return (\n *     <ReactFlow defaultNodes={[...]} defaultEdges={[...]}>\n *       <Background color=\"#ccc\" variant={BackgroundVariant.Dots} />\n *     </ReactFlow>\n *   );\n * }\n * ```\n *\n * @example\n *\n * In this example you can see how to combine multiple backgrounds\n *\n * ```tsx\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n * import '@xyflow/react/dist/style.css';\n *\n * export default function Flow() {\n *   return (\n *     <ReactFlow defaultNodes={[...]} defaultEdges={[...]}>\n *       <Background\n *         id=\"1\"\n *         gap={10}\n *         color=\"#f1f1f1\"\n *         variant={BackgroundVariant.Lines}\n *       />\n *       <Background\n *         id=\"2\"\n *         gap={100}\n *         color=\"#ccc\"\n *         variant={BackgroundVariant.Lines}\n *       />\n *     </ReactFlow>\n *   );\n * }\n * ```\n *\n * @remarks\n *\n * When combining multiple <Background /> components it’s important to give each of them a unique id prop!\n *\n */\nconst Background = memo(BackgroundComponent);\n\nfunction PlusIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 32\", children: jsx(\"path\", { d: \"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z\" }) }));\n}\n\nfunction MinusIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 5\", children: jsx(\"path\", { d: \"M0 0h32v4.2H0z\" }) }));\n}\n\nfunction FitViewIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 30\", children: jsx(\"path\", { d: \"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z\" }) }));\n}\n\nfunction LockIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 25 32\", children: jsx(\"path\", { d: \"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z\" }) }));\n}\n\nfunction UnlockIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 25 32\", children: jsx(\"path\", { d: \"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z\" }) }));\n}\n\n/**\n * You can add buttons to the control panel by using the `<ControlButton />` component\n * and pass it as a child to the [`<Controls />`](/api-reference/components/controls) component.\n *\n * @public\n * @example\n *```jsx\n *import { MagicWand } from '@radix-ui/react-icons'\n *import { ReactFlow, Controls, ControlButton } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[...]} edges={[...]}>\n *      <Controls>\n *        <ControlButton onClick={() => alert('Something magical just happened. ✨')}>\n *          <MagicWand />\n *        </ControlButton>\n *      </Controls>\n *    </ReactFlow>\n *  )\n *}\n *```\n */\nfunction ControlButton({ children, className, ...rest }) {\n    return (jsx(\"button\", { type: \"button\", className: cc(['react-flow__controls-button', className]), ...rest, children: children }));\n}\n\nconst selector$2 = (s) => ({\n    isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,\n    minZoomReached: s.transform[2] <= s.minZoom,\n    maxZoomReached: s.transform[2] >= s.maxZoom,\n    ariaLabelConfig: s.ariaLabelConfig,\n});\nfunction ControlsComponent({ style, showZoom = true, showFitView = true, showInteractive = true, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position = 'bottom-left', orientation = 'vertical', 'aria-label': ariaLabel, }) {\n    const store = useStoreApi();\n    const { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow);\n    const { zoomIn, zoomOut, fitView } = useReactFlow();\n    const onZoomInHandler = () => {\n        zoomIn();\n        onZoomIn?.();\n    };\n    const onZoomOutHandler = () => {\n        zoomOut();\n        onZoomOut?.();\n    };\n    const onFitViewHandler = () => {\n        fitView(fitViewOptions);\n        onFitView?.();\n    };\n    const onToggleInteractivity = () => {\n        store.setState({\n            nodesDraggable: !isInteractive,\n            nodesConnectable: !isInteractive,\n            elementsSelectable: !isInteractive,\n        });\n        onInteractiveChange?.(!isInteractive);\n    };\n    const orientationClass = orientation === 'horizontal' ? 'horizontal' : 'vertical';\n    return (jsxs(Panel, { className: cc(['react-flow__controls', orientationClass, className]), position: position, style: style, \"data-testid\": \"rf__controls\", \"aria-label\": ariaLabel ?? ariaLabelConfig['controls.ariaLabel'], children: [showZoom && (jsxs(Fragment, { children: [jsx(ControlButton, { onClick: onZoomInHandler, className: \"react-flow__controls-zoomin\", title: ariaLabelConfig['controls.zoomIn.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.zoomIn.ariaLabel'], disabled: maxZoomReached, children: jsx(PlusIcon, {}) }), jsx(ControlButton, { onClick: onZoomOutHandler, className: \"react-flow__controls-zoomout\", title: ariaLabelConfig['controls.zoomOut.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.zoomOut.ariaLabel'], disabled: minZoomReached, children: jsx(MinusIcon, {}) })] })), showFitView && (jsx(ControlButton, { className: \"react-flow__controls-fitview\", onClick: onFitViewHandler, title: ariaLabelConfig['controls.fitView.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.fitView.ariaLabel'], children: jsx(FitViewIcon, {}) })), showInteractive && (jsx(ControlButton, { className: \"react-flow__controls-interactive\", onClick: onToggleInteractivity, title: ariaLabelConfig['controls.interactive.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.interactive.ariaLabel'], children: isInteractive ? jsx(UnlockIcon, {}) : jsx(LockIcon, {}) })), children] }));\n}\nControlsComponent.displayName = 'Controls';\n/**\n * The `<Controls />` component renders a small panel that contains convenient\n * buttons to zoom in, zoom out, fit the view, and lock the viewport.\n *\n * @public\n * @example\n *```tsx\n *import { ReactFlow, Controls } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[...]} edges={[...]}>\n *      <Controls />\n *    </ReactFlow>\n *  )\n *}\n *```\n *\n * @remarks To extend or customise the controls, you can use the [`<ControlButton />`](/api-reference/components/control-button) component\n *\n */\nconst Controls = memo(ControlsComponent);\n\nfunction MiniMapNodeComponent({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }) {\n    const { background, backgroundColor } = style || {};\n    const fill = (color || background || backgroundColor);\n    return (jsx(\"rect\", { className: cc(['react-flow__minimap-node', { selected }, className]), x: x, y: y, rx: borderRadius, ry: borderRadius, width: width, height: height, style: {\n            fill,\n            stroke: strokeColor,\n            strokeWidth,\n        }, shapeRendering: shapeRendering, onClick: onClick ? (event) => onClick(event, id) : undefined }));\n}\nconst MiniMapNode = memo(MiniMapNodeComponent);\n\nconst selectorNodeIds = (s) => s.nodes.map((node) => node.id);\nconst getAttrFunction = (func) => func instanceof Function ? func : () => func;\nfunction MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, \n/*\n * We need to rename the prop to be `CapitalCase` so that JSX will render it as\n * a component properly.\n */\nnodeComponent: NodeComponent = MiniMapNode, onClick, }) {\n    const nodeIds = useStore(selectorNodeIds, shallow);\n    const nodeColorFunc = getAttrFunction(nodeColor);\n    const nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor);\n    const nodeClassNameFunc = getAttrFunction(nodeClassName);\n    const shapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision';\n    return (jsx(Fragment, { children: nodeIds.map((nodeId) => (\n        /*\n         * The split of responsibilities between MiniMapNodes and\n         * NodeComponentWrapper may appear weird. However, it’s designed to\n         * minimize the cost of updates when individual nodes change.\n         *\n         * For more details, see a similar commit in `NodeRenderer/index.tsx`.\n         */\n        jsx(NodeComponentWrapper, { id: nodeId, nodeColorFunc: nodeColorFunc, nodeStrokeColorFunc: nodeStrokeColorFunc, nodeClassNameFunc: nodeClassNameFunc, nodeBorderRadius: nodeBorderRadius, nodeStrokeWidth: nodeStrokeWidth, NodeComponent: NodeComponent, onClick: onClick, shapeRendering: shapeRendering }, nodeId))) }));\n}\nfunction NodeComponentWrapperInner({ id, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick, }) {\n    const { node, x, y, width, height } = useStore((s) => {\n        const node = s.nodeLookup.get(id);\n        if (!node) {\n            return { node: undefined, x: 0, y: 0, width: 0, height: 0 };\n        }\n        const userNode = node.internals.userNode;\n        const { x, y } = node.internals.positionAbsolute;\n        const { width, height } = getNodeDimensions(userNode);\n        return {\n            node: userNode,\n            x,\n            y,\n            width,\n            height,\n        };\n    }, shallow);\n    if (!node || node.hidden || !nodeHasDimensions(node)) {\n        return null;\n    }\n    return (jsx(NodeComponent, { x: x, y: y, width: width, height: height, style: node.style, selected: !!node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering: shapeRendering, onClick: onClick, id: node.id }));\n}\nconst NodeComponentWrapper = memo(NodeComponentWrapperInner);\nvar MiniMapNodes$1 = memo(MiniMapNodes);\n\nconst defaultWidth = 200;\nconst defaultHeight = 150;\nconst filterHidden = (node) => !node.hidden;\nconst selector$1 = (s) => {\n    const viewBB = {\n        x: -s.transform[0] / s.transform[2],\n        y: -s.transform[1] / s.transform[2],\n        width: s.width / s.transform[2],\n        height: s.height / s.transform[2],\n    };\n    /*\n     * the bounds only cover the visible nodes, so we have to check for a visible node\n     * here as well. getInternalNodesBounds returns a rect at the origin when nothing\n     * passes the filter, which would stretch the bounds to include (0, 0).\n     */\n    let hasVisibleNode = false;\n    for (const node of s.nodeLookup.values()) {\n        if (!node.hidden) {\n            hasVisibleNode = true;\n            break;\n        }\n    }\n    return {\n        viewBB,\n        boundingRect: hasVisibleNode\n            ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB)\n            : viewBB,\n        rfId: s.rfId,\n        panZoom: s.panZoom,\n        translateExtent: s.translateExtent,\n        flowWidth: s.width,\n        flowHeight: s.height,\n        ariaLabelConfig: s.ariaLabelConfig,\n    };\n};\nconst rectEqual = (a, b) => a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n// the selector builds new viewBB/boundingRect objects every call, so the default shallow equality always\n// treats them as changed; comparing the rects by value lets the minimap skip re-renders when nothing moved\nconst areEqual = (a, b) => rectEqual(a.viewBB, b.viewBB) &&\n    rectEqual(a.boundingRect, b.boundingRect) &&\n    a.rfId === b.rfId &&\n    a.panZoom === b.panZoom &&\n    a.translateExtent === b.translateExtent &&\n    a.flowWidth === b.flowWidth &&\n    a.flowHeight === b.flowHeight &&\n    a.ariaLabelConfig === b.ariaLabelConfig;\nconst ARIA_LABEL_KEY = 'react-flow__minimap-desc';\nfunction MiniMapComponent({ style, className, nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, \n/*\n * We need to rename the prop to be `CapitalCase` so that JSX will render it as\n * a component properly.\n */\nnodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel, inversePan, zoomStep = 1, offsetScale = 5, }) {\n    const store = useStoreApi();\n    const svg = useRef(null);\n    const { boundingRect, panZoom, viewBB, rfId, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, areEqual);\n    const elementWidth = style?.width ?? defaultWidth;\n    const elementHeight = style?.height ?? defaultHeight;\n    const scaledWidth = boundingRect.width / elementWidth;\n    const scaledHeight = boundingRect.height / elementHeight;\n    const viewScale = Math.max(scaledWidth, scaledHeight);\n    const viewWidth = viewScale * elementWidth;\n    const viewHeight = viewScale * elementHeight;\n    const offset = offsetScale * viewScale;\n    const x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;\n    const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;\n    const width = viewWidth + offset * 2;\n    const height = viewHeight + offset * 2;\n    const labelledBy = `${ARIA_LABEL_KEY}-${rfId}`;\n    const viewScaleRef = useRef(0);\n    const minimapInstance = useRef();\n    viewScaleRef.current = viewScale;\n    useEffect(() => {\n        const currentPanZoom = store.getState().panZoom;\n        if (svg.current && currentPanZoom) {\n            minimapInstance.current = XYMinimap({\n                domNode: svg.current,\n                panZoom: currentPanZoom,\n                getTransform: () => store.getState().transform,\n                getViewScale: () => viewScaleRef.current,\n            });\n            return () => {\n                minimapInstance.current?.destroy();\n            };\n        }\n    }, [panZoom]);\n    useEffect(() => {\n        minimapInstance.current?.update({\n            translateExtent,\n            width: flowWidth,\n            height: flowHeight,\n            inversePan,\n            pannable,\n            zoomStep,\n            zoomable,\n        });\n    }, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]);\n    const onSvgClick = onClick\n        ? (event) => {\n            const [x, y] = minimapInstance.current?.pointer(event) || [0, 0];\n            onClick(event, { x, y });\n        }\n        : undefined;\n    const nodeClickHandler = useCallback((event, nodeId) => {\n        const node = store.getState().nodeLookup.get(nodeId).internals.userNode;\n        onNodeClick?.(event, node);\n    }, [onNodeClick]);\n    const onSvgNodeClick = onNodeClick ? nodeClickHandler : undefined;\n    const _ariaLabel = ariaLabel ?? ariaLabelConfig['minimap.ariaLabel'];\n    return (jsx(Panel, { position: position, style: {\n            ...style,\n            '--xy-minimap-background-color-props': typeof bgColor === 'string' ? bgColor : undefined,\n            '--xy-minimap-mask-background-color-props': typeof maskColor === 'string' ? maskColor : undefined,\n            '--xy-minimap-mask-stroke-color-props': typeof maskStrokeColor === 'string' ? maskStrokeColor : undefined,\n            '--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined,\n            '--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined,\n            '--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined,\n            '--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'number' ? nodeStrokeWidth : undefined,\n        }, className: cc(['react-flow__minimap', className]), \"data-testid\": \"rf__minimap\", children: jsxs(\"svg\", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: \"react-flow__minimap-svg\", role: \"img\", \"aria-labelledby\": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx(\"title\", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), jsx(\"path\", { className: \"react-flow__minimap-mask\", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z\n        M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: \"evenodd\", pointerEvents: \"none\" })] }) }));\n}\nMiniMapComponent.displayName = 'MiniMap';\n/**\n * The `<MiniMap />` component can be used to render an overview of your flow. It\n * renders each node as an SVG element and visualizes where the current viewport is\n * in relation to the rest of the flow.\n *\n * @public\n * @example\n *\n * ```jsx\n *import { ReactFlow, MiniMap } from '@xyflow/react';\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[...]} edges={[...]}>\n *      <MiniMap nodeStrokeWidth={3} />\n *    </ReactFlow>\n *  );\n *}\n *```\n */\nconst MiniMap = memo(MiniMapComponent);\n\nconst scaleSelector = (calculateScale) => (store) => calculateScale ? `${Math.max(1 / store.transform[2], 1)}` : undefined;\nconst defaultPositions = {\n    [ResizeControlVariant.Line]: 'right',\n    [ResizeControlVariant.Handle]: 'bottom-right',\n};\nfunction ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style = undefined, children, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, resizeDirection, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) {\n    const contextNodeId = useNodeId();\n    const id = typeof nodeId === 'string' ? nodeId : contextNodeId;\n    const store = useStoreApi();\n    const resizeControlRef = useRef(null);\n    const isHandleControl = variant === ResizeControlVariant.Handle;\n    const scale = useStore(useCallback(scaleSelector(isHandleControl && autoScale), [isHandleControl, autoScale]), shallow);\n    const resizer = useRef(null);\n    const controlPosition = position ?? defaultPositions[variant];\n    useEffect(() => {\n        if (!resizeControlRef.current || !id) {\n            return;\n        }\n        if (!resizer.current) {\n            resizer.current = XYResizer({\n                domNode: resizeControlRef.current,\n                nodeId: id,\n                getStoreItems: () => {\n                    const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, domNode } = store.getState();\n                    return {\n                        nodeLookup,\n                        transform,\n                        snapGrid,\n                        snapToGrid,\n                        nodeOrigin,\n                        paneDomNode: domNode,\n                    };\n                },\n                onChange: (change, childChanges) => {\n                    const { triggerNodeChanges, nodeLookup, parentLookup, nodeOrigin } = store.getState();\n                    const changes = [];\n                    const nextPosition = { x: change.x, y: change.y };\n                    const node = nodeLookup.get(id);\n                    if (node && node.expandParent && node.parentId) {\n                        const origin = node.origin ?? nodeOrigin;\n                        const width = change.width ?? node.measured.width ?? 0;\n                        const height = change.height ?? node.measured.height ?? 0;\n                        const child = {\n                            id: node.id,\n                            parentId: node.parentId,\n                            rect: {\n                                width,\n                                height,\n                                ...evaluateAbsolutePosition({\n                                    x: change.x ?? node.position.x,\n                                    y: change.y ?? node.position.y,\n                                }, { width, height }, node.parentId, nodeLookup, origin),\n                            },\n                        };\n                        const parentExpandChanges = handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin);\n                        changes.push(...parentExpandChanges);\n                        /*\n                         * when the parent was expanded by the child node, its position will be clamped at\n                         * 0,0 when node origin is 0,0 and to width, height if it's 1,1\n                         */\n                        nextPosition.x = change.x ? Math.max(origin[0] * width, change.x) : undefined;\n                        nextPosition.y = change.y ? Math.max(origin[1] * height, change.y) : undefined;\n                    }\n                    if (nextPosition.x !== undefined && nextPosition.y !== undefined) {\n                        const positionChange = {\n                            id,\n                            type: 'position',\n                            position: { ...nextPosition },\n                        };\n                        changes.push(positionChange);\n                    }\n                    if (change.width !== undefined && change.height !== undefined) {\n                        const setAttributes = !resizeDirection ? true : resizeDirection === 'horizontal' ? 'width' : 'height';\n                        const dimensionChange = {\n                            id,\n                            type: 'dimensions',\n                            resizing: true,\n                            setAttributes,\n                            dimensions: {\n                                width: change.width,\n                                height: change.height,\n                            },\n                        };\n                        changes.push(dimensionChange);\n                    }\n                    for (const childChange of childChanges) {\n                        const positionChange = {\n                            ...childChange,\n                            type: 'position',\n                        };\n                        changes.push(positionChange);\n                    }\n                    triggerNodeChanges(changes);\n                },\n                onEnd: ({ width, height }) => {\n                    const dimensionChange = {\n                        id: id,\n                        type: 'dimensions',\n                        resizing: false,\n                        dimensions: {\n                            width,\n                            height,\n                        },\n                    };\n                    store.getState().triggerNodeChanges([dimensionChange]);\n                },\n            });\n        }\n        resizer.current.update({\n            controlPosition,\n            boundaries: {\n                minWidth,\n                minHeight,\n                maxWidth,\n                maxHeight,\n            },\n            keepAspectRatio,\n            resizeDirection,\n            onResizeStart,\n            onResize,\n            onResizeEnd,\n            shouldResize,\n        });\n        return () => {\n            resizer.current?.destroy();\n        };\n    }, [\n        controlPosition,\n        minWidth,\n        minHeight,\n        maxWidth,\n        maxHeight,\n        keepAspectRatio,\n        onResizeStart,\n        onResize,\n        onResizeEnd,\n        shouldResize,\n    ]);\n    const positionClassNames = controlPosition.split('-');\n    return (jsx(\"div\", { className: cc(['react-flow__resize-control', 'nodrag', ...positionClassNames, variant, className]), ref: resizeControlRef, style: {\n            ...style,\n            scale,\n            ...(color && { [isHandleControl ? 'backgroundColor' : 'borderColor']: color }),\n        }, children: children }));\n}\n/**\n * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons).\n * @public\n *\n */\nconst NodeResizeControl = memo(ResizeControl);\n\n/**\n * The `<NodeResizer />` component can be used to add a resize functionality to your\n * nodes. It renders draggable controls around the node to resize in all directions.\n * @public\n *\n * @example\n *```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeResizer } from '@xyflow/react';\n *\n *function ResizableNode({ data }) {\n *  return (\n *    <>\n *      <NodeResizer minWidth={100} minHeight={30} />\n *      <Handle type=\"target\" position={Position.Left} />\n *      <div style={{ padding: 10 }}>{data.label}</div>\n *      <Handle type=\"source\" position={Position.Right} />\n *    </>\n *  );\n *};\n *\n *export default memo(ResizableNode);\n *```\n */\nfunction NodeResizer({ nodeId, isVisible = true, handleClassName, handleStyle, lineClassName, lineStyle, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) {\n    if (!isVisible) {\n        return null;\n    }\n    return (jsxs(Fragment, { children: [XY_RESIZER_LINE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: lineClassName, style: lineStyle, nodeId: nodeId, position: position, variant: ResizeControlVariant.Line, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position))), XY_RESIZER_HANDLE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: handleClassName, style: handleStyle, nodeId: nodeId, position: position, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position)))] }));\n}\n\nconst selector = (state) => state.domNode?.querySelector('.react-flow__renderer');\nfunction NodeToolbarPortal({ children }) {\n    const wrapperRef = useStore(selector);\n    if (!wrapperRef) {\n        return null;\n    }\n    return createPortal(children, wrapperRef);\n}\n\nconst nodeEqualityFn = (a, b) => a?.internals.positionAbsolute.x !== b?.internals.positionAbsolute.x ||\n    a?.internals.positionAbsolute.y !== b?.internals.positionAbsolute.y ||\n    a?.measured.width !== b?.measured.width ||\n    a?.measured.height !== b?.measured.height ||\n    a?.selected !== b?.selected ||\n    a?.internals.z !== b?.internals.z;\nconst nodesEqualityFn = (a, b) => {\n    if (a.size !== b.size) {\n        return false;\n    }\n    for (const [key, node] of a) {\n        if (nodeEqualityFn(node, b.get(key))) {\n            return false;\n        }\n    }\n    return true;\n};\nconst storeSelector = (state) => ({\n    x: state.transform[0],\n    y: state.transform[1],\n    zoom: state.transform[2],\n    selectedNodesCount: state.nodes.filter((node) => node.selected).length,\n});\n/**\n * This component can render a toolbar or tooltip to one side of a custom node. This\n * toolbar doesn't scale with the viewport so that the content is always visible.\n *\n * @public\n * @example\n * ```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeToolbar } from '@xyflow/react';\n *\n *function CustomNode({ data }) {\n *  return (\n *    <>\n *      <NodeToolbar isVisible={data.toolbarVisible} position={data.toolbarPosition}>\n *        <button>delete</button>\n *        <button>copy</button>\n *        <button>expand</button>\n *      </NodeToolbar>\n *\n *      <div style={{ padding: '10px 20px' }}>\n *        {data.label}\n *      </div>\n *\n *      <Handle type=\"target\" position={Position.Left} />\n *      <Handle type=\"source\" position={Position.Right} />\n *    </>\n *  );\n *};\n *\n *export default memo(CustomNode);\n *```\n * @remarks By default, the toolbar is only visible when a node is selected. If multiple\n * nodes are selected it will not be visible to prevent overlapping toolbars or\n * clutter. You can override this behavior by setting the `isVisible` prop to `true`.\n */\nfunction NodeToolbar({ nodeId, children, className, style, isVisible, position = Position.Top, offset = 10, align = 'center', ...rest }) {\n    const contextNodeId = useNodeId();\n    const nodesSelector = useCallback((state) => {\n        const nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ''];\n        const internalNodes = nodeIds.reduce((res, id) => {\n            const node = state.nodeLookup.get(id);\n            if (node) {\n                res.set(node.id, node);\n            }\n            return res;\n        }, new Map());\n        return internalNodes;\n    }, [nodeId, contextNodeId]);\n    const nodes = useStore(nodesSelector, nodesEqualityFn);\n    const { x, y, zoom, selectedNodesCount } = useStore(storeSelector, shallow);\n    // if isVisible is not set, we show the toolbar only if its node is selected and no other node is selected\n    const isActive = typeof isVisible === 'boolean'\n        ? isVisible\n        : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1;\n    if (!isActive || !nodes.size) {\n        return null;\n    }\n    const nodeRect = getInternalNodesBounds(nodes);\n    const nodesArray = Array.from(nodes.values());\n    const zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1));\n    const wrapperStyle = {\n        position: 'absolute',\n        transform: getNodeToolbarTransform(nodeRect, { x, y, zoom }, position, offset, align),\n        zIndex,\n        ...style,\n    };\n    return (jsx(NodeToolbarPortal, { children: jsx(\"div\", { style: wrapperStyle, className: cc(['react-flow__node-toolbar', className]), ...rest, \"data-id\": nodesArray.reduce((acc, node) => `${acc}${node.id} `, '').trim(), children: children }) }));\n}\n\nconst zoomSelector = (state) => state.transform[2];\n/**\n * This component can render a toolbar or tooltip to one side of a custom edge. This\n * toolbar doesn't scale with the viewport so that the content stays the same size.\n *\n * @public\n * @example\n * ```jsx\n * import { EdgeToolbar, BaseEdge, getBezierPath, type EdgeProps } from \"@xyflow/react\";\n *\n * export function CustomEdge({ id, data, ...props }: EdgeProps) {\n *   const [edgePath, centerX, centerY] = getBezierPath(props);\n *\n *   return (\n *     <>\n *       <BaseEdge id={id} path={edgePath} />\n *       <EdgeToolbar edgeId={id} x={centerX} y={centerY} isVisible>\n *         <button onClick={() => console.log('edge', id, 'click')}}>Click me</button>\n *       </EdgeToolbar>\n *     </>\n *   );\n * }\n * ```\n */\nfunction EdgeToolbar({ edgeId, x, y, children, className, style, isVisible, alignX = 'center', alignY = 'center', ...rest }) {\n    const edgeSelector = useCallback((state) => state.edgeLookup.get(edgeId), [edgeId]);\n    const edge = useStore(edgeSelector, shallow);\n    const isActive = typeof isVisible === 'boolean' ? isVisible : edge?.selected;\n    const zoom = useStore(zoomSelector);\n    if (!isActive) {\n        return null;\n    }\n    const zIndex = (edge?.zIndex ?? 0) + 1;\n    const transform = getEdgeToolbarTransform(x, y, zoom, alignX, alignY);\n    return (jsx(EdgeLabelRenderer, { children: jsx(\"div\", { style: {\n                position: 'absolute',\n                transform,\n                zIndex,\n                pointerEvents: 'all',\n                transformOrigin: '0 0',\n                ...style,\n            }, className: cc(['react-flow__edge-toolbar', className]), \"data-id\": edge?.id ?? '', ...rest, children: children }) }));\n}\n\nexport { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, EdgeToolbar, Handle, MiniMap, MiniMapNode, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, addEdge, applyEdgeChanges, applyNodeChanges, experimental_useOnEdgesChangeMiddleware, experimental_useOnNodesChangeMiddleware, getSimpleBezierPath, isEdge, isNode, reconnectEdge, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport };\n","// Dragging a step card onto an append slot re-parents it. The slots are the\n// only drop targets, so a drop always names a step and a port.\nimport { useSyncExternalStore } from \"react\";\nimport { reachableFrom } from \"./ap-layout.js\";\nimport type { WorkflowModel } from \"./model.js\";\n\nexport interface StepMove {\n  stepId: string;\n  toParentId: string;\n  port: string;\n}\n\nexport type MoveRejection = \"self\" | \"cycle\" | \"already-there\";\n\n// Why this move can't happen, or null when it can.\nexport function moveRejection(\n  model: WorkflowModel,\n  move: StepMove,\n): MoveRejection | null {\n  if (move.stepId === move.toParentId) return \"self\";\n  if (\n    model.edges.some(\n      (edge) =>\n        edge.from === move.toParentId &&\n        edge.to === move.stepId &&\n        edge.port === move.port,\n    )\n  ) {\n    return \"already-there\";\n  }\n  // The slot's owner must not be somewhere the step already leads to.\n  if (reachableFrom(move.stepId, model.edges).has(move.toParentId)) {\n    return \"cycle\";\n  }\n  return null;\n}\n\nexport function canMoveStep(model: WorkflowModel, move: StepMove): boolean {\n  return moveRejection(model, move) === null;\n}\n\nexport const MOVE_REJECTION_TEXT: Record<MoveRejection, string> = {\n  self: \"A step can't follow itself\",\n  cycle: \"That slot is inside this step's own path\",\n  \"already-there\": \"Already connected there\",\n};\n\n// The step being dragged, shared with the slots so they can offer themselves.\nlet dragging: string | undefined;\nconst listeners = new Set<() => void>();\n\nexport function setDraggingStep(stepId: string | undefined): void {\n  if (dragging === stepId) return;\n  dragging = stepId;\n  for (const listener of listeners) listener();\n}\n\nfunction subscribe(listener: () => void): () => void {\n  listeners.add(listener);\n  return () => listeners.delete(listener);\n}\n\nfunction snapshot(): string | undefined {\n  return dragging;\n}\n\nexport function useDraggingStep(): string | undefined {\n  return useSyncExternalStore(subscribe, snapshot, snapshot);\n}\n","// Step card + add buttons, ported from the Activepieces builder step-node\n// and add-button components (MIT, activepieces packages/web).\nimport { Handle, Position, type NodeProps } from \"@xyflow/react\";\nimport { createContext, useContext, useState } from \"react\";\nimport {\n  ADD_BUTTON_SIZE,\n  BIG_ADD_BUTTON_SIZE,\n  STEP_HEIGHT,\n  STEP_WIDTH,\n} from \"./ap-layout.js\";\nimport { useBlockMeta } from \"./block-meta.js\";\nimport { BlockLogo, BlockSelector } from \"./BlockSelector.js\";\nimport {\n  STEP_PRESETS,\n  stepBlock,\n  TRIGGER_PRESETS,\n  triggerBlock,\n  type BlockPreset,\n  type PickedPreset,\n} from \"./blocks.js\";\nimport { useDesignTime, useRunById } from \"./design-time.js\";\nimport type { StepModel, TriggerModel } from \"./model.js\";\nimport {\n  MOVE_REJECTION_TEXT,\n  setDraggingStep,\n  useDraggingStep,\n  type MoveRejection,\n  type StepMove,\n} from \"./step-drag.js\";\nimport { isTestableTrigger, testState } from \"./test-state.js\";\nimport { useBlockCheck } from \"./use-validity.js\";\nimport {\n  useResolution,\n  versionBadge,\n  type VersionBadgeView,\n  type VersionTone,\n} from \"./version-badge.js\";\n\nconst hiddenHandle = { opacity: 0, pointerEvents: \"none\" as const };\n\ntype NodeBadge =\n  | { kind: \"invalid\"; issues: string[] }\n  | { kind: \"incomplete\"; missing: string[] }\n  | { kind: \"test\"; stale: boolean }\n  | { kind: \"failed\" }\n  | { kind: \"passed\" }\n  | null;\n\n// Inline beside the title, so no zoom level clips it against the card edge.\nconst BADGE_CLASS =\n  \"inline-flex shrink-0 items-center rounded-full px-1.5 text-[10px] font-medium leading-4\";\n\nfunction badgeTitle(badge: NonNullable<NodeBadge>): string {\n  switch (badge.kind) {\n    case \"invalid\":\n      return badge.issues.join(\"\\n\");\n    case \"incomplete\":\n      return `Needs a value: ${badge.missing.join(\", \")}`;\n    case \"test\":\n      return badge.stale ? \"Changed since its last test\" : \"Not tested yet\";\n    case \"failed\":\n      return \"The last test failed\";\n    case \"passed\":\n      return \"Tested\";\n  }\n}\n\n// Which one badge a crowded title keeps; the other goes in its tooltip.\nconst TEST_SEVERITY = {\n  passed: 0,\n  test: 2,\n  incomplete: 3,\n  failed: 4,\n  invalid: 6,\n};\nconst VERSION_SEVERITY: Record<VersionTone, number> = {\n  neutral: 1,\n  warn: 3,\n  fail: 5,\n};\n\nconst VERSION_CLASS: Record<VersionTone, string> = {\n  neutral: \"bg-muted text-muted-foreground\",\n  warn: \"bg-wf-warn/15 text-wf-warn\",\n  fail: \"bg-wf-fail/10 text-wf-fail\",\n};\n\n// Activepieces' order: incomplete first, then the test. A version badge\n// shows instead only when it is the more severe.\nfunction Badge(props: { badge: NodeBadge; version: VersionBadgeView | null }) {\n  const { badge, version } = props;\n  if (\n    version &&\n    (!badge || VERSION_SEVERITY[version.tone] > TEST_SEVERITY[badge.kind])\n  ) {\n    return (\n      <span\n        data-testid=\"version-badge\"\n        className={`${BADGE_CLASS} ${VERSION_CLASS[version.tone]}`}\n        title={badge ? `${version.title}\\n${badgeTitle(badge)}` : version.title}\n      >\n        {version.label}\n      </span>\n    );\n  }\n  if (!badge) return null;\n  const title = version\n    ? `${badgeTitle(badge)}\\n${version.title}`\n    : badgeTitle(badge);\n  switch (badge.kind) {\n    case \"invalid\":\n      return (\n        <span\n          className={`${BADGE_CLASS} bg-wf-fail/10 text-wf-fail`}\n          title={title}\n        >\n          Miswired\n        </span>\n      );\n    case \"incomplete\":\n      return (\n        <span\n          className={`${BADGE_CLASS} bg-wf-warn/15 text-wf-warn`}\n          title={title}\n        >\n          Incomplete\n        </span>\n      );\n    case \"test\":\n      return (\n        <span\n          className={`${BADGE_CLASS} bg-muted text-muted-foreground`}\n          title={title}\n        >\n          Test me\n        </span>\n      );\n    case \"failed\":\n      return (\n        <span\n          className={`${BADGE_CLASS} bg-wf-fail/10 text-wf-fail`}\n          title={title}\n        >\n          Failed\n        </span>\n      );\n    case \"passed\":\n      return (\n        <span\n          className=\"flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full bg-wf-ok/15 text-wf-ok\"\n          title={title}\n          aria-label=\"Tested\"\n        >\n          <svg viewBox=\"0 0 24 24\" className=\"h-2.5 w-2.5\">\n            <path\n              d=\"M5 12l5 5 9-10\"\n              stroke=\"currentColor\"\n              strokeWidth={3}\n              fill=\"none\"\n              strokeLinecap=\"round\"\n            />\n          </svg>\n        </span>\n      );\n  }\n}\n\nexport function ApStepNode(props: NodeProps) {\n  const data = props.data as (\n    | { kind: \"trigger\"; trigger: TriggerModel }\n    | { kind: \"step\"; step: StepModel }\n  ) & { outgoingPorts?: string[] };\n  const ref =\n    data.kind === \"trigger\" ? triggerBlock(data.trigger) : stepBlock(data.step);\n  // Subscribed, so the piece name replaces the fallback once the catalog lands.\n  const meta = useBlockMeta(ref);\n  const title =\n    data.kind === \"trigger\"\n      ? meta.displayName\n      : data.step.name || data.step.key;\n  const block = data.kind === \"trigger\" ? data.trigger : data.step;\n  const skipped = data.kind === \"step\" && data.step.skip === true;\n  const check = useBlockCheck({\n    ...block,\n    block: ref,\n    skip: skipped,\n    outgoingPorts: data.outgoingPorts,\n  });\n\n  const designTime = useDesignTime();\n  const testable =\n    data.kind === \"trigger\"\n      ? isTestableTrigger(ref) && Boolean(designTime?.testTrigger)\n      : Boolean(designTime?.testStep);\n  const testRun = useRunById(testable ? block.lastTest?.runId : null);\n  const tested = testable ? testState(block, testRun?.status) : null;\n  // No tick until the run says it didn't fail.\n  const test = tested === \"passed\" && testRun === undefined ? null : tested;\n  const badge: NodeBadge = skipped\n    ? null\n    : check.issues.length > 0\n      ? { kind: \"invalid\", issues: check.issues }\n      : check.missing && check.missing.length > 0\n        ? { kind: \"incomplete\", missing: check.missing }\n        : test === \"never\" || test === \"stale\"\n          ? { kind: \"test\", stale: test === \"stale\" }\n          : test === \"failed\"\n            ? { kind: \"failed\" }\n            : test === \"passed\"\n              ? { kind: \"passed\" }\n              : null;\n\n  const resolution = useResolution(block.id, ref);\n  const version = skipped ? null : versionBadge(resolution);\n\n  const dragging = useDraggingStep();\n  const isDragged = data.kind === \"step\" && dragging === data.step.id;\n\n  return (\n    <div\n      style={{ width: STEP_WIDTH, height: STEP_HEIGHT }}\n      className={`border-box group relative overflow-visible rounded-md border border-solid bg-card shadow-sm transition-all ${\n        props.selected ? \"border-wf-run\" : \"border-foreground/10\"\n      } ${isDragged ? \"opacity-40\" : \"\"} ${skipped ? \"border-dashed\" : \"\"} ${\n        data.kind === \"step\"\n          ? // nodrag/nopan hand the gesture over: without them React Flow's\n            // pane claims the mousedown and the canvas pans instead.\n            \"nodrag nopan cursor-grab active:cursor-grabbing\"\n          : \"\"\n      }`}\n      draggable={data.kind === \"step\"}\n      onDragStart={(event) => {\n        if (data.kind !== \"step\") return;\n        event.dataTransfer.effectAllowed = \"move\";\n        // Firefox ignores a drag with no payload.\n        event.dataTransfer.setData(\"text/plain\", data.step.id);\n        setDraggingStep(data.step.id);\n      }}\n      onDragEnd={() => setDraggingStep(undefined)}\n    >\n      <Handle type=\"target\" position={Position.Top} style={hiddenHandle} />\n      <div\n        className={`flex h-full items-center gap-3 px-3 ${skipped ? \"opacity-50 grayscale\" : \"\"}`}\n      >\n        <BlockLogo block={ref} size={36} />\n        <div className=\"min-w-0 grow\">\n          <div className=\"flex items-center gap-1.5\">\n            <span className=\"truncate text-sm font-medium text-foreground\">\n              {title}\n            </span>\n            {skipped ? (\n              <span className=\"shrink-0 rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground\">\n                Skipped\n              </span>\n            ) : null}\n            <Badge badge={badge} version={version} />\n          </div>\n          <div className=\"truncate text-xs text-muted-foreground/80\">\n            {data.kind === \"trigger\"\n              ? meta.subtitle === \"Trigger\"\n                ? \"Trigger\"\n                : meta.subtitle\n              : meta.subtitle}\n          </div>\n        </div>\n      </div>\n      <Handle type=\"source\" position={Position.Bottom} style={hiddenHandle} />\n    </div>\n  );\n}\n\n// Shared with the edges, which label a taken port the same way.\nexport const PORT_LABEL_CLASSES: Record<string, string> = {\n  true: \"bg-wf-ok/10 text-wf-ok hover:bg-green-200\",\n  false: \"bg-wf-fail/10 text-wf-fail hover:bg-red-200\",\n  error: \"bg-wf-warn/10 text-wf-warn hover:bg-wf-warn/20\",\n};\n\nfunction AddButton(props: {\n  size?: number;\n  title: string;\n  presets: BlockPreset[];\n  onPick: (preset: PickedPreset) => void;\n  showPieces?: boolean;\n  pieceMode?: \"actions\" | \"triggers\";\n  attachSteps?: StepModel[];\n  onAttach?: (stepId: string) => void;\n  // Named ports read as their name; an unnamed one is just a plus.\n  label?: string;\n}) {\n  const [open, setOpen] = useState(false);\n  const size = props.size ?? ADD_BUTTON_SIZE;\n  const label = props.label;\n  return (\n    <div className=\"relative\" style={{ width: size, height: size }}>\n      <button\n        type=\"button\"\n        aria-label={props.title}\n        aria-expanded={open}\n        style={label ? { height: size } : { width: size, height: size }}\n        // Labelled buttons keep the node's own footprint and overflow it\n        // evenly, so the layout still positions them by their centre.\n        className={`flex cursor-pointer items-center justify-center rounded-md border border-solid transition-all ${\n          label\n            ? \"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 px-1.5 text-[10px] font-semibold\"\n            : \"\"\n        } ${\n          open\n            ? \"border-wf-run bg-wf-run text-card\"\n            : label\n              ? `border-transparent ${PORT_LABEL_CLASSES[label] ?? \"bg-muted text-muted-foreground hover:bg-foreground/10\"}`\n              : \"border-foreground/15 bg-card text-foreground hover:border-foreground/25\"\n        }`}\n        onClick={(event) => {\n          event.stopPropagation();\n          setOpen((value) => !value);\n        }}\n      >\n        {label ? (\n          label\n        ) : (\n          <svg width={size * 0.55} height={size * 0.55} viewBox=\"0 0 24 24\">\n            <path\n              d=\"M12 5v14M5 12h14\"\n              stroke=\"currentColor\"\n              strokeWidth={3}\n              strokeLinecap=\"round\"\n              fill=\"none\"\n            />\n          </svg>\n        )}\n      </button>\n      {open ? (\n        <div\n          data-selector-open=\"true\"\n          className=\"absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2\"\n        >\n          <BlockSelector\n            title={props.title}\n            presets={props.presets}\n            showPieces={props.showPieces}\n            pieceMode={props.pieceMode}\n            attachSteps={props.attachSteps}\n            onAttach={\n              props.onAttach\n                ? (stepId) => {\n                    setOpen(false);\n                    props.onAttach?.(stepId);\n                  }\n                : undefined\n            }\n            onPick={(preset) => {\n              setOpen(false);\n              props.onPick(preset);\n            }}\n            onClose={() => setOpen(false)}\n          />\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\nexport interface ApCanvasHandlers {\n  appendStep: (fromId: string, port: string, preset: PickedPreset) => void;\n  insertOnEdge: (edgeId: string, preset: PickedPreset) => void;\n  pickTrigger: (preset: PickedPreset) => void;\n  // Re-attaching steps that are unreachable from the trigger.\n  attachableSteps: (fromId: string) => StepModel[];\n  attachStep: (fromId: string, port: string, stepId: string) => void;\n  // Dragging a step card onto a slot.\n  moveStep: (move: StepMove) => void;\n  moveRejection: (move: StepMove) => MoveRejection | null;\n}\n\n// Node/edge components can't receive functions through the layout data\n// cleanly; they render inside ReactFlow, under the canvas's provider.\nconst CanvasHandlersContext = createContext<ApCanvasHandlers | undefined>(\n  undefined,\n);\n\nexport const CanvasHandlersProvider = CanvasHandlersContext.Provider;\n\nexport function useCanvasHandlers(): ApCanvasHandlers | undefined {\n  return useContext(CanvasHandlersContext);\n}\n\nexport function ApAppendNode(props: NodeProps) {\n  const data = props.data as {\n    parentId: string;\n    port: string;\n    card?: boolean;\n    hint?: boolean;\n  };\n  const handlers = useCanvasHandlers();\n  const attachSteps = handlers?.attachableSteps(data.parentId);\n  const dragging = useDraggingStep();\n  const move = dragging\n    ? { stepId: dragging, toParentId: data.parentId, port: data.port }\n    : undefined;\n  const rejection = move ? handlers?.moveRejection(move) : undefined;\n\n  if (move) {\n    // While a card is in flight the slot becomes the drop target, sized like\n    // the step it would hold. The node keeps its button-sized footprint so the\n    // layout still anchors it by the same point.\n    return (\n      <div\n        className=\"relative\"\n        style={\n          data.card\n            ? { width: STEP_WIDTH, height: STEP_HEIGHT }\n            : { width: ADD_BUTTON_SIZE, height: ADD_BUTTON_SIZE }\n        }\n      >\n        <Handle type=\"target\" position={Position.Top} style={hiddenHandle} />\n        <div\n          style={{ width: STEP_WIDTH, height: STEP_HEIGHT }}\n          className={`nodrag nopan absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md border-2 border-dashed text-xs font-medium transition-colors ${\n            rejection\n              ? \"border-foreground/10 bg-muted/50 text-muted-foreground/80\"\n              : \"border-wf-run bg-wf-run/10 text-wf-run\"\n          }`}\n          title={rejection ? MOVE_REJECTION_TEXT[rejection] : undefined}\n          onDragOver={(event) => {\n            if (rejection) return;\n            event.preventDefault();\n            event.dataTransfer.dropEffect = \"move\";\n          }}\n          onDrop={(event) => {\n            event.preventDefault();\n            if (rejection) return;\n            handlers?.moveStep(move);\n            setDraggingStep(undefined);\n          }}\n        >\n          {rejection\n            ? MOVE_REJECTION_TEXT[rejection]\n            : data.port === \"next\"\n              ? \"Move here\"\n              : `Move to ${data.port}`}\n        </div>\n      </div>\n    );\n  }\n\n  if (data.card) {\n    return (\n      <div\n        style={{ width: STEP_WIDTH, height: STEP_HEIGHT }}\n        className=\"relative flex items-center justify-center rounded-md border border-dashed border-foreground/15 bg-muted/40\"\n      >\n        <Handle type=\"target\" position={Position.Top} style={hiddenHandle} />\n        <span\n          className={`absolute left-3 top-3 rounded px-1.5 text-[10px] font-semibold ${\n            PORT_LABEL_CLASSES[data.port] ?? \"bg-muted text-muted-foreground\"\n          }`}\n        >\n          {data.port}\n        </span>\n        <AddButton\n          title={`Add step (${data.port})`}\n          presets={STEP_PRESETS}\n          showPieces\n          attachSteps={attachSteps}\n          onAttach={(stepId) =>\n            handlers?.attachStep(data.parentId, data.port, stepId)\n          }\n          onPick={(preset) =>\n            handlers?.appendStep(data.parentId, data.port, preset)\n          }\n        />\n      </div>\n    );\n  }\n\n  return (\n    <>\n      <Handle type=\"target\" position={Position.Top} style={hiddenHandle} />\n      {data.hint ? (\n        <span className=\"pointer-events-none absolute left-1/2 top-full mt-2 -translate-x-1/2 whitespace-nowrap text-xs text-muted-foreground\">\n          Add your first step with +\n        </span>\n      ) : null}\n      <AddButton\n        title={data.port === \"next\" ? \"Add step\" : `Add step (${data.port})`}\n        label={data.port === \"next\" ? undefined : data.port}\n        presets={STEP_PRESETS}\n        showPieces\n        attachSteps={attachSteps}\n        onAttach={(stepId) =>\n          handlers?.attachStep(data.parentId, data.port, stepId)\n        }\n        onPick={(preset) =>\n          handlers?.appendStep(data.parentId, data.port, preset)\n        }\n      />\n    </>\n  );\n}\n\nexport function ApBigButtonNode(_props: NodeProps) {\n  const handlers = useCanvasHandlers();\n  return (\n    <div className=\"flex flex-col items-center gap-2\">\n      <AddButton\n        size={BIG_ADD_BUTTON_SIZE}\n        title=\"Choose a trigger\"\n        presets={TRIGGER_PRESETS}\n        showPieces\n        pieceMode=\"triggers\"\n        onPick={(preset) => handlers?.pickTrigger(preset)}\n      />\n      <span className=\"text-xs text-muted-foreground/80\">Select a trigger</span>\n    </div>\n  );\n}\n\nexport { AddButton };\n\nexport const apNodeTypes = {\n  apStep: ApStepNode,\n  apAppend: ApAppendNode,\n  apBigButton: ApBigButtonNode,\n};\n","// Edge with the mid-line add button, ported from the Activepieces builder\n// edges/add-button (MIT, activepieces packages/web).\nimport {\n  BaseEdge,\n  EdgeLabelRenderer,\n  getSmoothStepPath,\n  Position,\n  type EdgeProps,\n} from \"@xyflow/react\";\nimport {\n  AddButton,\n  PORT_LABEL_CLASSES,\n  useCanvasHandlers,\n} from \"./ap-nodes.js\";\nimport { STEP_PRESETS } from \"./blocks.js\";\n\nexport function ApEdge(props: EdgeProps) {\n  const handlers = useCanvasHandlers();\n  const data = props.data as {\n    edgeId: string;\n    port: string;\n    condition: string | null;\n    fromSkipped?: boolean;\n    dead?: boolean;\n  };\n  const [path, labelX, labelY] = getSmoothStepPath({\n    sourceX: props.sourceX,\n    sourceY: props.sourceY,\n    targetX: props.targetX,\n    targetY: props.targetY,\n    sourcePosition: Position.Bottom,\n    targetPosition: Position.Top,\n    borderRadius: 15,\n  });\n  const portLabel = data.dead\n    ? `${data.port} · never taken`\n    : data.port !== \"next\"\n      ? data.port\n      : null;\n\n  return (\n    <>\n      <BaseEdge\n        id={props.id}\n        path={path}\n        style={{\n          stroke: data.dead ? \"var(--wf-fail)\" : \"var(--wf-edge)\",\n          strokeWidth: 1.5,\n          ...(data.dead ? { strokeDasharray: \"5 4\" } : {}),\n          ...(data.fromSkipped\n            ? { opacity: 0.45, strokeDasharray: \"2 3\" }\n            : {}),\n        }}\n      />\n      <EdgeLabelRenderer>\n        <div\n          className=\"nodrag nopan pointer-events-auto absolute flex items-center gap-1\"\n          style={{\n            transform: `translate(-50%, -50%) translate(${labelX}px, ${labelY}px)`,\n          }}\n        >\n          {portLabel ? (\n            <span\n              className={`rounded px-1.5 py-0.5 text-[10px] font-semibold ${\n                data.dead\n                  ? \"border border-solid border-wf-fail/40 bg-card text-wf-fail\"\n                  : (PORT_LABEL_CLASSES[portLabel] ??\n                    \"bg-muted text-muted-foreground\")\n              }`}\n              title={\n                data.dead\n                  ? `The source never leaves on \"${data.port}\", so no run takes this edge`\n                  : undefined\n              }\n            >\n              {portLabel}\n              {data.condition ? \" ?\" : \"\"}\n            </span>\n          ) : null}\n          <AddButton\n            title=\"Insert step\"\n            presets={STEP_PRESETS}\n            showPieces\n            onPick={(preset) => handlers?.insertOnEdge(data.edgeId, preset)}\n          />\n        </div>\n      </EdgeLabelRenderer>\n    </>\n  );\n}\n\nexport function ApLinkEdge(props: EdgeProps) {\n  const [path] = getSmoothStepPath({\n    sourceX: props.sourceX,\n    sourceY: props.sourceY,\n    targetX: props.targetX,\n    targetY: props.targetY,\n    sourcePosition: Position.Bottom,\n    targetPosition: Position.Top,\n    borderRadius: 15,\n  });\n  return (\n    <BaseEdge\n      id={props.id}\n      path={path}\n      style={{\n        stroke: \"var(--wf-edge)\",\n        strokeWidth: 1.5,\n        strokeDasharray: \"4 3\",\n      }}\n    />\n  );\n}\n\nexport const apEdgeTypes = { apEdge: ApEdge, apLink: ApLinkEdge };\n","// Canvas right-click menu, in the spirit of the Activepieces builder step and\n// edge context menus; the step pickers reuse the add-button BlockSelector.\nimport { useEffect, useRef, useState } from \"react\";\nimport { BlockSelector } from \"./BlockSelector.js\";\nimport { STEP_PRESETS, TRIGGER_PRESETS, type PickedPreset } from \"./blocks.js\";\nimport {\n  contextMenuItems,\n  type PortsOf,\n  menuHeight,\n  menuPosition,\n  MENU_WIDTH,\n  type ContextMenuActionId,\n  type ContextMenuTarget,\n} from \"./canvas-menu.js\";\nimport type { PointModel, WorkflowModel } from \"./model.js\";\n\nexport interface CanvasMenuState {\n  target: ContextMenuTarget;\n  point: PointModel;\n}\n\n// Actions that pick a block first; the rest fire straight away.\nconst PICKERS: Partial<Record<ContextMenuActionId, string>> = {\n  addBelow: \"Add step\",\n  addStep: \"Add step\",\n  insertStep: \"Insert step\",\n  changeTrigger: \"Choose a trigger\",\n};\n\nconst PICKER_SIZE = { width: 320, height: 400 };\n\nexport function CanvasContextMenu(props: {\n  state: CanvasMenuState;\n  model: WorkflowModel;\n  portsOf: PortsOf;\n  onAction: (action: ContextMenuActionId, preset?: PickedPreset) => void;\n  onClose: () => void;\n}) {\n  const [picker, setPicker] = useState<ContextMenuActionId | null>(null);\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    const onMouseDown = (event: MouseEvent) => {\n      if (!containerRef.current?.contains(event.target as globalThis.Node)) {\n        props.onClose();\n      }\n    };\n    const onKeyDown = (event: KeyboardEvent) => {\n      if (event.key === \"Escape\") props.onClose();\n    };\n    window.addEventListener(\"mousedown\", onMouseDown);\n    window.addEventListener(\"keydown\", onKeyDown);\n    window.addEventListener(\"scroll\", props.onClose, true);\n    return () => {\n      window.removeEventListener(\"mousedown\", onMouseDown);\n      window.removeEventListener(\"keydown\", onKeyDown);\n      window.removeEventListener(\"scroll\", props.onClose, true);\n    };\n  }, [props]);\n\n  const items = contextMenuItems(\n    props.state.target,\n    props.model,\n    props.portsOf,\n  );\n  const size = picker\n    ? PICKER_SIZE\n    : { width: MENU_WIDTH, height: menuHeight(items.length) };\n  const position = menuPosition(props.state.point, size, {\n    width: window.innerWidth,\n    height: window.innerHeight,\n  });\n\n  return (\n    <div\n      ref={containerRef}\n      className=\"workflow-context-menu nodrag nopan fixed\"\n      style={{ left: position.x, top: position.y }}\n      onContextMenu={(event) => event.preventDefault()}\n    >\n      {picker ? (\n        <BlockSelector\n          title={PICKERS[picker] ?? \"\"}\n          presets={picker === \"changeTrigger\" ? TRIGGER_PRESETS : STEP_PRESETS}\n          showPieces\n          pieceMode={picker === \"changeTrigger\" ? \"triggers\" : \"actions\"}\n          onPick={(preset) => props.onAction(picker, preset)}\n          onClose={props.onClose}\n        />\n      ) : (\n        <div\n          style={{ width: MENU_WIDTH }}\n          className=\"rounded-md border border-solid border-foreground/10 bg-card py-1 shadow-lg\"\n        >\n          {items.map((item) => (\n            <button\n              key={item.id}\n              type=\"button\"\n              className={`flex w-full items-center px-3 py-1.5 text-left text-xs text-foreground ${\n                item.disabled\n                  ? \"cursor-not-allowed opacity-50\"\n                  : \"hover:bg-muted/50\"\n              }`}\n              disabled={item.disabled}\n              onClick={() => {\n                if (PICKERS[item.id]) setPicker(item.id);\n                else props.onAction(item.id);\n              }}\n            >\n              {item.label}\n            </button>\n          ))}\n        </div>\n      )}\n    </div>\n  );\n}\n","import {\n  Background,\n  Controls,\n  MiniMap,\n  ReactFlow,\n  type Edge,\n  type Node,\n  type ReactFlowInstance,\n} from \"@xyflow/react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { apEdgeTypes } from \"./ap-edge.js\";\nimport { attachableSteps, layoutWorkflow } from \"./ap-layout.js\";\nimport {\n  flowPorts,\n  knownPorts,\n} from \"@powerhousedao/pieces-framework/workflow\";\nimport {\n  useBlockFormLoader,\n  useBlockPorts,\n  useCachedBlockForm,\n} from \"./design-time.js\";\nimport { moveRejection } from \"./step-drag.js\";\nimport type { AddedBlock } from \"./add-follow-up.js\";\nimport { withPropDefaults } from \"./prop-defaults.js\";\nimport {\n  apNodeTypes,\n  CanvasHandlersProvider,\n  type ApCanvasHandlers,\n} from \"./ap-nodes.js\";\nimport {\n  stepBlock,\n  stepFields,\n  triggerBlock,\n  triggerFields,\n  type PickedPreset,\n} from \"./blocks.js\";\nimport {\n  CanvasContextMenu,\n  type CanvasMenuState,\n} from \"./CanvasContextMenu.js\";\nimport type { ContextMenuActionId, ContextMenuTarget } from \"./canvas-menu.js\";\nimport {\n  uniqueStepKey,\n  type AddStepInputModel,\n  type WorkflowEditorCallbacks,\n  type WorkflowModel,\n} from \"./model.js\";\n\ninterface WorkflowCanvasProps {\n  model: WorkflowModel;\n  callbacks: WorkflowEditorCallbacks;\n  onSelect: (id: string | null) => void;\n}\n\nfunction presetToInput(\n  preset: PickedPreset,\n  model: WorkflowModel,\n  config: unknown,\n): AddStepInputModel {\n  return {\n    key: uniqueStepKey(\n      model.steps.map((step) => step.key),\n      preset.label,\n    ),\n    name: preset.label,\n    ...stepFields(preset.block),\n    config,\n  };\n}\n\nconst MINIMAP_MIN_STEPS = 8;\n\nconst MINIMAP_NODE_COLOR = (node: Node) =>\n  node.type === \"apStep\" ? \"var(--wf-edge)\" : \"transparent\";\n\nexport function WorkflowCanvas({\n  model,\n  callbacks,\n  onSelect,\n}: WorkflowCanvasProps) {\n  const blocks = useMemo(\n    () => [\n      ...(model.trigger ? [triggerBlock(model.trigger)] : []),\n      ...model.steps.map(stepBlock),\n    ],\n    [model],\n  );\n  const portsOf = useBlockPorts(blocks);\n  const loadForm = useBlockFormLoader();\n  const cachedForm = useCachedBlockForm();\n  const portsKey = blocks.map((block) => portsOf(block)?.join(\"|\")).join(\",\");\n  const { nodes, edges } = useMemo(\n    () => layoutWorkflow(model, portsOf),\n    // portsKey stands for what portsOf answers.\n    // oxlint-disable-next-line react-hooks/exhaustive-deps\n    [model, portsKey],\n  );\n  // Local-first: a block is added at once, with its piece's defaults when\n  // the form is cached; otherwise they follow once it loads. Adding selects\n  // the block, which opens its panel.\n  const add = useCallback(\n    (\n      preset: PickedPreset,\n      commit: (config: unknown) => AddedBlock | undefined,\n    ) => {\n      const cached = cachedForm(preset.block);\n      const added = commit(\n        cached\n          ? withPropDefaults(cached.props, preset.defaultConfig)\n          : preset.defaultConfig,\n      );\n      if (!added) return;\n      onSelect(added.id);\n      if (cached) return;\n      void loadForm(preset.block).then((form) => {\n        if (form) callbacks.completeBlock(added, form);\n      });\n    },\n    [cachedForm, loadForm, callbacks, onSelect],\n  );\n  // The inserted block continues on its first flow port, known from its kind\n  // until the form loads; the follow-up corrects it if the form disagrees.\n  const insertOnEdge = useCallback(\n    (edgeId: string, preset: PickedPreset) => {\n      const ports = cachedForm(preset.block)?.ports ?? knownPorts(preset.block);\n      const port = flowPorts(ports)[0];\n      if (!port) {\n        console.error(\n          `${preset.block.pieceName} ${preset.block.name} declares no port to continue on`,\n        );\n        return;\n      }\n      add(preset, (config) =>\n        callbacks.insertStepOnEdge(\n          edgeId,\n          presetToInput(preset, model, config),\n          port,\n        ),\n      );\n    },\n    [add, cachedForm, callbacks, model],\n  );\n  const [menu, setMenu] = useState<CanvasMenuState | null>(null);\n  const [flow, setFlow] = useState<ReactFlowInstance | null>(null);\n  const appendStep = (fromId: string, port: string, preset: PickedPreset) =>\n    add(preset, (config) =>\n      callbacks.appendStep(fromId, port, presetToInput(preset, model, config)),\n    );\n  const pickTrigger = (preset: PickedPreset) =>\n    add(preset, (config) =>\n      callbacks.setTrigger({ ...triggerFields(preset.block), config }),\n    );\n\n  const handlers = useMemo<ApCanvasHandlers>(\n    () => ({\n      appendStep: (fromId, port, preset) =>\n        add(preset, (config) =>\n          callbacks.appendStep(\n            fromId,\n            port,\n            presetToInput(preset, model, config),\n          ),\n        ),\n      insertOnEdge,\n      pickTrigger: (preset) =>\n        add(preset, (config) =>\n          callbacks.setTrigger({ ...triggerFields(preset.block), config }),\n        ),\n      attachableSteps: (fromId) => attachableSteps(model, fromId),\n      moveStep: (move) => callbacks.moveStep(move),\n      moveRejection: (move) => moveRejection(model, move),\n      attachStep: (fromId, port, stepId) =>\n        callbacks.addEdge({ from: fromId, to: stepId, port }),\n    }),\n    [callbacks, model, add, insertOnEdge],\n  );\n\n  // Delete/Backspace on a selection: steps go through removeStep (which\n  // drops their edges); only edges between surviving steps are removed here.\n  const onDelete = ({\n    nodes: deletedNodes,\n    edges: deletedEdges,\n  }: {\n    nodes: Node[];\n    edges: Edge[];\n  }) => {\n    const stepIds = new Set(model.steps.map((step) => step.id));\n    const removedSteps = new Set(\n      deletedNodes\n        .filter((node) => node.type === \"apStep\" && stepIds.has(node.id))\n        .map((node) => node.id),\n    );\n    for (const id of removedSteps) callbacks.removeStep(id);\n    for (const edge of deletedEdges) {\n      if (edge.type !== \"apEdge\") continue;\n      if (removedSteps.has(edge.source) || removedSteps.has(edge.target)) {\n        continue;\n      }\n      if (model.edges.some((entry) => entry.id === edge.id)) {\n        callbacks.removeEdge(edge.id);\n      }\n    }\n    if (removedSteps.size > 0) onSelect(null);\n  };\n\n  const openMenu = (\n    event: { clientX: number; clientY: number; preventDefault: () => void },\n    target: ContextMenuTarget,\n  ) => {\n    event.preventDefault();\n    setMenu({ target, point: { x: event.clientX, y: event.clientY } });\n  };\n\n  const onMenuAction = (action: ContextMenuActionId, preset?: PickedPreset) => {\n    if (!menu) return;\n    const target = menu.target;\n    const point = menu.point;\n    setMenu(null);\n    switch (action) {\n      case \"open\":\n        onSelect(\n          target.kind === \"step\" ? target.id : (model.trigger?.id ?? null),\n        );\n        break;\n      case \"addBelow\": {\n        const fromId = target.kind === \"step\" ? target.id : model.trigger?.id;\n        if (preset && fromId) appendStep(fromId, \"next\", preset);\n        break;\n      }\n      case \"duplicate\":\n        if (target.kind === \"step\") callbacks.duplicateStep(target.id);\n        break;\n      case \"toggleSkip\":\n        if (target.kind === \"step\") {\n          const step = model.steps.find((entry) => entry.id === target.id);\n          if (step) callbacks.updateStep({ id: step.id, skip: !step.skip });\n        }\n        break;\n      case \"removeStep\":\n        if (target.kind === \"step\") {\n          callbacks.removeStep(target.id);\n          onSelect(null);\n        }\n        break;\n      case \"changeTrigger\":\n        if (preset) pickTrigger(preset);\n        break;\n      case \"removeTrigger\":\n        callbacks.clearTrigger();\n        onSelect(null);\n        break;\n      case \"insertStep\":\n        if (preset && target.kind === \"edge\") insertOnEdge(target.id, preset);\n        break;\n      case \"removeEdge\":\n        if (target.kind === \"edge\") callbacks.removeEdge(target.id);\n        break;\n      case \"addStep\":\n        if (preset) {\n          const position = flow?.screenToFlowPosition(point);\n          add(preset, (config) =>\n            callbacks.addStep({\n              ...presetToInput(preset, model, config),\n              position,\n            }),\n          );\n        }\n        break;\n      case \"selectAll\":\n        flow?.setNodes((current) =>\n          current.map((node) =>\n            node.type === \"apStep\" ? { ...node, selected: true } : node,\n          ),\n        );\n        break;\n      case \"fitView\":\n        void flow?.fitView({ padding: 0.25, maxZoom: 1 });\n        break;\n    }\n  };\n\n  return (\n    <CanvasHandlersProvider value={handlers}>\n      <div\n        className=\"relative h-full w-full\"\n        onContextMenu={(event) => event.preventDefault()}\n      >\n        <ReactFlow\n          nodes={nodes}\n          edges={edges}\n          nodeTypes={apNodeTypes}\n          edgeTypes={apEdgeTypes}\n          onInit={setFlow}\n          onNodeClick={(_event, node) => {\n            setMenu(null);\n            if (node.type === \"apStep\") onSelect(node.id);\n          }}\n          onPaneClick={() => {\n            setMenu(null);\n            onSelect(null);\n          }}\n          onNodeContextMenu={(event, node) =>\n            openMenu(\n              event,\n              node.type !== \"apStep\"\n                ? { kind: \"pane\" }\n                : node.id === model.trigger?.id\n                  ? { kind: \"trigger\" }\n                  : { kind: \"step\", id: node.id },\n            )\n          }\n          onEdgeContextMenu={(event, edge) =>\n            openMenu(\n              event,\n              edge.type === \"apEdge\"\n                ? { kind: \"edge\", id: edge.id }\n                : { kind: \"pane\" },\n            )\n          }\n          onPaneContextMenu={(event) => openMenu(event, { kind: \"pane\" })}\n          onMove={() => setMenu(null)}\n          onDelete={onDelete}\n          nodesDraggable={false}\n          nodesConnectable={false}\n          deleteKeyCode={[\"Backspace\", \"Delete\"]}\n          zoomOnDoubleClick={false}\n          fitView\n          fitViewOptions={{ padding: 0.25, maxZoom: 1 }}\n          proOptions={{ hideAttribution: true }}\n        >\n          <Background gap={16} />\n          <Controls showInteractive={false} />\n          {/* Only worth the space once the flow outgrows the viewport. */}\n          {model.steps.length > MINIMAP_MIN_STEPS ? (\n            <MiniMap\n              pannable\n              zoomable\n              nodeColor={MINIMAP_NODE_COLOR}\n              nodeStrokeWidth={0}\n              style={{ width: 140, height: 90 }}\n            />\n          ) : null}\n        </ReactFlow>\n        {menu ? (\n          <CanvasContextMenu\n            portsOf={portsOf}\n            state={menu}\n            model={model}\n            onAction={onMenuAction}\n            onClose={() => setMenu(null)}\n          />\n        ) : null}\n      </div>\n    </CanvasHandlersProvider>\n  );\n}\n","import { useMemo, useState, type ReactNode } from \"react\";\nimport { Button } from \"../../shared/controls.js\";\nimport { Icon } from \"../../shared/icons.js\";\nimport {\n  ExpressionPickerPopup,\n  ExpressionTargetProvider,\n} from \"./ExpressionPicker.js\";\nimport {\n  hasDraftChanges,\n  VARIABLES_VIEW,\n  type WorkflowEditorCallbacks,\n  type WorkflowModel,\n} from \"./model.js\";\nimport {\n  DraftBanner,\n  PublishButton,\n  PublishState,\n  StatusToggle,\n  usePublish,\n} from \"./PublishControls.js\";\nimport { StepPanel, TriggerPanel } from \"./StepPanel.js\";\nimport { useWorkflowCheck } from \"./use-validity.js\";\nimport { VariablesEditor } from \"./VariablesEditor.js\";\nimport { useBlockResolutions, useDesignTime } from \"./design-time.js\";\nimport { BlockResolutionsProvider, VersionSummary } from \"./version-badge.js\";\nimport { stepBlock, triggerBlock } from \"./blocks.js\";\nimport { WorkflowCanvas } from \"./WorkflowCanvas.js\";\n\nexport function WorkflowEditorApp(props: {\n  model: WorkflowModel;\n  callbacks: WorkflowEditorCallbacks;\n  // Host controls around the header: a way out before, run facts after.\n  leading?: ReactNode;\n  trailing?: ReactNode;\n}) {\n  const { model, callbacks } = props;\n  const [selectedId, setSelectedId] = useState<string | null>(null);\n  const { publishing, error: publishError, publish } = usePublish(callbacks);\n  const { readiness } = useWorkflowCheck(model);\n\n  const selectedStep = model.steps.find((step) => step.id === selectedId);\n  const selectedTrigger =\n    model.trigger && model.trigger.id === selectedId ? model.trigger : null;\n  const showVariables = selectedId === VARIABLES_VIEW;\n  const workflowId = useDesignTime()?.workflowId ?? \"\";\n  const trigger = useMemo(\n    () => (model.trigger ? triggerBlock(model.trigger) : undefined),\n    [model.trigger],\n  );\n  const blocks = useMemo(\n    () => [\n      ...(model.trigger && trigger\n        ? [{ id: model.trigger.id, block: trigger }]\n        : []),\n      ...model.steps.map((step) => ({ id: step.id, block: stepBlock(step) })),\n    ],\n    [model.trigger, trigger, model.steps],\n  );\n  const resolutions = useBlockResolutions(workflowId, blocks);\n  const draftBlocks = useMemo(\n    () => blocks.map((entry) => entry.block),\n    [blocks],\n  );\n  const stepBlocks = useMemo(\n    () =>\n      Object.fromEntries(\n        model.steps.map((step) => [step.key, stepBlock(step)]),\n      ),\n    [model.steps],\n  );\n\n  return (\n    <BlockResolutionsProvider resolutions={resolutions} blocks={draftBlocks}>\n      <div className=\"flex min-h-0 flex-1 flex-col\">\n        <div className=\"flex items-center gap-3 border-b border-solid border-foreground/10 bg-background px-4 py-2\">\n          {props.leading ? (\n            <>\n              {props.leading}\n              <span aria-hidden className=\"h-5 w-px bg-foreground/10\" />\n            </>\n          ) : null}\n          <input\n            key={model.name}\n            aria-label=\"Workflow name\"\n            className=\"min-w-0 max-w-72 rounded-md border border-solid border-transparent bg-transparent px-1.5 py-1 text-[15px] font-semibold text-foreground hover:border-foreground/15 focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/25\"\n            defaultValue={model.name}\n            placeholder=\"Untitled workflow\"\n            spellCheck={false}\n            onKeyDown={(event) => {\n              if (event.key === \"Enter\") event.currentTarget.blur();\n            }}\n            onBlur={(event) => {\n              const name = event.target.value.trim();\n              if (name && name !== model.name) callbacks.setName(name);\n            }}\n          />\n          <span className=\"text-xs tabular-nums text-muted-foreground\">\n            v{model.version}\n          </span>\n          <PublishState model={model} />\n          <VersionSummary resolutions={resolutions} onSelect={setSelectedId} />\n          <span className=\"ml-auto flex items-center gap-3\">\n            {props.trailing}\n          </span>\n          <Button\n            size=\"sm\"\n            variant={showVariables ? \"primary\" : \"secondary\"}\n            aria-pressed={showVariables}\n            onClick={() => setSelectedId(showVariables ? null : VARIABLES_VIEW)}\n          >\n            <Icon name=\"braces\" className=\"h-3.5 w-3.5\" />\n            Variables\n            {model.variables.length > 0 ? (\n              <span className=\"tabular-nums opacity-70\">\n                {model.variables.length}\n              </span>\n            ) : null}\n          </Button>\n          <span aria-hidden className=\"h-5 w-px bg-foreground/10\" />\n          <StatusToggle\n            published={Boolean(model.published)}\n            status={model.status}\n            onChange={callbacks.setStatus}\n          />\n          {/* The draft banner shows it, unless the snapshot landed and enabling failed. */}\n          {publishError && !hasDraftChanges(model) ? (\n            <span\n              role=\"alert\"\n              className=\"max-w-64 truncate text-xs text-wf-fail\"\n              title={publishError}\n            >\n              {publishError}\n            </span>\n          ) : null}\n          <PublishButton\n            model={model}\n            readiness={readiness}\n            publishing={publishing}\n            onPublish={publish}\n            onSelect={setSelectedId}\n          />\n        </div>\n        <div className=\"flex min-h-0 flex-1\">\n          <div className=\"relative min-h-[480px] min-w-0 flex-1\">\n            <WorkflowCanvas\n              model={model}\n              callbacks={callbacks}\n              onSelect={setSelectedId}\n            />\n            <div className=\"pointer-events-none absolute inset-x-0 top-3 z-10 flex justify-center px-4\">\n              <DraftBanner\n                model={model}\n                readiness={readiness}\n                publishing={publishing}\n                error={publishError}\n                onPublish={publish}\n                onDiscard={callbacks.discardChanges}\n                onSelect={setSelectedId}\n              />\n            </div>\n          </div>\n          {showVariables ? (\n            <aside className=\"min-h-0 w-[26rem] shrink-0 overflow-y-auto border-l border-solid border-foreground/10 bg-card\">\n              <VariablesEditor\n                variables={model.variables}\n                callbacks={callbacks}\n                onClose={() => setSelectedId(null)}\n              />\n            </aside>\n          ) : null}\n          {selectedStep || selectedTrigger ? (\n            <ExpressionTargetProvider\n              key={selectedId}\n              stepBlocks={stepBlocks}\n              triggerBlock={trigger}\n            >\n              <aside className=\"flex min-h-0 w-[26rem] shrink-0 flex-col border-l border-solid border-foreground/10 bg-card\">\n                <div className=\"min-h-0 flex-1 overflow-y-auto\">\n                  {selectedStep ? (\n                    <StepPanel\n                      key={selectedStep.id}\n                      step={selectedStep}\n                      model={model}\n                      callbacks={callbacks}\n                      onClose={() => setSelectedId(null)}\n                      onSelect={setSelectedId}\n                      readOnly={model.readOnly}\n                    />\n                  ) : null}\n                  {selectedTrigger ? (\n                    <TriggerPanel\n                      key={selectedTrigger.id}\n                      trigger={selectedTrigger}\n                      callbacks={callbacks}\n                      onClose={() => setSelectedId(null)}\n                      readOnly={model.readOnly}\n                    />\n                  ) : null}\n                </div>\n                <ExpressionPickerPopup />\n              </aside>\n            </ExpressionTargetProvider>\n          ) : null}\n        </div>\n      </div>\n    </BlockResolutionsProvider>\n  );\n}\n","import \"@xyflow/react/dist/style.css\";\nimport \"./ui/canvas.css\";\nimport {\n  useFileNodesInSelectedDrive,\n  useSelectedDocumentId,\n  useSelectedDriveId,\n} from \"@powerhousedao/reactor-browser\";\nimport { useSelectedWorkflowDocument } from \"document-models/workflow\";\nimport { WORKFLOW_UNDO } from \"./undo-policy.js\";\nimport { useMemo } from \"react\";\nimport { useWorkflowModel } from \"./document/useWorkflowModel.js\";\nimport type { BlockRef } from \"@powerhousedao/pieces-framework/block-type\";\nimport type { OutputTreeNode, RuntimeClient } from \"./runtime-client.js\";\nimport {\n  useRunsQuery,\n  useRuntime,\n  useRuntimeActions,\n  WorkflowRuntimeProvider,\n} from \"./runtime-context.js\";\nimport {\n  LATEST_RUN_WINDOW,\n  outputTreeQuery,\n  runsQuery,\n  stepOutputTreeQuery,\n} from \"./runtime-queries.js\";\nimport { realRuns, TEST_TRIGGER_KIND } from \"./run-kinds.js\";\nimport type { QueryClient } from \"@tanstack/react-query\";\nimport { BackButton, UndoRedo } from \"../shared/editor-chrome.js\";\nimport {\n  formatAbsolute,\n  formatDuration,\n  formatWhen,\n  RUN_TONE,\n  toneOf,\n  TONE_DOT,\n  TONE_TEXT,\n} from \"../workflow-studio/components/run-format.js\";\nimport { buildExpressionScope, EMPTY_SCOPE } from \"./ui/expression-scope.js\";\nimport { DesignTimeProvider } from \"./ui/design-time.js\";\nimport {\n  ExpressionScopeSourceProvider,\n  type ExpressionScopeSource,\n} from \"./ui/ExpressionPicker.js\";\nimport type { DesignTimeService } from \"./ui/forms.js\";\nimport { DocumentErrorBoundary } from \"../shared/DocumentErrorBoundary.js\";\nimport { WorkflowEditorApp } from \"./ui/WorkflowEditorApp.js\";\n\nfunction treeValue(nodes: OutputTreeNode[]): Record<string, unknown> {\n  return Object.fromEntries(\n    nodes.map((node) => [\n      node.name,\n      node.children ? treeValue(node.children) : node.type,\n    ]),\n  );\n}\n\nasync function authoredOutput(\n  runtime: { client: RuntimeClient; queryClient: QueryClient },\n  block: BlockRef,\n  config: unknown,\n) {\n  try {\n    const tree = await runtime.queryClient.fetchQuery(\n      outputTreeQuery(runtime.client, block, config),\n    );\n    if (tree.nodes.length > 0) return treeValue(tree.nodes);\n    // Schema with no sub-paths = the output itself is the value.\n    return tree.source === \"none\" ? \"no declared schema\" : \"value\";\n  } catch {\n    return {};\n  }\n}\n\nconst LAST_RUN_POLL_MS = 10_000;\n\nfunction LastRunFact(props: { workflowId: string }) {\n  const runs = useRunsQuery(\n    { workflowId: props.workflowId, limit: LATEST_RUN_WINDOW },\n    { pollMs: LAST_RUN_POLL_MS },\n  );\n  if (runs.status === \"pending\") return null;\n  const run = runs.data?.at(0) ?? null;\n  if (run === null) {\n    return <span className=\"text-xs text-muted-foreground\">Not run yet</span>;\n  }\n  const tone = toneOf(RUN_TONE, run.status);\n  return (\n    <span\n      className=\"flex items-center gap-1.5 text-xs text-muted-foreground\"\n      title={formatAbsolute(run.startedAt)}\n    >\n      Last run\n      <span className={`h-1.5 w-1.5 rounded-full ${TONE_DOT[tone]}`} />\n      <span className={TONE_TEXT[tone]}>{formatWhen(run.startedAt)}</span>\n      <span className=\"tabular-nums\">\n        {formatDuration(run.startedAt, run.endedAt)}\n      </span>\n    </span>\n  );\n}\n\nfunction WorkflowEditor() {\n  const { client, queryClient } = useRuntime();\n  const actions = useRuntimeActions();\n  const { model, callbacks } = useWorkflowModel();\n  const [document] = useSelectedWorkflowDocument();\n  const workflowId = document.header.id;\n\n  // The runtime lists every connection it holds; offer only this drive's.\n  // Null outside a drive, where there's nothing to scope to.\n  const driveNodes = useFileNodesInSelectedDrive();\n  // Lets the runtime wait for a workflow that hasn't synced to it yet.\n  const driveId = useSelectedDriveId() ?? undefined;\n  const driveConnections = driveNodes\n    ? driveNodes\n        .filter((node) => node.documentType === \"powerhouse/connection\")\n        .map((node) => node.id)\n        .join(\",\")\n    : null;\n\n  const designTime = useMemo<DesignTimeService>(\n    () => ({\n      workflowId,\n      getBlockForm: (block) => client.getBlockForm(block),\n      loadOptions: (...args) => client.loadBlockOptions(...args),\n      testTrigger: () => client.testTrigger(workflowId, driveId),\n      testStep: (stepId) => client.testStep(workflowId, stepId, driveId),\n      webhookEndpoint: () => client.fetchWebhookEndpoint(workflowId, driveId),\n      connectionScope: driveConnections ?? undefined,\n      listConnections: () =>\n        client.fetchConnections().then((connections) => {\n          if (driveConnections === null) return connections;\n          const inDrive = new Set(driveConnections.split(\",\").filter(Boolean));\n          return connections.filter((connection) => inDrive.has(connection.id));\n        }),\n      latestRun: () =>\n        client\n          .fetchRuns({\n            workflowId,\n            limit: LATEST_RUN_WINDOW,\n            excludeTriggerKinds: [TEST_TRIGGER_KIND],\n          })\n          .then((runs) => realRuns(runs).at(0) ?? null),\n      fetchRun: (runId) => client.fetchRun(runId),\n      blockResolutions: () => client.blockResolutions(workflowId),\n      secrets: {\n        save: ({ ref, value, label }) =>\n          ref\n            ? actions.rotateSecret(ref, value)\n            : actions.createSecret(value, label),\n        stat: (ref) => client.fetchSecretStat(ref),\n      },\n    }),\n    [client, actions, workflowId, driveId, driveConnections],\n  );\n\n  // Scope for the {} picker: last test samples first, then journaled outputs\n  // from the latest run, then authored shapes (declared types as leaves).\n  const scopeSource = useMemo<ExpressionScopeSource>(\n    () => ({\n      load: async ({ stepId }) => {\n        // Trigger config fields run before any step; nothing to reference.\n        if (!stepId) return EMPTY_SCOPE;\n        const latestRun = await queryClient\n          .fetchQuery(\n            runsQuery(client, { workflowId, limit: LATEST_RUN_WINDOW }),\n          )\n          .then(\n            (runs) => runs[0],\n            () => undefined,\n          );\n        return buildExpressionScope({\n          model,\n          stepId,\n          latestRun,\n          authoredOutput: (block, config) =>\n            authoredOutput({ client, queryClient }, block, config),\n          testOutput: async (blockId) => {\n            const block =\n              model.trigger?.id === blockId\n                ? model.trigger\n                : model.steps.find((step) => step.id === blockId);\n            const tree = await queryClient.fetchQuery(\n              stepOutputTreeQuery(\n                client,\n                workflowId,\n                blockId,\n                block?.lastTest?.testedAt ?? null,\n              ),\n            );\n            return tree.source === \"test\" && tree.testedAt\n              ? { value: tree.sample, testedAt: tree.testedAt }\n              : undefined;\n          },\n        });\n      },\n    }),\n    [client, queryClient, model, workflowId],\n  );\n\n  return (\n    <DesignTimeProvider\n      service={designTime}\n      queryClient={queryClient}\n      scope={client.url}\n    >\n      <ExpressionScopeSourceProvider value={scopeSource}>\n        <div className=\"flex h-full min-h-0 flex-col bg-background\">\n          <WorkflowEditorApp\n            model={model}\n            callbacks={callbacks}\n            leading={<BackButton />}\n            trailing={\n              <>\n                <LastRunFact workflowId={workflowId} />\n                <UndoRedo documentId={workflowId} policy={WORKFLOW_UNDO} />\n              </>\n            }\n          />\n        </div>\n      </ExpressionScopeSourceProvider>\n    </DesignTimeProvider>\n  );\n}\n\n// A drive node can point at a document the reactor cannot serve; the document\n// hooks throw for it. The boundary keeps that failure inside the editor pane.\nexport default function Editor() {\n  const documentId = useSelectedDocumentId();\n  return (\n    <DocumentErrorBoundary documentId={documentId}>\n      <WorkflowRuntimeProvider>\n        <WorkflowEditor />\n      </WorkflowRuntimeProvider>\n    </DocumentErrorBoundary>\n  );\n}\n"],"x_google_ignoreList":[25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143],"mappings":";;;;;;;;;;;;;;;;AAMA,SAAS,YAAY,MAAc,IAAqB;CACtD,IAAI,KAAK,SAAS,cAAc,KAAK,SAAS,eAAe,OAAO;CACpE,OAAQ,KAAK,OAAwC,OAAO;AAC9D;AAIA,MAAa,gBAA4B;CACvC,sBAAM,IAAI,IAAI,CAAC,iBAAiB,cAAc,CAAC;CAC/C,SAAS,QAAQ,WAAW;EAC1B,IAAI,OAAO,SAAS,iBAAiB;GACnC,MAAM,QAAQ,OAAO;GAGr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