diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..8d9ad3005 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Generated bundles may preserve whitespace inside dependency template literals. +frontend/dist/assets/*.js -whitespace diff --git a/.github/workflows/Benchmarks.yml b/.github/workflows/Benchmarks.yml index 381e2742d..cdaba191a 100644 --- a/.github/workflows/Benchmarks.yml +++ b/.github/workflows/Benchmarks.yml @@ -3,23 +3,109 @@ on: pull_request_target: branches: [ main ] workflow_dispatch: + inputs: + full_performance: + description: Run the complete downstream performance workflow + required: false + default: false + type: boolean permissions: pull-requests: write + contents: read jobs: bench: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }} + if: ${{ github.event_name != 'workflow_dispatch' || !inputs.full_performance }} + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ + github.event_name }} runs-on: ${{ matrix.os }} timeout-minutes: 60 + env: + PSE_BENCHMARK_INCLUDE_DOWNSTREAM: "false" strategy: fail-fast: false matrix: version: - - "1" + - "1.12.1" os: - ubuntu-latest + arch: + - x64 steps: - uses: MilesCranmer/AirspeedVelocity.jl@action-v1 with: julia-version: ${{ matrix.version }} bench-on: ${{ github.event.pull_request.head.sha }} - extra-pkgs: https://github.com/PalmStudio/XPalm.jl,https://github.com/VEZY/PlantBiophysics.jl \ No newline at end of file + + plantbiophysics: + if: ${{ github.event_name != 'workflow_dispatch' || !inputs.full_performance }} + name: PlantBiophysics multi-timestep + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + env: + JULIA_NUM_THREADS: "1" + JULIA_PKG_PRECOMPILE_AUTO: "0" + PSE_PLANTBIOPHYSICS_BENCHMARK_STEPS: "1000" + PSE_PLANTBIOPHYSICS_BENCHMARK_SAMPLES: "5" + PSE_PLANTBIOPHYSICS_FANOUT_SCENES: "20" + steps: + - name: Check out PlantSimEngine + uses: actions/checkout@v7 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + + - name: Check out PlantBiophysics + uses: actions/checkout@v7 + with: + repository: VEZY/PlantBiophysics.jl + ref: multi-plant + path: downstream/PlantBiophysics + + - name: Set up Julia + uses: julia-actions/setup-julia@v3 + with: + version: "1.12.1" + + - name: Cache Julia packages + uses: julia-actions/cache@v3 + + - name: Resolve the PlantBiophysics benchmark environment + shell: julia --project=benchmark --color=yes {0} + run: | + using Pkg + + benchmark_project = joinpath(pwd(), "benchmark", "Project.toml") + include(joinpath(pwd(), "benchmark", "prepare_full_performance_project.jl")) + prepare_plantbiophysics_performance_project!(benchmark_project) + Pkg.activate(joinpath(pwd(), "benchmark")) + Pkg.develop([ + PackageSpec(path=pwd()), + PackageSpec(path=joinpath(pwd(), "downstream", "PlantBiophysics")), + ]) + Pkg.resolve() + Pkg.instantiate() + Pkg.precompile() + + - name: Run the warmed multi-timestep benchmark + run: >- + julia --project=benchmark --color=yes + benchmark/test/runtests.jl + "PlantBiophysics benchmark (API smoke|performance)" + + - name: Persist measurements + if: always() + uses: actions/upload-artifact@v7 + with: + name: plantbiophysics-performance-${{ github.run_id }}-${{ github.run_attempt }} + path: benchmark/results/plantbiophysics-full-latest.csv + if-no-files-found: warn + retention-days: 30 + + full-performance: + if: ${{ github.event_name == 'workflow_dispatch' && inputs.full_performance }} + uses: ./.github/workflows/FullPerformance.yml + with: + xpalm_ref: codex/xpalm-release-regression + plantbiophysics_ref: multi-plant + plantgeom_ref: plantsimengine-multi-plant diff --git a/.github/workflows/FullPerformance.yml b/.github/workflows/FullPerformance.yml new file mode 100644 index 000000000..1a1afcac5 --- /dev/null +++ b/.github/workflows/FullPerformance.yml @@ -0,0 +1,139 @@ +name: Full downstream performance + +on: + schedule: + - cron: "17 2 * * *" + push: + tags: + - "v*" + workflow_dispatch: + inputs: + xpalm_ref: + description: XPalm branch, tag, or commit + required: true + default: main + type: string + plantbiophysics_ref: + description: PlantBiophysics branch, tag, or commit + required: true + default: master + type: string + plantgeom_ref: + description: PlantGeom branch, tag, or commit + required: true + default: plantsimengine-multi-plant + type: string + workflow_call: + inputs: + xpalm_ref: + description: XPalm branch, tag, or commit + required: false + default: main + type: string + plantbiophysics_ref: + description: PlantBiophysics branch, tag, or commit + required: false + default: master + type: string + plantgeom_ref: + description: PlantGeom branch, tag, or commit + required: false + default: plantsimengine-multi-plant + type: string + +permissions: + contents: read + +concurrency: + group: full-downstream-performance-${{ github.ref }} + cancel-in-progress: false + +jobs: + full-downstream-performance: + name: PlantBiophysics and XPalm + runs-on: ubuntu-24.04 + timeout-minutes: 45 + env: + JULIA_NUM_THREADS: "1" + JULIA_PKG_PRECOMPILE_AUTO: "0" + PSE_BENCHMARK_INCLUDE_DOWNSTREAM: "true" + PSE_PLANTBIOPHYSICS_BENCHMARK_STEPS: "8760" + PSE_PLANTBIOPHYSICS_BENCHMARK_SAMPLES: "10" + PSE_PLANTBIOPHYSICS_FANOUT_SCENES: "100" + steps: + - name: Check out PlantSimEngine + uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + + - name: Check out XPalm + uses: actions/checkout@v6 + with: + repository: PalmStudio/XPalm.jl + ref: ${{ inputs.xpalm_ref || 'main' }} + path: downstream/XPalm + + - name: Check out PlantBiophysics + uses: actions/checkout@v6 + with: + repository: VEZY/PlantBiophysics.jl + ref: ${{ inputs.plantbiophysics_ref || 'master' }} + path: downstream/PlantBiophysics + + - name: Check out PlantGeom + uses: actions/checkout@v6 + with: + repository: VEZY/PlantGeom.jl + ref: ${{ inputs.plantgeom_ref || 'plantsimengine-multi-plant' }} + path: downstream/PlantGeom + + - name: Set up Julia + uses: julia-actions/setup-julia@v3 + with: + version: "1.12.1" + + - name: Cache Julia packages + uses: julia-actions/cache@v3 + + - name: Resolve and instantiate the benchmark environment + shell: julia --project=benchmark --color=yes {0} + run: | + using Pkg + + benchmark_project = joinpath(pwd(), "benchmark", "Project.toml") + include(joinpath(pwd(), "benchmark", "prepare_full_performance_project.jl")) + prepare_full_performance_project!(benchmark_project) + Pkg.activate(joinpath(pwd(), "benchmark")) + Pkg.develop([ + PackageSpec(path=pwd()), + PackageSpec(path=joinpath(pwd(), "downstream", "XPalm")), + PackageSpec(path=joinpath(pwd(), "downstream", "PlantBiophysics")), + PackageSpec(path=joinpath(pwd(), "downstream", "PlantGeom")), + ]) + Pkg.resolve() + Pkg.instantiate() + Pkg.precompile() + + - name: Run the PlantBiophysics API and performance benchmark + run: >- + julia --project=benchmark --color=yes + benchmark/test/runtests.jl + "PlantBiophysics benchmark (API smoke|performance)" + + - name: Run the complete XPalm performance and correctness matrix + run: >- + julia --project=benchmark --color=yes + benchmark/test/runtests.jl + "XPalm staged performance profile full" + + - name: Persist measurements and the resolved environment + if: always() + uses: actions/upload-artifact@v4 + with: + name: downstream-full-performance-${{ github.run_id }}-${{ github.run_attempt }} + path: | + benchmark/results/plantbiophysics-full-latest.csv + benchmark/results/xpalm-full-latest.csv + benchmark/Manifest.toml + if-no-files-found: warn + retention-days: 90 diff --git a/.gitignore b/.gitignore index a7d1af9c5..9228d1f28 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,8 @@ docs/Manifest.toml test/Manifest.toml docs/build/ benchmark/Manifest.toml -frontend/node_modules/ -docs/src/www/simple_dependency_graph.html +benchmark/results/ +/frontend/node_modules/ +/frontend/.vite/ +/frontend/test-results/ +/frontend/playwright-report/ diff --git a/AGENTS.md b/AGENTS.md index 119f35fd3..a660dda6a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,340 +1,224 @@ # PlantSimEngine Agent And Developer Guide -This file is the maintainer-facing summary of how PlantSimEngine works internally. -It is meant for humans and coding agents making changes to the package. - -PlantSimEngine is a Julia engine for composing process models on either: - -- a single shared status (`ModelMapping{SingleScale}` / legacy `ModelList`) -- a multiscale MTG scene (`GraphSimulation`) - -The package is built around four ideas: - -1. Models declare `inputs_`, `outputs_`, and optionally `dep`. -2. The engine compiles a dependency graph from those declarations. -3. Runtime state is reference-based (`Status`, `RefVector`), so coupling is often aliasing, not copying. -4. Multiscale and multirate configuration can change where an input comes from, how it is transported, and when it is sampled. - -## What The Package Supports - -- Single-scale process composition with automatic soft-dependency inference. -- Hard dependencies declared explicitly and called manually from model code. -- MTG-based multiscale simulations with cross-scale variable mappings. -- Cross-scale scalar sharing through shared `Ref`s. -- Cross-scale multi-node sharing through `RefVector`s. -- Cross-scale writes, where a variable computed at one scale is materialized as an input at another scale. -- Same-scale variable aliasing and renaming. -- Cycle breaking through `PreviousTimeStep`. -- Multi-rate execution through `ModelSpec`, `ClockSpec`, and temporal policies. -- Explicit or inferred `InputBindings` between producers and consumers. -- Meteo resampling/aggregation per model in multi-rate MTG runs. -- Output routing (`:canonical` vs `:stream_only`) and online output export (`OutputRequest`). -- Parallel single-scale execution when model traits allow it. - -## Core Runtime Objects - -### Processes and models - -- All models subtype `AbstractModel`. -- `@process` creates an abstract process type such as `AbstractGrowthModel`. -- Process identity comes from the abstract process type, not the concrete model name. -- The model execution contract is: +PlantSimEngine composes process models over a unified composite-model/object registry. +The repository contains one scenario compiler and runtime: the composite-model/object +API. + +## Core Model Contract + +- Every model subtypes `AbstractModel`. +- `@process` defines the abstract process type. +- `process(model)` identifies the process. +- `inputs_(model)` and `outputs_(model)` declare status variables. +- `environment_inputs_(model)` and `environment_outputs_(model)` declare environment + variables. +- `dep(model)` optionally returns model-author defaults using `Input(...)` and + `Call(...)`. +- Kernels implement: ```julia -PlantSimEngine.run!(model, models, status, meteo, constants, extra) +PlantSimEngine.run!(model, status, environment, constants, context) ``` -- `inputs_(model)` and `outputs_(model)` are the authoritative declarations. -- `variables(model)` is `merge(inputs_(model), outputs_(model))`. -- Do not rely on a variable being both an input and an output under the same name: `merge` means the later declaration wins. - -### Status - -- `Status` is a wrapper around a `NamedTuple` of `Ref`s. -- Reading a field dereferences it. Writing a field mutates the underlying `Ref`. -- This aliasing behavior is intentional and is the basis of most coupling. -- In single-scale runs, vector-valued user inputs are flattened to one timestep value and updated per timestep with `set_variables_at_timestep!`. - -### RefVector - -- `RefVector` is an `AbstractVector` of `Base.RefValue`s. -- It is used when one model input must see a vector of references coming from many statuses. -- Reading a `RefVector` dereferences each underlying status cell. -- Writing into a `RefVector` mutates the source statuses. -- `RefVector` order follows MTG traversal order during initialization, not a semantic plant order. - -### Mapping wrappers - -- `MultiScaleModel` wraps one model plus a multiscale mapping declaration. -- `ModelSpec` wraps one model plus scenario-level runtime configuration: - `multiscale`, `timestep`, `input_bindings`, `meteo_bindings`, `meteo_window`, `output_routing`, and `scope`. -- `ModelMapping` is the normalized mapping container used by current entry points. -- Legacy `ModelList` still exists, but it is compatibility plumbing and should not be treated as the main abstraction for new work. - -### Simulation wrappers - -- `DependencyGraph` holds root dependency nodes plus unresolved dependencies. -- `GraphSimulation` holds the MTG, statuses, status templates, reverse mappings, dependency graph, models, model specs, outputs, and temporal state. - -## Dependency Graph Under The Hood +Read the current model's parameters directly from `model`. `context` is a +`RunContext` and provides `run_call!`, `call_targets`, and lifecycle access. -### Hard dependencies +## CompositeModel Structure -- Hard dependencies are declared with `dep(::ModelType)`. -- A hard dependency means: "this model directly calls another model from inside its own `run!` implementation." -- Hard dependencies are represented by `HardDependencyNode`. -- They are executed manually by the parent model. The runtime does not automatically recurse into hard dependencies. -- Hard dependencies can be same-scale or explicitly multiscale. +- `CompositeModel` owns a `ObjectRegistry`, model applications, instances, and an + environment. +- `Object` is one runtime entity with stable `ObjectId`, labels, parent, + geometry, and `Status`. +- Plant architecture is not prescribed. Users choose scales and topology. +- `CompositeModelTemplate` and `ObjectInstance` reuse the same model definitions across + several plants or objects. +- `Override` replaces one application model for selected objects without + splitting the logical application. +- `objects_from_mtg` and `CompositeModel(mtg; ...)` adapt MTG topology into the same + registry. -Important nuance: +## Model Applications -- A hard dependency does not become an independent soft-dependency node under the parent. -- But it still matters for graph construction, because the graph compiler aggregates the root model's hard-dependency subtree when computing that root's effective inputs and outputs. -- In multiscale graph building, if another model depends on a process that exists only as a nested hard dependency, the code resolves that dependency back to the master soft node that owns that hard subtree. +Use one configuration grammar: -So "hard dependencies do not directly participate in the soft graph" is true for execution structure, but false if interpreted as "their IO is irrelevant to graph compilation." - -### Soft dependencies - -- Soft dependencies are inferred by matching model inputs against outputs. -- Matching is name-based after variable flattening, not based on a richer semantic contract. -- Same-scale soft dependencies are built after hard-dependency trees are known. -- A process cannot also list one of its hard dependencies as a soft dependency. -- `PreviousTimeStep` variables are removed from current-step soft dependency inference. -- Soft dependencies are represented by `SoftDependencyNode`. -- A soft node may have multiple parents. -- A node is considered runnable once all of its parent nodes have already run for the current traversal. -- If no producer output matches an input, no soft edge is added. Soft-edge construction does not itself fail on missing producers. - -### Single-scale graph build - -Single-scale graph construction is: - -1. Build `HardDependencyNode`s for each declared process. -2. Attach explicit hard-dependency children under their parents. -3. Traverse each hard-dependency root and collect its effective inputs and outputs. -4. Build one `SoftDependencyNode` per hard-dependency root. -5. Infer parent and child links by matching inputs to outputs. - -### Multiscale graph build - -Multiscale graph construction is more involved: - -1. Normalize the user mapping into `ModelMapping`. -2. Build per-scale hard-dependency graphs. -3. Resolve multiscale hard dependencies declared across scales. -4. Compute per-scale effective inputs and outputs for each hard-dependency root. -5. Build one `SoftDependencyNode` per root process per scale. -6. Compile mapped variables and reverse mappings. -7. Infer same-scale soft dependencies. -8. Infer cross-scale soft dependencies from mapped variables and reverse mappings. -9. If a dependency points to a nested hard dependency, redirect it to the owning soft node. -10. Check the final graph for cycles. - -### Cycle handling - -- The graph is expected to be acyclic. -- The official way to break a same-step cycle is `PreviousTimeStep`. -- `PreviousTimeStep` breaks cycles by suppressing current-step edge creation, not by adding special scheduler logic. -- In multiscale runs, cycle detection happens after the cross-scale graph is assembled. -- Single-scale `dep(...)` relies mostly on builder-time guards. Multiscale `dep(mapping)` also runs an explicit global cycle check on the final soft graph. - -## Multiscale Mapping Model - -### Mapping modes - -PlantSimEngine distinguishes three mapping modes: - -- `SingleNodeMapping(scale)`: one scalar value is read from one source scale. -- `MultiNodeMapping(scales)`: one input reads a vector of values from many source nodes. -- `SelfNodeMapping()`: a source scale must expose a scalar reference to itself so other scales can share it. - -The runtime carrier is `MappedVar`, which stores: - -- the mapping mode -- the local variable name -- the source variable name -- the resolved default value +```julia +ModelSpec(model; name=:application, on=selector, inputs=(...), calls=(...), every=Dates.Hour(1), environment=Environment(...)) +``` -### Supported mapping forms +- `on` selects where the model runs. +- `inputs` declares value dependencies. +- `calls` declares manually executable hard dependencies. +- `Updates(:x; after=:producer)` orders intentional duplicate writers. +- `output_routing=(x=:stream_only,)` excludes an output from canonical + ownership while retaining its stream. -These are the important user-level forms and what they become internally: +## Selectors -| User form | Meaning | Runtime shape | -| --- | --- | --- | -| `:x => :Plant` | scalar read from one `:Plant` node | shared `Ref` | -| `:x => (:Plant => :y)` | scalar read with renaming | shared `Ref` | -| `:x => [:Leaf]` | vector read from all `:Leaf` nodes | `RefVector` | -| `:x => [:Leaf, :Internode]` | vector read from several scales | `RefVector` | -| `:x => [:Leaf => :a, :Internode => :b]` | vector read with per-scale renaming | `RefVector` | -| `PreviousTimeStep(:x) => ...` | lagged mapping, excluded from same-step dependency build | lagged input | -| `PreviousTimeStep(:x)` | pure cycle-breaking marker | local/default value | -| `:x => (Symbol(\"\") => :y)` | same-scale rename | `RefVariable` alias | +Multiplicity: + +- `One(...)` +- `OptionalOne(...)` +- `Many(...)` + +Scope and topology: -### Mapping compilation pipeline +- `SceneScope()` +- `Self()`: the current object +- `Subtree()`: the current object and its descendants +- `SelfPlant()`: the current plant instance/root +- `Ancestor(...)` +- `Scope(name)` +- `Relation(...)` -`mapped_variables(...)` does not just mirror user syntax. It compiles it. +Use keyword criteria for object labels: `kind=:plant`, `species=:oil_palm`, +`scale=:Leaf`, and `name=:leaf_1`. -The main passes are: +`Self()` never means the model, species, or plant unless the current object is +itself that plant. -1. Start from effective per-scale inputs and outputs collected from hard-dependency roots. -2. Add variables that are outputs of one scale but must appear as inputs at another scale. -3. Convert scalar cross-scale reads into self-mapped outputs on the source scale so one shared `Ref` exists. -4. Resolve default values recursively back to the ultimate producer. -5. Convert mapping descriptors into runtime carriers: - - scalar mappings become shared `Ref`s - - multi-node mappings become empty `RefVector`s - - same-scale renames become `RefVariable` +## Value Coupling -### Reverse mapping and status wiring +The compiler resolves `ModelSpec(...; inputs=...)` to reference carriers: -- Reverse mapping is computed before the reference conversion pass. -- Reverse mapping answers: "when a source node is initialized, which target scale/vector inputs should receive a reference to this source variable?" -- Reverse mapping excludes scalar `SingleNodeMapping` edges when `all=false`, because scalar sharing is already handled by shared `Ref`s. +- one source uses a shared `Ref`; +- many homogeneous sources use `RefVector`; +- heterogeneous sources use `ObjectRefVector`; +- temporal policies read typed output streams. -During `init_node_status!`: +Use `Diagnostics.input_carrier`, `Diagnostics.input_value`, `Diagnostics.explain_bindings`, and +`Diagnostics.has_reference_carrier` instead of inspecting internal fields. -1. A copy of the scale template is made. -2. `:node => Ref(node)` is injected. -3. Remaining uninitialized variables may be filled from MTG attributes. -4. The template becomes a `Status`. -5. The status is pushed into `statuses[scale]`. -6. If this node feeds any downstream `RefVector`, its `Ref`s are pushed into those target vectors. -7. The status is stored on the MTG node under `:plantsimengine_status`. +Same-object input/output matches are inferred when unique. Cross-object +coupling should be explicit with `ModelSpec(...; inputs=...)`. -### Copies vs references +## Hard Calls -- MTG attribute initialization copies plain values into the status. -- If the MTG attribute itself is already a `Ref`, that `Ref` is preserved. -- The runtime cannot create a live reference directly into a dict-backed MTG attribute. -- Cross-scale sharing is reference-based once the status exists. +Hard dependencies are parent-controlled: -## Multi-Rate Runtime - -Multi-rate behavior is layered on top of the multiscale MTG runtime. +1. Declare them with model-level `Call(...)` or scenario-level `ModelSpec(...; calls=...)`. +2. Execute all resolved targets with `run_call!(context, name)`. It always + returns a vector-like `CallTargets` collection. +3. For selective or iterative execution, inspect `call_targets(context, name)` + and execute individual `CallTarget`s with `run_call!`. -### Timing and policies +`run_call!` defaults to `publish=false`, which is appropriate for iterative +trial states. Publish only the accepted state with `publish=true`. -- `timespec(model)` defines the model's default clock. The default is `ClockSpec(1.0, 0.0)`. -- `ModelSpec.timestep` can override runtime clock selection. -- `output_policy(model)` declares per-output temporal policy defaults. - -Supported schedule policies are: - -- `HoldLast()`: use the latest available producer value. -- `Interpolate()`: interpolate or hold/extrapolate producer streams. -- `Integrate()`: reduce values over the consumer window, default reducer is `SumReducer()`. -- `Aggregate()`: reduce values over the consumer window, default reducer is `MeanReducer()`. +Applications used exclusively as call targets are not run by the root +scheduler and do not receive inferred soft bindings. -### ModelSpec configuration surface +## Time -`ModelSpec` is the configuration point for scenario-specific runtime behavior. +- `ModelSpec(...; every=Dates.Period)` configures application cadence. +- `timespec(model)` provides a model default. +- `timestep_hint(model)` validates compatibility when cadence comes from the + environment base step. +- `HoldLast`, `Interpolate`, `Integrate`, and `Aggregate` configure temporal + input policies. +- `PreviousTimeStep(:x)` breaks same-step cycles. -It can define: +Dates periods are converted using meteorology `duration`. Model code should not +know its scenario timestep unless the scientific model explicitly requires it. -- `multiscale`: mapping declaration -- `timestep`: runtime clock -- `input_bindings`: explicit producer selection for consumer inputs -- `meteo_bindings`: per-model weather aggregation -- `meteo_window`: weather window selection strategy -- `output_routing`: `:canonical` or `:stream_only` -- `scope`: `:global`, `:self`, `:plant`, `:scene`, `ScopeId`, or callable +## Environment -### Input binding inference +- `Environment(...)` configures provider selection and source remapping. +- Global meteorology and spatial backends use the same model-facing contract. +- Spatial object-to-environment handles are compiled and cached. +- `move_object!`, `update_geometry!`, or + `mark_environment_binding_dirty!` invalidate affected bindings. +- `run_call!(context, name; environment=trial_state)` samples transient + backend-specific state through each target's compiled handle. +- `environment_outputs_` declares environment variables a controller may commit, and + `commit_environment!` commits only the accepted state. -- If explicit `InputBindings` are absent, the package tries to infer bindings from the dependency graph and mapping. -- Unique same-scale producers win first. -- Unique cross-scale producers are accepted when unambiguous. -- Existing multiscale mapping hints can disambiguate some cross-scale cases. -- Ambiguity is an error and must be resolved explicitly. - -### Runtime sequence in multi-rate MTG mode - -For each dependency node and each status at that node's scale: - -1. Decide whether the model should run at the current time according to its clock. -2. Resolve consumer inputs from temporal state with explicit or inferred bindings. -3. Sample or aggregate meteo for the model. -4. Call the model's `run!`. -5. Publish outputs back into temporal caches and streams. -6. Materialize any requested online exports. - -Important consequences: - -- In non-multirate MTG runs, cross-scale coupling is mostly direct aliasing through shared refs. -- In multirate MTG runs, temporal state can overwrite consumer inputs just before execution. -- Multi-rate MTG runs are currently forced to sequential execution. - -## Configurations Developers Must Keep In Mind - -A variable seen by a model may be in any of these supported configurations: +## Lifecycle -- Plain local status value initialized by the user. -- Plain local status value initialized from MTG node attributes. -- Output computed locally at the same scale. -- Same-scale alias of another local variable through `RefVariable`. -- Scalar value mapped from another scale through a shared `Ref`. -- Vector of references mapped from one or many other scales through `RefVector`. -- Output computed at one scale and written into another scale, which means it is injected as an input on the receiving scale during mapping compilation. -- Value marked as `PreviousTimeStep`, which removes it from same-step dependency inference. -- Input resolved from a hard dependency that is called manually inside another model. -- Input resolved from temporal streams instead of directly from the current status value. -- Input bound explicitly with `InputBindings`. -- Input bound implicitly by inference from producers and mappings. -- Input sampled with `HoldLast`, `Interpolate`, `Integrate`, or `Aggregate`. -- Output published canonically into status state. -- Output published as `:stream_only`, meaning it participates in temporal streams but not canonical output ownership. -- Value partitioned by scope (`:global`, `:self`, `:plant`, `:scene`, or custom scope function). +- `add_organ!` is the high-level operation for MTG-backed growth. It creates + the node, reuses the model's MTG status policy, applies initial values, + attaches the status, and registers the object. +- `register_object!`, `remove_object!`, and `reparent_object!` mutate topology. +- Use `register_object!` directly only when the caller already owns a fully + initialized `Object`. +- Structural changes refresh application targets, value carriers, call + targets, writer checks, and schedules after the application that made the + change; new objects can run applications that remain later in the timestep. +- Geometry changes refresh only affected environment bindings when possible. +- Removed objects keep their historical output samples. + +## Outputs -When changing dependency, mapping, or runtime code, assume all of these modes can exist in the same simulation. - -## Execution Semantics And Important Caveats - -- Soft-dependency order controls model order. MTG topology does not define execution order within a scale. -- Within one scale, execution order follows the order of `statuses[scale]`, which comes from MTG traversal at initialization time. -- `SingleNodeMapping` assumes the source node is unique at runtime. The mapping layer does not enforce uniqueness. -- `RefVector` ordering is traversal order, not a guaranteed biological ordering. -- Hard dependencies are manual calls. If model code stops calling them, the declared hard dependency no longer executes. -- Hard dependencies still influence graph compilation through their effective inputs and outputs. -- Multiscale redirection from nested hard dependencies back to the owning soft node is implemented with upward walking through parent links and a defensive depth guard. Treat that path as fragile. -- MTG topology changes after `init_statuses` leave `statuses`, node attributes, and populated `RefVector`s stale. Reinitialize after topology changes. -- Same-scale renaming does not create a graph-wide shared ref. It creates a per-status alias. -- `parent_vars` is dependency metadata, not a full provenance graph, and in multiscale builds it can be overwritten when a node has both same-scale and cross-scale parents. -- Duplicate canonical publishers for one `(scale, variable)` are invalid in multi-rate mode unless non-canonical producers are marked `:stream_only`. -- User `extra` arguments are not allowed in MTG runs because `GraphSimulation` already occupies that slot. -- String scale names still work in many places but are deprecated. Prefer `Symbol` scales. -- `ModelList` is deprecated as the primary API. Prefer `ModelMapping`. -- `run_node_multiscale!` currently uses `node.simulation_id[1]` as the visitation guard. Treat that code carefully if you touch traversal semantics. -- Some variable collection helpers use set-like flattening, so collection order is not always stable. Do not attach semantics to incidental variable ordering. +- `run!(model; outputs=:none)` starts a fresh timeline and returns + `Simulation`; use `outputs=:all` or output requests to retain streams. +- `continue!(simulation)` and `step!(simulation)` advance the same timeline. +- `final_state(simulation)` returns the latest one-object status snapshot; + pass an object id or selector for multi-object simulations. +- `outputs(sim)` exposes retained typed streams. +- `OutputRequest` selects retained/resampled outputs. +- `collect_outputs(sim)` materializes output rows. +- `Diagnostics.explain_output_retention(sim)` reports why each stream is retained. + +Streams are keyed by application, object, and variable so repeated processes do +not overwrite each other. + +## Performance Rules + +- Keep model parameters and status values generic; do not force `Float64`. +- Preserve concrete model, status, carrier, and stream types. +- Do not copy values when a reference carrier is sufficient. +- Keep dynamic dispatch at compiled batch boundaries, not per object. +- Preserve cached hard-call targets and homogeneous execution batches. +- Test allocations for hot loops that run over many organs. ## High-Signal Files -- `src/PlantSimEngine.jl`: module layout and exports. -- `src/Abstract_model_structs.jl`: `AbstractModel` and `process`. -- `src/processes/process_generation.jl`: `@process`. -- `src/processes/models_inputs_outputs.jl`: model declarations and runtime traits. -- `src/variables_wrappers.jl`: `UninitializedVar`, `PreviousTimeStep`, `RefVariable`. -- `src/component_models/Status.jl`: reference-based status container. -- `src/component_models/RefVector.jl`: vector of references. -- `src/dependencies/*`: hard and soft dependency graph construction and traversal. -- `src/mtg/MultiScaleModel.jl`: mapping syntax normalization. -- `src/mtg/ModelSpec.jl`: runtime configuration wrapper. -- `src/mtg/mapping/*`: mapping compilation, reverse mapping, initialization helpers. -- `src/mtg/initialisation.jl`: status creation and MTG wiring. -- `src/mtg/GraphSimulation.jl`: simulation wrapper. -- `src/time/multirate.jl`: clocks, policies, temporal storage types. -- `src/time/runtime/*`: input resolution, scopes, publishers, meteo sampling, output export. -- `src/run.jl`: single-scale and multiscale execution. - -## Practical Rule For Future Changes - -If you change dependency, mapping, or runtime behavior, re-check all of these questions: - -1. Does it still work for both single-scale and MTG runs? -2. Does it preserve aliasing semantics for `Status` and `RefVector`? -3. Does it preserve the distinction between hard dependencies and soft dependencies? -4. Does it still handle scalar mappings, vector mappings, same-scale aliasing, and cross-scale writes? -5. Does it still behave correctly with `PreviousTimeStep`? -6. Does it still work when input bindings are inferred instead of explicit? -7. Does it still work in multi-rate mode with temporal policies and scoped streams? -8. Does it remain correct if the producer is nested under a hard dependency? +- `src/composite_model_api.jl`: dependency-ordered include boundary for the sole + CompositeModel/Object compiler and runtime. +- `src/composite_model/registry_topology.jl`: objects, registry, templates, + instances, overrides, topology, and lifecycle ownership. +- `src/composite_model/selectors.jl`: selector normalization and resolution. +- `src/composite_model/compilation.jl`: applications, carriers, calls, writer + validation, schedules, and structured compilation explanations. +- `src/composite_model/environment_bindings.jl`: global/spatial environment + bindings and invalidation. +- `src/composite_model/runtime_outputs.jl`: execution, temporal streams, hard-call + publication, retention, and output collection. +- `src/composite_model/scenario_dsl.jl`: small scenario construction helpers. +- `src/ModelSpec.jl`: model application configuration. +- `src/component_models/Status.jl`: reference-based status. +- `src/component_models/RefVector.jl`: homogeneous reference vectors. +- `src/time/multirate.jl`: clocks and temporal policies. +- `src/time/runtime/clocks.jl`: Dates-based timing. +- `src/time/runtime/environment_sampling.jl`: model-facing environment sampling. +- `src/time/runtime/environment_backends.jl`: environment backend contract. +- `test/test-unified-model-object-api.jl`: broad integration coverage. +- `test/test-model-*.jl`: focused CompositeModel/Object behavioral contracts. + +## Change Checklist + +When changing compilation or runtime behavior, verify: + +1. one object and many objects; +2. same-object and cross-object inputs; +3. `One`, `OptionalOne`, and `Many`; +4. hard calls and iterative publication; +5. duplicate writers and `Updates`; +6. multirate policies and `PreviousTimeStep`; +7. global and spatial environments; +8. object creation, removal, reparenting, and movement; +9. templates, instances, and overrides; +10. generic numeric types and allocation-sensitive execution. + +## API evolution policy + +This project is in active development and has no stable public API yet. + +When implementing API changes: + +- Do not preserve backward compatibility unless explicitly requested. +- Do not add deprecated aliases, compatibility wrappers, fallback methods, old keyword support, migration layers, or dual APIs. +- Prefer a clean breaking change over supporting both old and new APIs. +- Update all internal call sites, tests, and documentation to the new API. +- Remove obsolete code instead of keeping it. +- If existing tests fail because they expect the old API, update the tests to match the new API. +- Before adding compatibility code, stop and ask for confirmation. diff --git a/CHANGELOG.md b/CHANGELOG.md index 95527f37f..2bc275bcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## v0.15.0 + +### Breaking changes + +- Environment backends now compile an opaque per-target handle with + `bind_environment`. Accepted state is committed explicitly with + `commit_environment!`, while provider-aware trial state is passed with + `run_call!(context, name; environment=state)`. The former support/scatter, + scoped override, and context-level meteorology APIs were removed. +- Hard dependencies now execute through + `run_call!(context::RunContext, name::Symbol; ...)`, which executes every + selector-resolved target and always returns a vector-like `CallTargets` + collection. +- The singular hard-call accessor and string-name hard-call methods were + removed. Use `only(call_targets(context, :name))` for fine-grained access to + a `One` dependency. +- Direct recursive dependency execution is no longer supported. Model kernels + must run inside a compiled `CompositeModel` and receive a `RunContext`. + +### Added + +- `CallTargets`, a cached `AbstractVector` view over compiled hard-call targets + that is allocation-free to retrieve. +- `run_call!(context, name)` for the common execute-all operation while + retaining `run_call!(target::CallTarget)` for selective, per-target, and + iterative control. + ## v0.14.1 Changes in this section are based on the git history since [`v0.14.0`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/releases/tag/v0.14.0), corresponding to the GitHub compare view for [`v0.14.1`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/compare/v0.14.0...v0.14.1). @@ -27,7 +54,7 @@ working with PlantSimEngine internals. edges, variable dependency edges, scale filters, relationship filters, search, overview/detail modes, and an inspector. - An interactive browser-based graph editor through `edit_graph`, backed by a - local `HTTP.jl` server and WebSocket session. + local `HTTP.jl` server and WebSocket session. - The live graph editor runs as a package extension that depends on `HTTP.jl`; static graph visualization is available without loading `HTTP`. @@ -48,7 +75,7 @@ working with PlantSimEngine internals. - Visualization of required initialization values and graph diagnostics even when a mapping is incomplete or cyclic. - A new documentation page for graph visualization and editing: - [`docs/src/step_by_step/graph_visualization_editor.md`](docs/src/step_by_step/graph_visualization_editor.md). + [`docs/src/guides/graph_visualizer_editor.md`](docs/src/guides/graph_visualizer_editor.md). - Playwright end-to-end tests for the browser editor and new Julia tests for the static graph viewer and editor extension. - A local `plantsimengine` Codex skill describing the package architecture and @@ -80,7 +107,7 @@ and substantially expands the documentation. The main user-facing breaking change in this release is the move toward `Symbol`-based scale names in mappings and multi-scale configuration. Code that still uses string scales such as `"Leaf"` or `"Plant"` should be updated to use -symbols such as `:Leaf` and `:Plant`, especially in `ModelMapping(...)`, +symbols such as `:Leaf` and `:Plant`, especially in `PlantSimEngine.ModelMapping(...)`, `MultiScaleModel(...)`, and explicit multi-rate bindings. `ModelList` is also on the deprecation path in favor of `ModelMapping`, so this release is a good time to migrate mapping code to the newer API. @@ -95,7 +122,7 @@ to migrate mapping code to the newer API. `InputBindings`, `MeteoBindings`, `MeteoWindow`, `OutputRouting`, and `ScopeModel`. - New model traits for multi-rate inference and defaults: - `output_policy`, `timestep_hint`, and `meteo_hint`. + `output_policy`, `timestep_hint`, and `environment_hint`. - New export API for resampled output streams with `OutputRequest(...)` and `collect_outputs(...)`. - New debugging/introspection helpers: @@ -136,12 +163,12 @@ to migrate mapping code to the newer API. ### Deprecated -- `run!(::ModelList, ...)` is deprecated. Use `run!(ModelMapping(...), ...)` +- `run!(::ModelList, ...)` is deprecated. Use `run!(PlantSimEngine.ModelMapping(...), ...)` instead. - `run!` with collections of `ModelList` is deprecated. Use collections of `ModelMapping` instead. - `run!(mtg, mapping::AbstractDict, ...)` is deprecated. Construct a - `ModelMapping(...)` first, or call `run!(mtg, ModelMapping(mapping), ...)`. + `PlantSimEngine.ModelMapping(...)` first, or call `run!(mtg, PlantSimEngine.ModelMapping(mapping), ...)`. - String scale names are deprecated in multi-scale mapping APIs. Use `Symbol` scales such as `:Leaf` instead of `"Leaf"`. - `ModelList` remains available for now but is being phased out in favor of @@ -152,7 +179,7 @@ to migrate mapping code to the newer API. #### 1. Replace ad hoc mappings with `ModelMapping` If you previously used `ModelList(...)` directly for single-scale runs, or a -plain `Dict` for MTG runs, migrate to `ModelMapping(...)`. +plain `Dict` for MTG runs, migrate to `PlantSimEngine.ModelMapping(...)`. Before: @@ -172,13 +199,13 @@ mapping = Dict( After: ```julia -leaf = ModelMapping( +leaf = PlantSimEngine.ModelMapping( process1 = Process1Model(), process2 = Process2Model(), status = (x = 1.0,), ) -mapping = ModelMapping( +mapping = PlantSimEngine.ModelMapping( :Leaf => (ToyAssimModel(),), :Plant => (ToyGrowthModel(),), ) @@ -192,7 +219,7 @@ When a model should run at a cadence different from the meteo, wrap it in Typical pattern: ```julia -mapping = ModelMapping( +mapping = PlantSimEngine.ModelMapping( :Leaf => ( ModelSpec(HourlyLeafModel()) |> TimeStepModel(1.0), ), @@ -239,7 +266,7 @@ If your mappings still use string scales, migrate them to symbols. Before: ```julia -mapping = ModelMapping( +mapping = PlantSimEngine.ModelMapping( "Leaf" => (ToyAssimModel(),), ) @@ -250,7 +277,7 @@ MultiScaleModel([:A => "Leaf"]) After: ```julia -mapping = ModelMapping( +mapping = PlantSimEngine.ModelMapping( :Leaf => (ToyAssimModel(),), ) @@ -289,7 +316,7 @@ For reusable models, it is now often worth defining: - `output_policy(::Type{<:MyModel})` to describe the natural aggregation rule for a produced variable, - `timestep_hint(::Type{<:MyModel})` to declare valid/preferred cadences, -- `meteo_hint(::Type{<:MyModel})` to declare default weather aggregation rules. +- `environment_hint(::Type{<:MyModel})` to declare default environment aggregation rules. This is optional, but it makes inference more useful and error messages more actionable. diff --git a/Project.toml b/Project.toml index 364c8be5d..59f321b62 100644 --- a/Project.toml +++ b/Project.toml @@ -1,22 +1,18 @@ name = "PlantSimEngine" uuid = "9a576370-710b-4269-adf9-4f603a9c6423" -version = "0.14.1" +version = "0.15.0" authors = ["Rémi Vezy and contributors"] [deps] -AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" -DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" -FLoops = "cc61a311-1640-44b5-9fba-1b764f453329" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" MultiScaleTreeGraph = "dd4a991b-8a45-4075-bede-262ee62d5583" PlantMeteo = "4630fe09-e0fb-4da5-a846-781cb73437b6" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" Term = "22787eb5-b846-44ae-b979-8e399b8463ab" @@ -28,20 +24,16 @@ HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" PlantSimEngineGraphEditorExt = "HTTP" [compat] -AbstractTrees = "0.4" CSV = "0.10" -DataAPI = "1.15" DataFrames = "1" Dates = "1.10" -FLoops = "0.2" HTTP = "1, 2.0" InteractiveUtils = "1.10" -JSON = "1" +JSON = "1.6.1" Markdown = "1.10" MultiScaleTreeGraph = "0.15.1" PlantMeteo = "0.8.2" Random = "1.10" -SHA = "0.7.0" Statistics = "1.10" Tables = "1" Term = "2" diff --git a/README.md b/README.md index 39ae36e10..288e5c037 100644 --- a/README.md +++ b/README.md @@ -9,369 +9,228 @@ [![DOI](https://zenodo.org/badge/571659510.svg)](https://zenodo.org/badge/latestdoi/571659510) [![JOSS](https://joss.theoj.org/papers/137e3e6c2ddc349bec39e06bb04e4e09/status.svg)](https://joss.theoj.org/papers/137e3e6c2ddc349bec39e06bb04e4e09) -- [PlantSimEngine](#plantsimengine) - - [Overview](#overview) - - [Unique Features](#unique-features) - - [Automatic Model Coupling](#automatic-model-coupling) - - [Flexibility with Precision Control](#flexibility-with-precision-control) - - [Multi-rate Execution](#multi-rate-execution) - - [Batteries included](#batteries-included) - - [Ask Questions](#ask-questions) - - [Installation](#installation) - - [Example usage](#example-usage) - - [Simple example](#simple-example) - - [Model coupling](#model-coupling) - - [Multiscale modelling](#multiscale-modelling) - - [Multi-rate modelling](#multi-rate-modelling) - - [Projects that use PlantSimEngine](#projects-that-use-plantsimengine) - - [Performance](#performance) - - [Make it yours](#make-it-yours) +PlantSimEngine is a Julia framework for composing soil-plant-atmosphere +simulations from reusable process models. -## Overview +A modeler writes generic kernels with: -`PlantSimEngine` is a comprehensive framework for building models of the soil-plant-atmosphere continuum. It includes everything you need to **prototype, evaluate, test, and deploy** plant/crop models at any scale, with a strong emphasis on performance and efficiency, so you can focus on building and refining your models. +- `inputs_` declarations using `Required(T)` or `Default(value)` +- `outputs_` +- optional `dep`, `timespec`, `output_policy`, `environment_inputs_`, and + `environment_outputs_` traits +- `run!(model, status, environment, constants, context)` -**Why choose PlantSimEngine?** +A simulation author assembles those kernels on objects with `CompositeModel`, +`Object`, and one direct application constructor: -- **Simplicity**: Write less code, focus on your model's logic, and let the framework handle the rest. -- **Modularity**: Each model component can be developed, tested, and improved independently. Assemble complex simulations by reusing pre-built, high-quality modules. -- **Standardisation**: Clear, enforceable guidelines ensure that all models adhere to best practices. This built-in consistency means that once you implement a model, it works seamlessly with others in the ecosystem. -- **Optimised Performance**: Don't re-invent the wheel. Delegating low-level tasks to PlantSimEngine guarantees that your model will benefit from every improvement in the framework. Enjoy faster prototyping, robust simulations, and efficient execution using Julia's high-performance capabilities. - -## Unique Features - -### Automatic Model Coupling - -**Seamless Integration:** PlantSimEngine leverages Julia's multiple-dispatch capabilities to automatically compute the dependency graph between models. This allows researchers to effortlessly couple models without writing complex connection code or manually managing dependencies. - -**Intuitive Multi-Scale Support:** The framework naturally handles models operating at different scales—from organelle to ecosystem—connecting them with minimal effort and maintaining consistency across scales. - -### Flexibility with Precision Control - -**Effortless Model Switching:** Researchers can switch between different component models using a simple syntax without rewriting the underlying model code. This enables rapid comparison between different hypotheses and model versions, accelerating the scientific discovery process. - -### Multi-rate Execution - -**Mix model cadences in one simulation:** PlantSimEngine can run models at different timesteps within the same MTG simulation. This makes it possible to combine, for example, hourly leaf processes with daily plant balances and weekly reporting models without writing custom scheduling glue. - -**Explicit bindings between rates:** `TimeStepModel`, `InputBindings`, `MeteoBindings`, `ScopeModel`, and `OutputRequest` let you declare how model inputs, meteorology, and exported outputs should behave when rates differ. - -## Batteries included - -- **Automated Management**: Seamlessly handle inputs, outputs, time-steps, objects, and dependency resolution. -- **Iterative Development**: Fast and interactive prototyping of models with built-in constraints to avoid errors and sensible defaults to streamline the model writing process. -- **Control Your Degrees of Freedom**: Fix variables to constant values or force to observations, use simpler models for specific processes to reduce complexity. -- **Multi-Rate Scheduling**: Combine hourly, daily, and coarser models in the same simulation, with explicit policies for input aggregation and meteorological sampling. -- **High-Speed Computations**: Achieve impressive performance with benchmarks showing operations in the 100th of nanoseconds range for complex models (see this [benchmark script](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/benchmark.jl)). -- **Parallelize and Distribute Computing**: Out-of-the-box support for sequential, multi-threaded, or distributed computations over objects, time-steps, and independent processes, thanks to [Floops.jl](https://juliafolds.github.io/FLoops.jl/stable/). -- **Scale Effortlessly**: Methods for computing over objects, time-steps, and [Multi-Scale Tree Graphs](https://github.com/VEZY/MultiScaleTreeGraph.jl). -- **Compose Freely**: Use any types as inputs, including [Unitful](https://github.com/PainterQubits/Unitful.jl) for unit propagation and [MonteCarloMeasurements.jl](https://github.com/baggepinnen/MonteCarloMeasurements.jl) for measurement error propagation. - -## Ask Questions +```julia +ModelSpec( + model; + name=:application, + on=Many(scale=:Leaf), + inputs=(...), + calls=(...), + every=Hour(1), + environment=Environment(...), + output_routing=(...), + updates=Updates(...), +) +``` -If you have any questions or feedback, [open an issue](https://github.com/VirtualPlantLab/PlantSimEngine.jl/issues) or ask on [discourse](https://fspm.discourse.group/c/software/virtual-plant-lab). +This is the package API for multiscale, multi-plant, soil, microclimate, and +model-scale simulations. ## Installation -To install the package, enter the Julia package manager mode by pressing `]` in the REPL, and execute the following command: +In Julia package mode: ```julia add PlantSimEngine ``` -To use the package, execute this command from the Julia REPL: +Then: ```julia using PlantSimEngine ``` -## Example usage +## Quickstart -The package is designed to be easy to use, and to help users avoid errors when implementing, coupling and simulating models. +This example runs three existing toy models on one model object: -### Simple example - -Here's a simple example of a model that simulates the growth of a plant, using a simple exponential growth model: +1. `ToyDegreeDaysCumulModel` computes daily thermal time. +2. `ToyLAIModel` consumes cumulative thermal time and computes LAI. +3. `Beer` consumes LAI and meteorology to compute absorbed PAR. ```julia -# ] add PlantSimEngine -using PlantSimEngine - -# Include the model definition from the examples sub-module: +using PlantSimEngine, PlantMeteo, Dates, DataFrames using PlantSimEngine.Examples -# Define the model: -model = ModelMapping( - ToyLAIModel(), - status=(TT_cu=1.0:2000.0,), # Pass the cumulated degree-days as input to the model +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, ) -run!(model) # run the model - -status(model) # extract the status, i.e. the output of the model -``` - -Which gives: - -``` -TimeStepTable{Status{(:TT_cu, :LAI...}(1300 x 2): -╭─────┬────────────────┬────────────╮ -│ Row │ TT_cu │ LAI │ -│ │ Float64 │ Float64 │ -├─────┼────────────────┼────────────┤ -│ 1 │ 1.0 │ 0.00560052 │ -│ 2 │ 2.0 │ 0.00565163 │ -│ 3 │ 3.0 │ 0.00570321 │ -│ 4 │ 4.0 │ 0.00575526 │ -│ 5 │ 5.0 │ 0.00580778 │ -│ ⋮ │ ⋮ │ ⋮ │ -╰─────┴────────────────┴────────────╯ - 1295 rows omitted -``` - -> **Note** -> The `ToyLAIModel` is available from the [examples folder](https://github.com/VirtualPlantLab/PlantSimEngine.jl/tree/main/examples), and is a simple exponential growth model. It is used here for the sake of simplicity, but you can use any model you want, as long as it follows `PlantSimEngine` interface. - -Of course you can plot the outputs quite easily: - -```julia -# ] add CairoMakie -using CairoMakie - -lines(model[:TT_cu], model[:LAI], color=:green, axis=(ylabel="LAI (m² m⁻²)", xlabel="Cumulated growing degree days since sowing (°C)")) -``` - -![LAI Growth](examples/LAI_growth.png) - -### Model coupling - -Model coupling is done automatically by the package, and is based on the dependency graph between the models. To couple models, we just have to add them to the `ModelMapping`. For example, let's couple the `ToyLAIModel` with a model for light interception based on Beer's law: - -```julia -# ] add PlantSimEngine, PlantMeteo, Dates -using PlantSimEngine, PlantMeteo, Dates - -# Include the model definition from the examples folder: -using PlantSimEngine.Examples - -# Import the example meteorological data: -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -# Define the list of models for coupling: -model = ModelMapping( +model = CompositeModel( + ToyDegreeDaysCumulModel(), ToyLAIModel(), - Beer(0.6), - status=(TT_cu=cumsum(meteo_day[:, :TT]),), # Pass the cumulated degree-days as input to `ToyLAIModel`, this could also be done using another model + Beer(0.6); + environment=meteo_day, ) -``` - -The `ModelMapping` couples the models by automatically computing the dependency graph of the models. The resulting dependency graph is: -``` -╭──── Dependency graph ──────────────────────────────────────────╮ -│ ╭──── LAI_Dynamic ─────────────────────────────────────────╮ │ -│ │ ╭──── Main model ────────╮ │ │ -│ │ │ Process: LAI_Dynamic │ │ │ -│ │ │ Model: ToyLAIModel │ │ │ -│ │ │ Dep: │ │ │ -│ │ ╰────────────────────────╯ │ │ -│ │ │ ╭──── Soft-coupled model ─────────╮ │ │ -│ │ │ │ Process: light_interception │ │ │ -│ │ └──│ Model: Beer │ │ │ -│ │ │ Dep: (LAI_Dynamic = (:LAI,),) │ │ │ -│ │ ╰─────────────────────────────────╯ │ │ -│ ╰──────────────────────────────────────────────────────────╯ │ -╰────────────────────────────────────────────────────────────────╯ +sim = run!(model; steps=30, outputs=:all) +out = collect_outputs(sim; sink=DataFrame) +first(out, 6) ``` -```julia -# Run the simulation: -run!(model, meteo_day) +The compiler infers the unambiguous same-object bindings from each model's +declared inputs and outputs: `ToyLAIModel` receives `TT_cu` from +`:Degreedays`, and `Beer` receives `LAI` from `:LAI_Dynamic`. -status(model) +```julia +select( + DataFrame(explain_bindings(model)), + :application_id, + :input, + :source_application_ids, + :carrier_kind, + :copy_semantics, +) ``` -Which returns: +## Multi-Object Coupling -``` -TimeStepTable{Status{(:TT_cu, :LAI...}(365 x 3): -╭─────┬────────────────┬────────────┬───────────╮ -│ Row │ TT_cu │ LAI │ aPPFD │ -│ │ Float64 │ Float64 │ Float64 │ -├─────┼────────────────┼────────────┼───────────┤ -│ 1 │ 0.0 │ 0.00554988 │ 0.0476221 │ -│ 2 │ 0.0 │ 0.00554988 │ 0.0260688 │ -│ 3 │ 0.0 │ 0.00554988 │ 0.0377774 │ -│ 4 │ 0.0 │ 0.00554988 │ 0.0468871 │ -│ 5 │ 0.0 │ 0.00554988 │ 0.0545266 │ -│ ⋮ │ ⋮ │ ⋮ │ ⋮ │ -╰─────┴────────────────┴────────────┴───────────╯ - 360 rows omitted -``` +Use the `inputs` keyword when a model needs values from selected objects. This +model-scale LAI application reads live references to the surface of every +plant in the model: ```julia -# Plot the results: -using CairoMakie - -fig = Figure(resolution=(800, 600)) -ax = Axis(fig[1, 1], ylabel="LAI (m² m⁻²)") -lines!(ax, model[:TT_cu], model[:LAI], color=:mediumseagreen) - -ax2 = Axis(fig[2, 1], xlabel="Cumulated growing degree days since sowing (°C)", ylabel="aPPFD (mol m⁻² d⁻¹)") -lines!(ax2, model[:TT_cu], model[:aPPFD], color=:firebrick1) +plant_scene = CompositeModel( + Object(:scene; scale=:Scene, kind=:scene), + Object(:plant_1; scale=:Plant, kind=:plant, parent=:scene, + status=Status(surface=12.0)), + Object(:plant_2; scale=:Plant, kind=:plant, parent=:scene, + status=Status(surface=8.0)); + applications=( + ModelSpec( + ToyLAIfromLeafAreaModel(100.0); + name=:scene_lai, + on=One(scale=:Scene), + inputs=( + :plant_surfaces => Many( + scale=:Plant, + within=SceneScope(), + var=:surface, + ), + ), + ), + ), +) -fig +run!(plant_scene) +scene_status = only(model_objects(plant_scene; scale=:Scene)).status +(total_surface=scene_status.total_surface, LAI=scene_status.LAI) ``` -![LAI Growth and light interception](examples/LAI_growth2.png) +Use `within=Self()` for plant-local aggregations, for example a plant +allocation model summing only the leaves inside the current plant. Use +`within=SceneScope()` for model-wide aggregation. -### Multiscale modelling +## Manual Calls -> See the Multi-scale modeling section of the docs for more details. - -The package is designed to be easily scalable, and can be used to simulate models at different scales. For example, you can simulate a model at the leaf scale, and then couple it with models at any other scale, *e.g.* internode, plant, soil, scene scales. Here's an example of a simple model that simulates plant growth using sub-models operating at different scales: +Use the `calls` keyword when a parent model must directly run selected child models, +for example a model energy-balance solver that iterates leaf temperatures: ```julia -mapping = ModelMapping( - :Scene => ToyDegreeDaysCumulModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.6), - MultiScaleModel( - model=ToyAssimModel(), - mapped_variables=[:soil_water_content => :Soil], - ), - MultiScaleModel( - model=ToyCAllocationModel(), - mapped_variables=[ - :carbon_demand => [:Leaf, :Internode], - :carbon_allocation => [:Leaf, :Internode] - ], - ), - MultiScaleModel( - model=ToyPlantRmModel(), - mapped_variables=[:Rm_organs => [:Leaf => :Rm, :Internode => :Rm],], - ), - ), - :Internode => ( - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], - ), - MultiScaleModel( - model=ToyInternodeEmergence(TT_emergence=20.0), - mapped_variables=[:TT_cu => :Scene], +ModelSpec( + SceneEnergyBalance(); + name=:scene_energy, + on=One(scale=:Scene), + calls=( + :leaf_energy => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + application=:energy_balance, ), - ToyMaintenanceRespirationModel(1.5, 0.06, 25.0, 0.6, 0.004), - Status(carbon_biomass=1.0) - ), - :Leaf => ( - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], + :soil => One( + kind=:soil, + scale=:Soil, + within=SceneScope(), + application=:soil_water, ), - ToyMaintenanceRespirationModel(2.1, 0.06, 25.0, 1.0, 0.025), - Status(carbon_biomass=1.0) - ), - :Soil => ( - ToySoilWaterModel(), ), -); -``` - -We can import an example plant from the package: - -```julia -mtg = import_mtg_example() + every=Hour(1), +) ``` -Make a fake meteorological data: - -```julia -meteo = Weather( - [ - Atmosphere(T=20.0, Wind=1.0, Rh=0.65, Ri_PAR_f=300.0), - Atmosphere(T=25.0, Wind=0.5, Rh=0.8, Ri_PAR_f=500.0) -] -); -``` +Scenario-level `inputs` and `calls` should usually name the concrete producer +or callee with `application=...`. Use process identities in model-level +contracts such as `dep(model)`, where the model author cannot know application +names chosen by future scenarios. -And run the simulation: +Inside the parent model, `run_call!(context, :leaf_energy)` executes every target +and returns a vector-like collection. For iterative control, +`call_targets(context, :leaf_energy)` returns the collection without executing +it. `run_call!(target; publish=false)` is the default for trial iterations, and +`run_call!(target; publish=true)` publishes the accepted state. -```julia -out_vars = ModelMapping( - :Scene => (:TT_cu,), - :Plant => (:carbon_allocation, :carbon_assimilation, :soil_water_content, :aPPFD, :TT_cu, :LAI), - :Leaf => (:carbon_demand, :carbon_allocation), - :Internode => (:carbon_demand, :carbon_allocation), - :Soil => (:soil_water_content,), -) +## What PlantSimEngine Handles -out = run!(mtg, mapping, meteo, outputs=out_vars, executor=SequentialEx()); -``` +- object graphs with arbitrary plant architecture; +- several plant species and repeated plant instances through templates; +- same-rate reference wiring and typed many-object carriers; +- multirate scheduling with `Dates.Period` values; +- temporal policies such as `HoldLast`, `Interpolate`, `Integrate`, and + `Aggregate`; +- automatic global or spatial environment binding; +- mutable microclimate outputs through `environment_outputs_`; +- growth, pruning, reparenting, and movement with binding-cache refresh; +- structured explanations for users and agents. -We can then extract the outputs in a `DataFrame` and sort them: +Useful inspection helpers include: ```julia -using DataFrames -df_out = convert_outputs(out, DataFrame) -sort!(df_out, [:timestep, :node]) +explain_objects(model) +explain_scopes(model) +explain_bindings(model) +explain_calls(model) +explain_environment_bindings(model) +explain_schedule(model) +explain_execution_plan(model) ``` -| **timestep**
`Int64` | **organ**
`String` | **node**
`Int64` | **carbon\_allocation**
`U{Nothing, Float64}` | **TT\_cu**
`U{Nothing, Float64}` | **carbon\_assimilation**
`U{Nothing, Float64}` | **aPPFD**
`U{Nothing, Float64}` | **LAI**
`U{Nothing, Float64}` | **soil\_water\_content**
`U{Nothing, Float64}` | **carbon\_demand**
`U{Nothing, Float64}` | -|------------------------:|----------------------:|--------------------:|-----------------------------------------------------------------------------------:|------------------------------------:|--------------------------------------------------:|-----------------------------------:|---------------------------------:|--------------------------------------------------:|--------------------------------------------:| -| 1 | Scene | 1 | | 10.0 | | | | | | -| 1 | Soil | 2 | | | | | | 0.3 | | -| 1 | Plant | 3 | | 10.0 | 0.299422 | 4.99037 | 0.00607765 | 0.3 | | -| 1 | Internode | 4 | 0.0742793 | | | | | | 0.5 | -| 1 | Leaf | 5 | 0.0742793 | | | | | | 0.5 | -| 1 | Internode | 6 | 0.0742793 | | | | | | 0.5 | -| 1 | Leaf | 7 | 0.0742793 | | | | | | 0.5 | -| 2 | Scene | 1 | | 25.0 | | | | | | -| 2 | Soil | 2 | | | | | | 0.2 | | -| 2 | Plant | 3 | | 25.0 | 0.381154 | 9.52884 | 0.00696482 | 0.2 | | -| 2 | Internode | 4 | 0.0627036 | | | | | | 0.75 | -| 2 | Leaf | 5 | 0.0627036 | | | | | | 0.75 | -| 2 | Internode | 6 | 0.0627036 | | | | | | 0.75 | -| 2 | Leaf | 7 | 0.0627036 | | | | | | 0.75 | -| 2 | Internode | 8 | 0.0627036 | | | | | | 0.75 | -| 2 | Leaf | 9 | 0.0627036 | | | | | | 0.75 | - -An example output of a multiscale simulation is shown in the documentation of PlantBiophysics.jl: - -![Plant growth simulation](docs/src/www/image.png) +## Documentation -### Multi-rate modelling +- [Stable documentation](https://VirtualPlantLab.github.io/PlantSimEngine.jl/stable) +- [Development documentation](https://VirtualPlantLab.github.io/PlantSimEngine.jl/dev) +- [CompositeModel/object quickstart](https://VirtualPlantLab.github.io/PlantSimEngine.jl/dev/composite_model/quickstart/) +- [CompositeModel/object migration guide](https://VirtualPlantLab.github.io/PlantSimEngine.jl/dev/migration_composite_model/) +- [Public API reference](https://VirtualPlantLab.github.io/PlantSimEngine.jl/dev/API/API_public/) -PlantSimEngine also supports multi-rate MTG simulations, where different models run at different cadences inside the same execution. A typical use case is to run leaf-scale processes hourly, aggregate them into daily plant-scale balances, and then export weekly summary series from the same simulation. +## Projects That Use PlantSimEngine -The dedicated documentation now has three pages: a short introduction to the -core ideas, a fuller step-by-step tutorial, and an advanced configuration page: - -- [Introduction to multi-rate execution](https://VirtualPlantLab.github.io/PlantSimEngine.jl/stable/multirate/introduction/) -- [Step-by-step hourly, daily, weekly simulation](https://VirtualPlantLab.github.io/PlantSimEngine.jl/stable/multirate/multirate_tutorial/) -- [Advanced multi-rate configuration](https://VirtualPlantLab.github.io/PlantSimEngine.jl/stable/multirate/advanced_configuration/) - -## Projects that use PlantSimEngine - -Take a look at these projects that use PlantSimEngine: - -- [PlantBiophysics.jl](https://github.com/VEZY/PlantBiophysics.jl) - For the simulation of biophysical processes for plants such as photosynthesis, conductance, energy fluxes, and temperature -- [XPalm](https://github.com/PalmStudio/XPalm.jl) - An experimental crop model for oil palm +- [PlantBiophysics.jl](https://github.com/VEZY/PlantBiophysics.jl) for + plant biophysical processes such as photosynthesis, conductance, energy + fluxes, and temperature. +- [XPalm](https://github.com/PalmStudio/XPalm.jl), an experimental crop model + for oil palm. ## Performance -PlantSimEngine delivers impressive performance for plant modeling tasks. On an M1 MacBook Pro, a toy model for leaf area over a year at daily time-scale took only 260 μs to perform (about 688 ns per day), and 275 μs (756 ns per day) when coupled to a light interception model. These benchmarks demonstrate performance on par with compiled languages like Fortran or C, far outpacing typical interpreted language implementations. - -For example, PlantBiophysics.jl, which implements ecophysiological models using PlantSimEngine, has been measured to run up to 38,000 times faster than equivalent implementations in other scientific computing languages. +PlantSimEngine keeps model kernels close to regular Julia functions while the +runtime handles dependency scheduling, object selection, temporal aggregation, +and environment sampling. On an M1 MacBook Pro, toy daily simulations run in +hundreds of microseconds, and PlantBiophysics.jl models using PlantSimEngine +have been measured much faster than equivalent implementations in typical +scientific scripting languages. -## Make it yours +For performance-sensitive composite models, inspect the compiled representation with +`explain_execution_plan(model)` to see homogeneous batches and concrete carrier +types. -The package is developed so anyone can easily implement plant/crop models, use it freely and as you want thanks to its MIT license. +## License And Contributions -If you develop such tools and it is not on the list yet, please make a PR or contact me so we can add it! 😃 Make sure to read the community guidelines before in case you're not familiar with such things. +PlantSimEngine is distributed under the MIT license. Questions and bug reports +are welcome on [GitHub issues](https://github.com/VirtualPlantLab/PlantSimEngine.jl/issues) +or the [FSPM discourse](https://fspm.discourse.group/c/software/virtual-plant-lab). diff --git a/benchmark/Project.toml b/benchmark/Project.toml index 16cbac02d..0d1d915cc 100644 --- a/benchmark/Project.toml +++ b/benchmark/Project.toml @@ -7,6 +7,8 @@ PlantBiophysics = "7ae8fcfa-76ad-4ec6-9ea7-5f8f5e2d6ec9" PlantMeteo = "4630fe09-e0fb-4da5-a846-781cb73437b6" PlantSimEngine = "9a576370-710b-4269-adf9-4f603a9c6423" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" +Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" XPalm = "6b523e1e-d512-416c-8e51-a8fbef0064e7" diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index f3bdc06f7..d8a977dea 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -17,36 +17,220 @@ elseif Sys.islinux() suite_name = suite_name * "linux" end const SUITE = BenchmarkGroup() -SUITE[suite_name] = BenchmarkGroup(["PSE", "PBP", "XPalm"]) +const INCLUDE_DOWNSTREAM_BENCHMARKS = get( + ENV, + "PSE_BENCHMARK_INCLUDE_DOWNSTREAM", + get(ENV, "GITHUB_ACTIONS", "false") == "true" ? "false" : "true", +) == "true" +_supports_composite_object_benchmarks(engine) = + isdefined(engine, :CompositeModel) && + isdefined(engine, :Object) && + isdefined(engine, :RunContext) +const SUPPORTS_COMPOSITE_OBJECT_BENCHMARKS = + get(ENV, "PSE_BENCHMARK_FORCE_LEGACY_BASELINE", "false") != "true" && + _supports_composite_object_benchmarks(PlantSimEngine) +SUITE[suite_name] = BenchmarkGroup( + INCLUDE_DOWNSTREAM_BENCHMARKS && + SUPPORTS_COMPOSITE_OBJECT_BENCHMARKS ? + ["PSE", "PBP", "XPalm"] : ["PSE"], +) +SUITE[suite_name]["PSE_status_read_write"] = @benchmarkable begin + status.value += 1.0 + status.value +end setup = (status = PlantSimEngine.Status(value=0.0)) -# "PSE benchmark" -include("test-PSE-benchmark.jl") -SUITE[suite_name]["PSE"] = @benchmarkable do_benchmark_on_heavier_mtg() +if SUPPORTS_COMPOSITE_OBJECT_BENCHMARKS + # Composite-model benchmarks cannot be constructed while AirspeedVelocity + # evaluates this script against a pre-CompositeModel baseline revision. + include(joinpath(@__DIR__, "test-PSE-benchmark.jl")) + SUITE[suite_name]["PSE"] = @benchmarkable benchmark_heavier_scene( + model, + requests, + nsteps, + ) setup = ((model, requests, nsteps) = setup_heavier_model_benchmark()) -if isdefined(PlantSimEngine, :ModelSpec) # Only in new versions - include("test-multirate-buffer-benchmark.jl") - mtg_mr, mapping_mr, meteo_mr, reqs_mr, tracked_mr, nsteps_mr = setup_multirate_buffer_benchmark() - SUITE[suite_name]["PSE_multirate_status_tracked_run"] = @benchmarkable benchmark_multirate_status_tracked_run($mtg_mr, $mapping_mr, $meteo_mr, $tracked_mr, $nsteps_mr) - SUITE[suite_name]["PSE_multirate_output_request_run"] = @benchmarkable benchmark_multirate_output_request_run($mtg_mr, $mapping_mr, $meteo_mr, $reqs_mr, $tracked_mr, $nsteps_mr) + include(joinpath(@__DIR__, "test-multirate-buffer-benchmark.jl")) + SUITE[suite_name]["PSE_multirate_retain_all_run"] = @benchmarkable benchmark_multirate_retain_all_run( + model, + nsteps, + ) setup = ((model, ignored_requests, nsteps) = setup_multirate_buffer_benchmark()) + SUITE[suite_name]["PSE_multirate_output_request_run"] = @benchmarkable benchmark_multirate_output_request_run( + model, + requests, + nsteps, + ) setup = ((model, requests, nsteps) = setup_multirate_buffer_benchmark()) + SUITE[suite_name]["PSE_multirate_no_output_run"] = @benchmarkable benchmark_multirate_no_output_run( + model, + nsteps, + ) setup = ((model, ignored_requests, nsteps) = setup_multirate_buffer_benchmark()) + + include(joinpath(@__DIR__, "test-hard-call-path-benchmark.jl")) + for usage in (:zero, :sparse, :dense) + SUITE[suite_name]["PSE_hard_calls_$(usage)"] = + @benchmarkable benchmark_hard_call_path( + model, + nsteps, + ) setup = ((model, nsteps) = setup_hard_call_path_benchmark( + usage=$usage, + )) + end + for (kind, repeats, target_count) in ( + (:singular, 1, 1), + (:repeated, 8, 1), + (:nested, 1, 1), + (:many, 1, 1000), + (:heterogeneous, 1, 2), + (:sampled_environment, 1, 1), + (:published, 1, 1), + ) + SUITE[suite_name]["PSE_compiled_hard_call_$(kind)"] = + @benchmarkable benchmark_compiled_hard_call( + model, + nsteps, + ) setup = ((model, nsteps) = + setup_compiled_hard_call_benchmark( + kind=$kind, + repeats=$repeats, + target_count=$target_count, + )) + end + SUITE[suite_name]["PSE_lifecycle_small"] = + @benchmarkable benchmark_lifecycle_event( + simulation, + new_index, + ) setup = ((simulation, new_index) = + setup_lifecycle_hard_call_benchmark( + nobjects=32, + usage=:zero, + )) + SUITE[suite_name]["PSE_lifecycle_large"] = + @benchmarkable benchmark_lifecycle_event( + simulation, + new_index, + ) setup = ((simulation, new_index) = + setup_lifecycle_hard_call_benchmark( + nobjects=5000, + usage=:zero, + )) + SUITE[suite_name]["PSE_lifecycle_immediate_hard_call"] = + @benchmarkable benchmark_lifecycle_event( + simulation, + new_index, + ) setup = ((simulation, new_index) = + setup_lifecycle_hard_call_benchmark( + nobjects=1000, + usage=:dense, + )) end -# "PBP benchmark" -include("test-plantbiophysics.jl") -SUITE[suite_name]["PBP"] = @benchmarkable benchmark_plantbiophysics() -leaf, meteo = setup_benchmark_plantbiophysics_multitimestep() -SUITE[suite_name]["PBP_multiple_timesteps_MT"] = @benchmarkable benchmark_plantbiophysics_multitimestep_MT($leaf, $meteo) -SUITE[suite_name]["PBP_multiple_timesteps_ST"] = @benchmarkable benchmark_plantbiophysics_multitimestep_ST($leaf, $meteo) +if INCLUDE_DOWNSTREAM_BENCHMARKS && + SUPPORTS_COMPOSITE_OBJECT_BENCHMARKS + # "PBP benchmark" + include(joinpath(@__DIR__, "test-plantbiophysics.jl")) + const PLANTBIOPHYSICS_PR_BENCHMARK_STEPS = 100 + SUITE[suite_name]["PBP_multistep_no_outputs"] = + @benchmarkable benchmark_plantbiophysics_multistep( + model, + nsteps; + outputs=:none, + ) setup = ((model, nsteps) = setup_plantbiophysics_multistep( + nsteps=PLANTBIOPHYSICS_PR_BENCHMARK_STEPS, + )) + SUITE[suite_name]["PBP_multistep_all_outputs"] = + @benchmarkable benchmark_plantbiophysics_multistep( + model, + nsteps; + outputs=:all, + ) setup = ((model, nsteps) = setup_plantbiophysics_multistep( + nsteps=PLANTBIOPHYSICS_PR_BENCHMARK_STEPS, + )) + SUITE[suite_name]["PBP_construction"] = + @benchmarkable setup_plantbiophysics_multistep( + nsteps=PLANTBIOPHYSICS_PR_BENCHMARK_STEPS, + ) + SUITE[suite_name]["PBP_one_step_fanout"] = + @benchmarkable benchmark_plantbiophysics_batch( + scenes, + ) setup = (scenes = setup_benchmark_plantbiophysics_batch()) + + # "XPalm benchmark" + include(joinpath(@__DIR__, "test-xpalm.jl")) + include(joinpath(@__DIR__, "performance_regression.jl")) + const XPALM_PR_BENCHMARK_STEPS = 100 + SUITE[suite_name]["XPalm_setup_100"] = + @benchmarkable xpalm_default_param_create( + nsteps=XPALM_PR_BENCHMARK_STEPS, + ) seconds = 30 + + SUITE[suite_name]["XPalm_run_100"] = + @benchmarkable xpalm_default_param_run( + model, + requests, + nsteps, + ) setup = ((model, requests, nsteps) = xpalm_default_param_create(; + nsteps=XPALM_PR_BENCHMARK_STEPS, + )) -# "XPalm benchmark" -include("test-xpalm.jl") -SUITE[suite_name]["XPalm_setup"] = @benchmarkable xpalm_default_param_create() seconds = 120 + SUITE[suite_name]["XPalm_reference_outputs_100"] = + @benchmarkable xpalm_reference_param_run( + model, + requests, + nsteps, + ) setup = ((model, requests, nsteps) = xpalm_reference_param_create(; + nsteps=XPALM_PR_BENCHMARK_STEPS, + )) -palm, models, out_vars, meteo = xpalm_default_param_create() -sim_outputs = xpalm_default_param_run(palm, models, out_vars, meteo) + SUITE[suite_name]["XPalm_no_outputs_100"] = + @benchmarkable xpalm_reference_param_run( + model, + requests, + nsteps; + outputs=:none, + ) setup = ((model, requests, nsteps) = xpalm_reference_param_create(; + nsteps=XPALM_PR_BENCHMARK_STEPS, + )) -SUITE[suite_name]["XPalm_run"] = @benchmarkable xpalm_default_param_run(palm, models, out_vars, meteo) setup = ((palm, models, out_vars, meteo) = xpalm_default_param_create()) -SUITE[suite_name]["XPalm_convert_outputs"] = @benchmarkable xpalm_default_param_convert_outputs($sim_outputs) + SUITE[suite_name]["XPalm_small_outputs_100"] = + @benchmarkable xpalm_reference_param_run( + model, + requests, + nsteps, + ) setup = ((model, requests, nsteps) = xpalm_small_param_create(; + nsteps=XPALM_PR_BENCHMARK_STEPS, + )) -#tune!(SUITE) -#results = run(SUITE, verbose=true) -#BenchmarkTools.save(dirname(@__FILE__) * "/output.json", median(results)) + SUITE[suite_name]["XPalm_all_outputs_100"] = + @benchmarkable xpalm_reference_param_run( + model, + OutputRequest[], + nsteps; + outputs=:all, + ) setup = ((model, nsteps) = xpalm_reference_model_create(; + nsteps=XPALM_PR_BENCHMARK_STEPS, + )) +end + +if abspath(PROGRAM_FILE) == @__FILE__ + tune!(SUITE) + results = run(SUITE; verbose=true) + default_name = + "benchmark-$(Dates.format(Dates.now(), dateformat"yyyymmdd-HHMMSS")).json" + output_path = get( + ENV, + "PSE_BENCHMARK_OUTPUT", + joinpath(@__DIR__, "results", default_name), + ) + mkpath(dirname(output_path)) + BenchmarkTools.save(output_path, median(results)) + if INCLUDE_DOWNSTREAM_BENCHMARKS && + SUPPORTS_COMPOSITE_OBJECT_BENCHMARKS + summary_path = replace(output_path, r"\.[^.]+$" => "-summary.csv") + metadata = _performance_metadata(; + warmup_policy="BenchmarkTools tune plus per-benchmark setup", + ) + write_benchmark_summary(summary_path, results, metadata) + @info "PlantSimEngine benchmark suite complete" output_path summary_path + else + @info "PlantSimEngine benchmark suite complete" output_path + end +end diff --git a/benchmark/performance_regression.jl b/benchmark/performance_regression.jl new file mode 100644 index 000000000..64d0305d3 --- /dev/null +++ b/benchmark/performance_regression.jl @@ -0,0 +1,799 @@ +using BenchmarkTools +using CSV +using DataFrames +using Dates +using PlantSimEngine +using SHA +using Sockets +using Statistics +using XPalm + +isdefined(@__MODULE__, :xpalm_reference_param_create) || + include(joinpath(@__DIR__, "test-xpalm.jl")) + +const PERFORMANCE_SMOKE_STEPS = 2 +const PERFORMANCE_SHORT_STEPS = 100 +const PERFORMANCE_MEDIUM_STEPS = 1000 +const PERFORMANCE_FULL_STEPS = 4160 +const PERFORMANCE_STATISTICAL_SAMPLES = 3 + +function _performance_git_revision(path) + try + return readchomp(`git -C $path rev-parse HEAD`) + catch + return "unknown" + end +end + +function _performance_path_hash(path) + if isfile(path) + return bytes2hex(SHA.sha256(read(path))) + elseif isdir(path) + entries = String[] + for (root, directories, files) in walkdir(path) + sort!(directories) + for file in sort!(files) + file_path = joinpath(root, file) + relative_path = relpath(file_path, path) + push!( + entries, + string( + relative_path, + '\0', + bytes2hex(SHA.sha256(read(file_path))), + ), + ) + end + end + return bytes2hex(SHA.sha256(codeunits(join(entries, '\n')))) + end + return "missing" +end + +function _performance_fixture_hash(xpalm_root) + paths = ( + joinpath(xpalm_root, "0-data", "meteo.csv"), + joinpath( + xpalm_root, + "test", + "references", + "regression", + "v0.6.1", + ), + ) + entries = String[ + string(relpath(path, xpalm_root), '\0', _performance_path_hash(path)) + for path in paths + ] + return bytes2hex(SHA.sha256(codeunits(join(entries, '\n')))) +end + +function _performance_metadata(; warmup_policy) + pse_root = dirname(@__DIR__) + xpalm_root = dirname(dirname(pathof(XPalm))) + plantbiophysics_source = Base.find_package("PlantBiophysics") + plantbiophysics_root = isnothing(plantbiophysics_source) ? + nothing : + dirname(dirname(plantbiophysics_source)) + plantgeom_source = Base.find_package("PlantGeom") + plantgeom_root = isnothing(plantgeom_source) ? + nothing : + dirname(dirname(plantgeom_source)) + manifest_path = joinpath(pse_root, "benchmark", "Manifest.toml") + return ( + recorded_at=Dates.format(Dates.now(), dateformat"yyyy-mm-ddTHH:MM:SS.sss"), + julia_version=string(VERSION), + hostname=Sockets.gethostname(), + machine=Sys.MACHINE, + cpu=Sys.CPU_NAME, + memory_bytes=Sys.total_memory(), + threads=Threads.nthreads(), + plantsimengine_revision=_performance_git_revision(pse_root), + plantbiophysics_revision=isnothing(plantbiophysics_root) ? + "unavailable" : + _performance_git_revision( + plantbiophysics_root, + ), + plantgeom_revision=isnothing(plantgeom_root) ? + "unavailable" : + _performance_git_revision(plantgeom_root), + xpalm_revision=_performance_git_revision(xpalm_root), + manifest_hash=_performance_path_hash(manifest_path), + fixture_hash=_performance_fixture_hash(xpalm_root), + warmup_policy=warmup_policy, + ) +end + +function _benchmark_summary_records( + results, + metadata; + benchmark_path=String[], +) + records = NamedTuple[] + for (name, result) in pairs(results) + path = [benchmark_path; string(name)] + if result isa BenchmarkTools.Trial + median_estimate = BenchmarkTools.median(result) + minimum_estimate = BenchmarkTools.minimum(result) + push!( + records, + merge( + metadata, + ( + benchmark=join(path, "/"), + samples=length(result), + median_time_ns=median_estimate.time, + minimum_time_ns=minimum_estimate.time, + median_memory_bytes=median_estimate.memory, + minimum_memory_bytes=minimum_estimate.memory, + median_allocations=median_estimate.allocs, + minimum_allocations=minimum_estimate.allocs, + ), + ), + ) + else + append!( + records, + _benchmark_summary_records( + result, + metadata; + benchmark_path=path, + ), + ) + end + end + return records +end + +function write_benchmark_summary(path, results, metadata) + records = _benchmark_summary_records(results, metadata) + mkpath(dirname(path)) + CSV.write(path, DataFrame(records)) + return records +end + +function _performance_record!( + records, + metadata, + profile, + stage, + metric, + value, + unit, +) + push!( + records, + merge( + metadata, + ( + profile=String(profile), + stage=String(stage), + metric=String(metric), + value=Float64(value), + unit=String(unit), + ), + ), + ) + return records +end + +function _checkpoint_performance_records(path, records) + isnothing(path) && return records + mkpath(dirname(path)) + CSV.write(path, DataFrame(records)) + return records +end + +function _performance_allocation_count(measurement) + stats = measurement.gcstats + return sum(( + Int(getproperty(stats, name)) + for name in (:malloc, :realloc, :poolalloc, :bigalloc) + if hasproperty(stats, name) + ); init=0) +end + +function _timed_performance_operation(operation) + GC.gc() + return @timed operation() +end + +function _measure_performance_stage!( + operation, + records, + metadata, + profile, + stage, + checkpoint_path=nothing, + ; + samples::Int=1, + sample_factory=nothing, +) + samples >= 1 || error("Performance stage samples must be positive.") + started_at = time_ns() + measurement = try + _timed_performance_operation(operation) + catch + _performance_record!( + records, + metadata, + profile, + stage, + :failed, + 1, + :count, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :wall_time_before_failure, + (time_ns() - started_at) / 1.0e9, + :seconds, + ) + _checkpoint_performance_records(checkpoint_path, records) + rethrow() + end + measurements = Any[measurement] + for _ in 2:samples + sample_operation = isnothing(sample_factory) ? + operation : + sample_factory() + push!( + measurements, + _timed_performance_operation(sample_operation), + ) + end + times = getproperty.(measurements, :time) + memories = getproperty.(measurements, :bytes) + allocations = _performance_allocation_count.(measurements) + _performance_record!( + records, + metadata, + profile, + stage, + :wall_time, + measurement.time, + :seconds, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :median_time, + median(times), + :seconds, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :minimum_time, + minimum(times), + :seconds, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :allocated, + measurement.bytes, + :bytes, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :median_memory, + median(memories), + :bytes, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :minimum_memory, + minimum(memories), + :bytes, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :allocations, + allocations[1], + :count, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :median_allocations, + median(allocations), + :count, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :minimum_allocations, + minimum(allocations), + :count, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :samples, + samples, + :count, + ) + _performance_record!( + records, + metadata, + profile, + stage, + :gc_time, + measurement.gctime, + :seconds, + ) + _checkpoint_performance_records(checkpoint_path, records) + return measurement.value +end + +function _record_runtime_performance!( + records, + metadata, + profile, + stage, + simulation, +) + performance = PlantSimEngine.Advanced.runtime_performance(simulation) + isnothing(performance) && return records + for (metric, value) in sort!(collect(performance.counts); by=first) + _performance_record!( + records, + metadata, + profile, + stage, + metric, + value, + :count, + ) + end + for (metric, value) in sort!( + collect(performance.elapsed_seconds); + by=first, + ) + _performance_record!( + records, + metadata, + profile, + stage, + metric, + value, + :seconds, + ) + end + return records +end + +function _record_xpalm_state!( + records, + metadata, + profile, + stage, + state, +) + for metric in (:current_step, :phytomer_count, :lai, :ftsw) + _performance_record!( + records, + metadata, + profile, + stage, + metric, + getproperty(state, metric), + :value, + ) + end + return records +end + +function _performance_steps(profile) + profile == :smoke && return PERFORMANCE_SMOKE_STEPS + profile == :short && return PERFORMANCE_SHORT_STEPS + profile == :medium && return PERFORMANCE_MEDIUM_STEPS + profile == :full && return PERFORMANCE_FULL_STEPS + error( + "Unsupported performance profile `$(profile)`. Use `:smoke`, `:short`, ", + "`:medium`, or `:full`.", + ) +end + +function _warmup_xpalm_performance!(profile_steps) + lifecycle_steps = min(profile_steps, PERFORMANCE_SHORT_STEPS) + no_output_model, no_output_steps = + xpalm_reference_model_create(; nsteps=lifecycle_steps) + xpalm_reference_param_run( + no_output_model, + OutputRequest[], + no_output_steps; + outputs=:none, + ) + + reference_model, reference_requests, reference_steps = + xpalm_reference_param_create(; nsteps=PERFORMANCE_SMOKE_STEPS) + reference_simulation = xpalm_reference_param_run( + reference_model, + reference_requests, + reference_steps, + ) + xpalm_default_param_collect_outputs(reference_simulation) + return nothing +end + +function run_xpalm_performance_profile(; + profile=:short, + checkpoint_path=nothing, +) + normalized_profile = Symbol(profile) + nsteps = _performance_steps(normalized_profile) + warmup_policy = + "unmeasured outputs=:none prefix ($(min(nsteps, PERFORMANCE_SHORT_STEPS)) steps) " * + "plus requested-output smoke ($(PERFORMANCE_SMOKE_STEPS) steps)" + _warmup_xpalm_performance!(nsteps) + metadata = _performance_metadata(; warmup_policy=warmup_policy) + records = NamedTuple[] + + compile_model, _ = xpalm_reference_model_create(; nsteps=nsteps) + initial_compilation = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :initial_scene_compilation, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + sample_factory=() -> begin + sample_model, _ = + xpalm_reference_model_create(; nsteps=nsteps) + return () -> + PlantSimEngine.Advanced.refresh_bindings!(sample_model) + end, + ) do + PlantSimEngine.Advanced.refresh_bindings!(compile_model) + end + _performance_record!( + records, + metadata, + normalized_profile, + :initial_scene_compilation, + :application_count, + length(initial_compilation.applications), + :count, + ) + + steady_model, _ = xpalm_reference_model_create(; nsteps=2) + steady_simulation = xpalm_reference_param_run( + steady_model, + OutputRequest[], + 1; + outputs=:none, + ) + steady_simulation = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :clean_steady_state_step, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + sample_factory=() -> begin + sample_model, _ = + xpalm_reference_model_create(; nsteps=2) + sample_simulation = xpalm_reference_param_run( + sample_model, + OutputRequest[], + 1; + outputs=:none, + ) + return () -> continue!(sample_simulation) + end, + ) do + continue!(steady_simulation) + end + current_step(steady_simulation) == 2 || error( + "XPalm clean-step benchmark did not advance to step two.", + ) + + no_output_setup = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :scene_construction_no_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + ) do + xpalm_reference_model_create(; nsteps=nsteps) + end + no_output_model, no_output_steps = no_output_setup + no_output_simulation = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :simulation_no_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + sample_factory=() -> begin + sample_model, sample_steps = + xpalm_reference_model_create(; nsteps=nsteps) + return () -> xpalm_reference_param_run( + sample_model, + OutputRequest[], + sample_steps; + outputs=:none, + performance=true, + ) + end, + ) do + xpalm_reference_param_run( + no_output_model, + OutputRequest[], + no_output_steps; + outputs=:none, + performance=true, + ) + end + _record_runtime_performance!( + records, + metadata, + normalized_profile, + :simulation_no_outputs, + no_output_simulation, + ) + _checkpoint_performance_records(checkpoint_path, records) + + small_setup = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :scene_and_request_compile_small_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + ) do + xpalm_small_param_create(; nsteps=nsteps) + end + small_model, small_requests, small_steps = small_setup + small_simulation = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :simulation_small_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + sample_factory=() -> begin + sample_model, sample_requests, sample_steps = + xpalm_small_param_create(; nsteps=nsteps) + return () -> xpalm_reference_param_run( + sample_model, + sample_requests, + sample_steps; + performance=true, + ) + end, + ) do + xpalm_reference_param_run( + small_model, + small_requests, + small_steps; + performance=true, + ) + end + _record_runtime_performance!( + records, + metadata, + normalized_profile, + :simulation_small_outputs, + small_simulation, + ) + + reference_setup = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :scene_and_request_compile_reference_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + ) do + xpalm_reference_param_create(; nsteps=nsteps) + end + reference_model, reference_requests, reference_steps = reference_setup + reference_simulation = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :simulation_reference_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + sample_factory=() -> begin + sample_model, sample_requests, sample_steps = + xpalm_reference_param_create(; nsteps=nsteps) + return () -> xpalm_reference_param_run( + sample_model, + sample_requests, + sample_steps; + performance=true, + ) + end, + ) do + xpalm_reference_param_run( + reference_model, + reference_requests, + reference_steps; + performance=true, + ) + end + reference_outputs = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :collect_reference_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + ) do + xpalm_default_param_collect_outputs(reference_simulation) + end + _record_runtime_performance!( + records, + metadata, + normalized_profile, + :simulation_reference_outputs, + reference_simulation, + ) + + all_output_setup = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :scene_construction_all_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + ) do + xpalm_reference_model_create(; nsteps=nsteps) + end + all_output_model, all_output_steps = all_output_setup + all_output_simulation = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :simulation_all_outputs, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + sample_factory=() -> begin + sample_model, sample_steps = + xpalm_reference_model_create(; nsteps=nsteps) + return () -> xpalm_reference_param_run( + sample_model, + OutputRequest[], + sample_steps; + outputs=:all, + performance=true, + ) + end, + ) do + xpalm_reference_param_run( + all_output_model, + OutputRequest[], + all_output_steps; + outputs=:all, + performance=true, + ) + end + _record_runtime_performance!( + records, + metadata, + normalized_profile, + :simulation_all_outputs, + all_output_simulation, + ) + + no_output_state = xpalm_reference_final_state(no_output_simulation) + small_state = xpalm_reference_final_state(small_simulation) + reference_state = xpalm_reference_final_state(reference_simulation) + all_output_state = xpalm_reference_final_state(all_output_simulation) + _record_xpalm_state!( + records, + metadata, + normalized_profile, + :final_state_no_outputs, + no_output_state, + ) + _record_xpalm_state!( + records, + metadata, + normalized_profile, + :final_state_reference_outputs, + reference_state, + ) + _record_xpalm_state!( + records, + metadata, + normalized_profile, + :final_state_small_outputs, + small_state, + ) + _record_xpalm_state!( + records, + metadata, + normalized_profile, + :final_state_all_outputs, + all_output_state, + ) + _checkpoint_performance_records(checkpoint_path, records) + no_output_state == small_state == reference_state == all_output_state || error( + "XPalm performance fixtures diverged across output-retention modes: ", + "none=$(no_output_state), small=$(small_state), ", + "reference=$(reference_state), all=$(all_output_state).", + ) + isempty(reference_outputs) && error( + "XPalm performance reference output collection returned no tables.", + ) + + if normalized_profile == :full + xpalm_reference_state_matches(reference_state) || error( + "XPalm full-cycle performance fixture does not match the committed v0.6.1 final state: ", + "$(reference_state).", + ) + high_level_outputs = _measure_performance_stage!( + records, + metadata, + normalized_profile, + :historical_end_to_end_reference, + checkpoint_path, + samples=PERFORMANCE_STATISTICAL_SAMPLES, + ) do + xpalm_reference_end_to_end(; nsteps=nsteps) + end + xpalm_reference_high_level_state_matches(high_level_outputs) || error( + "XPalm historical end-to-end performance fixture does not match the committed ", + "v0.6.1 final state.", + ) + end + + return ( + records=records, + no_output_state=no_output_state, + small_state=small_state, + reference_state=reference_state, + all_output_state=all_output_state, + ) +end + +function write_xpalm_performance_profile(path; profile=:short) + result = run_xpalm_performance_profile(; + profile=profile, + checkpoint_path=path, + ) + _checkpoint_performance_records(path, result.records) + return result +end + +if abspath(PROGRAM_FILE) == @__FILE__ + profile = Symbol(get(ENV, "PSE_PERFORMANCE_PROFILE", "short")) + default_name = "xpalm-$(profile)-$(Dates.format(Dates.now(), dateformat"yyyymmdd-HHMMSS")).csv" + output_path = get( + ENV, + "PSE_PERFORMANCE_OUTPUT", + joinpath(@__DIR__, "results", default_name), + ) + result = write_xpalm_performance_profile(output_path; profile=profile) + @info "XPalm performance profile complete" profile output_path final_state=result.reference_state +end diff --git a/benchmark/prepare_full_performance_project.jl b/benchmark/prepare_full_performance_project.jl new file mode 100644 index 000000000..3a2eaf9b6 --- /dev/null +++ b/benchmark/prepare_full_performance_project.jl @@ -0,0 +1,20 @@ +using TOML + +function prepare_full_performance_project!(project_path) + project = TOML.parsefile(project_path) + pop!(project, "sources", nothing) + open(project_path, "w") do io + TOML.print(io, project) + end + return project_path +end + +function prepare_plantbiophysics_performance_project!(project_path) + project = TOML.parsefile(project_path) + pop!(project, "sources", nothing) + pop!(project["deps"], "XPalm", nothing) + open(project_path, "w") do io + TOML.print(io, project) + end + return project_path +end diff --git a/benchmark/release_baselines/README.md b/benchmark/release_baselines/README.md new file mode 100644 index 000000000..a955ce4e2 --- /dev/null +++ b/benchmark/release_baselines/README.md @@ -0,0 +1,82 @@ +# Pinned downstream release baselines + +These isolated projects preserve the release stacks used by the performance +acceptance checks. They deliberately do not share the main benchmark manifest. +Instantiate and run each project in a fresh Julia process with one Julia thread: + +```sh +JULIA_NUM_THREADS=1 julia --project=benchmark/release_baselines/plantbiophysics -e 'using Pkg; Pkg.instantiate()' +JULIA_NUM_THREADS=1 julia --project=benchmark/release_baselines/plantbiophysics benchmark/release_baselines/plantbiophysics/run.jl + +JULIA_NUM_THREADS=1 julia --project=benchmark/release_baselines/xpalm -e 'using Pkg; Pkg.instantiate()' +JULIA_NUM_THREADS=1 julia --project=benchmark/release_baselines/xpalm benchmark/release_baselines/xpalm/run.jl +``` + +Both runners warm the relevant API before collecting several one-setup, +many-timestep samples. They write a CSV result when an output path is supplied +as their first argument and otherwise place it beside the runner. Construction +is outside the timed region. Julia startup and package loading are excluded. + +Pinned sources: + +- PlantSimEngine `v0.14.1`, commit + `503af98c3709a0b1207407e3741b7cb09ebfbcf7`; +- PlantBiophysics `v0.17.0`, commit + `9f39af4ffd48bab234e5d80b89cd52c67b9f3f82`; +- XPalm `v0.6.1`, commit + `a0dbf2e8d6fa9e21f8e8ced3220da184b3ee3f4c`. + +Do not commit generated manifests or result CSV files. Preserve the runner, +resolved manifest, raw CSV, machine description, Julia version, and thread +count together when recording a release decision. + +## Accepted local comparison, 2026-08-11 + +The release decision was checked on an Apple M3 Max MacBook Pro with 36 GB RAM, +macOS/Darwin 25.5.0, and Julia 1.12.1. The accepted current stack used +PlantSimEngine runtime commit `d5480c50`, PlantBiophysics commit `dbd04e0`, and +XPalm commit `192e43f7`. The release commits are the pinned sources listed +above. + +PlantBiophysics used one Julia thread and a single constructed leaf scene for +one continuous 8,760-step trajectory. Each row is the median of 10 samples; +construction was outside the timed steady-state rows. + +| Stack and output policy | Median | Minimum | Per step | Allocated bytes | Allocations | Release ratio | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| release, normal retained outputs | 85.142 ms | not retained | 9.719 us | 129,536,608 | 1,759,504 | 1.000x | +| current, `outputs=:none` | 18.414 ms | 17.430 ms | 2.102 us | 25,883,792 | 288,137 | 0.216x | +| current, `outputs=:all` | 32.216 ms | 30.238 ms | 3.678 us | 47,792,736 | 868,558 | 0.378x | + +Current PlantBiophysics construction was 16.359 ms median. The separate +100-scene, one-step fan-out diagnostic was 15.205 ms median and is not used as +the acceptance metric. The complete 113,880-row retained-output trajectory was +exactly identical to the pre-optimization current stack, with a maximum +absolute difference of 0.0. + +XPalm used 10 Julia threads, although its model execution remained sequential. +Both sides warmed a 100-step run, prepared meteorology and `Palm` outside each +timed sample, and timed the same high-level `XPalm.xpalm` scope: scene +construction, the 4,160-step lifecycle run, requested outputs, and DataFrame +materialization. Julia startup and package loading were excluded. Five samples +were forced with a 120-second BenchmarkTools budget. + +| Stack | Median | Per step | Allocated bytes | Allocations | Release ratio | +| --- | ---: | ---: | ---: | ---: | ---: | +| XPalm `v0.6.1` / PlantSimEngine `v0.14.1` | 5.416 s | 1.302 ms | 6,898,039,968 | 80,317,174 | 1.000x | +| current XPalm / current PlantSimEngine | 8.035 s | 1.931 ms | 3,378,642,888 | 39,259,563 | **1.483x** | + +Raw full-cycle times, in seconds: + +- release: `5.115200625`, `5.384637000`, `5.416365375`, `5.474346833`, `5.782515542`; +- current: `7.953668959`, `7.961468750`, `8.034666500`, `8.041943916`, `8.071678500`. + +The current full-cycle output matched the committed XPalm `v0.6.1` reference: +step 4,160, 344 phytomers, LAI `5.0587602356164405`, and FTSW +`0.7991179101191216`. A separate staged profile kept construction and retention +costs distinct: 7.779 ms initial compilation, 6.438 ms no-output scene +construction, 83.562 ms for a 100-step no-output run, 79.818 ms for the same +short requested-output simulation, 3.323 ms to materialize its retained output, +and 95.263 ms with all outputs retained. The 100-step no-output profile included +10 lifecycle binding refreshes; the accepted 4,160-step timing includes all +growth-related refresh work. diff --git a/benchmark/release_baselines/plantbiophysics/.gitignore b/benchmark/release_baselines/plantbiophysics/.gitignore new file mode 100644 index 000000000..5e16486bd --- /dev/null +++ b/benchmark/release_baselines/plantbiophysics/.gitignore @@ -0,0 +1,2 @@ +Manifest.toml +latest.csv diff --git a/benchmark/release_baselines/plantbiophysics/Project.toml b/benchmark/release_baselines/plantbiophysics/Project.toml new file mode 100644 index 000000000..9fe9dbaa9 --- /dev/null +++ b/benchmark/release_baselines/plantbiophysics/Project.toml @@ -0,0 +1,18 @@ +[deps] +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +PlantBiophysics = "7ae8fcfa-76ad-4ec6-9ea7-5f8f5e2d6ec9" +PlantMeteo = "4630fe09-e0fb-4da5-a846-781cb73437b6" +PlantSimEngine = "9a576370-710b-4269-adf9-4f603a9c6423" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[sources] +PlantBiophysics = {rev = "9f39af4ffd48bab234e5d80b89cd52c67b9f3f82", url = "https://github.com/VEZY/PlantBiophysics.jl"} +PlantSimEngine = {rev = "503af98c3709a0b1207407e3741b7cb09ebfbcf7", url = "https://github.com/VirtualPlantLab/PlantSimEngine.jl"} + +[compat] +PlantBiophysics = "=0.17.0" +PlantSimEngine = "=0.14.1" +julia = "1.12" diff --git a/benchmark/release_baselines/plantbiophysics/run.jl b/benchmark/release_baselines/plantbiophysics/run.jl new file mode 100644 index 000000000..f0227518b --- /dev/null +++ b/benchmark/release_baselines/plantbiophysics/run.jl @@ -0,0 +1,93 @@ +using BenchmarkTools +using CSV +using DataFrames +using Dates +using PlantBiophysics +using PlantMeteo +using PlantSimEngine +using Random + +const NSTEPS = parse(Int, get(ENV, "PSE_RELEASE_BASELINE_STEPS", "8760")) +const SAMPLES = parse(Int, get(ENV, "PSE_RELEASE_BASELINE_SAMPLES", "12")) + +function forcing_set(n::Int) + Random.seed!(1) + ranges = ( + T=range(18, 40; length=10_000), + Wind=range(0.5, 20; length=10_000), + P=range(90, 101; length=10_000), + Rh=range(0.1, 0.98; length=10_000), + Ca=range(360, 900; length=10_000), + JMaxRef=range(200.0, 300.0; length=10_000), + VcMaxRef=range(150.0, 250.0; length=10_000), + RdRef=range(0.3, 2.0; length=10_000), + Ra_SW_f=range(10, 500; length=10_000), + sky_fraction=range(0.0, 1.0; length=10_000), + d=range(0.001, 0.5; length=10_000), + TPURef=range(5.0, 20.0; length=10_000), + g0=range(0.001, 2.0; length=10_000), + g1=range(0.5, 15.0; length=10_000), + ) + return DataFrame((; ( + name => [rand(values) for _ in 1:n] + for (name, values) in pairs(ranges) + )...)) +end + +function atmosphere(row) + return Atmosphere( + T=row.T, + Wind=row.Wind, + P=row.P, + Rh=row.Rh, + Cₐ=row.Ca, + duration=Hour(1), + ) +end + +function setup_workload(nsteps::Int) + forcing = forcing_set(nsteps) + first_row = first(eachrow(forcing)) + weather = Weather([atmosphere(row) for row in eachrow(forcing)]) + leaf = ModelMapping( + energy_balance=Monteith(), + photosynthesis=Fvcb( + VcMaxRef=first_row.VcMaxRef, + JMaxRef=first_row.JMaxRef, + RdRef=first_row.RdRef, + TPURef=first_row.TPURef, + ), + stomatal_conductance=Medlyn(first_row.g0, first_row.g1), + status=( + Ra_SW_f=first_row.Ra_SW_f, + sky_fraction=first_row.sky_fraction, + aPPFD=first_row.Ra_SW_f * 0.48 * 4.57, + d=first_row.d, + ), + ) + return leaf, weather +end + +warm_leaf, warm_weather = setup_workload(min(NSTEPS, 2)) +run!(warm_leaf, warm_weather) + +trial = @benchmark run!(leaf, weather) setup = ( + (leaf, weather) = setup_workload($NSTEPS) +) samples = SAMPLES evals = 1 +estimate = BenchmarkTools.median(trial) +record = DataFrame([((; + stack="PlantBiophysics v0.17.0 / PlantSimEngine v0.14.1", + julia_version=string(VERSION), + threads=Threads.nthreads(), + nsteps=NSTEPS, + samples=length(trial), + output_policy="release default retained outputs", + median_time_ns=estimate.time, + median_time_per_step_ns=estimate.time / NSTEPS, + median_memory_bytes=estimate.memory, + median_allocations=estimate.allocs, +))]) + +output_path = isempty(ARGS) ? joinpath(@__DIR__, "latest.csv") : only(ARGS) +CSV.write(output_path, record) +record diff --git a/benchmark/release_baselines/xpalm/.gitignore b/benchmark/release_baselines/xpalm/.gitignore new file mode 100644 index 000000000..5e16486bd --- /dev/null +++ b/benchmark/release_baselines/xpalm/.gitignore @@ -0,0 +1,2 @@ +Manifest.toml +latest.csv diff --git a/benchmark/release_baselines/xpalm/Project.toml b/benchmark/release_baselines/xpalm/Project.toml new file mode 100644 index 000000000..d9b3aa3ac --- /dev/null +++ b/benchmark/release_baselines/xpalm/Project.toml @@ -0,0 +1,15 @@ +[deps] +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +PlantSimEngine = "9a576370-710b-4269-adf9-4f603a9c6423" +XPalm = "6b523e1e-d512-416c-8e51-a8fbef0064e7" + +[sources] +PlantSimEngine = {rev = "503af98c3709a0b1207407e3741b7cb09ebfbcf7", url = "https://github.com/VirtualPlantLab/PlantSimEngine.jl"} +XPalm = {rev = "a0dbf2e8d6fa9e21f8e8ced3220da184b3ee3f4c", url = "https://github.com/PalmStudio/XPalm.jl"} + +[compat] +PlantSimEngine = "=0.14.1" +XPalm = "=0.6.1" +julia = "1.12" diff --git a/benchmark/release_baselines/xpalm/run.jl b/benchmark/release_baselines/xpalm/run.jl new file mode 100644 index 000000000..e857c7933 --- /dev/null +++ b/benchmark/release_baselines/xpalm/run.jl @@ -0,0 +1,97 @@ +using BenchmarkTools +using CSV +using DataFrames +using XPalm + +const SAMPLES = parse(Int, get(ENV, "PSE_RELEASE_BASELINE_SAMPLES", "5")) +const TIME_BUDGET_SECONDS = + parse(Float64, get(ENV, "PSE_RELEASE_BASELINE_SECONDS", "120")) +const REFERENCE_VARIABLES = Dict{Symbol,Any}( + :Scene => (:lai, :leaf_area, :aPPFD), + :Plant => ( + :plant_age, + :leaf_area, + :aPPFD, + :Rm, + :carbon_assimilation, + :phytomer_count, + :biomass_bunch_harvested, + :biomass_bunch_harvested_cum, + :n_bunches_harvested, + :n_bunches_harvested_cum, + :biomass_oil_harvested, + :biomass_oil_harvested_cum, + ), + :Soil => (:ftsw, :root_depth), +) + +function setup_workload() + meteo = CSV.read( + joinpath(dirname(dirname(pathof(XPalm))), "0-data", "meteo.csv"), + DataFrame, + ) + palm = XPalm.Palm( + initiation_age=0, + parameters=XPalm.default_parameters(), + ) + return meteo, palm +end + +function run_workload(meteo, palm) + return XPalm.xpalm( + meteo, + DataFrame; + vars=REFERENCE_VARIABLES, + architecture=false, + palm=palm, + ) +end + +warm_meteo, warm_palm = setup_workload() +run_workload(warm_meteo[1:100, :], warm_palm) + +trial = @benchmark run_workload(meteo, palm) setup = ( + (meteo, palm) = setup_workload() +) samples = SAMPLES evals = 1 seconds = TIME_BUDGET_SECONDS +estimate = BenchmarkTools.median(trial) + +check_meteo, check_palm = setup_workload() +outputs = run_workload(check_meteo, check_palm) +final_state = ( + current_step=nrow(outputs[:Plant]), + phytomer_count=last(outputs[:Plant].phytomer_count), + lai=last(outputs[:Scene].lai), + ftsw=last(outputs[:Soil].ftsw), +) +expected = ( + current_step=4160, + phytomer_count=344, + lai=5.0587602356164405, + ftsw=0.7991179101191216, +) +final_state.current_step == expected.current_step || error("XPalm step mismatch") +final_state.phytomer_count == expected.phytomer_count || error("XPalm phytomer mismatch") +isapprox(final_state.lai, expected.lai; atol=1.0e-8, rtol=1.0e-8) || + error("XPalm LAI mismatch") +isapprox(final_state.ftsw, expected.ftsw; atol=1.0e-8, rtol=1.0e-8) || + error("XPalm FTSW mismatch") + +record = DataFrame([((; + stack="XPalm v0.6.1 / PlantSimEngine v0.14.1", + julia_version=string(VERSION), + threads=Threads.nthreads(), + nsteps=final_state.current_step, + samples=length(trial), + output_policy="historical requested outputs and DataFrame materialization", + median_time_ns=estimate.time, + median_time_per_step_ns=estimate.time / final_state.current_step, + median_memory_bytes=estimate.memory, + median_allocations=estimate.allocs, + phytomer_count=final_state.phytomer_count, + lai=final_state.lai, + ftsw=final_state.ftsw, +))]) + +output_path = isempty(ARGS) ? joinpath(@__DIR__, "latest.csv") : only(ARGS) +CSV.write(output_path, record) +record diff --git a/benchmark/test-PSE-benchmark.jl b/benchmark/test-PSE-benchmark.jl index 080f02b1a..056d0877d 100644 --- a/benchmark/test-PSE-benchmark.jl +++ b/benchmark/test-PSE-benchmark.jl @@ -15,10 +15,12 @@ end ToyInternodeCrazyEmergence(; TT_emergence=300.0) = ToyInternodeCrazyEmergence(TT_emergence) -PlantSimEngine.inputs_(m::ToyInternodeCrazyEmergence) = (TT_cu=-Inf,) +PlantSimEngine.inputs_(m::ToyInternodeCrazyEmergence) = (TT_cu=Required(Float64),) PlantSimEngine.outputs_(m::ToyInternodeCrazyEmergence) = (TT_cu_emergence=0.0,) -function PlantSimEngine.run!(m::ToyInternodeCrazyEmergence, models, status, meteo, constants=nothing, sim_object=nothing) +function PlantSimEngine.run!(m::ToyInternodeCrazyEmergence, status, environment, constants=nothing, context=nothing) + + model = runtime_model(context) #root = get_root(status.node) @@ -28,21 +30,21 @@ function PlantSimEngine.run!(m::ToyInternodeCrazyEmergence, models, status, mete if length(MultiScaleTreeGraph.children(status.node)) == 1 && status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) + status_new_internode = add_organ!(status.node, model, "<", :Internode, 2; index=1, initial_status=(carbon_biomass=1.0, TT_cu_emergence=0.0)) + add_organ!(status_new_internode.node, model, "+", :Leaf, 2; index=1, initial_status=(carbon_biomass=1.0,)) status_new_internode.TT_cu_emergence = status.TT_cu elseif (length(MultiScaleTreeGraph.children(status.node)) >= 2 && length(MultiScaleTreeGraph.children(status.node)) < 7) && status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=4) - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=5) + status_new_internode = add_organ!(status.node, model, "<", :Internode, 2; index=1, initial_status=(carbon_biomass=1.0, TT_cu_emergence=0.0)) + add_organ!(status.node, model, "+", :Leaf, 2; index=4, initial_status=(carbon_biomass=1.0,)) + add_organ!(status.node, model, "+", :Leaf, 2; index=5, initial_status=(carbon_biomass=1.0,)) status_new_internode.TT_cu_emergence = status.TT_cu elseif (length(MultiScaleTreeGraph.children(status.node)) >= 7 && length(MultiScaleTreeGraph.children(status.node)) < 30) && status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=6) - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=7) - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=8) - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=9) - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=10) - add_organ!(status.node, sim_object, "+", :Leaf, 2, index=11) + add_organ!(status.node, model, "+", :Leaf, 2; index=6, initial_status=(carbon_biomass=1.0,)) + add_organ!(status.node, model, "+", :Leaf, 2; index=7, initial_status=(carbon_biomass=1.0,)) + add_organ!(status.node, model, "+", :Leaf, 2; index=8, initial_status=(carbon_biomass=1.0,)) + add_organ!(status.node, model, "+", :Leaf, 2; index=9, initial_status=(carbon_biomass=1.0,)) + add_organ!(status.node, model, "+", :Leaf, 2; index=10, initial_status=(carbon_biomass=1.0,)) + add_organ!(status.node, model, "+", :Leaf, 2; index=11, initial_status=(carbon_biomass=1.0,)) end @@ -50,73 +52,56 @@ function PlantSimEngine.run!(m::ToyInternodeCrazyEmergence, models, status, mete end -# Wrapped this into a function so that it doesn't plague the benchmark with variables on a global scope -#@check_allocs -function do_benchmark_on_heavier_mtg() +function _benchmark_mtg_status(node) + data = Dict{Symbol,Any}(:node => node) + scale = MultiScaleTreeGraph.symbol(node) + scale in (:Leaf, :Internode) && (data[:carbon_biomass] = 1.0) + scale == :Plant && (data[:carbon_allocation] = zeros(4)) + return Status((; data...)) +end + +function setup_heavier_model_benchmark() mtg = import_mtg_example() - # Example meteo, 365 timesteps : meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Day) - - #similar to the mtg growth test but with a much lower emergence threshold - mapping = ModelMapping( - :Scene => ToyDegreeDaysCumulModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - PlantSimEngine.Examples.Beer(0.6), - MultiScaleModel( - model=ToyCAllocationModel(), - mapped_variables=[ - :carbon_assimilation => [:Leaf], - :carbon_demand => [:Leaf, :Internode], - :carbon_allocation => [:Leaf, :Internode] - ], - ), - MultiScaleModel( - model=ToyPlantRmModel(), - mapped_variables=[:Rm_organs => [:Leaf => :Rm, :Internode => :Rm],], - ), - ), - :Internode => ( - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], - ), - MultiScaleModel( - model=ToyInternodeCrazyEmergence(TT_emergence=1.0), - mapped_variables=[:TT_cu => :Scene], - ), - ToyMaintenanceRespirationModel(1.5, 0.06, 25.0, 0.6, 0.004), - Status(carbon_biomass=1.0) - ), - :Leaf => ( - MultiScaleModel( - model=ToyAssimModel(), - mapped_variables=[:soil_water_content => :Soil, :aPPFD => :Plant], - ), - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], - ), - ToyMaintenanceRespirationModel(2.1, 0.06, 25.0, 1.0, 0.025), - Status(carbon_biomass=1.0) - ), - :Soil => ( - ToySoilWaterModel(), - ), + applications = ( + ModelSpec(ToyDegreeDaysCumulModel(); name=:scene_degree_days, on=One(scale=:Scene)), + ModelSpec(ToyLAIModel(); name=:plant_lai, on=Many(scale=:Plant), inputs=(:TT_cu => One(scale=:Scene, within=SceneScope(), application=:scene_degree_days, var=:TT_cu))), + ModelSpec(PlantSimEngine.Examples.Beer(0.6); name=:plant_light, on=Many(scale=:Plant)), + ModelSpec(ToyPlantRmModel(); name=:plant_rm, on=Many(scale=:Plant), inputs=(:Rm_organs => Many(scale=(:Leaf, :Internode), within=Subtree(), var=:Rm))), + ModelSpec(ToyCAllocationModel(); name=:plant_allocation, on=Many(scale=:Plant), inputs=(:carbon_assimilation => Many(scale=:Leaf, within=Subtree(), application=:leaf_assimilation, var=:carbon_assimilation), + :carbon_demand => Many(scale=(:Leaf, :Internode), within=Subtree(), var=:carbon_demand),)), + ModelSpec(ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0); name=:internode_demand, on=Many(scale=:Internode), inputs=(:TT => One(scale=:Scene, within=SceneScope(), application=:scene_degree_days, var=:TT))), + ModelSpec(ToyInternodeCrazyEmergence(TT_emergence=1.0); name=:internode_emergence, on=Many(scale=:Internode), inputs=(:TT_cu => One(scale=:Scene, within=SceneScope(), application=:scene_degree_days, var=:TT_cu))), + ModelSpec(ToyMaintenanceRespirationModel(1.5, 0.06, 25.0, 0.6, 0.004); name=:internode_respiration, on=Many(scale=:Internode)), + ModelSpec(ToyAssimModel(); name=:leaf_assimilation, on=Many(scale=:Leaf), inputs=(:soil_water_content => One(scale=:Soil, within=SceneScope(), application=:soil_water, var=:soil_water_content), + :aPPFD => One(scale=:Plant, within=Ancestor(scale=:Plant), application=:plant_light, var=:aPPFD),)), + ModelSpec(ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0); name=:leaf_demand, on=Many(scale=:Leaf), inputs=(:TT => One(scale=:Scene, within=SceneScope(), application=:scene_degree_days, var=:TT))), + ModelSpec(ToyMaintenanceRespirationModel(2.1, 0.06, 25.0, 1.0, 0.025); name=:leaf_respiration, on=Many(scale=:Leaf)), + ModelSpec(ToySoilWaterModel(); name=:soil_water, on=One(scale=:Soil)), ) - out_vars = Dict( - :Leaf => (:carbon_assimilation, :carbon_demand, :soil_water_content, :carbon_allocation), - :Internode => (:carbon_allocation, :TT_cu_emergence), - :Plant => (:carbon_allocation,), - :Soil => (:soil_water_content,), + model = CompositeModel( + mtg; + applications=applications, + environment=meteo_day, + status=_benchmark_mtg_status, ) + requests = OutputRequest[ + OutputRequest(:Leaf, :carbon_assimilation; name=:leaf_assimilation, application=:leaf_assimilation), + OutputRequest(:Leaf, :carbon_demand; name=:leaf_demand, application=:leaf_demand), + OutputRequest(:Internode, :TT_cu_emergence; name=:internode_emergence, application=:internode_emergence), + OutputRequest(:Plant, :carbon_offer; name=:plant_carbon_offer, application=:plant_allocation), + OutputRequest(:Soil, :soil_water_content; name=:soil_water, application=:soil_water), + ] + return model, requests, length(meteo_day) +end + +function benchmark_heavier_scene(model, requests, nsteps) + return run!(model; steps=nsteps, outputs=requests) +end - out = run!(mtg, mapping, meteo_day, tracked_outputs=out_vars, executor=SequentialEx()) -end \ No newline at end of file +function do_benchmark_on_heavier_mtg() + model, requests, nsteps = setup_heavier_model_benchmark() + return benchmark_heavier_scene(model, requests, nsteps) +end diff --git a/benchmark/test-hard-call-path-benchmark.jl b/benchmark/test-hard-call-path-benchmark.jl new file mode 100644 index 000000000..50a4c0e4c --- /dev/null +++ b/benchmark/test-hard-call-path-benchmark.jl @@ -0,0 +1,502 @@ +using Dates +using PlantSimEngine + +PlantSimEngine.@process "benchmark_call_source" verbose = false +PlantSimEngine.@process "benchmark_call_controller" verbose = false +PlantSimEngine.@process "benchmark_bulk_call_controller" verbose = false +PlantSimEngine.@process "benchmark_sampled_environment_source" verbose = false +PlantSimEngine.@process "benchmark_sampled_environment_controller" verbose = false +PlantSimEngine.@process "benchmark_unrelated_work" verbose = false + +struct BenchmarkCallSourceModel <: AbstractBenchmark_Call_SourceModel end +struct BenchmarkAlternateCallSourceModel <: AbstractBenchmark_Call_SourceModel end +struct BenchmarkCallControllerModel <: AbstractBenchmark_Call_ControllerModel end +struct BenchmarkBulkCallControllerModel{P,C} <: + AbstractBenchmark_Bulk_Call_ControllerModel + repeats::Int + publish::P + capture_context::C +end +struct BenchmarkSampledEnvironmentSourceModel <: + AbstractBenchmark_Sampled_Environment_SourceModel end +struct BenchmarkSampledEnvironmentControllerModel{E} <: + AbstractBenchmark_Sampled_Environment_ControllerModel + sampled_environment::E +end +struct BenchmarkUnrelatedWorkModel <: AbstractBenchmark_Unrelated_WorkModel end + +const BENCHMARK_BULK_CALL_CONTEXT = Ref{Any}() + +PlantSimEngine.inputs_(::BenchmarkCallSourceModel) = NamedTuple() +PlantSimEngine.outputs_(::BenchmarkCallSourceModel) = (signal=0,) + +function PlantSimEngine.run!( + ::BenchmarkCallSourceModel, + status, + environment, + constants, + context, +) + status.signal += 1 + return nothing +end + +PlantSimEngine.inputs_(::BenchmarkSampledEnvironmentSourceModel) = NamedTuple() +PlantSimEngine.outputs_(::BenchmarkSampledEnvironmentSourceModel) = + (temperature_seen=0.0,) +PlantSimEngine.environment_inputs_(::BenchmarkSampledEnvironmentSourceModel) = + (T=Required(Float64),) + +function PlantSimEngine.run!( + ::BenchmarkSampledEnvironmentSourceModel, + status, + environment, + constants, + context, +) + status.temperature_seen = environment.T + return nothing +end + +PlantSimEngine.inputs_(::BenchmarkSampledEnvironmentControllerModel) = + NamedTuple() +PlantSimEngine.outputs_(::BenchmarkSampledEnvironmentControllerModel) = + (executions=0,) + +function PlantSimEngine.run!( + model::BenchmarkSampledEnvironmentControllerModel, + status, + environment, + constants, + context, +) + run_call!( + context, + :source; + sampled_environment=model.sampled_environment, + publish=false, + ) + BENCHMARK_BULK_CALL_CONTEXT[] = context + status.executions += 1 + return nothing +end + +PlantSimEngine.inputs_(::BenchmarkAlternateCallSourceModel) = NamedTuple() +PlantSimEngine.outputs_(::BenchmarkAlternateCallSourceModel) = (signal=0,) + +function PlantSimEngine.run!( + ::BenchmarkAlternateCallSourceModel, + status, + environment, + constants, + context, +) + status.signal += 2 + return nothing +end + +PlantSimEngine.inputs_(::BenchmarkCallControllerModel) = NamedTuple() +PlantSimEngine.outputs_(::BenchmarkCallControllerModel) = (called_signal=0,) + +function PlantSimEngine.run!( + ::BenchmarkCallControllerModel, + status, + environment, + constants, + context, +) + target = only(run_call!(context, :source; publish=false)) + status.called_signal = target.status.signal + return nothing +end + +PlantSimEngine.inputs_(::BenchmarkBulkCallControllerModel) = NamedTuple() +PlantSimEngine.outputs_(::BenchmarkBulkCallControllerModel) = (executions=0,) + +function PlantSimEngine.run!( + model::BenchmarkBulkCallControllerModel, + status, + environment, + constants, + context, +) + for _ in 1:model.repeats + run_call!(context, :source; publish=model.publish) + end + model.capture_context && (BENCHMARK_BULK_CALL_CONTEXT[] = context) + status.executions += model.repeats + return nothing +end + +PlantSimEngine.inputs_(::BenchmarkUnrelatedWorkModel) = NamedTuple() +PlantSimEngine.outputs_(::BenchmarkUnrelatedWorkModel) = (work=0,) + +function PlantSimEngine.run!( + ::BenchmarkUnrelatedWorkModel, + status, + environment, + constants, + context, +) + status.work += 1 + return nothing +end + +function setup_hard_call_path_benchmark(; + nobjects=1000, + usage=:sparse, + steps=100, +) + usage in (:zero, :sparse, :dense) || error( + "Unsupported hard-call benchmark usage `$(usage)`. Use `:zero`, ", + "`:sparse`, or `:dense`.", + ) + objects = Any[PlantSimEngine.Object(:scene; scale=:Scene)] + append!( + objects, + ( + PlantSimEngine.Object( + Symbol(:leaf_, index); + scale=:Leaf, + name=Symbol(:leaf_, index), + parent=:scene, + ) + for index in 1:nobjects + ), + ) + source = ModelSpec( + BenchmarkCallSourceModel(); + name=:source, + on=Many(scale=:Leaf), + ) + unrelated = ModelSpec( + BenchmarkUnrelatedWorkModel(); + name=:unrelated, + on=Many(scale=:Leaf), + ) + applications = if usage == :zero + (source, unrelated) + else + caller_selector = + usage == :sparse ? + One(name=:leaf_1) : + Many(scale=:Leaf) + caller = ModelSpec( + BenchmarkCallControllerModel(); + name=:controller, + on=caller_selector, + calls=( + :source => + One(within=Self(), application=:source), + ), + ) + (source, caller, unrelated) + end + return CompositeModel(objects...; applications=applications), Int(steps) +end + +function benchmark_hard_call_path(model, steps) + return run!(model; steps=steps, outputs=:none) +end + +function setup_compiled_hard_call_benchmark(; + kind=:singular, + target_count=1000, + repeats=1, + publish=false, + steps=100, +) + kind in ( + :singular, + :repeated, + :nested, + :many, + :heterogeneous, + :sampled_environment, + :published, + ) || + error("Unsupported compiled hard-call benchmark kind `$(kind)`.") + if kind == :heterogeneous + template = CompositeModelTemplate( + ( + ModelSpec( + BenchmarkCallSourceModel(); + name=:source, + on=Many(scale=:Leaf), + ), + ModelSpec( + BenchmarkBulkCallControllerModel(1, false, true); + name=:controller, + on=One(scale=:Plant), + calls=( + :source => Many( + scale=:Leaf, + within=Subtree(), + application=:source, + ), + ), + ), + ); + kind=:plant, + ) + instance = ObjectInstance( + :benchmark_plant, + template; + root=PlantSimEngine.Object( + :plant; + scale=:Plant, + parent=:scene, + ), + objects=( + PlantSimEngine.Object( + :leaf_1; + scale=:Leaf, + parent=:plant, + ), + PlantSimEngine.Object( + :leaf_2; + scale=:Leaf, + parent=:plant, + ), + ), + object_overrides=( + Override( + object=:leaf_2, + application=:source, + model=BenchmarkAlternateCallSourceModel(), + ), + ), + ) + return ( + CompositeModel( + PlantSimEngine.Object(:scene; scale=:Scene), + instance, + ), + Int(steps), + ) + end + if kind == :sampled_environment + model = CompositeModel( + PlantSimEngine.Object(:scene; scale=:Scene, name=:scene), + PlantSimEngine.Object( + :leaf_1; + scale=:Leaf, + name=:leaf_1, + parent=:scene, + ); + applications=( + ModelSpec( + BenchmarkSampledEnvironmentSourceModel(); + name=:source, + on=One(name=:leaf_1), + ), + ModelSpec( + BenchmarkSampledEnvironmentControllerModel((T=30.0,)); + name=:controller, + on=One(name=:scene), + calls=( + :source => One( + name=:leaf_1, + application=:source, + ), + ), + ), + ), + environment=(T=20.0, duration=Hour(1)), + ) + return model, Int(steps) + end + leaf_count = kind == :many ? target_count : 1 + objects = Any[PlantSimEngine.Object(:scene; scale=:Scene, name=:scene)] + if kind == :nested + push!( + objects, + PlantSimEngine.Object( + :middle; + scale=:Plant, + name=:middle, + parent=:scene, + ), + ) + end + append!( + objects, + ( + PlantSimEngine.Object( + Symbol(:leaf_, index); + scale=:Leaf, + name=Symbol(:leaf_, index), + parent=kind == :nested ? :middle : :scene, + ) + for index in 1:leaf_count + ), + ) + + source = ModelSpec( + BenchmarkCallSourceModel(); + name=:source, + on=Many(scale=:Leaf), + ) + if kind == :nested + middle = ModelSpec( + BenchmarkBulkCallControllerModel(1, false, false); + name=:middle, + on=One(name=:middle), + calls=( + :source => One( + name=:leaf_1, + within=Subtree(), + application=:source, + ), + ), + ) + root = ModelSpec( + BenchmarkBulkCallControllerModel(1, false, true); + name=:root, + on=One(name=:scene), + calls=( + :source => One( + name=:middle, + within=Subtree(), + application=:middle, + ), + ), + ) + applications = (source, middle, root) + else + selector = kind == :many ? + Many(scale=:Leaf, application=:source) : + One(name=:leaf_1, application=:source) + effective_repeats = kind == :repeated ? repeats : 1 + effective_publish = kind == :published ? true : publish + controller = ModelSpec( + BenchmarkBulkCallControllerModel( + effective_repeats, + effective_publish, + true, + ); + name=:controller, + on=One(name=:scene), + calls=(:source => selector,), + ) + applications = (source, controller) + end + return ( + CompositeModel(objects...; applications=applications), + Int(steps), + ) +end + +benchmark_compiled_hard_call(model, steps) = + run!(model; steps=steps, outputs=:none) + +function setup_compiled_hard_call_step(; kwargs...) + model, _ = setup_compiled_hard_call_benchmark(; steps=1, kwargs...) + return run!(model; steps=1, outputs=:none) +end + +benchmark_compiled_hard_call_step(simulation) = step!(simulation) + +function benchmark_compiled_hard_call_invocation( + context::T; + repeats=1, + publish=false, +) where {T} + for _ in 1:repeats + run_call!(context, :source; publish=publish) + end + return nothing +end + +function compiled_hard_call_invocation_allocations( + context::T; + repeats=1, + publish=false, +) where {T} + benchmark_compiled_hard_call_invocation( + context; + repeats=repeats, + publish=publish, + ) + return @allocated benchmark_compiled_hard_call_invocation( + context; + repeats=repeats, + publish=publish, + ) +end + +function benchmark_sampled_hard_call_invocation( + context::T, + sampled_environment, +) where {T} + run_call!( + context, + :source; + sampled_environment=sampled_environment, + publish=false, + ) + return nothing +end + +function sampled_hard_call_invocation_allocations( + context::T, + sampled_environment, +) where {T} + benchmark_sampled_hard_call_invocation(context, sampled_environment) + return @allocated benchmark_sampled_hard_call_invocation( + context, + sampled_environment, + ) +end + +function hard_call_path_summary(model) + rows = PlantSimEngine.Diagnostics.explain_execution_plan(model) + return ( + no_call_targets=sum(( + row.batch_size for row in rows + if row.call_capability == :no_calls + ); init=0), + call_capable_targets=sum(( + row.batch_size for row in rows + if row.call_capability == :compiled_calls + ); init=0), + unrelated_no_call_targets=sum(( + row.batch_size for row in rows + if row.application_id == :unrelated && + row.call_capability == :no_calls + ); init=0), + ) +end + +function setup_lifecycle_hard_call_benchmark(; + nobjects=1000, + usage=:zero, +) + model, _ = setup_hard_call_path_benchmark(; + nobjects=nobjects, + usage=usage, + steps=1, + ) + simulation = run!( + model; + steps=1, + outputs=:none, + performance=true, + ) + return simulation, nobjects + 1 +end + +function benchmark_lifecycle_event(simulation, new_index) + new_id = Symbol(:leaf_, new_index) + register_object!( + simulation.model, + PlantSimEngine.Object( + new_id; + scale=:Leaf, + name=new_id, + parent=:scene, + ), + ) + continue!(simulation) + return simulation +end diff --git a/benchmark/test-multirate-buffer-benchmark.jl b/benchmark/test-multirate-buffer-benchmark.jl index 2bc67d5a5..ac35ead70 100644 --- a/benchmark/test-multirate-buffer-benchmark.jl +++ b/benchmark/test-multirate-buffer-benchmark.jl @@ -1,6 +1,4 @@ using PlantSimEngine -using MultiScaleTreeGraph -using PlantMeteo using Dates PlantSimEngine.@process "mrbenchsource" verbose = false @@ -9,90 +7,83 @@ struct MRBenchSourceModel <: AbstractMrbenchsourceModel end PlantSimEngine.inputs_(::MRBenchSourceModel) = NamedTuple() PlantSimEngine.outputs_(::MRBenchSourceModel) = (X=-Inf,) -function PlantSimEngine.run!(m::MRBenchSourceModel, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(m::MRBenchSourceModel, status, environment, constants=nothing, context=nothing) m.n[] += 1 status.X = float(m.n[]) end PlantSimEngine.@process "mrbenchconsumer4" verbose = false struct MRBenchConsumer4Model <: AbstractMrbenchconsumer4Model end -PlantSimEngine.inputs_(::MRBenchConsumer4Model) = (X=[-Inf],) +PlantSimEngine.inputs_(::MRBenchConsumer4Model) = (X=Required(Vector{Float64}),) PlantSimEngine.outputs_(::MRBenchConsumer4Model) = (Y4=-Inf,) -function PlantSimEngine.run!(::MRBenchConsumer4Model, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(::MRBenchConsumer4Model, status, environment, constants=nothing, context=nothing) status.Y4 = sum(status.X) end PlantSimEngine.@process "mrbenchconsumer24" verbose = false struct MRBenchConsumer24Model <: AbstractMrbenchconsumer24Model end -PlantSimEngine.inputs_(::MRBenchConsumer24Model) = (X=[-Inf],) +PlantSimEngine.inputs_(::MRBenchConsumer24Model) = (X=Required(Vector{Float64}),) PlantSimEngine.outputs_(::MRBenchConsumer24Model) = (Y24=-Inf,) -function PlantSimEngine.run!(::MRBenchConsumer24Model, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(::MRBenchConsumer24Model, status, environment, constants=nothing, context=nothing) status.Y24 = sum(status.X) end -function _build_multirate_benchmark_mtg(nleaves::Int) - mtg = Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) - plant = Node(mtg, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - internode = Node(plant, MultiScaleTreeGraph.NodeMTG("/", :Internode, 1, 2)) - - for i in 1:nleaves - Node(internode, MultiScaleTreeGraph.NodeMTG("+", :Leaf, i, 2)) - end - - return mtg +function _build_multirate_benchmark_objects(nleaves::Int) + objects = PlantSimEngine.Object[ + PlantSimEngine.Object(:plant; scale=:Plant), + ] + append!( + objects, + [ + PlantSimEngine.Object(Symbol(:leaf_, i); scale=:Leaf, parent=:plant) for + i in 1:nleaves + ], + ) + return objects end function setup_multirate_buffer_benchmark(; nleaves=2000, ndays=30) - mtg = _build_multirate_benchmark_mtg(nleaves) - - mapping = ModelMapping( - :Leaf => ( - ModelSpec(MRBenchSourceModel(Ref(0))) |> TimeStepModel(1.0), - ), - :Plant => ( - ModelSpec(MRBenchConsumer4Model()) |> - MultiScaleModel([:X => [:Leaf]]) |> - TimeStepModel(ClockSpec(4.0, 1.0)) |> - InputBindings(; X=(process=:mrbenchsource, var=:X, scale=:Leaf, policy=Integrate())), - ModelSpec(MRBenchConsumer24Model()) |> - MultiScaleModel([:X => [:Leaf]]) |> - TimeStepModel(ClockSpec(24.0, 1.0)) |> - InputBindings(; X=(process=:mrbenchsource, var=:X, scale=:Leaf, policy=Integrate())), - ), + objects = _build_multirate_benchmark_objects(nleaves) + applications = ( + ModelSpec(MRBenchSourceModel(Ref(0)); name=:hourly_source, on=Many(scale=:Leaf), every=Hour(1)), + ModelSpec(MRBenchConsumer4Model(); name=:four_hour_consumer, on=One(scale=:Plant), inputs=(:X => Many( + scale=:Leaf, + within=Subtree(), + application=:hourly_source, + var=:X, + policy=Integrate(), + window=Hour(4), + )), every=Hour(4)), + ModelSpec(MRBenchConsumer24Model(); name=:daily_consumer, on=One(scale=:Plant), inputs=(:X => Many( + scale=:Leaf, + within=Subtree(), + application=:hourly_source, + var=:X, + policy=Integrate(), + window=Day(1), + )), every=Day(1)), ) nsteps = 24 * ndays - meteo = Weather(repeat([Atmosphere(T=20.0, Wind=1.0, Rh=0.65)], nsteps)) + environment = [(T=20.0, Wind=1.0, Rh=0.65, duration=Hour(1)) for _ in 1:nsteps] + model = CompositeModel(objects...; applications=applications, environment=environment) reqs = [ - OutputRequest(:Leaf, :X; name=:x_hourly, process=:mrbenchsource, policy=HoldLast()), - OutputRequest(:Leaf, :X; name=:x_daily_sum, process=:mrbenchsource, policy=Integrate(), clock=ClockSpec(24.0, 1.0)), + OutputRequest(:Plant, :Y4; name=:four_hour_total, application=:four_hour_consumer), + OutputRequest(:Plant, :Y24; name=:daily_total, application=:daily_consumer), + OutputRequest(:Leaf, :X; name=:x_daily_sum, application=:hourly_source, policy=Integrate(), clock=Day(1)), ] + return model, reqs, nsteps +end - tracked = Dict(:Plant => (:Y4, :Y24), :Leaf => (:X,)) - return mtg, mapping, meteo, reqs, tracked, nsteps +function benchmark_multirate_retain_all_run(model, nsteps) + return run!(model; steps=nsteps, outputs=:all) end -function benchmark_multirate_status_tracked_run(mtg, mapping, meteo, tracked, nsteps) - run!( - mtg, - mapping, - meteo, - nsteps=nsteps, - check=true, - executor=SequentialEx(), - tracked_outputs=tracked - ) +function benchmark_multirate_output_request_run(model, reqs, nsteps) + return run!(model; steps=nsteps, outputs=reqs) end -function benchmark_multirate_output_request_run(mtg, mapping, meteo, reqs, tracked, nsteps) - run!( - mtg, - mapping, - meteo, - nsteps=nsteps, - check=true, - executor=SequentialEx(), - tracked_outputs=reqs - ) +function benchmark_multirate_no_output_run(model, nsteps) + return run!(model; steps=nsteps, outputs=:none) end diff --git a/benchmark/test-plantbiophysics.jl b/benchmark/test-plantbiophysics.jl index 83b6f0c21..5e685df3c 100644 --- a/benchmark/test-plantbiophysics.jl +++ b/benchmark/test-plantbiophysics.jl @@ -1,182 +1,254 @@ -# For local testing : -#using Pkg -#Pkg.develop("PlantSimEngine") -#using PlantSimEngine - -using Pkg -#Pkg.add(url="https://github.com/VEZY/PlantBiophysics.jl#dev") -#Pkg.instantiate() -using Statistics -#using DataFrames -#using CSV -using Random +using BenchmarkTools +using CSV +using Dates +using DataFrames using PlantBiophysics -#using BenchmarkTools -#using Test -#using PlantMeteo - -function benchmark_plantbiophysics() - - Random.seed!(1) # Set random seed - microbenchmark_steps = 100 # Number of times the microbenchmark is run - microbenchmark_evals = 1 # N. times each sample is run to be sure of the output - N = 100 # Number of timesteps simulated for each microbenchmark step +using PlantMeteo +using PlantSimEngine +using Random - length_range = 10000 - Ra_SW_f = range(10, 500, length=length_range) - Ta = range(18, 40, length=length_range) - Wind = range(0.5, 20, length=length_range) - P = range(90, 101, length=length_range) - Rh = range(0.1, 0.98, length=length_range) - Ca = range(360, 900, length=length_range) - skyF = range(0.0, 1.0, length=length_range) - d = range(0.001, 0.5, length=length_range) - Jmax = range(200.0, 300.0, length=length_range) - Vmax = range(150.0, 250.0, length=length_range) - Rd = range(0.3, 2.0, length=length_range) - TPU = range(5.0, 20.0, length=length_range) - g0 = range(0.001, 2.0, length=length_range) - g1 = range(0.5, 15.0, length=length_range) - vars = hcat([Ta, Wind, P, Rh, Ca, Jmax, Vmax, Rd, Ra_SW_f, skyF, d, TPU, g0, g1]) +function _plantbiophysics_forcing_set(n::Int) + Random.seed!(1) + length_range = 10_000 + ranges = ( + T=range(18, 40; length=length_range), + Wind=range(0.5, 20; length=length_range), + P=range(90, 101; length=length_range), + Rh=range(0.1, 0.98; length=length_range), + Ca=range(360, 900; length=length_range), + JMaxRef=range(200.0, 300.0; length=length_range), + VcMaxRef=range(150.0, 250.0; length=length_range), + RdRef=range(0.3, 2.0; length=length_range), + Ra_SW_f=range(10, 500; length=length_range), + sky_fraction=range(0.0, 1.0; length=length_range), + d=range(0.001, 0.5; length=length_range), + TPURef=range(5.0, 20.0; length=length_range), + g0=range(0.001, 2.0; length=length_range), + g1=range(0.5, 15.0; length=length_range), + ) + columns = (; ( + name => [rand(values) for _ in 1:n] + for (name, values) in pairs(ranges) + )...) + return DataFrame(columns) +end - set = [rand.(vars) for i = 1:N] - set = reshape(vcat(set...), (length(set[1]), length(set)))' - name = [ - "T", - "Wind", - "P", - "Rh", - "Ca", - "JMaxRef", - "VcMaxRef", - "RdRef", - "Ra_SW_f", - "sky_fraction", - "d", - "TPURef", - "g0", - "g1", - ] - set = DataFrame(set, name) - @. set[!, :vpd] = e_sat(set.T) - vapor_pressure(set.T, set.Rh) - @. set[!, :aPPFD] = set.Ra_SW_f * 0.48 * 4.57 +function _plantbiophysics_atmosphere(row) + return Atmosphere( + T=row.T, + Wind=row.Wind, + P=row.P, + Rh=row.Rh, + Cₐ=row.Ca, + duration=Hour(1), + ) +end - constants = Constants() - #time_PB = Vector{Float64}(undef, N*microbenchmark_steps) - for i = 1:N - leaf = ModelMapping( - energy_balance=Monteith(), - photosynthesis=Fvcb( - VcMaxRef=set.VcMaxRef[i], - JMaxRef=set.JMaxRef[i], - RdRef=set.RdRef[i], - TPURef=set.TPURef[i], - ), - stomatal_conductance=Medlyn(set.g0[i], set.g1[i]), - status=( - Ra_SW_f=set.Ra_SW_f[i], - sky_fraction=set.sky_fraction[i], - aPPFD=set.aPPFD[i], - d=set.d[i], - ), - ) - #deps = PlantSimEngine.dep(leaf) - meteo = Atmosphere(T=set.T[i], Wind=set.Wind[i], P=set.P[i], Rh=set.Rh[i], Cₐ=set.Ca[i]) - #st = PlantMeteo.row_struct(leaf.status[1]) - #b_PB = @benchmark run!($leaf, $meteo, $constants, nothing; executor = ThreadedEx()) evals = microbenchmark_evals samples = microbenchmark_steps - run!(leaf, meteo, constants, nothing; executor=ThreadedEx()) +function _plantbiophysics_leaf_scene( + row; + environment=_plantbiophysics_atmosphere(row), +) + return PlantBiophysics.leaf_scene( + Monteith(), + Fvcb( + VcMaxRef=row.VcMaxRef, + JMaxRef=row.JMaxRef, + RdRef=row.RdRef, + TPURef=row.TPURef, + ), + Medlyn(row.g0, row.g1); + status=Status( + Ra_SW_f=row.Ra_SW_f, + sky_fraction=row.sky_fraction, + aPPFD=row.Ra_SW_f * 0.48 * 4.57, + d=row.d, + ), + environment=environment, + ) +end - # transform in seconds - #=for j in 1:microbenchmark_steps - time_PB[microbenchmark_steps*(i-1) + j] = b_PB.times[j]*1e-9 - end=# - end - #return time_PB +function setup_plantbiophysics_multistep(; nsteps=8760) + forcing = _plantbiophysics_forcing_set(nsteps) + environment = Weather([ + _plantbiophysics_atmosphere(row) + for row in eachrow(forcing) + ]) + return ( + _plantbiophysics_leaf_scene(first(eachrow(forcing)); environment), + nsteps, + ) end -function setup_benchmark_plantbiophysics_multitimestep() +function benchmark_plantbiophysics_multistep(model, nsteps; outputs=:none) + return run!(model; steps=nsteps, outputs=outputs) +end - Random.seed!(1) # Set random seed - N = 100 # Number of timesteps simulated for each microbenchmark step +function setup_benchmark_plantbiophysics_batch(; n=100) + forcing = _plantbiophysics_forcing_set(n) + return [_plantbiophysics_leaf_scene(row) for row in eachrow(forcing)] +end - length_range = 10000 - Ra_SW_f = range(10, 500, length=length_range) - Ta = range(18, 40, length=length_range) - Wind = range(0.5, 20, length=length_range) - P = range(90, 101, length=length_range) - Rh = range(0.1, 0.98, length=length_range) - Ca = range(360, 900, length=length_range) - skyF = range(0.0, 1.0, length=length_range) - d = range(0.001, 0.5, length=length_range) - Jmax = range(200.0, 300.0, length=length_range) - Vmax = range(150.0, 250.0, length=length_range) - Rd = range(0.3, 2.0, length=length_range) - TPU = range(5.0, 20.0, length=length_range) - g0 = range(0.001, 2.0, length=length_range) - g1 = range(0.5, 15.0, length=length_range) - vars = hcat([Ta, Wind, P, Rh, Ca, Jmax, Vmax, Rd, Ra_SW_f, skyF, d, TPU, g0, g1]) +function benchmark_plantbiophysics_batch(scenes) + constants = Constants() + for model in scenes + run!(model; constants=constants, outputs=:none) + end + return nothing +end - set = [rand.(vars) for i = 1:N] - set = reshape(vcat(set...), (length(set[1]), length(set)))' - name = [ - "T", - "Wind", - "P", - "Rh", - "Ca", - "JMaxRef", - "VcMaxRef", - "RdRef", - "Ra_SW_f", - "sky_fraction", - "d", - "TPURef", - "g0", - "g1", - ] - set = DataFrame(set, name) - @. set[!, :vpd] = e_sat(set.T) - vapor_pressure(set.T, set.Rh) - @. set[!, :aPPFD] = set.Ra_SW_f * 0.48 * 4.57 +function benchmark_plantbiophysics_fanout(; n=100) + scenes = setup_benchmark_plantbiophysics_batch(; n=n) + return benchmark_plantbiophysics_batch(scenes) +end - leaf = Vector{ModelMapping}(undef, N) - for i = 1:N - leaf[i] = ModelMapping( - energy_balance=Monteith(), - photosynthesis=Fvcb( - VcMaxRef=set.VcMaxRef[i], - JMaxRef=set.JMaxRef[i], - RdRef=set.RdRef[i], - TPURef=set.TPURef[i], - ), - stomatal_conductance=Medlyn(set.g0[i], set.g1[i]), - status=( - Ra_SW_f=set.Ra_SW_f, - sky_fraction=set.sky_fraction, - aPPFD=set.aPPFD, - d=set.d, - ), - ) +function _plantbiophysics_performance_record( + stage, + trial; + scope, + output_policy, + nscenes, + nsteps_per_scene, +) + median_estimate = BenchmarkTools.median(trial) + minimum_estimate = BenchmarkTools.minimum(trial) + total_model_steps = nscenes * nsteps_per_scene + median_time_per_step_ns = if iszero(total_model_steps) + NaN + else + median_estimate.time / total_model_steps end - - atm = Vector{Atmosphere}(undef, N) - for i in 1:N - atm[i] = Atmosphere(T=set.T[i], Wind=set.Wind[i], P=set.P[i], Rh=set.Rh[i], Cₐ=set.Ca[i]) + minimum_time_per_step_ns = if iszero(total_model_steps) + NaN + else + minimum_estimate.time / total_model_steps end - meteo = Weather(atm) - - return leaf, meteo + return ( + recorded_at=Dates.format( + Dates.now(), + dateformat"yyyy-mm-ddTHH:MM:SS.sss", + ), + stage=String(stage), + julia_version=string(VERSION), + threads=Threads.nthreads(), + plantsimengine_version=string(pkgversion(PlantSimEngine)), + plantbiophysics_version=string(pkgversion(PlantBiophysics)), + scope=String(scope), + output_policy=String(output_policy), + nscenes=nscenes, + nsteps_per_scene=nsteps_per_scene, + total_model_steps=total_model_steps, + samples=length(trial), + median_time_ns=median_estimate.time, + minimum_time_ns=minimum_estimate.time, + median_time_per_step_ns=median_time_per_step_ns, + minimum_time_per_step_ns=minimum_time_per_step_ns, + median_memory_bytes=median_estimate.memory, + minimum_memory_bytes=minimum_estimate.memory, + median_allocations=median_estimate.allocs, + minimum_allocations=minimum_estimate.allocs, + ) end -function benchmark_plantbiophysics_multitimestep_MT(leaf, meteo) - N = length(meteo) - for i in 1:N - run!(leaf[i], meteo, Constants(), nothing; executor=ThreadedEx()) - end +function run_plantbiophysics_performance_profile(; + nsteps=8760, + fanout_scenes=100, + samples=10, +) + nsteps > 0 || error("PlantBiophysics benchmark step count must be positive.") + fanout_scenes > 0 || + error("PlantBiophysics benchmark fan-out count must be positive.") + samples > 0 || + error("PlantBiophysics benchmark sample count must be positive.") + + warm_model, warm_steps = setup_plantbiophysics_multistep(; + nsteps=min(nsteps, 2), + ) + benchmark_plantbiophysics_multistep( + warm_model, + warm_steps; + outputs=:none, + ) + warm_model, warm_steps = setup_plantbiophysics_multistep(; + nsteps=min(nsteps, 2), + ) + benchmark_plantbiophysics_multistep( + warm_model, + warm_steps; + outputs=:all, + ) + benchmark_plantbiophysics_fanout(; n=min(fanout_scenes, 2)) + + no_retention_trial = BenchmarkTools.@benchmark benchmark_plantbiophysics_multistep( + model, + $nsteps; + outputs=:none, + ) setup = ((model, setup_steps) = setup_plantbiophysics_multistep( + nsteps=$nsteps, + )) samples = samples evals = 1 + retain_all_trial = BenchmarkTools.@benchmark benchmark_plantbiophysics_multistep( + model, + $nsteps; + outputs=:all, + ) setup = ((model, setup_steps) = setup_plantbiophysics_multistep( + nsteps=$nsteps, + )) samples = samples evals = 1 + construction_trial = BenchmarkTools.@benchmark setup_plantbiophysics_multistep( + nsteps=$nsteps, + ) samples = samples evals = 1 + fanout_trial = BenchmarkTools.@benchmark benchmark_plantbiophysics_batch( + scenes, + ) setup = (scenes = setup_benchmark_plantbiophysics_batch( + n=$fanout_scenes, + )) samples = samples evals = 1 + + return [ + _plantbiophysics_performance_record( + :steady_state_no_retention, + no_retention_trial; + scope=:one_setup_many_timesteps, + output_policy=:none, + nscenes=1, + nsteps_per_scene=nsteps, + ), + _plantbiophysics_performance_record( + :steady_state_retain_all, + retain_all_trial; + scope=:one_setup_many_timesteps, + output_policy=:all, + nscenes=1, + nsteps_per_scene=nsteps, + ), + _plantbiophysics_performance_record( + :construction_only, + construction_trial; + scope=:setup, + output_policy=:not_applicable, + nscenes=1, + nsteps_per_scene=0, + ), + _plantbiophysics_performance_record( + :one_step_fanout, + fanout_trial; + scope=:many_setups_one_timestep, + output_policy=:none, + nscenes=fanout_scenes, + nsteps_per_scene=1, + ), + ] end -function benchmark_plantbiophysics_multitimestep_ST(leaf, meteo) - N = length(meteo) - for i in 1:N - run!(leaf[i], meteo, Constants(), nothing; executor=SequentialEx()) - end -end \ No newline at end of file +function write_plantbiophysics_performance_profile( + path; + nsteps=8760, + fanout_scenes=100, + samples=10, +) + records = run_plantbiophysics_performance_profile(; + nsteps=nsteps, + fanout_scenes=fanout_scenes, + samples=samples, + ) + mkpath(dirname(path)) + CSV.write(path, DataFrame(records)) + return records +end diff --git a/benchmark/test-xpalm.jl b/benchmark/test-xpalm.jl index e3d9f7c98..e06317c2a 100644 --- a/benchmark/test-xpalm.jl +++ b/benchmark/test-xpalm.jl @@ -1,60 +1,235 @@ -#using Pkg -#Pkg.develop("PlantSimEngine") -#using PlantSimEngine - -using Pkg -#Pkg.add(url="https://github.com/PalmStudio/XPalm.jl#dev") -#Pkg.instantiate() -using Test -using PlantMeteo#, MultiScaleTreeGraph -#using CairoMakie, AlgebraOfGraphics -using DataFrames, CSV, Statistics +using BenchmarkTools +using CSV +using DataFrames using Dates +using PlantSimEngine using XPalm -using BenchmarkTools -function xpalm_default_param_create() - meteo = CSV.read(joinpath(dirname(dirname(pathof(XPalm))), "0-data", "meteo.csv"), DataFrame) - #meteo.duration = [Dates.Day(i[1:1]) for i in meteo.duration] - m = Weather(meteo) +const XPALM_REFERENCE_BENCHMARK_VARIABLES = Dict{Symbol,Any}( + :Scene => (:lai, :leaf_area, :aPPFD), + :Plant => ( + :plant_age, + :leaf_area, + :aPPFD, + :Rm, + :carbon_assimilation, + :phytomer_count, + :biomass_bunch_harvested, + :biomass_bunch_harvested_cum, + :n_bunches_harvested, + :n_bunches_harvested_cum, + :biomass_oil_harvested, + :biomass_oil_harvested_cum, + ), + :Soil => (:ftsw, :root_depth), +) + +const XPALM_SMALL_BENCHMARK_VARIABLES = Dict{Symbol,Any}( + :Scene => (:lai,), +) + +function _xpalm_output_requests(model, vars) + applications = PlantSimEngine.Diagnostics.explain_applications(model) + requests = OutputRequest[] + for (scale, variables) in pairs(vars) + for variable in variables + scale_symbol = Symbol(scale) + variable_symbol = Symbol(variable) + candidates = [ + row.application_id + for row in applications + if ( + scale_symbol in row.target_scales || + PlantSimEngine.Diagnostics.object_address( + row.applies_to, + ).scale == scale_symbol + ) && variable_symbol in row.outputs + ] + isempty(candidates) && error( + "No XPalm benchmark output publisher for `$(scale_symbol).$(variable_symbol)`.", + ) + push!( + requests, + OutputRequest( + scale_symbol, + variable_symbol; + name=Symbol(scale, "__", variable), + application=last(candidates), + ), + ) + end + end + return requests +end + +function _xpalm_benchmark_meteo(; nsteps=nothing) + meteo = CSV.read( + joinpath(dirname(dirname(pathof(XPalm))), "0-data", "meteo.csv"), + DataFrame, + ) + :duration in propertynames(meteo) || + (meteo.duration = fill(Day(1), nrow(meteo))) + isnothing(nsteps) && return meteo + requested_steps = Int(nsteps) + 1 <= requested_steps <= nrow(meteo) || error( + "XPalm benchmark `nsteps` must be between 1 and $(nrow(meteo)), got $(requested_steps).", + ) + return meteo[1:requested_steps, :] +end - out_vars = Dict{Symbol,Any}( +function xpalm_reference_model_create(; nsteps=nothing) + meteo = _xpalm_benchmark_meteo(; nsteps=nsteps) + palm = XPalm.Palm( + initiation_age=0, + parameters=XPalm.default_parameters(), + ) + model = XPalm.xpalm_scene(palm; environment=meteo) + return model, nrow(meteo) +end + +function _xpalm_benchmark_scene(vars; nsteps=nothing) + model, resolved_steps = xpalm_reference_model_create(; nsteps=nsteps) + return model, _xpalm_output_requests(model, vars), resolved_steps +end + +function xpalm_default_param_create(; nsteps=nothing) + vars = Dict{Symbol,Any}( :Scene => (:lai,), - # :Scene => (:LAI, :scene_leaf_area, :aPPFD, :TEff), - # :Plant => (:plant_age, :ftsw, :newPhytomerEmergence, :aPPFD, :plant_leaf_area, :carbon_assimilation, :carbon_offer_after_rm, :Rm, :TT_since_init, :TEff, :phytomer_count, :newPhytomerEmergence), - :Leaf => (:Rm, :potential_area, :TT_since_init, :TEff, :biomass, :carbon_demand, :carbon_allocation,), - # :Leaf => (:Rm, :potential_area), - # :Internode => (:Rm, :carbon_allocation, :carbon_demand), + :Leaf => ( + :Rm, + :potential_area, + :TT_since_init, + :biomass, + :carbon_demand, + ), :Male => (:Rm,), - # :Female => (:biomass,), - # :Soil => (:TEff, :ftsw, :root_depth), ) + return _xpalm_benchmark_scene(vars; nsteps=nsteps) +end - # Example 1: Run the model with the default parameters (but output as a DataFrame): - palm = XPalm.Palm(initiation_age=0, parameters=XPalm.default_parameters()) - models = XPalm.model_mapping(palm) - return palm, models, out_vars, m +function xpalm_small_param_create(; nsteps=nothing) + return _xpalm_benchmark_scene( + XPALM_SMALL_BENCHMARK_VARIABLES; + nsteps=nsteps, + ) end -function xpalm_default_param_run(palm, models, out_vars, meteo) - sim_outputs = PlantSimEngine.run!(palm.mtg, models, meteo, tracked_outputs=out_vars, executor=PlantSimEngine.SequentialEx(), check=false) - return sim_outputs +function xpalm_reference_param_create(; nsteps=nothing) + return _xpalm_benchmark_scene( + XPALM_REFERENCE_BENCHMARK_VARIABLES; + nsteps=nsteps, + ) end -function xpalm_default_param_convert_outputs(sim_outputs) - df = PlantSimEngine.convert_outputs(sim_outputs, DataFrame, no_value=missing) - return df +function xpalm_reference_end_to_end(; nsteps=nothing) + meteo = _xpalm_benchmark_meteo(; nsteps=nsteps) + return XPalm.xpalm( + meteo, + DataFrame; + vars=XPALM_REFERENCE_BENCHMARK_VARIABLES, + architecture=false, + palm=XPalm.Palm( + initiation_age=0, + parameters=XPalm.default_parameters(), + ), + ) end +function xpalm_default_param_run( + model, + requests, + nsteps; + outputs=requests, + performance=false, +) + return PlantSimEngine.run!( + model; + steps=nsteps, + outputs=outputs, + performance=performance, + ) +end + +function xpalm_reference_final_phytomer_count(simulation) + plant = only(PlantSimEngine.model_objects(simulation.model; scale=:Plant)) + return plant.status.phytomer_count +end + +function xpalm_reference_final_state(simulation) + plant = only(PlantSimEngine.model_objects(simulation.model; scale=:Plant)) + scene = only(PlantSimEngine.model_objects(simulation.model; scale=:Scene)) + soil = only(PlantSimEngine.model_objects(simulation.model; scale=:Soil)) + return ( + current_step=PlantSimEngine.current_step(simulation), + phytomer_count=plant.status.phytomer_count, + lai=scene.status.lai, + ftsw=soil.status.ftsw, + ) +end + +function xpalm_reference_param_run( + model, + requests, + nsteps; + outputs=requests, + performance=false, +) + return xpalm_default_param_run( + model, + requests, + nsteps; + outputs=outputs, + performance=performance, + ) +end -println(Pkg.status("XPalm")) +function xpalm_reference_full_cycle_expected_state() + return ( + current_step=4160, + phytomer_count=344, + lai=5.0587602356164405, + ftsw=0.7991179101191216, + ) +end -#=@testset "XPalm simple test" begin - # default number of seconds is 5 - b_XP = @benchmark xpalm_default_param_run() seconds = 120 +function xpalm_reference_state_matches( + state, + expected=xpalm_reference_full_cycle_expected_state(); + atol=1.0e-8, + rtol=1.0e-8, +) + return state.current_step == expected.current_step && + state.phytomer_count == expected.phytomer_count && + isapprox(state.lai, expected.lai; atol=atol, rtol=rtol) && + isapprox(state.ftsw, expected.ftsw; atol=atol, rtol=rtol) +end - #N = length(b_XP.times) +function xpalm_reference_high_level_final_state(outputs) + plant = outputs[:Plant] + scene = outputs[:Scene] + soil = outputs[:Soil] + return ( + current_step=nrow(plant), + phytomer_count=last(plant.phytomer_count), + lai=last(scene.lai), + ftsw=last(soil.ftsw), + ) +end - @test mean(b_XP.times*1e-9) > 10 - @test mean(b_XP.times*1e-9) < 15 -end =# \ No newline at end of file +function xpalm_reference_high_level_state_matches( + outputs; + expected=xpalm_reference_full_cycle_expected_state(), + atol=1.0e-8, + rtol=1.0e-8, +) + return xpalm_reference_state_matches( + xpalm_reference_high_level_final_state(outputs), + expected; + atol=atol, + rtol=rtol, + ) +end + +function xpalm_default_param_collect_outputs(simulation) + return PlantSimEngine.collect_outputs(simulation; sink=DataFrame) +end diff --git a/benchmark/test/runtests.jl b/benchmark/test/runtests.jl new file mode 100644 index 000000000..4eb4100f3 --- /dev/null +++ b/benchmark/test/runtests.jl @@ -0,0 +1,920 @@ +using BenchmarkTools +using CSV +using DataFrames +using Dates +using MultiScaleTreeGraph +using PlantMeteo +using PlantSimEngine +using PlantSimEngine.Examples +using Profile +using Statistics +using Test +using TOML + +const BENCHMARK_TEST_PATTERN = + isempty(ARGS) ? nothing : Regex(only(ARGS), "i") +benchmark_test_enabled(name) = + isnothing(BENCHMARK_TEST_PATTERN) || + occursin(BENCHMARK_TEST_PATTERN, name) + +if benchmark_test_enabled("full-performance project bootstrap smoke") + @testset "full-performance project bootstrap smoke" begin + include( + joinpath( + @__DIR__, + "..", + "prepare_full_performance_project.jl", + ), + ) + mktempdir() do directory + project_path = joinpath(directory, "Project.toml") + cp( + joinpath(@__DIR__, "..", "Project.toml"), + project_path, + ) + prepare_full_performance_project!(project_path) + project = TOML.parsefile(project_path) + @test !haskey(project, "sources") + @test haskey(project["deps"], "PlantSimEngine") + @test haskey(project["deps"], "XPalm") + @test haskey(project["deps"], "PlantBiophysics") + end + mktempdir() do directory + project_path = joinpath(directory, "Project.toml") + cp( + joinpath(@__DIR__, "..", "Project.toml"), + project_path, + ) + prepare_plantbiophysics_performance_project!(project_path) + project = TOML.parsefile(project_path) + @test !haskey(project, "sources") + @test haskey(project["deps"], "PlantSimEngine") + @test haskey(project["deps"], "PlantBiophysics") + @test !haskey(project["deps"], "XPalm") + end + + release_root = joinpath(@__DIR__, "..", "release_baselines") + release_projects = Dict( + :plantbiophysics => TOML.parsefile( + joinpath(release_root, "plantbiophysics", "Project.toml"), + ), + :xpalm => TOML.parsefile( + joinpath(release_root, "xpalm", "Project.toml"), + ), + ) + @test release_projects[:plantbiophysics]["sources"][ + "PlantBiophysics" + ]["rev"] == "9f39af4ffd48bab234e5d80b89cd52c67b9f3f82" + @test release_projects[:plantbiophysics]["sources"][ + "PlantSimEngine" + ]["rev"] == "503af98c3709a0b1207407e3741b7cb09ebfbcf7" + @test release_projects[:xpalm]["sources"]["XPalm"]["rev"] == + "a0dbf2e8d6fa9e21f8e8ced3220da184b3ee3f4c" + @test release_projects[:xpalm]["sources"][ + "PlantSimEngine" + ]["rev"] == "503af98c3709a0b1207407e3741b7cb09ebfbcf7" + for downstream in keys(release_projects) + runner = joinpath(release_root, String(downstream), "run.jl") + @test Meta.parseall(read(runner, String)) isa Expr + end + end +end + +if benchmark_test_enabled("PlantSimEngine benchmark API smoke") + @testset "PlantSimEngine benchmark API smoke" begin + include(joinpath(@__DIR__, "..", "test-PSE-benchmark.jl")) + model, requests, _ = setup_heavier_model_benchmark() + simulation = benchmark_heavier_scene(model, requests, 1) + @test current_step(simulation) == 1 + @test !isempty(collect_outputs(simulation; sink=nothing)) + end +end + +if benchmark_test_enabled("multirate benchmark API smoke") + @testset "multirate benchmark API smoke" begin + include(joinpath(@__DIR__, "..", "test-multirate-buffer-benchmark.jl")) + model, requests, nsteps = + setup_multirate_buffer_benchmark(; ndays=1, nleaves=4) + simulation = + benchmark_multirate_output_request_run(model, requests, nsteps) + @test current_step(simulation) == nsteps + @test !isempty(collect_outputs(simulation; sink=nothing)) + no_output_model, _, no_output_steps = + setup_multirate_buffer_benchmark(; ndays=1, nleaves=4) + no_output_simulation = + benchmark_multirate_no_output_run( + no_output_model, + no_output_steps, + ) + @test current_step(no_output_simulation) == no_output_steps + retention = + PlantSimEngine.Diagnostics.explain_output_retention( + no_output_simulation, + ) + @test all( + row.reasons == (:temporal_dependency,) + for row in retention + ) + @test maximum( + length, + values(outputs(no_output_simulation)), + ) <= 25 + end +end + +if benchmark_test_enabled("lifecycle benchmark API smoke") + @testset "lifecycle benchmark API smoke" begin + isdefined(@__MODULE__, :BenchmarkCallSourceModel) || + include( + joinpath( + @__DIR__, + "..", + "test-hard-call-path-benchmark.jl", + ), + ) + for (nobjects, usage) in ( + (8, :zero), + (64, :zero), + (16, :dense), + ) + simulation, new_index = + setup_lifecycle_hard_call_benchmark(; + nobjects=nobjects, + usage=usage, + ) + benchmark_lifecycle_event(simulation, new_index) + new_id = Symbol(:leaf_, new_index) + new_object = only( + object for object in model_objects( + simulation.model; + scale=:Leaf, + ) + if object.id == ObjectId(new_id) + ) + @test current_step(simulation) == 2 + @test new_object.status.work == 1 + @test new_object.status.signal == 1 + if usage == :dense + @test new_object.status.called_signal == 1 + end + performance = + PlantSimEngine.Advanced.runtime_performance(simulation) + @test performance.counts[ + :execution_target_rebuild_new + ] <= 3 + end + end +end + +if benchmark_test_enabled("hard-call path benchmark API smoke") + @testset "hard-call path benchmark API smoke" begin + include(joinpath(@__DIR__, "..", "test-hard-call-path-benchmark.jl")) + expected_call_targets = Dict( + :zero => 0, + :sparse => 1, + :dense => 16, + ) + for usage in (:zero, :sparse, :dense) + model, steps = setup_hard_call_path_benchmark(; + nobjects=16, + usage=usage, + steps=2, + ) + summary = hard_call_path_summary(model) + @test summary.call_capable_targets == + expected_call_targets[usage] + @test summary.unrelated_no_call_targets == 16 + simulation = benchmark_hard_call_path(model, steps) + @test current_step(simulation) == steps + @test all( + object.status.work == steps + for object in model_objects(model; scale=:Leaf) + ) + end + for (kind, repeats, target_count, expected_signal) in ( + (:singular, 1, 1, 2), + (:repeated, 8, 1, 16), + (:nested, 1, 1, 2), + (:many, 1, 8, 2), + (:published, 1, 1, 2), + ) + model, steps = setup_compiled_hard_call_benchmark(; + kind=kind, + repeats=repeats, + target_count=target_count, + steps=2, + ) + simulation = benchmark_compiled_hard_call(model, steps) + @test current_step(simulation) == steps + leaves = model_objects(model; scale=:Leaf) + @test length(leaves) == target_count + @test all( + leaf.status.signal == expected_signal for leaf in leaves + ) + end + heterogeneous_model, heterogeneous_steps = + setup_compiled_hard_call_benchmark(; + kind=:heterogeneous, + steps=2, + ) + heterogeneous_simulation = benchmark_compiled_hard_call( + heterogeneous_model, + heterogeneous_steps, + ) + heterogeneous_leaves = sort!( + model_objects(heterogeneous_model; scale=:Leaf); + by=object -> string(object.id.value), + ) + @test current_step(heterogeneous_simulation) == 2 + @test getproperty.(getproperty.(heterogeneous_leaves, :status), :signal) == + [2, 4] + sampled_model, sampled_steps = setup_compiled_hard_call_benchmark(; + kind=:sampled_environment, + steps=2, + ) + sampled_simulation = benchmark_compiled_hard_call( + sampled_model, + sampled_steps, + ) + sampled_leaf = only(model_objects(sampled_model; scale=:Leaf)) + @test current_step(sampled_simulation) == 2 + @test sampled_leaf.status.temperature_seen == 30.0 + for (kind, repeats, target_count) in ( + (:singular, 1, 1), + (:repeated, 8, 1), + (:nested, 1, 1), + (:many, 1, 8), + (:heterogeneous, 1, 2), + ) + setup_compiled_hard_call_step(; + kind=kind, + repeats=repeats, + target_count=target_count, + ) + context = BENCHMARK_BULK_CALL_CONTEXT[] + @test compiled_hard_call_invocation_allocations( + context; + repeats=repeats, + publish=false, + ) == 0 + end + setup_compiled_hard_call_step(; kind=:published) + published_context = BENCHMARK_BULK_CALL_CONTEXT[] + @test compiled_hard_call_invocation_allocations( + published_context; + publish=true, + ) <= 256 + setup_compiled_hard_call_step(; kind=:sampled_environment) + sampled_context = BENCHMARK_BULK_CALL_CONTEXT[] + @test sampled_hard_call_invocation_allocations( + sampled_context, + (T=31.0,), + ) == 0 + end +end + +if benchmark_test_enabled("internal-only benchmark suite assembly smoke") + @testset "internal-only benchmark suite assembly smoke" begin + benchmark_module = Module(:InternalOnlyBenchmarkSuite) + Core.eval( + benchmark_module, + :(include(path) = Base.include(@__MODULE__, path)), + ) + Core.eval(benchmark_module, :(const Object = Nothing)) + include_error = try + withenv( + "GITHUB_ACTIONS" => "true", + "PSE_BENCHMARK_INCLUDE_DOWNSTREAM" => nothing, + "PSE_BENCHMARK_FORCE_LEGACY_BASELINE" => nothing, + ) do + Base.include( + benchmark_module, + joinpath(@__DIR__, "..", "benchmarks.jl"), + ) + end + nothing + catch error + sprint(showerror, error, catch_backtrace()) + end + @test isnothing(include_error) + if isnothing(include_error) + suite = getfield( + benchmark_module, + :SUITE, + )[getfield(benchmark_module, :suite_name)] + @test haskey(suite, "PSE_status_read_write") + @test haskey(suite, "PSE") + @test haskey(suite, "PSE_hard_calls_zero") + @test haskey(suite, "PSE_lifecycle_large") + @test !haskey(suite, "PBP") + @test !haskey(suite, "PBP_batch_run") + @test !haskey(suite, "XPalm_run_100") + @test !haskey(suite, "XPalm_all_outputs_100") + end + end +end + +if benchmark_test_enabled("legacy benchmark suite assembly smoke") + @testset "legacy benchmark suite assembly smoke" begin + benchmark_module = Module(:LegacyBenchmarkSuite) + Core.eval( + benchmark_module, + :(include(path) = Base.include(@__MODULE__, path)), + ) + include_error = try + withenv( + "GITHUB_ACTIONS" => "true", + "PSE_BENCHMARK_INCLUDE_DOWNSTREAM" => nothing, + "PSE_BENCHMARK_FORCE_LEGACY_BASELINE" => "true", + ) do + Base.include( + benchmark_module, + joinpath(@__DIR__, "..", "benchmarks.jl"), + ) + end + nothing + catch error + sprint(showerror, error, catch_backtrace()) + end + @test isnothing(include_error) + if isnothing(include_error) + suite = getfield( + benchmark_module, + :SUITE, + )[getfield(benchmark_module, :suite_name)] + @test haskey(suite, "PSE_status_read_write") + @test !haskey(suite, "PSE") + @test !haskey(suite, "PSE_multirate_no_output_run") + @test !haskey(suite, "PSE_hard_calls_zero") + @test !haskey(suite, "PBP") + @test !haskey(suite, "XPalm_run_100") + end + end +end + +if benchmark_test_enabled("PlantBiophysics benchmark API smoke") + @testset "PlantBiophysics benchmark API smoke" begin + include(joinpath(@__DIR__, "..", "test-plantbiophysics.jl")) + scenes = setup_benchmark_plantbiophysics_batch(; n=2) + @test isnothing(benchmark_plantbiophysics_batch(scenes)) + model, nsteps = setup_plantbiophysics_multistep(; nsteps=2) + simulation = benchmark_plantbiophysics_multistep( + model, + nsteps; + outputs=:none, + ) + @test current_step(simulation) == nsteps + records = run_plantbiophysics_performance_profile(; + nsteps=2, + fanout_scenes=2, + samples=2, + ) + @test Set(record.stage for record in records) == + Set([ + "steady_state_no_retention", + "steady_state_retain_all", + "construction_only", + "one_step_fanout", + ]) + steady_records = filter( + record -> record.scope == "one_setup_many_timesteps", + records, + ) + @test length(steady_records) == 2 + @test all(record.nscenes == 1 for record in steady_records) + @test all(record.nsteps_per_scene == 2 for record in steady_records) + @test all(record.total_model_steps == 2 for record in steady_records) + @test all(record.samples == 2 for record in records) + @test all(record.minimum_time_ns > 0 for record in records) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("PlantBiophysics benchmark performance") + @testset "PlantBiophysics benchmark performance" begin + isdefined(@__MODULE__, :run_plantbiophysics_performance_profile) || + include(joinpath(@__DIR__, "..", "test-plantbiophysics.jl")) + output_path = get( + ENV, + "PSE_PLANTBIOPHYSICS_BENCHMARK_OUTPUT", + joinpath( + @__DIR__, + "..", + "results", + "plantbiophysics-full-latest.csv", + ), + ) + samples = parse( + Int, + get(ENV, "PSE_PLANTBIOPHYSICS_BENCHMARK_SAMPLES", "10"), + ) + nsteps = parse( + Int, + get(ENV, "PSE_PLANTBIOPHYSICS_BENCHMARK_STEPS", "8760"), + ) + fanout_scenes = parse( + Int, + get(ENV, "PSE_PLANTBIOPHYSICS_FANOUT_SCENES", "100"), + ) + records = write_plantbiophysics_performance_profile( + output_path; + nsteps=nsteps, + fanout_scenes=fanout_scenes, + samples=samples, + ) + @test isfile(output_path) + @test length(records) == 4 + @test only( + record.nsteps_per_scene for record in records + if record.stage == "steady_state_no_retention" + ) == nsteps + @test only( + record.nscenes for record in records + if record.stage == "one_step_fanout" + ) == fanout_scenes + @test all(record.samples == samples for record in records) + end +end + +if benchmark_test_enabled("XPalm benchmark API smoke") + @testset "XPalm benchmark API smoke" begin + include(joinpath(@__DIR__, "..", "test-xpalm.jl")) + model, requests, _ = xpalm_default_param_create() + simulation = PlantSimEngine.run!(model; steps=1, outputs=requests) + @test current_step(simulation) == 1 + @test !isempty(xpalm_default_param_collect_outputs(simulation)) + end +end + +if benchmark_test_enabled("XPalm staged performance profile smoke") + @testset "XPalm staged performance profile smoke" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + metadata = _performance_metadata(; warmup_policy="metadata smoke") + @test length(metadata.manifest_hash) == 64 + @test length(metadata.fixture_hash) == 64 + @test !isempty(metadata.hostname) + @test !isempty(metadata.plantgeom_revision) + result = run_xpalm_performance_profile(; profile=:smoke) + @test result.no_output_state == result.reference_state + @test result.small_state == result.reference_state + @test result.all_output_state == result.reference_state + @test result.reference_state.current_step == PERFORMANCE_SMOKE_STEPS + @test any( + row -> + row.stage == "simulation_reference_outputs" && + row.metric == "steps_executed" && + row.value == PERFORMANCE_SMOKE_STEPS, + result.records, + ) + @test any( + row -> + row.stage == "initial_scene_compilation" && + row.metric == "median_time", + result.records, + ) + @test any( + row -> + row.stage == "clean_steady_state_step" && + row.metric == "median_time", + result.records, + ) + @test any( + row -> + row.stage == "simulation_small_outputs" && + row.metric == "median_time", + result.records, + ) + @test any( + row -> + row.stage == "simulation_all_outputs" && + row.metric == "median_time", + result.records, + ) + @test any( + row -> + row.stage == "collect_reference_outputs" && + row.metric == "wall_time", + result.records, + ) + @test any( + row -> + row.stage == "simulation_reference_outputs" && + row.metric == "median_time", + result.records, + ) + @test any( + row -> + row.stage == "simulation_reference_outputs" && + row.metric == "minimum_allocations", + result.records, + ) + @test only( + row.value for row in result.records + if row.stage == "simulation_reference_outputs" && + row.metric == "samples" + ) == PERFORMANCE_STATISTICAL_SAMPLES + trial = BenchmarkTools.@benchmark 1 + 1 samples = 2 evals = 1 + group = BenchmarkTools.BenchmarkGroup() + group["tiny"] = trial + summary = _benchmark_summary_records(group, metadata) + @test length(summary) == 1 + @test only(summary).benchmark == "tiny" + @test only(summary).samples == 2 + @test only(summary).minimum_time_ns <= only(summary).median_time_ns + @test only(summary).median_allocations == 0 + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("benchmark suite assembly smoke") + @testset "benchmark suite assembly smoke" begin + include(joinpath(@__DIR__, "..", "benchmarks.jl")) + suite = SUITE[suite_name] + @test haskey(suite, "PSE_hard_calls_zero") + @test haskey(suite, "PSE_hard_calls_sparse") + @test haskey(suite, "PSE_hard_calls_dense") + @test haskey(suite, "PSE_compiled_hard_call_singular") + @test haskey(suite, "PSE_compiled_hard_call_repeated") + @test haskey(suite, "PSE_compiled_hard_call_nested") + @test haskey(suite, "PSE_compiled_hard_call_many") + @test haskey(suite, "PSE_compiled_hard_call_heterogeneous") + @test haskey(suite, "PSE_compiled_hard_call_sampled_environment") + @test haskey(suite, "PSE_compiled_hard_call_published") + @test haskey(suite, "PSE_lifecycle_small") + @test haskey(suite, "PSE_lifecycle_large") + @test haskey( + suite, + "PSE_lifecycle_immediate_hard_call", + ) + @test haskey(suite, "PSE_multirate_no_output_run") + @test haskey(suite, "PBP_multistep_no_outputs") + @test haskey(suite, "PBP_multistep_all_outputs") + @test haskey(suite, "PBP_construction") + @test haskey(suite, "PBP_one_step_fanout") + @test haskey(suite, "XPalm_small_outputs_100") + @test haskey(suite, "XPalm_all_outputs_100") + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm staged performance profile short") + @testset "XPalm staged performance profile short" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-short-latest.csv", + ) + result = write_xpalm_performance_profile(output_path; profile=:short) + @test result.no_output_state == result.reference_state + @test result.reference_state.current_step == PERFORMANCE_SHORT_STEPS + @test isfile(output_path) + @test any( + row -> + row.stage == "simulation_no_outputs" && + row.metric == "execution_targets_visited", + result.records, + ) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm staged performance profile medium") + @testset "XPalm staged performance profile medium" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-medium-latest.csv", + ) + result = write_xpalm_performance_profile(output_path; profile=:medium) + @test result.no_output_state == result.reference_state + @test result.reference_state.current_step == PERFORMANCE_MEDIUM_STEPS + @test isfile(output_path) + @test any( + row -> + row.stage == "simulation_no_outputs" && + row.metric == "output_retention_reuses", + result.records, + ) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm staged performance profile full") + @testset "XPalm staged performance profile full" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-full-latest.csv", + ) + result = write_xpalm_performance_profile(output_path; profile=:full) + @test result.no_output_state == result.reference_state + @test xpalm_reference_state_matches(result.reference_state) + @test isfile(output_path) + @test any( + row -> + row.stage == "historical_end_to_end_reference" && + row.metric == "wall_time", + result.records, + ) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm full no-output performance") + @testset "XPalm full no-output performance" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + _warmup_xpalm_performance!(PERFORMANCE_FULL_STEPS) + metadata = _performance_metadata(; + warmup_policy="unmeasured full-profile standard warmup", + ) + records = NamedTuple[] + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-full-no-output-latest.csv", + ) + model, nsteps = _measure_performance_stage!( + records, + metadata, + :full, + :scene_construction_no_outputs, + output_path, + ) do + xpalm_reference_model_create(; nsteps=PERFORMANCE_FULL_STEPS) + end + simulation = _measure_performance_stage!( + records, + metadata, + :full, + :simulation_no_outputs, + output_path, + ) do + xpalm_reference_param_run( + model, + OutputRequest[], + nsteps; + outputs=:none, + ) + end + final_state = xpalm_reference_final_state(simulation) + _record_xpalm_state!( + records, + metadata, + :full, + :final_state_no_outputs, + final_state, + ) + _checkpoint_performance_records(output_path, records) + @test final_state.current_step == PERFORMANCE_FULL_STEPS + @test final_state.phytomer_count == 344 + @test isfile(output_path) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm full warmed no-output performance") + @testset "XPalm full warmed no-output performance" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + warmup_model, warmup_steps = + xpalm_reference_model_create(; nsteps=PERFORMANCE_FULL_STEPS) + xpalm_reference_param_run( + warmup_model, + OutputRequest[], + warmup_steps; + outputs=:none, + ) + model, nsteps = + xpalm_reference_model_create(; nsteps=PERFORMANCE_FULL_STEPS) + metadata = _performance_metadata(; + warmup_policy="unmeasured complete 4,160-day lifecycle run", + ) + records = NamedTuple[] + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-full-warmed-no-output-latest.csv", + ) + simulation = _measure_performance_stage!( + records, + metadata, + :full, + :simulation_warmed_no_outputs, + output_path, + ) do + xpalm_reference_param_run( + model, + OutputRequest[], + nsteps; + outputs=:none, + ) + end + final_state = xpalm_reference_final_state(simulation) + _record_xpalm_state!( + records, + metadata, + :full, + :final_state_warmed_no_outputs, + final_state, + ) + _checkpoint_performance_records(output_path, records) + wall_time = only( + row.value for row in records + if row.stage == "simulation_warmed_no_outputs" && + row.metric == "wall_time" + ) + @test final_state.current_step == PERFORMANCE_FULL_STEPS + @test final_state.phytomer_count == 344 + @test xpalm_reference_state_matches(final_state) + @test wall_time <= 20.0 + @test isfile(output_path) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm full steady tail performance") + @testset "XPalm full steady tail performance" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + _warmup_xpalm_performance!(PERFORMANCE_SHORT_STEPS) + model, nsteps = + xpalm_reference_model_create(; nsteps=PERFORMANCE_FULL_STEPS) + tail_steps = 660 + simulation = xpalm_reference_param_run( + model, + OutputRequest[], + nsteps - tail_steps; + outputs=:none, + ) + GC.gc() + measurement = @timed PlantSimEngine.continue!( + simulation; + steps=tail_steps, + ) + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-full-steady-tail-latest.csv", + ) + CSV.write( + output_path, + DataFrame( + metric=["wall_time", "allocated", "gc_time"], + value=[ + measurement.time, + measurement.bytes, + measurement.gctime, + ], + ), + ) + @test current_step(simulation) == PERFORMANCE_FULL_STEPS + @test isfile(output_path) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm allocation profile short") + @testset "XPalm allocation profile short" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + _warmup_xpalm_performance!(PERFORMANCE_SHORT_STEPS) + model, nsteps = + xpalm_reference_model_create(; nsteps=PERFORMANCE_SHORT_STEPS) + Profile.Allocs.clear() + simulation = Profile.Allocs.@profile sample_rate = 0.01 xpalm_reference_param_run( + model, + OutputRequest[], + nsteps; + outputs=:none, + ) + allocation_results = Profile.Allocs.fetch() + pse_root = dirname(dirname(@__DIR__)) + xpalm_root = dirname(dirname(pathof(XPalm))) + totals = Dict{ + Tuple{String,String,Int,String,String}, + Tuple{Int,Int}, + }() + for allocation in allocation_results.allocs + frame_index = findfirst(allocation.stacktrace) do frame + file = string(frame.file) + occursin(pse_root, file) || occursin(xpalm_root, file) + end + isnothing(frame_index) && continue + frame = allocation.stacktrace[frame_index] + file = string(frame.file) + source = occursin(pse_root, file) ? "PlantSimEngine" : "XPalm" + key = ( + source, + file, + frame.line, + string(frame.func), + string(allocation.type), + ) + count, bytes = get(totals, key, (0, 0)) + totals[key] = (count + 1, bytes + allocation.size) + end + rows = [ + ( + source=first(key), + file=key[2], + line=key[3], + function_name=key[4], + allocation_type=key[5], + sampled_allocations=first(value), + sampled_bytes=last(value), + sample_rate=0.01, + ) + for (key, value) in totals + ] + sort!(rows; by=row -> row.sampled_bytes, rev=true) + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-allocations-short-latest.csv", + ) + CSV.write(output_path, DataFrame(rows)) + @test current_step(simulation) == PERFORMANCE_SHORT_STEPS + @test !isempty(rows) + @test isfile(output_path) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm CPU profile medium") + @testset "XPalm CPU profile medium" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + _warmup_xpalm_performance!(PERFORMANCE_MEDIUM_STEPS) + model, nsteps = + xpalm_reference_model_create(; nsteps=PERFORMANCE_MEDIUM_STEPS) + Profile.clear() + simulation = Profile.@profile xpalm_reference_param_run( + model, + OutputRequest[], + nsteps; + outputs=:none, + ) + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-cpu-medium-latest.txt", + ) + open(output_path, "w") do io + Profile.print( + io; + format=:flat, + sortedby=:count, + C=false, + combine=true, + ) + end + @test current_step(simulation) == PERFORMANCE_MEDIUM_STEPS + @test isfile(output_path) + end +end + +if !isnothing(BENCHMARK_TEST_PATTERN) && + benchmark_test_enabled("XPalm CPU profile full") + @testset "XPalm CPU profile full" begin + include(joinpath(@__DIR__, "..", "performance_regression.jl")) + _warmup_xpalm_performance!(PERFORMANCE_FULL_STEPS) + model, nsteps = + xpalm_reference_model_create(; nsteps=PERFORMANCE_FULL_STEPS) + profiled_steps = 660 + simulation = xpalm_reference_param_run( + model, + OutputRequest[], + nsteps - profiled_steps; + outputs=:none, + ) + Profile.clear() + Profile.@profile PlantSimEngine.continue!( + simulation; + steps=profiled_steps, + ) + output_path = joinpath( + @__DIR__, + "..", + "results", + "xpalm-cpu-full-latest.txt", + ) + open(output_path, "w") do io + Profile.print( + io; + format=:flat, + sortedby=:count, + C=false, + combine=true, + ) + end + @test current_step(simulation) == PERFORMANCE_FULL_STEPS + @test isfile(output_path) + end +end diff --git a/docs/make.jl b/docs/make.jl index e73b539d3..9d3640e97 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,26 +1,33 @@ #using Pkg #Pkg.develop("PlantSimEngine") using PlantSimEngine -using PlantSimEngine.Examples using PlantMeteo using DataFrames, CSV using Documenter using CairoMakie +using PlantSimEngine.Examples -DocMeta.setdocmeta!(PlantSimEngine, :DocTestSetup, :(using PlantSimEngine, PlantMeteo, DataFrames, CSV, CairoMakie); recursive=true) - -function build_graph_viewer_example() - mapping = ModelMapping( +function build_model_graph_example() + output_dir = joinpath(@__DIR__, "src", "assets") + mkpath(output_dir) + model = PlantSimEngine.CompositeModel( ToyDegreeDaysCumulModel(), ToyLAIModel(), - Beer(0.5), + Beer(0.6); + status=(TT=12.0,), + id=:plant, + scale=:Plant, + kind=:plant, + ) + GraphEditor.write_model_graph_view( + joinpath(output_dir, "model_graph_example.html"), + model, ) - path = joinpath(@__DIR__, "src", "www", "simple_dependency_graph.html") - write_graph_view(path, mapping) - return nothing end -build_graph_viewer_example() +build_model_graph_example() + +DocMeta.setdocmeta!(PlantSimEngine, :DocTestSetup, :(using PlantSimEngine, PlantMeteo, DataFrames, CSV, CairoMakie); recursive=true) makedocs(; modules=[PlantSimEngine], @@ -35,71 +42,93 @@ makedocs(; size_threshold=700000 ), pages=[ "Home" => "index.md", - "Introduction" => [ + "Start here" => [ "Why PlantSimEngine ?" => "./introduction/why_plantsimengine.md", - "Why Julia ?" => "./introduction/why_julia.md", - ], - "Prerequisites" => [ - "Installing and running PlantSimEngine" => "./prerequisites/installing_plantsimengine.md", - "Key Concepts" => "./prerequisites/key_concepts.md", - "Julia language basics" => "./prerequisites/julia_basics.md", + "Mental model" => "./journeys/users/mental_model.md", + "One object over time" => "./journeys/users/one_object.md", + "Several same-scale objects" => "./journeys/users/several_objects.md", ], - "Getting Started" => [ - "First simulation" => "./step_by_step/detailed_first_example.md", - "Model Coupling" => "./step_by_step/simple_model_coupling.md", - "Model Switching" => "./step_by_step/model_switching.md", - "Graph visualization and editing" => "./step_by_step/graph_visualization_editor.md", - "Quick examples" => "./step_by_step/quick_and_dirty_examples.md", - "Implementing a process" => "./step_by_step/implement_a_process.md", - "Implementing a model" => "./step_by_step/implement_a_model.md", - "Parallelization" => "./step_by_step/parallelization.md", - "Advanced coupling and hard dependencies" => "./step_by_step/advanced_coupling.md", - "Implementing a model : additional notes" => "./step_by_step/implement_a_model_additional.md", + "Structure and composition" => [ + "One multiscale plant" => "./journeys/users/one_plant.md", + "Several plants" => "./journeys/users/several_plants.md", + "Value coupling" => "./guides/multiscale/value_coupling.md", + "Importing an MTG" => "./guides/multiscale/import_mtg.md", + "How composite models execute" => "./guides/multiscale/concepts.md", + "Visualizing structure" => "./guides/multiscale/visualizing_structure.md", ], - "Execution" => "model_execution.md", - "Model traits" => "model_traits.md", - "AI agent skill" => "agent_skill.md", - "Working with data" => [ - "Reducing DoF" => "./working_with_data/reducing_dof.md", - "Fitting" => "./working_with_data/fitting.md", - "Input types" => "./working_with_data/inputs.md", - "Visualizing outputs and data" => "./working_with_data/visualising_outputs.md", - "Floating-point considerations" => "./working_with_data/floating_point_accumulation_error.md", + "Environment and time" => [ + "Read an environment" => "./journeys/users/environments.md", + "Different model cadences" => "./journeys/users/cadences.md", + "Hourly, daily, and weekly" => "./guides/time/hourly_daily_weekly.md", + "Advanced configuration" => "./guides/time/advanced_time_environment.md", ], - "Moving to multiscale" => [ - "Multiscale considerations" => "./multiscale/multiscale_considerations.md", - "Converting a simulation to multi-scale" => "./multiscale/single_to_multiscale.md", - "More variable mapping examples" => "./multiscale/multiscale.md", - "Handling cyclic dependencies" => "./multiscale/multiscale_cyclic.md", - "Multiscale coupling considerations" => "./multiscale/multiscale_coupling.md", - "Building a simple plant" => [ - "A rudimentary plant simulation" => "./multiscale/multiscale_example_1.md", - "Expanding the plant simulation" => "./multiscale/multiscale_example_2.md", - "Fixing bugs in the plant simulation" => "./multiscale/multiscale_example_3.md", - ], - "Visualizing our toy plant with PlantGeom" => "./multiscale/multiscale_example_4.md", + "Dynamic and advanced simulations" => [ + "Modify plant structure" => "./journeys/users/structure_changes.md", + "Modify the environment" => "./journeys/users/mutable_environments.md", + "Control advanced execution" => "./journeys/users/advanced_execution.md", + "MAESPA-style synthesis" => "./journeys/users/maespa_synthesis.md", + "Part 2: roots and water" => "./tutorials/growing_plant/part2_roots_water.md", + "Part 3: debugging" => "./tutorials/growing_plant/part3_debugging.md", + "Manual calls" => "./guides/multiscale/manual_calls.md", + "Advanced coupling and hard dependencies" => "./step_by_step/advanced_coupling.md", ], - "Multi-rate tutorials" => [ - "Introduction to multi-rate execution" => "./multirate/introduction.md", - "Step-by-step hourly/daily/weekly simulation" => "./multirate/multirate_tutorial.md", - "Advanced multi-rate configuration" => "./multirate/advanced_configuration.md", + "Implement models" => [ + "Basic contract and reuse" => "./journeys/modelers/basic_model.md", + "Cross-object values" => "./journeys/modelers/cross_object_values.md", + "Environment and cadence traits" => "./journeys/modelers/environment_and_cadence.md", + "Hard dependencies" => "./journeys/modelers/hard_dependencies.md", + "Mutable environment controllers" => "./journeys/modelers/mutable_environment.md", + "Port an existing model" => "./guides/modelers/port_existing_model.md", + "Implement a process" => "./step_by_step/implement_a_process.md", + "Implement a model" => "./step_by_step/implement_a_model.md", + "Composition and switching" => "./step_by_step/model_switching.md", + "Stateful models" => "./guides/modelers/stateful_models.md", + "Additional notes" => "./step_by_step/implement_a_model_additional.md", ], - "Troubleshooting and testing" => [ - "Troubleshooting" => "./troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md", - "Automated testing" => "./troubleshooting_and_testing/downstream_tests.md", - "Tips and Workarounds" => "./troubleshooting_and_testing/tips_and_workarounds.md", - "Implicit contracts" => "./troubleshooting_and_testing/implicit_contracts.md", - ], "API" => [ + "Reference" => [ + "Installing PlantSimEngine" => "./prerequisites/installing_plantsimengine.md", + "Julia language basics" => "./prerequisites/julia_basics.md", + "Why Julia ?" => "./introduction/why_julia.md", + "Model execution" => "model_execution.md", + "Model traits" => "model_traits.md", + "Collecting and plotting outputs" => "./guides/data/outputs_plotting.md", + "Forcing observations" => "./guides/data/forcing_observations.md", + "Numerical reliability" => "./guides/data/numerical_reliability.md", + "Parameter fitting" => "./working_with_data/fitting.md", + "Graph editor" => "./guides/graph_visualizer_editor.md", + "Common errors" => "./troubleshooting/common_errors.md", + "Runtime contracts" => "./troubleshooting/runtime_contracts.md", + "Dependency cycles" => "./troubleshooting/dependency_cycles.md", + "Downstream testing" => "./troubleshooting_and_testing/downstream_tests.md", + "Environment backend extensions" => "./guides/extensions/environment_backends.md", + "AI agent skill" => "agent_skill.md", "Public API" => "./API/API_public.md", + "Public symbol inventory" => "./API/public_symbols.md", "Example models" => "./API/API_examples.md", - "Internal API" => "./API/API_private.md",], - "Developer guidelines" => "developers.md", - "Roadmap" => "planned_features.md", + ], + "Migration" => [ + "From the mapping runtime" => "migration_composite_model.md", + ], + "Maintainers" => [ + "Developer guidelines" => "developers.md", + "Internal API" => "./API/API_private.md", + "Public API refinement decisions" => "./dev/public_api_refinement_decisions.md", + "Public API refinement completion audit" => "./dev/public_api_refinement_completion_audit.md", + "Composite model/object design" => "./dev/composite_model_design.md", + "Composite model/object implementation plan" => "./dev/composite_model_implementation_plan.md", + "Composite model/object completion audit" => "./dev/composite_model_completion_audit.md", + "MAESPA-style composite-model example handoff" => "./dev/maespa_model_handoff.md", + "Code cleanup audit" => "./dev/code_cleanup_audit.md", + "Release notes handoff" => "./dev/release_notes_handoff.md", + "Roadmap" => "planned_features.md", + ], ] ) -deploydocs(; - repo="github.com/VirtualPlantLab/PlantSimEngine.jl.git", - devbranch="main", - push_preview=true, # Visit https://VirtualPlantLab.github.io/PlantSimEngine.jl/previews/PR128 to visualize the preview of the PR #128 -) +if get(ENV, "PLANTSIMENGINE_DOCS_BUILD_ONLY", "false") != "true" + deploydocs(; + repo="github.com/VirtualPlantLab/PlantSimEngine.jl.git", + devbranch="main", + push_preview=true, # Visit https://VirtualPlantLab.github.io/PlantSimEngine.jl/previews/PR128 to visualize the preview of the PR #128 + ) +end diff --git a/docs/paper/paper.md b/docs/paper/paper.md index 974dec5a0..29f2b3a82 100644 --- a/docs/paper/paper.md +++ b/docs/paper/paper.md @@ -31,7 +31,8 @@ bibliography: paper.bib - Switch between models without changing any code, with a simple syntax to define the model to use for a given process - Reduce the degrees of freedom by fixing variables, passing measurements, or using a simpler model for a given process - Fast computation, with 100th of nanoseconds for one model, two coupled models (see this [benchmark script](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/benchmark.jl)), or the full energy balance of a leaf using [PlantBiophysics.jl](https://github.com/VEZY/PlantBiophysics.jl) [@vezy_vezyplantbiophysicsjl_2023], a package that uses PlantSimEngine -- Out of the box sequential, parallel (multi-threaded) or distributed (multi-process) computations over objects, time-steps and independent processes (thanks to [Floops.jl](https://juliafolds.github.io/FLoops.jl/stable/)) +- Sequential scene execution through concrete application/object batches. A + public parallel or distributed executor is not currently part of the API. - Easily scalable, with methods for computing over objects, time-steps and even [Multi-Scale Tree Graphs](https://github.com/VEZY/MultiScaleTreeGraph.jl) [@vezy_multiscaletreegraphjl_2023] - Composable, allowing the use of any types as inputs such as [Unitful](https://github.com/PainterQubits/Unitful.jl) to propagate units, or [MonteCarloMeasurements.jl](https://github.com/baggepinnen/MonteCarloMeasurements.jl) [@carlson_montecarlomeasurementsjl_2020] to propagate measurement error diff --git a/docs/src/API/API_public.md b/docs/src/API/API_public.md index b36380e4c..0aa29605d 100644 --- a/docs/src/API/API_public.md +++ b/docs/src/API/API_public.md @@ -1,165 +1,192 @@ # Public API +## Unified CompositeModel/Object API + +### Scenario and model applications + +- `CompositeModel` stores objects, model applications, instances, and environment. +- `CompositeModel(model, models...; status=..., timestep=...)` is the concise one-object + form and lowers to the same object/application representation. +- `Object` represents one runtime entity with stable identity and status. +- `CompositeModelTemplate` and `ObjectInstance` reuse a model across instances. +- `ModelSpec(model; name=..., on=..., inputs=..., calls=..., every=..., + environment=..., output_routing=..., updates=...)` is the one application + construction form. + +### Coupling + +- `ModelSpec(...; inputs=...)` declares value dependencies. +- `ModelSpec(...; calls=...)` declares manually executable child models. +- `Updates(:variable; after=:application_id)` orders intentional duplicate writers. +- `Input(...)` and `Call(...)` express model defaults through `dep(model)`. +- `run_call!(context, :name; publish=false)` executes every resolved hard-call + target and always returns a vector-like `CallTargets` collection. +- `run_call!(context, :name; sampled_environment=value)` forwards one already + sampled model-facing environment through cached typed execution batches. +- `call_model(context, :name)` returns the concrete model when a call resolves + to exactly one target. +- `call_targets(context, :name)` returns the same non-executing collection for + fine-grained execution with `run_call!(target; ...)`. + +### Model input schema + +- `Required(T)` declares an input that object state or another application must + supply. `T` is an expected type and may be generic. +- `Default(value)` declares a true model fallback that needs no user + initialization. +- `inputs_(model)` uses only these explicit declarations; plain literals are + rejected. +- `outputs_(model)` literals remain initial output-state values. +- `init_variables(model)` returns only genuine input defaults and initial + output values. + +### Selectors + +- Multiplicity: `One(...)`, `OptionalOne(...)`, and `Many(...)`. +- Scope: `SceneScope()`, `Self()`, `Subtree()`, `SelfPlant()`, + `Ancestor(...)`, and `Scope(name)`. +- Label criteria: `kind=...`, `species=...`, `scale=...`, and `name=...`. +- Topology relations: `Relation(...)`. + +`Self()` always means the current object: the object on which the consuming +application runs. It means a plant only when that object is itself the plant. + +Selector fields are checked where the selector is used: + +| Context | Accepted criteria | +|---|---| +| `ModelSpec(...; on=...)` | `kind`, `species`, `scale`, `name`, and a scene or named scope | +| `ModelSpec(...; inputs=...)` | object criteria plus `process`, `application`, `var`, `policy`, `window`, `from_status`, and `after` | +| `ModelSpec(...; calls=...)` | object criteria plus `process` and `application` | +| object queries and `OutputRequest` selectors | object criteria only | + +Unsupported or misspelled fields fail when the selector is constructed. +Object-relative scopes and relations require a current object, so they belong +in inputs, calls, or contextual object/output queries rather than application +targets. + +### Time and environment + +- `ModelSpec(...; every=period)` sets an application cadence. +- `HoldLast`, `Interpolate`, `Integrate`, and `Aggregate` define temporal + input policies. +- `Environment(...)` configures environment providers and source remapping. +- Models declare sampled environment variables with `environment_inputs_`. +- Mutable environment controllers pass trial state with + `run_call!(context, name; environment=trial_state)` and commit accepted state + with `commit_environment!`. +- `OutputRequest(selector, variable; ...)` selects retained and optionally + resampled streams using the same object selector grammar. + +### Lifecycle + +- `objects_from_mtg` and `CompositeModel(mtg; ...)` adapt an MTG into the object + registry. +- `add_organ!` creates and initializes a new organ in an MTG-backed model. +- `runtime_model(context)` gives lifecycle-capable kernels sanctioned access to + the live model from their `RunContext`. +- `register_object!`, `remove_object!`, and `reparent_object!` change + topology. +- `move_object!` and `update_geometry!` change spatial state. +- Supported lifecycle operations automatically invalidate and refresh the + affected structural or spatial bindings before the next timestep. +- `run!(model; steps=..., outputs=:none)` starts a fresh result timeline and + returns a `Simulation`. +- `continue!(simulation; steps=...)` and `step!(simulation)` advance an + existing timeline without resetting temporal state. +- `current_step(simulation)` reports the accepted timeline position. +- `final_state(simulation)` returns a latest-state snapshot without + requiring output retention; pass an object id or selector for multi-object + simulations. +- `collect_outputs(sim)` materializes retained output streams. + +### Explanations + +Use the `Diagnostics` namespace instead of inspecting internals: + +- `Diagnostics.explain_objects` +- `Diagnostics.explain_instances` +- `Diagnostics.explain_scopes` +- `Diagnostics.explain_applications` +- `Diagnostics.explain_bindings` +- `Diagnostics.explain_calls` +- `Diagnostics.explain_environment_bindings` +- `Diagnostics.explain_schedule` +- `Diagnostics.explain_writers` +- `Diagnostics.explain_execution_plan` +- `Diagnostics.explain_output_retention` +- `Diagnostics.explain_outputs` +- `Diagnostics.explain_initialization` +- `Diagnostics.input_carrier`, `Diagnostics.input_value`, and + `Diagnostics.has_reference_carrier` +- `Diagnostics.object_address` + +See [Migrating To The CompositeModel/Object API](../migration_composite_model.md) for +translations from removed APIs. + +### CompositeModel graph visualization and editing + +- `GraphEditor.compile_model_report(model; strict=false)` preserves partial graph state and + structured diagnostics for incomplete or cyclic composite models. +- `GraphEditor.model_graph_view(model; level=:applications)` returns the typed graph view. +- `GraphEditor.model_graph_view_json(model)` serializes the same DTO used by the browser. +- `GraphEditor.write_model_graph_view(path, model)` writes a self-contained static viewer. +- `GraphEditor.edit_graph(model; templates=..., environments=...)` starts the optional HTTP editor after `using HTTP` and keeps catalog values authoritative in Julia. +- `GraphEditor.current_model(session)`, `GraphEditor.undo!(session)`, + `GraphEditor.redo!(session)`, and `close(session)` control an interactive + session from Julia. + +See [Visualize And Edit A CompositeModel](../guides/graph_visualizer_editor.md) for the +runnable workflow, model discovery, selector previews, cycle breaking, and +Documenter embedding. + +### Environment backend extensions + +Backend packages extend the protocol under `EnvironmentAPI`, including +`EnvironmentAPI.AbstractEnvironmentBackend`, +`EnvironmentAPI.bind_environment`, `EnvironmentAPI.sample`, +`EnvironmentAPI.commit_environment!`, and `EnvironmentAPI.update_index!`. +The root-level `commit_environment!` remains part of the ordinary model-kernel +workflow for committing an accepted controller state. + +### Fitting and evaluation + +Generic fitting and metrics live under `Evaluation`: `Evaluation.fit`, +`Evaluation.RMSE`, `Evaluation.NRMSE`, `Evaluation.EF`, and `Evaluation.dr`. +PlantMeteo reducers are accessed from `PlantMeteo` directly rather than being +re-exported by PlantSimEngine. + +## Advanced compiler API + +```@docs +PlantSimEngine.Advanced +``` + +Compiler representations, cache refresh operations, and low-level binding +compilers live under `PlantSimEngine.Advanced`. They are intended for package +integration, diagnostics development, and compiler work rather than ordinary +scenario composition. Prefer `Diagnostics.explain_*`, which accepts a +`CompositeModel` directly, over manually compiling and inspecting fields. + +Examples include `Advanced.compile_composite_model`, `Advanced.refresh_bindings!`, and +the `Advanced.CompiledCompositeModel` family. These qualified APIs may evolve more +quickly than the default modeling interface. + ## Index ```@index Pages = ["API_public.md"] ``` -## API documentation +## API Documentation ```@autodocs -Modules = [PlantSimEngine] +Modules = [ + PlantSimEngine, + PlantSimEngine.Diagnostics, + PlantSimEngine.GraphEditor, + PlantSimEngine.EnvironmentAPI, + PlantSimEngine.Evaluation, +] Private = false ``` - -## Multi-rate policy examples - -For mapping-level multi-rate configuration, combine: - -- `ModelSpec(...)` -- `TimeStepModel(...)` -- `InputBindings(...)` -- `MeteoBindings(...)` -- `MeteoWindow(...)` -- `OutputRouting(...)` -- `ScopeModel(...)` -- `timespec(::Type{<:AbstractModel})` (optional trait) -- `output_policy(::Type{<:AbstractModel})` (optional trait) -- `timestep_hint(::Type{<:AbstractModel})` (optional trait) -- `meteo_hint(::Type{<:AbstractModel})` (optional trait) -- `resolved_model_specs(mapping)` (utility) -- `explain_model_specs(mapping_or_sim)` (utility) -- `OutputRequest(...)` in `tracked_outputs` for resampled exports - -`TimeStepModel(...)` accepts: -- `Real` step counts -- `ClockSpec` -- fixed `Dates` periods (`Dates.Second`, `Dates.Minute`, `Dates.Hour`, `Dates.Day`, ...) - -Period conversion detail: -- Period-based timesteps are converted using the meteo base step `duration`. -- Example: `TimeStepModel(Dates.Day(1))` with hourly meteo (`Dates.Hour(1)`) maps to `ClockSpec(24.0, 1.0)`, - so execution times are `t = 1, 25, 49, ...`. - -Trait-based inference detail: -- If `TimeStepModel(...)` is omitted, runtime resolves timestep from: -: `timespec(model)` when non-default, otherwise meteo `duration`. -- `timestep_hint(::Type{<:Model})` is then interpreted as: -: `required` = hard compatibility constraint, `preferred` = informational only. -- If `InputBindings(...)` is omitted, same-name sources are inferred automatically from -: unique producers (same scale first, then cross-scale). Ambiguous cases require explicit bindings. -- For inferred bindings, policy defaults to producer `output_policy` when defined, otherwise `HoldLast()`. -- Explicit `InputBindings(..., policy=...)` always overrides trait defaults. -- `output_policy` is hint-only: it is applied only when an output is actually consumed/exported. -- If `MeteoBindings(...)` / `MeteoWindow(...)` are omitted, `meteo_hint(::Type{<:Model})` -: may provide `(; bindings=..., window=...)`. -- Explicit mapping-level configuration always overrides hints. - -Compatibility checks: -- Meteo `duration` is mandatory when meteo is provided. -- For models with meteo-derived timestep, runtime enforces `timestep_hint.required`. -- `timestep_hint.preferred` never sets runtime timestep by itself. - -Scope selection detail: -- `ScopeModel(:global)` is the default and shares streams across the whole simulation. -- `ScopeModel(:plant)` isolates streams within each plant subtree. -- `ScopeModel(:scene)` isolates by scene ancestor. -- `ScopeModel(:self)` isolates by node id. - -### Exporting variables at requested rates - -```julia -req_hold = OutputRequest(:Leaf, :A; name=:A_hourly, process=:assim, policy=HoldLast()) -req_day = OutputRequest(:Leaf, :A; name=:A_daily_sum, process=:assim, policy=Integrate(), clock=ClockSpec(24.0, 1.0)) -run!(sim, meteo; tracked_outputs=[req_hold, req_day], executor=SequentialEx()) -out = collect_outputs(sim; sink=DataFrame) - -# or directly: -out_status, out = run!( - sim, - meteo; - tracked_outputs=[req_hold, req_day], - return_requested_outputs=true, -) -``` - -- `process` is optional when the source is canonical and unique. -- `policy` defines how source streams are resampled at export time. -- `clock` defines the export schedule; omit it to export every simulation step. - -### Default hold-last - -```julia -ModelSpec(ConsumerModel()) |> -TimeStepModel(ClockSpec(2.0, 1.0)) |> -InputBindings(; x=(process=:producer, var=:x)) -``` - -### Meteo aggregation bindings - -```julia -ModelSpec(DailyModel()) |> -TimeStepModel(ClockSpec(24.0, 1.0)) |> -MeteoWindow(CalendarWindow(:day; anchor=:current_period, week_start=1, completeness=:strict)) |> -MeteoBindings( - T=MeanWeighted(), # default source is :T - Ri_SW_f=RadiationEnergy(), # integrate W m-2 to MJ m-2 over the model window - custom_peak=(source=:custom_var, reducer=MaxReducer()), -) -``` - -`MeteoWindow(...)` options: -- `RollingWindow()` (default): trailing rolling window driven by `dt`. -- `CalendarWindow(period; anchor, week_start, completeness)` with: -: `period` in `:day`, `:week`, `:month` -: `anchor` in `:current_period`, `:previous_complete_period` -: `week_start` in `1:7` (1 = Monday) -: `completeness` in `:allow_partial`, `:strict` - -### Parameterized window reducers - -`Integrate()` defaults to `SumReducer()`; `Aggregate()` defaults to `MeanReducer()`. -With the same reducer, they are runtime-equivalent. -Use `Integrate` for accumulation semantics and `Aggregate` for summary-statistics semantics. - -```julia -ModelSpec(DailyModel()) |> -TimeStepModel(ClockSpec(24.0, 1.0)) |> -InputBindings(; a=(process=:hourly_assim, var=:A, scale=:Leaf, policy=Integrate(SumReducer()))) - -ModelSpec(DailyModel()) |> -TimeStepModel(ClockSpec(24.0, 1.0)) |> -InputBindings(; a=(process=:hourly_assim, var=:A, scale=:Leaf, policy=Aggregate(MaxReducer()))) - -ModelSpec(DailyModel()) |> -TimeStepModel(ClockSpec(24.0, 1.0)) |> -InputBindings(; a=(process=:hourly_assim, var=:A, scale=:Leaf, policy=Integrate(vals -> maximum(vals) - minimum(vals)))) - -ModelSpec(DailyModel()) |> -TimeStepModel(ClockSpec(24.0, 1.0)) |> -InputBindings(; a=(process=:hourly_assim, var=:A, scale=:Leaf, policy=Integrate((vals, durations) -> sum(vals .* durations)))) - -ModelSpec(DailyModel()) |> -TimeStepModel(ClockSpec(24.0, 1.0)) |> -InputBindings(; a=(process=:hourly_assim, var=:A, scale=:Leaf, policy=Integrate(PlantMeteo.DurationSumReducer()))) -``` - -Built-in reducer types are: -`SumReducer()`, `MeanReducer()`, `MaxReducer()`, `MinReducer()`, `FirstReducer()`, `LastReducer()`. -The same reducer objects are also used by `MeteoBindings(...)`. -Custom reducers/callables can accept either `(values)` or `(values, durations_seconds)`. - -### Parameterized interpolation mode - -`Interpolate()` defaults to `mode=:linear, extrapolation=:linear`. - -```julia -ModelSpec(FastModel()) |> -TimeStepModel(1.0) |> -InputBindings(; x=(process=:slow_source, var=:x, policy=Interpolate())) - -ModelSpec(FastModel()) |> -TimeStepModel(1.0) |> -InputBindings(; x=(process=:slow_source, var=:x, policy=Interpolate(; mode=:hold, extrapolation=:hold))) -``` diff --git a/docs/src/API/public_symbols.md b/docs/src/API/public_symbols.md new file mode 100644 index 000000000..b66a721cc --- /dev/null +++ b/docs/src/API/public_symbols.md @@ -0,0 +1,138 @@ +# Public Symbol Inventory + +This page records the supported default namespace and the four focused public +submodules. Compiler representations and cache controls are intentionally +listed separately under [`PlantSimEngine.Advanced`](#advanced-namespace). + +`using PlantSimEngine` imports the ordinary model-author and simulation-user +workflow plus the `Diagnostics`, `GraphEditor`, `EnvironmentAPI`, and +`Evaluation` module names. Their members remain qualified unless a user +explicitly imports one of those submodules. + +## Scenario composition + +- CompositeModel structure: `CompositeModel`, `Object`, `ObjectId`, `CompositeModelTemplate`, + `ObjectInstance`, `Override`. +- Applications: `ModelSpec`, `Environment`, and `Updates`. +- Application inspection: `application_name`, `applies_to`, `value_inputs`, + `model_calls`, `environment_config`, `output_routing`, `updates`. +- Dependency defaults: `Input`, `Call`, `PreviousTimeStep`. + +## Object selectors and queries + +- Multiplicity: `One`, `OptionalOne`, `Many`. +- Scope and topology: `SceneScope`, `Self`, `Subtree`, `SelfPlant`, `Ancestor`, + `Scope`, `Relation`. +- Label criteria are selector keywords: `kind`, `species`, `scale`, and + `name`. +- Queries: `object_ids`, `model_objects`, `resolve_object_ids`, + `resolve_objects`. +- Object data: `geometry`, `position`, `bounds`. + +## Execution, lifecycle, and outputs + +- Execution: `run!`, `continue!`, `step!`, `Simulation`, `current_step`, + `runtime_model`, `final_state`. +- Output selection and collection: `OutputRequest`, `outputs`, + `collect_outputs`. +- Lifecycle: `register_object!`, `add_organ!`, `remove_object!`, + `reparent_object!`, `move_object!`, `update_geometry!`, + `mark_environment_binding_dirty!`, `objects_from_mtg`. +- Hard calls: `RunContext`, `CallTarget`, `CallTargets`, `call_model`, + `call_targets`, `run_call!`. + +## Diagnostics namespace + +`PlantSimEngine.Diagnostics` owns structured explanations and supported +inspection: + +- Structure: `Diagnostics.explain_objects`, `Diagnostics.explain_instances`, `Diagnostics.explain_scopes`. +- Compilation: `Diagnostics.explain_applications`, `Diagnostics.explain_bindings`, + `Diagnostics.explain_calls`, `Diagnostics.explain_writers`, + `Diagnostics.explain_schedule`, `Diagnostics.explain_execution_plan`. +- Initialization, environment, and outputs: `Diagnostics.explain_initialization`, + `Diagnostics.explain_environment`, `Diagnostics.explain_environment_bindings`, + `Diagnostics.explain_output_retention`, `Diagnostics.explain_outputs`. +- Supported carrier inspection: `Diagnostics.input_carrier`, `Diagnostics.input_value`, + `Diagnostics.has_reference_carrier`. +- Normalized selector addresses: `Diagnostics.ObjectAddress`, + `Diagnostics.object_address`. + +## Model-author contract + +- Model identity: `AbstractModel`, `@process`, `process`. +- State schema and initialization: `Status`, `Required`, `Default`, + `init_variables`, `dep`. +- Model IO inspection: `inputs`, `outputs`, `variables`, + `environment_inputs`, `environment_outputs`, + `validate_environment_inputs`. +- Timing and routing traits: `timespec`, `output_policy`, `timestep_hint`, + `environment_hint`, `environment_bindings`, `environment_window`. + +The underscore declarations `inputs_`, `outputs_`, `environment_inputs_`, and +`environment_outputs_` are intentionally unexported extension functions. +Model authors implement them with qualified definitions such as +`PlantSimEngine.inputs_(model) = ...`. `inputs_` must return explicit +`Required(T)` or `Default(value)` declarations; `outputs_` returns initial +output-state values. + +## Time and reducers + +- Scheduling: `ClockSpec`, `SchedulePolicy`, `HoldLast`, `Interpolate`, + `Integrate`, `Aggregate`. +- Meteorology reducers are not re-exported. Use qualified PlantMeteo names, + for example `PlantMeteo.MeanReducer` or `PlantMeteo.RadiationEnergy`. + +## EnvironmentAPI namespace + +- Backend contract: `EnvironmentAPI.AbstractEnvironmentBackend`, `EnvironmentAPI.EnvironmentContext`, + `EnvironmentAPI.GlobalConstant`, `EnvironmentAPI.environment_backend`, `EnvironmentAPI.environment_variables`, + `EnvironmentAPI.base_step_seconds`, `EnvironmentAPI.get_nsteps`, and + `EnvironmentAPI.bind_environment`. +- Sampling and mutation: `EnvironmentAPI.sample`, + `EnvironmentAPI.sample_environment`, `EnvironmentAPI.commit_environment!`, + and `EnvironmentAPI.update_index!`. +- PlantMeteo conveniences: `Atmosphere`, `Constants`, `Weather`. + +## GraphEditor namespace + +- Discovery and DTOs: `GraphEditor.available_models`, + `GraphEditor.model_descriptor`, `GraphEditor.compile_model_report`, + `GraphEditor.ModelGraphView`, and `GraphEditor.model_graph_view`. +- Serialization and static views: `GraphEditor.model_graph_view_json`, + `GraphEditor.model_graph_view_html`, and + `GraphEditor.write_model_graph_view`. +- Semantic edits and sessions live under the same namespace, including + `GraphEditor.AddModelApplication`, `GraphEditor.apply_model_graph_edit`, + `GraphEditor.edit_graph`, `GraphEditor.current_model`, + `GraphEditor.undo!`, and `GraphEditor.redo!`. + +## Evaluation namespace + +- Fitting and metrics: `Evaluation.fit`, `Evaluation.RMSE`, + `Evaluation.NRMSE`, `Evaluation.EF`, and `Evaluation.dr`. + +## Advanced namespace + +`PlantSimEngine.Advanced` contains the qualified compiler and cache API: + +- registries and compiled representations: `ObjectRegistry`, `CompiledCompositeModel`, + `CompiledModelApplication`, `CompiledModelInputBinding`, + `CompiledModelCallBinding`, `CompiledEnvironmentBinding`, + `CompiledEnvironmentBindings`; +- carrier and adapter implementation types: `ObjectRefVector`, + `TimeStepTable`; +- compiler and cache operations: `compile_composite_model`, `refresh_bindings!`, + `refresh_environment_bindings!`, `compile_environment_bindings`; +- cache diagnostics: `bindings_dirty`, `environment_bindings_dirty`, + `model_revision`, `environment_revision`, `compiled_bindings`, + `compiled_environment_bindings`. + +These names require explicit qualification or `using PlantSimEngine.Advanced`. +They are not part of the concise user namespace and may evolve with compiler +implementation requirements. + +The namespace-boundary test in `test/test-model-api-stabilization.jl` compares +the complete default public-name set with an explicit inventory and separately +checks every focused submodule. Adding or removing an export therefore requires +an intentional inventory update. diff --git a/docs/src/FAQ/translate_a_model.md b/docs/src/FAQ/translate_a_model.md deleted file mode 100644 index 89b2b6a4c..000000000 --- a/docs/src/FAQ/translate_a_model.md +++ /dev/null @@ -1,157 +0,0 @@ -# I want to use PlantSimEngine for my model - -```@setup mymodel -using PlantSimEngine -using CairoMakie -# Import the example models defined in the `Examples` sub-module: -using PlantSimEngine.Examples -using PlantMeteo, Dates - -function lai_toymodel(TT_cu; max_lai=8.0, dd_incslope=500, inc_slope=70, dd_decslope=1000, dec_slope=20) - LAI = max_lai * (1 / (1 + exp((dd_incslope - TT_cu) / inc_slope)) - 1 / (1 + exp((dd_decslope - TT_cu) / dec_slope))) - if LAI < 0 - LAI = 0 - end - return LAI -end - -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) -``` - -If you already have a model, you can easily use `PlantSimEngine` to couple it with other models with minor adjustments. - -## Toy LAI Model - -### Model description - -Let's take an example with a simple LAI model that we define below: - -```julia -""" -Simulate leaf area index (LAI, m² m⁻²) for a crop based on the amount of degree-days since sowing with a simple double-logistic function. - -# Arguments - -- `TT_cu`: degree-days since sowing -- `max_lai=8`: Maximum value for LAI -- `dd_incslope=500`: degree-days at which we get the maximal increase in LAI -- `inc_slope=5`: slope of the increasing part of the LAI curve -- `dd_decslope=1000`: degree-days at which we get the maximal decrease in LAI -- `dec_slope=2`: slope of the decreasing part of the LAI curve -""" -function lai_toymodel(TT_cu; max_lai=8.0, dd_incslope=500, inc_slope=70, dd_decslope=1000, dec_slope=20) - LAI = max_lai * (1 / (1 + exp((dd_incslope - TT_cu) / inc_slope)) - 1 / (1 + exp((dd_decslope - TT_cu) / dec_slope))) - if LAI < 0 - LAI = 0 - end - return LAI -end -``` - -This model takes the number of days since sowing as input and returns the simulated LAI. We can plot the simulated LAI for a year: - -```@example mymodel -using CairoMakie - -lines(1:1300, lai_toymodel.(1:1300), color=:green, axis=(ylabel="LAI (m² m⁻²)", xlabel="Days since sowing")) -``` - -### Changes for PlantSimEngine - -The model can be implemented using `PlantSimEngine` as follows: - -#### Define a process - -If the process of LAI dynamic is not implemented yet, we can define it like so: - -```julia -@process LAI_Dynamic -``` - -#### Define the model - -We have to define a structure for our model that will contain the parameters of the model: - -```julia -struct ToyLAIModel <: AbstractLai_DynamicModel - max_lai::Float64 - dd_incslope::Int - inc_slope::Float64 - dd_decslope::Int - dec_slope::Float64 -end -``` - -We can also define default values for the parameters by defining a method with keyword arguments: - -```julia -ToyLAIModel(; max_lai=8.0, dd_incslope=500, inc_slope=70, dd_decslope=1000, dec_slope=20) = ToyLAIModel(max_lai, dd_incslope, inc_slope, dd_decslope, dec_slope) -``` - -This way users can create a model with default parameters just by calling `ToyLAIModel()`, or they can specify only the parameters they want to change, *e.g.* `ToyLAIModel(inc_slope=80.0)` - -#### Define inputs / outputs - -Then we can define the inputs and outputs of the model, and the default value at initialization: - -```julia -PlantSimEngine.inputs_(::ToyLAIModel) = (TT_cu=-Inf,) -PlantSimEngine.outputs_(::ToyLAIModel) = (LAI=-Inf,) -``` - -!!! note - Note that we use `-Inf` for the default value, it is the recommended value for `Float64` (-999 for `Int`), as it is a valid value for this type, and is easy to catch in the outputs if not properly set because it propagates nicely. You can also use `NaN` instead. - -#### Define the model function - -Finally, we can define the model function that will be called at each time step: - -```julia -function PlantSimEngine.run!(::ToyLAIModel, models, status, meteo, constants=nothing, extra=nothing) - status.LAI = models.LAI_Dynamic.max_lai * (1 / (1 + exp((models.LAI_Dynamic.dd_incslope - status.TT_cu) / model.LAI_Dynamic.inc_slope)) - 1 / (1 + exp((models.LAI_Dynamic.dd_decslope - status.TT_cu) / models.LAI_Dynamic.dec_slope))) - - if status.LAI < 0 - status.LAI = 0 - end -end -``` - -!!! note - Note that we don't return the value of the LAI in the definition of the function. This is because we rather update its value in the status directly. The status is a structure that efficiently stores the state of the model at each time step, and it contains all variables either declared as inputs or outputs of the model. This way, we can access the value of the LAI at any time step by calling `status.LAI`. - -!!! note - The function is defined for **one time step** only, and is called at each time step automatically by PlantSimEngine. This means that we don't have to loop over the time steps in the function. - -#### [Running a simulation](@id defining_the_meteo) - -Now that we have everything set up, we can run a simulation. The first step here is to define the weather: - -```julia -# Import the packages we need: -using PlantMeteo, Dates - -# Define the period of the simulation: -period = [Dates.Date("2021-01-01"), Dates.Date("2021-12-31")] - -# Get the weather data for CIRAD's site in Montpellier, France: -meteo = get_weather(43.649777, 3.869889, period, sink = DataFrame) - -# Compute the degree-days with a base temperature of 10°C: -meteo.TT = max.(meteo.T .- 10.0, 0.0) - -# Aggregate the weather data to daily values: -meteo_day = to_daily(meteo, :TT => (x -> sum(x) / 24) => :TT) -``` - -Then we can define our list of models, passing the values for `TT_cu` in the status at initialization: - -```@example mymodel -m = ModelMapping( - ToyLAIModel(), - status = (TT_cu = cumsum(meteo_day.TT),), -) - -outputs_sim = run!(m) - -lines(outputs_sim[:TT_cu], outputs_sim[:LAI], color=:green, axis=(ylabel="LAI (m² m⁻²)", xlabel="Days since sowing")) -``` diff --git a/docs/src/agent_skill.md b/docs/src/agent_skill.md index e432ba383..0af63b06e 100644 --- a/docs/src/agent_skill.md +++ b/docs/src/agent_skill.md @@ -8,12 +8,31 @@ The skill file is stored in the repository at: skills/plantsimengine/SKILL.md ``` -Users can download the `skills/plantsimengine` folder and tell their agent to use the `plantsimengine` skill when working with PlantSimEngine.jl. The skill gives agents the package-specific conventions they need for: +Users can download the `skills/plantsimengine` folder and tell their agent to +use the `plantsimengine` skill when working with PlantSimEngine.jl. The skill +gives agents the package-specific conventions they need for: -- composing existing models with `ModelMapping`; -- declaring spatial multiscale mappings with scale symbols and `MultiScaleModel`; -- configuring multirate simulations with `ModelSpec`, `TimeStepModel`, `InputBindings`, and temporal policies; -- implementing or wrapping models with `@process`, `inputs_`, `outputs_`, `run!`, hard dependencies, and model traits. +- building object graphs with `CompositeModel`, `Object`, `CompositeModelTemplate`, and + `ObjectInstance`; +- applying models with `ModelSpec` and `on`; +- coupling values and manual model calls with `inputs` and `calls`; +- using cached hard-call plans through bulk `run_call!`, singular `call_model`, + and lifecycle-maintained object target buffers; +- configuring multirate simulations with `every`, `Dates.Period` values, + and temporal policies; +- binding global or spatial microclimate through `Environment`; +- reasoning about model-clock weather aggregation, `environment_hint` reducers, and + scenario source overrides; +- inspecting compiled scenarios with structured explanation helpers; +- reporting supplied, generated, bound, and unresolved variables with + `Diagnostics.explain_initialization`; +- accessing the live model from lifecycle-capable kernels with + `runtime_model(context)`; +- inspecting homogeneous runtime batches with `Diagnostics.explain_execution_plan`; +- collecting raw or requested model outputs with `outputs`, + `OutputRequest`, `collect_outputs`, and `Diagnostics.explain_output_retention`; +- implementing or wrapping models with `@process`, `inputs_`, `outputs_`, + `run!`, hard dependencies, and model traits. The canonical source is [`skills/plantsimengine/SKILL.md`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/skills/plantsimengine/SKILL.md). diff --git a/docs/src/assets/.gitignore b/docs/src/assets/.gitignore new file mode 100644 index 000000000..e02769089 --- /dev/null +++ b/docs/src/assets/.gitignore @@ -0,0 +1 @@ +/model_graph_example.html diff --git a/docs/src/composite_model/quickstart.md b/docs/src/composite_model/quickstart.md new file mode 100644 index 000000000..988ae41cc --- /dev/null +++ b/docs/src/composite_model/quickstart.md @@ -0,0 +1,261 @@ +# CompositeModel/Object Quickstart + +This page is the shortest path to a native composite-model/object simulation. + +Use this API for new multiscale, multi-plant, soil, microclimate, and +model-scale simulations. Applications use one direct constructor: + +```julia +ModelSpec( + model; + name=:application, + on=Many(scale=:Leaf), + inputs=(...), + calls=(...), + every=Dates.Hour(1), + environment=Environment(...), + output_routing=(...), + updates=Updates(...), +) +``` + +Scenarios are defined with `CompositeModel` and model applications. A model is a +reusable process implementation; an application is one configured use of that +model, including its name, target objects, inputs, cadence, and environment. +One application may run on many objects, and the same model may appear in +several applications with different parameters or targets. + +```@setup model_object_quickstart +using PlantSimEngine, PlantMeteo, Dates, DataFrames +using PlantSimEngine.Examples +``` + +## One Object, Several Models + +For models that all run on one object, the concise constructor lowers directly +to the ordinary CompositeModel/Object representation: + +```julia +model = CompositeModel(ModelA(), ModelB(); status=(initial_value=1.0,)) +``` + +Use the explicit form later in this guide when applications need names, +selectors, or other scenario policies. + +The first model has one object, `:scene`, and three model applications: + +- `ToyDegreeDaysCumulModel` computes daily thermal time; +- `ToyLAIModel` consumes cumulative thermal time and computes LAI; +- `Beer` consumes LAI and meteorology to compute absorbed PAR. + +The model implementations are ordinary PlantSimEngine kernels. The model +application layer decides where they run. With no explicit `every`, these +applications use the environment cadence. + +```@example model_object_quickstart +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, +) + +model = CompositeModel( + ToyDegreeDaysCumulModel(), + ToyLAIModel(), + Beer(0.6); + environment=meteo_day, +) + +sim = run!(model; steps=30, outputs=:all) +out = collect_outputs(sim; sink=DataFrame) +first(out, 6) +``` + +The `Simulation` provides a snapshot of the latest status values: + +```@example model_object_quickstart +scene_status = final_state(sim) +(TT_cu=scene_status.TT_cu, LAI=scene_status.LAI, aPPFD=scene_status.aPPFD) +``` + +## Inspect The Compiled Bindings + +Before running, `Diagnostics.explain_initialization(model)` classifies each variable as +`:required`, `:defaulted`, `:supplied`, `:producer_bound`, `:generated`, or +`:environment_bound`. The report remains available when required values are +missing, so it can be used to finish configuring a model. + +The compiler infers unambiguous same-object dependencies from declared model +inputs and outputs: + +- `:LAI_Dynamic` reads `TT_cu` from `:Degreedays`; +- `:light_interception` reads `LAI` from `:LAI_Dynamic`. + +```@example model_object_quickstart +select( + DataFrame(Diagnostics.explain_bindings(model)), + :application_id, + :input, + :source_application_ids, + :carrier_kind, + :copy_semantics, +) +``` + +`carrier_kind = :ref` and `copy_semantics = :live_references` mean the +consumer sees a shared reference rather than a copied value. + +For runtime performance diagnostics, inspect the execution plan: + +```@example model_object_quickstart +select( + DataFrame(Diagnostics.explain_execution_plan(model)), + :application_id, + :object_ids, + :batch_size, + :inner_loop_dispatch, +) +``` + +## Request Outputs + +By default, model runs retain no user output streams. Pass `outputs=:all` to +retain every publisher, or pass `OutputRequest` values to retain and +materialize selected streams plus those required by temporal inputs. + +```@example model_object_quickstart +request = OutputRequest( + Many(scale=:Scene), + :LAI; + name=:lai_every_two_days, + application=:LAI_Dynamic, + policy=HoldLast(), + clock=Day(2), +) + +requested_sim = run!( + model; + steps=30, + outputs=request, +) + +collect_outputs(requested_sim, :lai_every_two_days; sink=nothing)[1:4] +``` + +The retention explanation reports why a stream was kept: + +```@example model_object_quickstart +Diagnostics.explain_output_retention(requested_sim) +``` + +## Many Objects As Inputs + +Use `ModelSpec(...; inputs=...)` when a model needs values from selected objects. This +model-scale LAI model reads live references to the surface of every plant: + +```@example model_object_quickstart +plant_scene = CompositeModel( + Object(:scene; scale=:Scene, kind=:scene), + Object( + :plant_1; + scale=:Plant, + kind=:plant, + parent=:scene, + status=Status(surface=12.0), + ), + Object( + :plant_2; + scale=:Plant, + kind=:plant, + parent=:scene, + status=Status(surface=8.0), + ); + applications=( + ModelSpec(ToyLAIfromLeafAreaModel(100.0); name=:scene_lai, on=One(scale=:Scene), inputs=(:plant_surfaces => Many( + scale=:Plant, + within=SceneScope(), + var=:surface, + ),)), + ), +) + +plant_sim = run!(plant_scene) +plant_model_status = final_state(plant_sim, One(scale=:Scene)) +(total_surface=plant_model_status.total_surface, LAI=plant_model_status.LAI) +``` + +The compiled binding shows a `RefVector` carrier: + +```@example model_object_quickstart +select( + DataFrame(Diagnostics.explain_bindings(plant_scene)), + :application_id, + :input, + :source_ids, + :carrier_kind, + :copy_semantics, +) +``` + +If the consumer model runs on each plant, use `within=Subtree()` to read only +objects inside the current plant. Use `within=SceneScope()` when a model model +must aggregate all matching objects. + +## Manual Calls + +Use `ModelSpec(...; calls=...)` when a parent model must directly run selected child models. +This is the mechanism for iterative solvers such as model energy balance: + +```julia +ModelSpec(SceneEnergyBalance(); name=:scene_energy, on=One(scale=:Scene), calls=(:leaf_energy => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + application=:energy_balance, + ), + :soil => One( + kind=:soil, + scale=:Soil, + within=SceneScope(), + application=:soil_water, + ),), every=Hour(1)) +``` + +For a one-shot call, execute all targets directly: + +```julia +targets = run_call!(context, :leaf_energy; publish=true) +``` + +`targets` is always vector-like regardless of whether the declaration uses +`One`, `OptionalOne`, or `Many`. For iterative control, retrieve the same +compiled targets without executing them: + +```julia +function PlantSimEngine.run!(model::SceneEnergyBalance, status, environment, + constants, context) + trial = trial_environment(model, status) + run_call!(context, :leaf_energy; environment=trial, publish=false) + + accepted = accepted_environment(model, status) + commit_environment!(context, accepted) + run_call!(context, :leaf_energy; publish=true) + + return nothing +end +``` + +`run_call!` defaults to `publish=false`, so trial calls mutate target statuses +without publishing temporal streams or committing mutable environment updates. +Pass non-committing trial state with `environment=trial_state`, then call +`commit_environment!` before publishing the accepted state. + +## Next Steps + +- [Migrating To The CompositeModel/Object API](../migration_composite_model.md) translates + scenarios written with removed APIs. +- [Public API](../API/API_public.md) lists constructors, selectors, lifecycle + helpers, environment helpers, and explanation helpers. +- [Model traits](../model_traits.md) documents `inputs_`, `outputs_`, `dep`, + `timespec`, `output_policy`, and `environment_inputs_`. +- [MAESPA-style model example handoff](../dev/maespa_model_handoff.md) + records the current multi-plant model energy-balance acceptance example. diff --git a/docs/src/dev/code_cleanup_audit.md b/docs/src/dev/code_cleanup_audit.md new file mode 100644 index 000000000..1e75bafb0 --- /dev/null +++ b/docs/src/dev/code_cleanup_audit.md @@ -0,0 +1,97 @@ +# Code Cleanup Audit + +## Status + +The compatibility cleanup is implemented on the `multi-plants` branch. + +The package now has one scenario compiler and runtime: the composite-model/object API. +The following superseded implementations were removed rather than deprecated: + +- `ModelList` and `SingleScaleModelSet`; +- `ModelMapping` and `MultiScaleModel`; +- `DependencyGraph`, `HardDependencyNode`, and `SoftDependencyNode`; +- `GraphSimulation` and the MTG mapping runner; +- mapping-specific multirate input resolution and output export; +- the unreleased domain prototype that preceded the composite-model/object API, + including `Domain`, `SimulationMapping`, `Route`, `AllDomains`, + `HardDomains`, and its separate scheduler, runtime, environment bridge, and + output publisher; +- mapping-only initialization, dataframe, dimension, and topology helpers; +- unused parallel-executor traits after removal of the executor runtime; +- dead `UninitializedVar`, `RefVariable`, `TreeAlike`, and `StatusView` types; +- the unreleased `CompositeModelTemplate(...; mapping=...)` alias and legacy + selector-to-mapping conversion helpers; +- compatibility tests, tutorials, and executable examples. + +Migration details are retained in +[`migration_composite_model.md`](../migration_composite_model.md) and +[`release_notes_handoff.md`](release_notes_handoff.md). + +## Current Ownership + +| Concern | Owner | +| --- | --- | +| Object registry, selectors, compilation, execution, lifecycle | `src/composite_model_api.jl` | +| Model application configuration | `src/ModelSpec.jl` | +| Status and reference vectors | `src/component_models/Status.jl`, `src/component_models/RefVector.jl` | +| Dates-based clocks and policies | `src/time/multirate.jl`, `src/time/runtime/clocks.jl` | +| Environment sampling | `src/time/runtime/environment_sampling.jl` | +| Environment backends | `src/time/runtime/environment_backends.jl` | +| Output request definition | `src/time/runtime/output_export.jl` | + +## Remaining Review Rules + +Future cleanup should reject: + +- a second scenario/runtime abstraction parallel to `CompositeModel`; +- compatibility wrappers for unreleased APIs; +- package-specific behavior in PlantSimEngine; +- model kernels that know their scenario object, timestep, or coupling unless + the scientific algorithm requires a hard call; +- dynamic per-object dispatch or copying in hot loops when compiled typed + batches and reference carriers are available; +- undocumented public names or agent instructions that describe removed APIs. + +## Verification + +Current cleanup evidence: + +- the `src` tree contains only the composite-model/object runtime and supporting status, + time, environment, fitting, trait, and example files; +- empty directories left by removed subsystems were deleted; +- `git diff --check` passes; +- PlantSimEngine precompiles and loads from a clean Kaimon session; +- `test/test-unified-model-object-api.jl` passes 576 tests; +- the complete package environment passes 885 tests, including Aqua and + doctests; +- `test/test-fitting.jl` passes; +- the documentation build passes, including executable examples and + cross-reference checks; +- repository search finds no superseded scenario-runtime definitions or + references in source, tests, examples, README, public docs, or the packaged + agent skill; +- remaining `ModelMapping` and `MultiScaleModel` references outside + development notes are migration text that explicitly points historical code + to the composite-model/object API. +- repository search finds no `Domain`, `SimulationMapping`, `Route`, + `AllDomains`, or `HardDomains` implementations, exports, tests, examples, or + public documentation. The only remaining references are development/release + notes that record their removal from this unreleased branch; +- ignored `.DS_Store` files were removed from the working tree outside `.git`. +- `ModelSpec` pipe-helper boilerplate was consolidated behind shared internal + helpers while keeping the public `on`, `inputs`, `calls`, `every`, + `Environment`, `Updates`, and `output_routing` grammar unchanged. +- the duplicate `Advanced.TimeStepTable` export was removed from the PlantMeteo + re-export block; `Advanced.TimeStepTable` remains exported once from the core status + export list. +- stale `PlantSimEngine.Examples` exports for the deleted + `ToyInternodeEmergence` example were removed. + +Downstream verification: + +- PlantBiophysics passes 117/117 tests against this working tree. +- XPalm's uncommitted CompositeModel/Object migration executes 74/75 assertions. The + remaining assertion retains the removed runtime's first-step LAI value, + while the explicit current dependency order produces zero from the initial + zero-biomass leaf before plant/model aggregation. PlantSimEngine intentionally + contains no package-specific compatibility workaround for that stale fixture. diff --git a/docs/src/dev/composite_model_completion_audit.md b/docs/src/dev/composite_model_completion_audit.md new file mode 100644 index 000000000..828ea4573 --- /dev/null +++ b/docs/src/dev/composite_model_completion_audit.md @@ -0,0 +1,96 @@ +# Unified CompositeModel/Object Completion Audit + +This audit records the evidence used to assess the breaking composite-model/object +redesign against `composite_model_design.md` and +`composite_model_implementation_plan.md`. + +Audit date: June 12, 2026. + +## Result + +The unified composite-model/object redesign is implemented as the primary public +configuration API. + +The superseded mapping implementation and the unreleased intermediate +prototype were removed after the composite-model/object runtime replaced them. + +## Public Contract + +The exported scenario vocabulary centers on: + +```julia +CompositeModel +Object +ModelSpec +Updates +Environment +``` + +Legacy scenario constructors such as `ModelMapping` and `MultiScaleModel` were +removed. + +Evidence: + +- `src/PlantSimEngine.jl` +- `docs/src/API/API_public.md` +- `docs/src/migration_composite_model.md` +- `README.md` + +## Requirement Evidence + +| Requirement | Evidence | +| --- | --- | +| One model object registry without prescribing plant topology | `CompositeModel`, `Object`, selectors, relations, scopes, and `objects_from_mtg` in `src/composite_model_api.jl`; selector and MTG adapter tests in `test/test-unified-model-object-api.jl` | +| Reusable species models and repeated plant instances | `CompositeModelTemplate`, `ObjectInstance`, `Override`, shared model ownership, and homogeneous/heterogeneous batches; four-instance and override tests | +| Soft/value dependencies | Compiled `ModelSpec(...; inputs=...)` bindings, same-object inference, scalar references, `RefVector`, `Advanced.ObjectRefVector`, temporal carriers, renaming, and optional inputs | +| Manual hard dependencies | Compiled `ModelSpec(...; calls=...)`, vector-like `CallTargets`, `run_call!(context, name)`, and fine-grained `run_call!(target)`; trial calls default to `publish=false` and accepted calls publish explicitly | +| Model-author dependency defaults | `Input(...)` and `Call(...)` entries from `dep(model)`, with `ModelSpec` overrides and binding provenance in explanations | +| Multirate execution | `every=Dates.Period`, model `timespec`, input policies, explicit windows, `PreviousTimeStep`, and stable compiled scheduling | +| Generic value types | Reference and temporal tests using `ModelObjectDualLike{BigFloat}` and `BigFloat` interpolation/integration without `Float64` conversion | +| Reference semantics and low-copy execution | Shared scalar references, typed many-object carriers, preinstalled status bindings, zero-allocation materialization tests, and a zero-allocation warmed 128-object execution batch | +| Duplicate writers | Canonical writer validation and `Updates(:variable; after=...)`, including pruning-after-allocation tests | +| Growth, pruning, reparenting, and movement | Central lifecycle APIs, structural/environment cache invalidation, dynamic target/carrier rebuilding, removed-object output history, and object-scoped geometry refresh tests | +| Automatic meteorology and microclimate | `environment_inputs_`, global and spatial backends, ancestor geometry fallback, source remapping, model hints, tabular aggregation, cached opaque handles, `run_call!(...; environment=trial_state)` trial sampling, and `commit_environment!` accepted mutable commits | +| Structured agent explanations | Object, instance, scope, application, binding, call, model-bundle, environment, schedule, writer, execution-plan, output, and retention explanations returning structured rows | +| Initialization workflow | `Required(T)` and `Default(value)` make the input contract explicit; `Diagnostics.explain_initialization` classifies required, defaulted, supplied, generated, producer-bound, and environment-bound variables before strict compilation | +| Runtime model access | `runtime_model` is the public accessor used by lifecycle-capable kernels and accepts `CompositeModel`, `RunContext`, and `Simulation` | +| One-object ergonomics | `CompositeModel(model, models...; status=...)` lowers to the same object/application compiler and runtime as explicit construction | +| Output ownership and retention | Application-qualified streams, `output_routing`, `OutputRequest(application=...)`, dynamic-object exports, and bounded policy-specific dependency histories | +| MAESPA acceptance case | `build_maespa_scene` and `run_maespa_example` use `CompositeModelTemplate`, `ObjectInstance`, `on`, `inputs`, `calls`, and `every`; verified by `test/test-maespa-model-example.jl` | +| Documentation and migration | CompositeModel/object-first README, home page, quickstart, execution guide, public API, migration guide, and explicitly labeled legacy reference sections | + +## Verification + +The following gates passed from a clean, controllable Kaimon Julia session: + +```text +test/test-unified-model-object-api.jl 576 passed +test/runtests.jl 885 passed +docs/make.jl passed +PlantBiophysics/test/runtests.jl 117 passed +git diff --check passed +``` + +The complete package suite includes Aqua, all focused restoration files, the +broad unified runtime regression, examples, fitting, and doctests. The +documentation build completed its executable examples, doctests, +cross-references, document checks, and HTML rendering successfully. + +The current uncommitted XPalm CompositeModel/Object migration loads this PlantSimEngine +worktree and executes 74 of 75 downstream assertions. Its remaining assertion +expects the removed runtime's first-step LAI (`0.000272`); the current compiled +dependency order correctly runs leaf area before plant and model aggregation, +so the initial zero-biomass leaf produces `0.0`. This is a downstream fixture +expectation in a dirty migration worktree, not a package-specific behavior to +restore in PlantSimEngine. No XPalm workaround was added here. + +## Compatibility Boundary + +Historical mapping source and tests were removed. Migration guidance remains +in the documentation for downstream packages moving to the composite-model/object API. +The branch-only intermediate prototype was also removed because it was never +released and has no compatibility boundary. + +Requested output histories are still materialized after a run. Dependency-only +temporal histories are bounded, but a fully online output sink would be an +additional optimization rather than a missing requirement of this redesign. diff --git a/docs/src/dev/composite_model_design.md b/docs/src/dev/composite_model_design.md new file mode 100644 index 000000000..f0fd4b22a --- /dev/null +++ b/docs/src/dev/composite_model_design.md @@ -0,0 +1,719 @@ +# Unified CompositeModel/Object Design + +This page records the target breaking design for one composite-model/object +configuration and runtime API. + +The central idea is: + +> Structural groupings and scales are selections over objects in one model. + +The engine should expose one way to say "this model input comes from these +objects" and one way to say "this model must manually call these models". The +compiler can then choose whether the runtime carrier is a `Ref`, `RefVector`, +temporal stream, materialized value, or callable model handle. + +The public API should be simple enough to remember as: + +```julia +ModelSpec( + model; + name=:application, + on=Many(scale=:Leaf), + inputs=(...), + calls=(...), + every=Dates.Hour(1), + environment=Environment(...), + output_routing=(...), + updates=Updates(...), +) +``` + +Everything else should either be a selector, a trait declared by the model +author, or an internal compiled carrier. + +## Core Concepts + +### CompositeModel + +A `CompositeModel` is the whole simulation universe. It contains: + +- simulated objects; +- model applications; +- environment providers; +- time/runtime state; +- caches for object selections and environment bindings. + +Plants, soil, atmosphere, microclimate grids, organs, sensors, and artificial +objects all live in the same model-level object graph. + +### Object + +An object is any simulated entity with identity. It may have: + +- a unique object id; +- one or more labels, such as `scale=:Leaf`, `kind=:plant`, + `species=:oil_palm`; +- parent/child links; +- geometry or position; +- status variables; +- model applications. + +The engine must not prescribe a plant architecture. A plant can be described as +`Plant -> Internode -> Leaf`, `Plant -> Axis -> Segment -> Leaf`, +`Plant -> Metamer -> Organ`, or another topology. The engine only needs object +identity, labels, and relations. + +Existing `MultiScaleTreeGraph.Node` topologies enter the same registry through +`objects_from_mtg(root; ...)` or `CompositeModel(root; ...)`. The adapter traverses once +and accepts accessors for ids, labels, status, and geometry; the timestep +runtime does not query the MTG topology. + +### Scale + +A scale is a label on objects, not a separate runtime layer. Examples: + +```julia +:Scene +:Plant +:Axis +:Internode +:Leaf +:Soil +:SoilLayer +:Voxel +``` + +### Scope + +A scope is a named or inferred subset of objects. Examples: + +```julia +SceneScope() +Self() +SelfPlant() +Ancestor(scale=:Plant) +Scope(:oil_palm) +Many(kind=:plant) +Many(species=:oil_palm) +``` + +`Self()` means only the current object: the object on which the consuming +application runs. It never means the model, species, or plant unless that +object is itself the plant. `Subtree()` means that object and its descendants. +Neither spelling changes meaning with scale. + +`SelfPlant()` is the nearest containing plant scope. The more generic form is +`Ancestor(scale=:Plant)`. Use these when a model running below the plant scale +must access siblings or state inside the containing plant. + +Reusable plant models should use scope-relative queries. If an allocation +model is applied to each `:Plant`, `Many(scale=:Leaf, within=Subtree())` means +"the leaves inside this plant", not all leaves in the model. The same query +applied to an axis-scale model means "the leaves inside this axis". + +CompositeModel-level models widen the scope explicitly with `within=SceneScope()`. + +Topology-relative selections use `Relation(...)`: + +```julia +One(Relation(:parent)) +Many(Relation(:children)) +Many(Relation(:ancestors); scale=:Plant) +Many(Relation(:descendants); scale=:Leaf) +Many(Relation(:siblings)) +``` + +Supported relations are `:self`, `:parent`, `:children`, `:ancestors`, +`:descendants`, and `:siblings`. They resolve relative to the current model +application object. An explicit `within=...` scope intersects the relation +result; inferred default scopes do not hide parents or siblings. Relation +results are normalized to stable object-id order before bindings are compiled. + +### Object Template And Instance + +An object template is a reusable model/parameter bundle, for example one oil +palm species model. An object instance is one concrete object in the model. + +The same template can be mounted several times: + +```julia +oil_palm = CompositeModelTemplate( + kind=:plant, + species=:oil_palm, + applications=oil_palm_applications, + parameters=oil_palm_parameters, +) + +model = CompositeModel( + ObjectInstance(:palm_1, oil_palm; root=node1), + ObjectInstance(:palm_2, oil_palm; root=node2), + ObjectInstance(:palm_3, oil_palm; root=node3), + ObjectInstance(:palm_4, oil_palm; root=node4), +) +``` + +Models and parameters can be overridden at instance or object level: + +```julia +ObjectInstance(:palm_2, oil_palm; overrides=( + stomatal_conductance = Tuzet(; g1=3.2), +)) + +Override( + object=:leaf_12, + application=:photosynthesis, + model=Fvcb(; VcMaxRef=90.0), +) +``` + +Ownership is reference-based and explicit: + +- a template retains the supplied model and parameter objects without copying; +- unchanged instances share those exact objects; +- an instance override replaces one complete model application with another + user-owned model object; +- an object override replaces that application only for the selected object; +- PlantSimEngine does not mutate model fields or implicitly merge parameter + dictionaries. + +Overrides must preserve the model contract: process identity and declared +status/environment variable names cannot change. Parameter-only overrides of +the same concrete model type retain concrete runtime dispatch. Heterogeneous +alternative implementations are supported but may require dynamic dispatch for +the exceptional application. + +### Model Kernel And Model Application + +A model kernel is the reusable model implementation written by a modeler. It +defines a process, parameters, `inputs_`, `outputs_`, optional `dep` defaults, +optional environment traits, and `run!`. + +A model application is the scenario-specific use of that kernel on selected +objects, at a selected rate, with selected value inputs, model calls, update +rules, output routing, and environment binding behavior. + +The model kernel should not need to know: + +- the species it will be used with; +- the model it will be embedded in; +- the timestep chosen by the user; +- whether its inputs come from local state, another scale, another object, a + temporal stream, units, automatic differentiation values, or uncertainty + wrappers. + +The scenario owns those decisions through `ModelSpec`. + +Target shape: + +```julia +ModelSpec(LeafEnergyBalance(); name=:leaf_energy, on=Many(kind=:plant, scale=:Leaf), inputs=(...), calls=(...), every=Hour(1)) +``` + +Application names are optional when a process occurs only once. Scenario +declarations identify singular producers and call targets with +`application=:sunlit_photosynthesis`; `process=...` is reserved for explicit +discovery queries such as `Many(process=:photosynthesis)`. + +## Unified Model Configuration + +`ModelSpec` is the single scenario wrapper. Released mapping-era configuration +is replaced by explicit value inputs and callable model calls. + +### Applies To + +Use `ModelSpec(...; on=...)` to declare the object set where a model application runs. +This should be first-class, not inferred from a container or mapping key. + +```julia +ModelSpec(LeafState(); on=Many(kind=:plant, scale=:Leaf)) + +ModelSpec(AllocationModel(); on=Many(kind=:plant, scale=:Plant)) + +ModelSpec(SceneEB(); on=One(scale=:Scene)) +``` + +The same model kernel can be applied several times with different selectors, +parameters, timesteps, or input bindings. The compiler should normalize each +application to a stable application id. + +### Dependency Defaults From Traits + +Model authors should still declare `inputs_`, `outputs_`, and `dep`. In the +final design, `dep(model)` is the model-level place for default dependency +intent. Historical `ModelMapping` declarations are migration inputs to the +CompositeModel/Object runtime, not a second supported path. + +The rule is: + +- `inputs_(model)` declares the variables the model needs; +- `outputs_(model)` declares the variables the model computes; +- `dep(model)` declares default value sources or manual model calls when the + model author knows a sensible coupling pattern; +- `ModelSpec(...; inputs=(...))` and `ModelSpec(...; calls=(...))` override + or specialize those defaults for a specific simulation. + +For example, a plant allocation model can provide a plant-local default: + +```julia +dep(::PlantAllocationModel) = ( + leaf_carbon = Input(Many(scale=:Leaf, within=Subtree(), var=:leaf_carbon)), +) +``` + +An energy-balance model can declare that it usually calls a stomatal +conductance model manually: + +```julia +dep(::LeafEnergyBalanceModel) = ( + stomatal_conductance = Call(process=:stomatal_conductance), +) +``` + +These trait defaults are not absolute wiring. They are model-author defaults +that make common cases work without repeating configuration, while scenario +authors keep final authority through `ModelSpec`. + +Compiler order: + +1. read `inputs_`, `outputs_`, and `dep`; +2. infer simple same-object value dependencies when unambiguous; +3. apply `dep(model)` defaults for value inputs and model calls; +4. apply `ModelSpec` overrides last. + +This order is part of the public contract. It keeps modeler defaults useful +without making them final wiring. Missing or ambiguous inputs after this pass +are errors, not incidental fallback behavior. + +### Value Inputs + +Use `ModelSpec(...; inputs=...)` when a model needs values before its `run!` method executes: + +```julia +ModelSpec(LAIModel(ground_area); inputs=(:leaf_areas => Many(scale=:Leaf, within=SceneScope(), var=:leaf_area))) +``` + +Reusable plant allocation: + +```julia +ModelSpec(AllocationModel(); on=Many(scale=:Plant), inputs=(:leaf_carbon => Many(scale=:Leaf, within=Subtree(), var=:leaf_carbon))) +``` + +The same declaration must compile to: + +- direct `Ref`/`RefVector` wiring when producer and consumer live in the same + object graph and rate; +- temporal stream reads when producer and consumer run at different rates; +- materialization when target status must be assigned before a + model runs; +- source-status lookup for graph-backed object selections. + +The important user rule is: + +- `ModelSpec(...; inputs=...)` means "give this model values"; the runtime schedules or + samples producers; +- the receiving model never manually calls the producer because of an + `ModelSpec(...; inputs=...)` declaration. + +### Carrier And Copy Semantics + +The compiler chooses the carrier, but the semantics must be documented and +explainable: + +| Situation | Preferred carrier | Copy behavior | +| --- | --- | --- | +| same-rate scalar input | shared `Ref` or local alias | no copy when possible | +| same-rate `Many(...)` input | `RefVector` or equivalent typed reference collection | no copy for live values | +| cross-rate input | temporal stream sample | value materialized for the consumer timestep | +| `Integrate` or `Aggregate` input | temporal window reduction | reduced value materialized | +| materialized target status input | compiler-generated assignment | assigned before consumer run | +| environment input | cached `EnvironmentBinding` sample | backend-defined value sample | + +This table is a required part of the design because performance, units, +automatic differentiation, and error propagation depend on preserving user +value types and avoiding hidden copies. + +PlantSimEngine should not force `Float64` internally. Status values, +parameters, environment values, and outputs must be allowed to use units, dual +numbers, uncertainty wrappers, tracked arrays, or other numeric-like types. +Compiled carriers should be parametric and type stable whenever the object set +and value type are known at initialization. + +### Multirate Inputs + +Multirate must be supported by the same `ModelSpec(...; inputs=...)` declaration, not a +separate mapping language. The public time language should remain `Dates` +periods. + +Example: + +```julia +ModelSpec(PlantAllocation(); on=Many(kind=:plant, scale=:Plant), inputs=(:leaf_assimilation => Many( + scale=:Leaf, + within=Subtree(), + var=:assimilation, + policy=Integrate(), + window=Day(1), + )), every=Day(1)) +``` + +Policy precedence should stay explicit: + +1. input-level policy in `ModelSpec(...; inputs=...)`; +2. producer `output_policy(model)`; +3. default `HoldLast()`. + +Cross-rate links must go through temporal state even when they point to objects +that could otherwise be reference-wired. + +Same-timestep feedback cycles are broken explicitly on the receiving input: + +```julia +ModelSpec(CarbonState(); inputs=(PreviousTimeStep(:carbon_biomass) => One( + scale=:Plant, + application=:carbon_allocation, + var=:carbon_biomass, + ),)) +``` + +`PreviousTimeStep(:x)` removes the producer-to-consumer edge from the current +timestep graph and reads the latest source sample at or before the previous +model timestep. Before a source sample exists, the initialized consumer status +value for `x` is used. This makes initialization part of the scenario contract +instead of silently inventing a zero value. + +### Model Calls + +Use `ModelSpec(...; calls=...)` when a model must manually run selected models, typically +inside an iterative solver. This is the required public API name and must be +implemented as part of the unified composite-model/object redesign, not left as a later +rename. + +```julia +ModelSpec(SceneEB(); calls=(:leaf_energy => Many( + kind=:plant, + scale=:Leaf, + process=:energy_balance, + )), calls=(:soil => One(kind=:soil, application=:soil_water))) +``` + +Inside `run!`, the model model receives call handles and calls +`run_call!(call)` during trial iterations, then +`run_call!(call; publish=true)` for the accepted final solution. The default is +deliberately `publish=false`: trial calls mutate target status for convergence +checks but do not append temporal samples or write environment outputs. + +The important user rule is: + +- `ModelSpec(...; calls=...)` means "give this model callable model handles"; +- the parent model owns the call stack and can iterate, reject, or accept trial + calls; +- call outputs are published only according to the call publication contract. + +`Diagnostics.explain_calls(compiled)` exposes this as +`publication_policy=:explicit_accept`, with `default_publish=false` and +`accepted_publish=true`. + +Binding and call explanations also report where each dependency declaration +came from: + +- `origin=:inferred_same_object` for compiler-inferred value dependencies; +- `origin=:model_default` for `Input(...)` or `Call(...)` declarations coming + from `dep(model)`; +- `origin=:model_spec` for scenario-level `ModelSpec(...; inputs=...)` or `ModelSpec(...; calls=...)`, + including declarations that override a model default. + +### Multiplicity + +Selection multiplicity is explicit: + +```julia +One(...) +Many(...) +OptionalOne(...) +``` + +`OptionalOne(...)` resolves to zero or one dependency. With zero matches, an +input keeps its `inputs_` default and a call returns an empty +`call_targets(...)` collection. Explanations retain these unresolved +optional bindings instead of hiding them. + +The compiler validates that `One(...)` resolves to exactly one producer per +consumer scope. `Many(...)` returns a vector-like value or target collection. + +### Address Normalization + +All source and target declarations normalize to an internal address: + +```julia +Diagnostics.ObjectAddress( + scope, + kind, + species, + scale, + name, + process, + application, + var, + relation, + policy, + window, + from_status, + after, + multiplicity, +) +``` + +Only the compiler works with this normalized address. Users should not need to +construct it manually. [`Diagnostics.object_address`](@ref) is the structured diagnostic +view and preserves every normalized selector field, including temporal and +status-routing fields. + +## Object Lifecycle And Spatial Contracts + +Growth, pruning, organ creation, reparenting, and moving organs must all update +the same compiled caches: + +- object selections used by `on`, `inputs`, and `calls`; +- `RefVector` or equivalent many-object carriers; +- temporal stream ownership; +- writer validation; +- environment bindings. + +The public mutation API should make cache invalidation explicit and centralized: + +```julia +register_object!(model, object; parent) +remove_object!(model, object) +reparent_object!(model, object, new_parent) +move_object!(model, object, geometry_or_position) +Advanced.refresh_bindings!(model) +``` + +Spatial environment backends should depend on a small geometry contract, not on +a particular plant representation: + +```julia +position(object_or_status) +geometry(object_or_status) +bounds(object_or_status) +``` + +Packages can provide richer geometry, octrees, voxel grids, or layers, but +PlantSimEngine should only require enough information to bind an object to an +environment provider. + +## Duplicate Writers And Updates + +Most variables should have one canonical writer per object and timestep. When a +variable is intentionally updated by several models, the scenario should say so +where the model applications are assembled: + +```julia +ModelSpec(PruningModel(); on=Many(scale=:Leaf), updates=Updates(:leaf_biomass; after=:carbon_allocation)) +``` + +`Updates(...)` should be rare and explicit. It is a scenario-level ordering +rule, because a model author cannot predict every model that will later update +the same variable. + +## Environment And Microclimate + +Meteorology should remain automatic unless a model or scenario needs special +behavior. Models declare environment variables: + +```julia +environment_inputs_(::LeafEnergyModel) = ( + T=0.0, + Rh=0.0, + Wind=0.0, + Ri_PAR_f=0.0, + CO2=0.0, +) +``` + +The runtime resolves those variables through the model environment service. + +Default resolution: + +1. A global/table environment backend gives every object the current sampled row. +2. A voxel, octree, layered, or grid backend samples the cell bound to the + object. +3. If the object has no position, use the parent position. +4. If no spatial binding can be made, fall back to the global environment or error when + the environment variable is required. + +Users can override the binding contract: + +```julia +EnvironmentResolver( + bind=(model, object) -> containing_cell(model.microclimate, position(object)), +) +``` + +PlantSimEngine should define the protocol and caching hooks, not the voxel or +octree implementation. Specialized packages should provide concrete spatial +backends. + +The environment backend protocol should be small and backend-oriented: + +```julia +handle = EnvironmentAPI.bind_environment(backend, object, context, config) +EnvironmentAPI.sample(backend, handle, variable, time) +EnvironmentAPI.sample(backend, handle, trial_state, variable, time) +commit_environment!(backend, handle, accepted_state, time) +EnvironmentAPI.update_index!(backend, changed_entities, removed_object_ids) +``` + +`environment_inputs_(model)` declares what a model reads from the active environment +provider, while `environment_outputs_(model)` declares what it may commit. Controllers +commit accepted mutable microclimate state with +`commit_environment!(context, accepted_state)` and run trial descendants with +`run_call!(context, name; environment=trial_state)`. Simple global meteorology +remains the default provider. + +Scenario-level environment source remapping belongs on `Environment(...)`, for +example: + +```julia +ModelSpec(LeafGasExchange(); name=:gas_exchange, on=Many(scale=:Leaf), environment=Environment(provider=:global, sources=(CO2=:Ca,))) +``` + +Here the model reads `environment.CO2` because that is its declared generic +contract, while the active environment backend samples the source variable +`:Ca`. Environment binding refresh validates source availability when the +backend can enumerate variables, and explanations report both +`required_inputs` and `source_inputs`. + +Global tabular meteorology follows the model application's compiled +`ModelSpec(...; every=...)`. PlantMeteo samples the table with the reducer and window from +`environment_hint(...)` when the model runs more slowly than the weather base step. +An `Environment(; sources=...)` override replaces only the source variable; it +does not discard the model-author reducer. The prepared weather sampler is +compiled once, and one sampled row is reused by every object targeted by the +same application at that timestep. + +Spatial or mutable backends retain control of their own temporal semantics. +PlantSimEngine supplies the compiled object/cell binding and current simulation +time; a specialized microclimate backend decides whether its local state is +instantaneous, interpolated, or internally integrated. + +### Cached Environment Bindings + +Spatial lookup must not happen for every model call. At initialization and when +objects are created, the runtime builds an environment binding cache: + +```julia +EnvironmentBinding( + object_id, + provider=:microclimate_grid, + cell_id, + variables=(:T, :Rh, :Wind, :Ri_PAR_f), +) +``` + +Runtime sampling is: + +```text +object -> cached binding -> environment cell -> current values +``` + +Invalidation events: + +- object created; +- object removed; +- object moved; +- geometry changed; +- environment grid rebuilt or refined; +- model environment requirements changed. + +Geometry APIs should provide ergonomic invalidation: + +```julia +mark_environment_binding_dirty!(model, object) +update_geometry!(object, geometry; invalidate_environment=true) +``` + +Before each timestep, dirty bindings are refreshed in batch. + +## Compilation Strategy + +The compiler should build one global dependency graph over object addresses. +The graph includes: + +- value dependencies from `ModelSpec(...; inputs=...)`; +- callable dependencies from `ModelSpec(...; calls=...)`; +- model update edges from `Updates(...)`; +- temporal policy edges; +- environment reads and writes; +- object-scope selection caches. + +The runtime representation is an implementation detail: + +- same-rate local links can stay as aliases; +- cross-rate links use temporal state; +- many-object links use `RefVector` or node-value streams; +- call links use `ModelCall` or an equivalent callable runtime handle; +- environment links use cached `EnvironmentBinding`s. + +The final execution plan should group contiguous targets with the same concrete +model, status, model-bundle, input-binding, and environment-binding types. +Dynamic dispatch may occur once at the application/batch boundary, but not for +every leaf in a homogeneous target set. Exceptional model overrides form +separate concrete batches while preserving stable object order. Lifecycle or +environment refreshes rebuild these batches before the next timestep. + +The public explanation API must describe the normalized graph, not the internal +carrier choice. + +## Agent-Facing Requirements + +The final design must be understandable by agents through structured +explanation helpers: + +```julia +Diagnostics.explain_objects(model) +Diagnostics.explain_instances(model) +Diagnostics.explain_scopes(model) +Diagnostics.explain_bindings(sim) +Diagnostics.explain_calls(sim) +Diagnostics.explain_environment_bindings(sim) +Diagnostics.explain_schedule(sim) +Diagnostics.explain_writers(sim) +Diagnostics.explain_execution_plan(sim) +Diagnostics.explain_output_retention(sim) +``` + +These helpers should return stable structured data, not only pretty text. A +binding row should include at least: + +- consumer application id; +- consumer object id; +- consumer variable; +- source selector; +- resolved producer application id or environment provider id; +- resolved producer object ids; +- process/name filters; +- temporal policy and window; +- carrier kind; +- copy/reference semantics; +- reason the binding was chosen; +- whether it came from inference, `dep(model)`, or `ModelSpec`. + +Execution-plan rows should additionally expose the selected object ids, +concrete model/status/carrier types, batch size, and whether the inner loop is +homogeneous and specialized. + +Output-retention rows should expose the retained application id, variable, +retention reasons, compiled retention horizon, and current target count so +agents can distinguish default retain-all behavior, requested output streams, +and bounded temporal-dependency streams. + +Errors should report concrete object labels, scope selectors, process names, +variables, and suggested fixes. + +## API Position + +This is a breaking design. Model kernels use +`run!(model, status, environment, constants, context)` while the scenario +configuration surface uses `CompositeModel`, `Object`, `ModelSpec`, selectors, +`ModelSpec(...; inputs=...)`, `ModelSpec(...; calls=...)`, `ModelSpec(...; every=...)`, and `Environment(...)`. diff --git a/docs/src/dev/composite_model_implementation_plan.md b/docs/src/dev/composite_model_implementation_plan.md new file mode 100644 index 000000000..85fb9c279 --- /dev/null +++ b/docs/src/dev/composite_model_implementation_plan.md @@ -0,0 +1,1035 @@ +# Unified CompositeModel/Object Implementation Plan + +This plan is the persistent handoff for replacing the historical +multiscale-mapping system with one composite-model/object address system. + +The implementation can be incremental internally, but the target API is +breaking. Do not preserve experimental intermediate APIs as user-facing +concepts in the final design. + +The target public surface should be centered on a small set of concepts: + +```julia +ModelSpec( + model; + name=:application, + on=Many(scale=:Leaf), + inputs=(...), + calls=(...), + every=Dates.Hour(1), + environment=Environment(...), + output_routing=(...), + updates=Updates(...), +) +``` + +This is the API memory target for users, modelers, and agents. Additional +types should be selectors, model traits, or internal compiled carriers. + +## Implementation Progress + +- Started Phase 0 by adding typed application metadata, now constructed + directly with `ModelSpec` keywords. +- Added `ModelSpec(model; name=...)` application names and getters: + `application_name`, `applies_to`, `value_inputs`, `model_calls`, and + `environment_config`. +- Added selector and address types: `SceneScope`, `Self`, `Subtree`, + `SelfPlant`, `Ancestor`, `Scope`, `Relation`, `One`, `OptionalOne`, `Many`, + and `Diagnostics.ObjectAddress`. +- Added initial `CompositeModel`/`Object` registry types and lifecycle hooks: + `register_object!`, `remove_object!`, `reparent_object!`, `move_object!`, + and `Advanced.refresh_bindings!`. +- Added registry-backed selector resolution with `resolve_object_ids` and + `resolve_objects` for `SceneScope()`, `Self()`, `SelfPlant()`, + `Ancestor(...)`, `Scope(...)`, label keywords such as `kind=:plant` and + `scale=:Leaf`, and `One`/`OptionalOne`/`Many` cardinality checks. +- Added `Diagnostics.explain_scopes(model)` for agent-readable scope diagnostics. It + reports the global model scope, each object subtree, each named + `Scope(...)`, and label groups by scale, kind, and species with concrete + resolved object ids. +- Selector cardinality and named-scope failures now report the consumer + context, matched object ids, requested criteria, available scales, kinds, + species, and names inside the resolved scope, plus bounded edit-distance + suggestions. +- `Relation(...)` selectors now resolve `:self`, `:parent`, `:children`, + `:ancestors`, `:descendants`, and `:siblings` relative to the consuming + object. Explicit scopes constrain relation results, default dependency scopes + do not erase parent/sibling queries, and compiled `ModelSpec(...; inputs=...)` can use these + relations without runtime selector resolution. +- `Diagnostics.ObjectAddress(selector)` normalizes scope, relation, label, routing, + temporal-policy, and status-ordering fields into one structured diagnostic + record. +- Started the object-address compiler with `Advanced.compile_composite_model(model, specs)` and + compiled model application/binding carriers. The compiler now resolves + `ModelSpec(...; on=...)` target object ids, object-relative `ModelSpec(...; inputs=...)` source + object ids, and object-relative `ModelSpec(...; calls=...)` callee object/application ids + before runtime. +- Added `Diagnostics.explain_applications`, `Diagnostics.explain_bindings`, and `Diagnostics.explain_calls` + for the compiled model view. These explanations expose application ids, + processes, target ids, input source ids, call callee ids, temporal policy, + window, and carrier hints. +- Added status-backed compiled input carriers. When source objects already + hold `Status` values, `ModelSpec(...; inputs=...)` bindings now precompile a scalar shared + `Ref`, a homogeneous `RefVector`, or an `Advanced.ObjectRefVector` fallback for + heterogeneous reference-preserving vectors. `Diagnostics.input_carrier`, `Diagnostics.input_value`, + and `Diagnostics.has_reference_carrier` expose these carriers, and `Diagnostics.explain_bindings` + reports carrier kind, copy/reference semantics, carrier type, and reference + availability. +- Added conservative same-object input inference in the model compiler. When a + model declares an `inputs_` variable that is not covered by explicit/default + `ModelSpec(...; inputs=...)`, and exactly one other application on the same object outputs + the same variable, `Advanced.compile_composite_model` creates an inferred reference binding. + `Diagnostics.explain_bindings` now reports binding `origin` values such as + `:model_default`, `:model_spec`, and `:inferred_same_object`. +- Compiled input bindings now carry producer metadata. When an `ModelSpec(...; inputs=...)` + selector uses `process=` or `application=`, `Advanced.compile_composite_model` validates that a + matching source application exists for the selected source objects. + `Diagnostics.explain_bindings` reports `source_application_ids`, `process`, and + `application` for agent-readable dependency diagnostics. +- Dependency selectors in `ModelSpec(...; inputs=...)` and `ModelSpec(...; calls=...)` now infer a default + scope from the consumer object when no explicit `within=...` is provided: + model objects default to `SceneScope()`, while non-model objects default to + `Self()`. Shared model/soil dependencies from organs should therefore use + `within=SceneScope()` explicitly. +- `Advanced.compile_composite_model` now validates `Required(T)` status inputs + from `inputs_(model)`. Each required input must either have a compiled + binding or already exist on the target object `Status`; otherwise + compilation errors with the concrete application id, object id, and input + variable. +- CompositeModel compilation creates an empty `Status` for model-targeted + objects when status is omitted, inserts missing `outputs_` fields and + `Default(value)` inputs from their initial values, and installs explicitly or + implicitly bound input carriers. Unbound `Required(T)` inputs remain + compilation errors. +- `Advanced.compile_composite_model` now rejects `ModelSpec(...; inputs=...)` declarations whose left-hand + variable is not declared by the target model's `inputs_`. This catches + misspelled or stale scenario bindings before they create silent unused + metadata. +- `Advanced.compile_composite_model` now validates source availability for status-backed + non-temporal `ModelSpec(...; inputs=...)` bindings. When selected source objects already + have `Status` values, the requested source variable must resolve to + references instead of silently compiling to an unused/no-op binding. +- Carrier compilation preserves source `Status` references and arbitrary value + types; tests cover scalar refs, heterogeneous many-object vectors, and a + homogeneous dual-like `BigFloat` value through `RefVector`, model arithmetic, + source mutation, and typed output publication. +- Same-object renaming is supported directly by `ModelSpec(...; inputs=...)`, for example + `inputs=(:renamed_signal => One(within=Self(), var=:signal),)`. The compiler + aliases the source `Ref`, records the renamed source variable in + `Diagnostics.explain_bindings`, and schedules the producer before the consumer. +- Same-rate input carriers are installed directly into consumer `Status` + reference cells during model compilation. Scalar bindings share the source + `Ref`; many-object bindings store the compiled `RefVector` or + `Advanced.ObjectRefVector` once. The timestep runtime performs no assignment for + these bindings, and a focused `Many(...)` materialization gate verifies zero + allocations after compilation. +- Reference wiring adds a missing bound input field to the consumer `Status` + schema when needed, instead of requiring users to duplicate compiler-owned + input placeholders. +- Added call ambiguity validation in the compiled model view: a call can select + by process when unique, and must use `application=:name` when several model + applications with the same process match the same object. +- Added a model binding cache with `Advanced.refresh_bindings!`, `Advanced.bindings_dirty`, + `Advanced.compiled_bindings`, and `Advanced.model_revision`. Object creation, removal, + and reparenting now invalidate the compiled binding cache and bump a model + revision before the next refresh. +- Added an environment binding cache with `Advanced.refresh_environment_bindings!`, + `Advanced.compile_environment_bindings`, `Advanced.CompiledEnvironmentBinding`, + `Advanced.CompiledEnvironmentBindings`, `Advanced.environment_bindings_dirty`, + `Advanced.compiled_environment_bindings`, `Advanced.environment_revision`, and + `Diagnostics.explain_environment_bindings`. The compiler resolves each + application/object environment provider, backend, required + `environment_inputs_`, support descriptor, and backend cell before runtime. +- Added the minimal model geometry contract: `geometry(object_or_status)`, + `position(object_or_status)`, and `bounds(object_or_status)`. Environment + binding refreshes now call `EnvironmentAPI.update_index!(backend, changed_entities, removed_object_ids)` once per + distinct backend before `Advanced.EnvironmentAPI.bind_environment`, giving spatial backends a current + model-wide object/entity list for precomputed microclimate lookup. +- Automatic spatial binding now uses the nearest ancestor geometry when a + target object has no geometry of its own. Existing backends still receive an + `Object` carrying the target id/status, while its binding-time geometry comes + from the ancestor. Explanations report `geometry_source=:self`, `:ancestor`, + or `:global` and the source object id. +- Moving an object invalidates environment bindings for descendants that + inherit its geometry, stopping at descendants with their own geometry. This + preserves unaffected cached bindings. +- Environment refresh now reconciles model environment contracts against + cached spatial bindings. If only `environment_inputs_` changes while application + id, object, process, provider, backend, status, and geometry provenance remain + unchanged, required metadata is updated while the cached cell is reused + without `EnvironmentAPI.update_index!` or `Advanced.EnvironmentAPI.bind_environment`. +- `validate_environment_inputs(model)` and + `validate_environment_inputs(compiled_scene, environment_or_backend)` now validate + composite-model/object model application `environment_inputs_` against the active + environment or an explicit replacement. Errors report model application ids, + so duplicate process applications remain diagnosable. +- `Environment(; sources=(target=:source,))` now remaps model-facing + environment variables to backend source variables. Environment binding + refresh validates missing source variables when the backend can enumerate its + variables, and `Diagnostics.explain_environment_bindings` reports both `required_inputs` + and `source_inputs`. +- CompositeModel applications now infer model-author default environment source remaps + from `environment_hint(...).bindings` when the scenario does not provide explicit + environment bindings. Scenario `Environment(; sources=...)` keeps precedence over + the trait. +- Global tabular meteorology is now sampled at each model application's + compiled clock. `environment_hint(...).bindings` reducers and windows are applied + through PlantMeteo, while `Environment(; sources=...)` replaces only the + source variable and preserves the selected reducer. Prepared weather + samplers are shared by applications using the same weather table, and each + application/timestep sample is cached once per run so all target objects + reuse it. +- Object creation, removal, and reparenting invalidate both structural and + environment bindings. Object movement invalidates only environment bindings, + so moving a leaf or changing its geometry can refresh microclimate lookup + without rebuilding object/model binding carriers. +- Added public geometry invalidation helpers: + `update_geometry!(model, object, geometry; invalidate_environment=true)` + and object-scoped `mark_environment_binding_dirty!(model, object)`. + Geometry-only changes record the affected object ids and refresh only their + compiled environment bindings; descendants inheriting moved ancestor + geometry are invalidated as part of the same object-scoped refresh. +- Started composite-model/object execution with `run!(model; steps=...)`. + The runtime refreshes compiled object bindings and environment bindings, + materializes precompiled `ModelSpec(...; inputs=...)` carriers into consumer `Status` + fields, samples the bound environment backend, and calls generic model + kernels through the existing `run!` contract. +- CompositeModel/object execution now publishes model outputs to model-local temporal + streams. Compiled `ModelSpec(...; inputs=...)` bindings marked as `:temporal_stream` can + materialize `HoldLast`, `Interpolate`, `Integrate`, and `Aggregate` values + before the consumer runs, using selector source ids, source variables, + windows, and the model base timestep. +- CompositeModel temporal `ModelSpec(...; inputs=...)` now honor producer `output_policy(...)` traits + when the selector omits `policy=...` and resolves to a unique source + application. Explicit selector policies remain scenario-level overrides. +- CompositeModel `Interpolate(...)` matches the established multirate runtime: + bracketed samples use linear interpolation, online consumers use linear + extrapolation from the last two samples when requested, and insufficient or + non-interpolable values fall back to hold-last. `mode=:hold` and + `extrapolation=:hold` are supported, invalid modes fail during model + compilation, and interpolation arithmetic preserves generic numeric value + types without converting model values to `Float64`. +- Unified `ModelSpec(...; inputs=...)` now supports explicit lagged dependencies with + `PreviousTimeStep(:input) => selector`. Lagged bindings use temporal streams, + read source samples at or before `t - 1`, preserve the initialized consumer + status value until history exists, and do not add a same-timestep scheduling + edge. This allows feedback cycles to compile without changing generic model + kernels. +- CompositeModel/object execution now exposes explicit mutable environment + commits through `commit_environment!(context, accepted_state)` and + non-committing trial sampling through + `run_call!(context, name; environment=trial_state)`. + Meteorological state stays in the environment backend instead of being staged + through same-named status values. +- Added root application scheduling from `ModelSpec(...; every=...)` using `Dates.Period` + values and the model environment base step. `Diagnostics.explain_schedule` on a + `Advanced.CompiledCompositeModel` now reports each application clock, phase, timestep in base + steps, timestep duration in seconds, and whether the application is scheduled + as a root application or is manual-call-only. +- CompositeModel application scheduling now also honors a model's `timespec(...)` trait + when `ModelSpec(...; every=...)` is omitted. Scenario-level `ModelSpec(...; every=...)` keeps + precedence over the model trait, matching the established multirate runtime. +- CompositeModel application scheduling now validates `timestep_hint(...)` required + bounds for base-step-derived clocks. Hints remain compatibility constraints; + they do not override explicit `ModelSpec(...; every=...)` or non-default `timespec(...)`. +- `Advanced.compile_composite_model` now computes a stable topological application order from + resolved `ModelSpec(...; inputs=...)` producer edges and `Updates(...)` writer-order edges. + Inputs produced by manual-call-only applications are redirected to the parent + application that owns the `ModelSpec(...; calls=...)` call stack. `run!(model)` uses this + precompiled order instead of user declaration order, cycles fail at compile + time, and `Diagnostics.explain_schedule` reports `execution_index`. +- `Advanced.CompiledCompositeModel` now pre-indexes input and call bindings by + `(application_id, object_id)`. Per-object input materialization and + `call_targets` lookup uses these indexes instead of scanning every + binding in the model at each model call. +- `Advanced.CompiledCompositeModel` now also pre-indexes applications by application id. + Hard-call target resolution and stable ordered-application materialization + use this index instead of scanning or rebuilding lookup dictionaries. +- `Advanced.CompiledEnvironmentBindings` now pre-indexes environment bindings by + `(application_id, object_id)`. Environment sampling and mutable environment + output scattering use direct lookup instead of scanning all environment + bindings for every model invocation. +- Added `RunContext` and `CallTarget`. Models can retrieve manual + `ModelSpec(...; calls=...)` targets with `call_targets(context, :name)` and execute + them with `run_call!`, preserving explicit call-stack control in the + composite-model/object runtime. Manual calls execute immediately under the parent call + stack; applications selected by `ModelSpec(...; calls=...)` are skipped by the root + `run!(model)` loop and only execute through `run_call!`. +- Added composite-model/object duplicate-writer validation. During `Advanced.compile_composite_model`, each + `(object, output variable)` now has one canonical writer unless later + writers declare `Updates(:var; after=...)`. The `after` token can match a + previous application id/name or process, so scenario authors can express + cases such as pruning after carbon allocation without changing either model + implementation. +- Added `Diagnostics.explain_writers(compiled)`. It reports each object/variable writer + group, duplicate-writer status, writer application ids/processes, and the + `Updates(...)` declarations used to validate ordered updates. +- Extended `explain_model_specs` rows with application name, target selector, + value inputs, manual calls, and environment metadata. +- Started Phase 3 by compiling simple `ModelSpec(...; inputs=...)` declarations to typed + scale/variable carriers, for example + `inputs=(:x => Many(scale=:Leaf, var=:y),)`. +- Added model-level `Input(...)` defaults from `dep(model)` into + `ModelSpec` value inputs. Scenario-level `ModelSpec(...; inputs=(...))` + overrides those defaults before the native binding is compiled. +- Removed the intermediate scenario bridge after the composite-model/object compiler + gained native `ModelSpec(...; inputs=...)` support. Manual value-transfer carriers are not + retained as user-authored API. +- Removed the intermediate dependency resolver after `ModelSpec(...; calls=...)` became + native composite-model/object metadata. Manual model execution now goes through + `CallTargets`, `call_targets`, and `run_call!`. +- Added model-level `Call(...)` defaults from `dep(model)` into + `ModelSpec` manual-call metadata. Scenario-level + `ModelSpec(...; calls=(...))` overrides those defaults, and + `dep(::ModelSpec)` excludes raw `Call(...)` trait entries so default calls + are normalized through the same bridge as explicit calls. +- Migrated the MAESPA example's model energy-balance hard calls to + scenario-level `ModelSpec(scene_model; calls=(...))`. +- Migrated the MAESPA example's model LAI leaf-area transfer to consumer-side + `ModelSpec(LAIModel(...); inputs=(...))`. +- Started Phase 5 with `CompositeModelTemplate` and `ObjectInstance`. A template stores + reusable composite-model/object `ModelSpec`s plus default object labels, and an + instance mounts those specs inside one named object subtree. +- `CompositeModel(...)` accepts `ObjectInstance` values directly or through its + `instances` keyword. An instance root can be an owned `Object` or the id of + an object supplied separately to the model. +- Mounted template applications receive stable instance-prefixed application + names and an implicit `Scope(instance_name)` on unqualified + `ModelSpec(...; on=...)` selectors. Their `ModelSpec(...; inputs=...)`, `ModelSpec(...; calls=...)`, scheduling, + writer validation, and execution use the normal compiled composite-model/object path. +- Instance overrides can replace one template application by application name + or process. Overrides must be unambiguous and preserve process identity. + Instances without overrides retain the exact shared model object from the + template. +- Template labels fill missing `kind` and `species` metadata throughout the + mounted subtree, while the root receives the instance name used by + `Scope(...)`. Tests cover four instances, plant-local aggregation, shared + model storage, and one process-level model override. +- Added explicit exceptional-organ overrides with + `Override(object=..., application=..., model=...)` through + `ObjectInstance(...; object_overrides=...)`. The override must resolve to one + template application, belong to the instance subtree, and preserve process, + input, output, and environment-variable declarations. +- Object overrides remain one logical model application: the compiler stores + the selected replacement model by target object id. Dependency bindings, + writer ownership, application names, and manual calls therefore remain + unchanged, and no selector resolution occurs in the runtime loop. +- Parameter/model ownership is explicit. Templates retain user-supplied model + and `parameters` objects by reference; unchanged instances share them. + Instance and object overrides retain their user-supplied replacement model + by reference. PlantSimEngine does not copy models or mutate model fields to + merge parameter overrides. +- Same-concrete-type object overrides use a concretely typed object-to-model + table. Structured application explanations report shared/per-object storage, + concrete versus heterogeneous dispatch, overridden object ids, and model + types. +- `CompositeModel` retains mounted instance metadata and `Diagnostics.explain_instances(model)` + reports each instance root, current subtree object ids, mounted application + ids, instance/object overrides, template labels, and parameter ownership. + `Diagnostics.explain_objects(model)` also reports instance membership. +- New objects registered below an instance automatically inherit missing + template `kind` and `species` labels. Instance explanations derive membership + from the current topology, so growth, pruning, and reparenting do not leave a + separate stale membership list. +- CompositeModel hard calls can run under temporary local meteorology with + `run_call!(context, name; environment=local_state)`. Descendants sample the + temporary state through normal environment bindings, while `publish=false` + suppresses output publication and environment commits. This supports + iterative microclimate solvers such as the MAESPA model energy-balance loop. +- Model kernels read their own parameters from the `model` argument. Generic + hard-dependency kernels such as `Monteith` and `Fvcb` discover declared call + targets through `call_targets` and execute them through `run_call!`. +- CompositeModel duplicate-writer validation now ignores manual-call-only applications + when validating canonical root writers. This keeps hard-dependency children + from being treated as independent root writers when they intentionally update + the same object status inside their parent call stack. +- Added a unified composite-model/object MAESPA example path: + `build_maespa_scene(...)` and `run_maespa_example(...)`. + It uses `CompositeModelTemplate`, `ObjectInstance`, `on`, `inputs`, `calls`, + and `every=Dates.Period` with two plant species, one shared soil object, + model LAI, and model energy balance. +- `test/test-maespa-model-example.jl` verifies the unified composite-model/object + MAESPA path. +- `run!(model)` now returns a `Simulation` wrapper with the mutated + `CompositeModel`, compiled model bindings, compiled environment bindings, and the + model-local temporal output streams. This keeps existing status mutation + behavior but makes model outputs inspectable after a run. +- Added `outputs(sim::Simulation)`, `collect_outputs(sim)`, and + `Diagnostics.explain_outputs(sim)` for composite-model/object runs. The explanation reports object + ids, variables, publishing application ids, sample counts, time bounds, and + value types. +- `run!(model; tracked_outputs=...)` now accepts `OutputRequest` and returns + requested model outputs through `collect_outputs(sim)` or + `collect_outputs(sim, :request_name)`. CompositeModel requests are materialized from + retained typed temporal streams after the run. They support `HoldLast`, + `Interpolate`, `Integrate`, and `Aggregate`, `Dates.Period` export clocks, + canonical-publisher inference when unique, explicit `process=...` + selection, and dynamic objects over each object's own published sample + interval. +- CompositeModel output requests now compile a publisher-level retention plan. With + `tracked_outputs=nothing`, the model runtime retains all output streams for + historical inspection. With explicit `tracked_outputs`, including an empty + request vector, it retains only requested publisher streams plus streams + required by temporal `ModelSpec(...; inputs=...)`. Dependency-only streams are pruned after + publication to the compiled policy horizon: latest-only for `HoldLast`, the + input window for `Integrate`/`Aggregate`, and enough source history for + `Interpolate`/`PreviousTimeStep`. Explicitly requested streams retain their + complete histories for post-run export. Export is therefore not yet fully + online, but unrequested temporal dependencies no longer grow for the full + simulation. +- Added `Diagnostics.explain_output_retention(sim)` to report which application/variable + streams are retained and whether the reason is default retention, an output + request, or a temporal dependency. Dependency-only rows also report their + compiled `retention_steps`; unbounded requested/default rows report + `nothing`. +- CompositeModel temporal streams are now keyed by application id, object id, and + variable. Multiple applications can publish the same variable on the same + object without overwriting each other's stream samples. +- CompositeModel output-export tests now cover requested-output `DataFrame` + materialization, canonical publisher inference when `process=` is omitted, + rejection when only stream-only publishers exist, and ambiguity when an + explicit process matches both a stream-only and a canonical publisher. +- CompositeModel `OutputRequest(...)` now accepts `application=...` to select an + explicit application id/name when the same process is mounted more than + once. Explicit application selection can retain and export a + `:stream_only` publisher. +- Each model temporal stream owns a concrete `Vector{Tuple{Float64,T}}` + selected from its first published value rather than boxing all values as + `Any`. Output type changes fail explicitly, and `Interpolate`/`Integrate` + tests verify `BigFloat` histories and reduced values remain `BigFloat`. +- CompositeModel `output_routing=(var=:stream_only,)` now matches the unified graph + semantics: stream-only outputs are excluded from canonical writer validation + and same-object input inference, while remaining available in output streams + and explicit `inputs=(... One(application=:name), ...)` selections. +- `run!(model; steps=...)` now refreshes dirty structural bindings at timestep + boundaries. Objects created, removed, or reparented by a model during one + timestep update `ModelSpec(...; on=...)` target sets, input carriers, call targets, + writer validation, and scheduling before the next timestep. +- Geometry-only mutations refresh environment bindings at the next timestep + without recompiling structural bindings. The returned `Simulation` + always contains final compiled structural and environment bindings, including + mutations performed on the last step. +- Environment dirty tracking is now object-scoped for geometry-only changes. + `move_object!`, `update_geometry!`, and + `mark_environment_binding_dirty!(model, object)` retain unaffected compiled + bindings and re-run `Advanced.EnvironmentAPI.bind_environment` only for applications targeting the + changed object. Structural changes and provider-wide invalidation still + rebuild the complete environment cache. +- Runtime lifecycle tests cover a model-created leaf joining a leaf + application and plant-local `RefVector`, a pruned leaf leaving both before + the next step, and a moved leaf switching mock microclimate cells. +- Root model execution now compiles contiguous homogeneous target batches. + Each target prebinds its concrete model, `Status`, input-binding tuple, and + environment binding. Runtime dispatch occurs once + at the batch function barrier; the inner object loop is specialized on a + concrete target type. +- Exceptional object overrides with another concrete model implementation + become separate batches without changing stable object execution order. + Structural or environment binding refresh recompiles the execution plan + before the next timestep. +- Added `Diagnostics.explain_execution_plan(scene_or_simulation)`. It reports batch object + ids, concrete model/status/carrier types, batch sizes, and inner-loop dispatch + semantics. A focused 128-leaf gate verifies zero allocations inside a warmed + homogeneous no-output batch. +- Added `objects_from_mtg(root; ...)` and `CompositeModel(root::MultiScaleTreeGraph.Node; + ...)`. Existing MTG topology is traversed once into the unified registry, + preserving stable node-derived ids, parent relations, labels, geometry, and + existing `:plantsimengine_status` objects through configurable accessors. + +The composite-model/object compiler is executable: selectors normalize to object +addresses, resolve before runtime, and compile into reference, temporal, call, +writer, and environment carriers. The historical mapping compiler has been +removed. + +## Phase 0: Public Contract Freeze + +Goal: decide the small public vocabulary before implementing internals. + +Define: + +- `ModelSpec(model; name=nothing)` as the model-application wrapper. +- `ModelSpec(...; on=selector)` as the target object-set declaration. +- `ModelSpec(...; inputs=...)` for value dependencies. +- `ModelSpec(...; calls=...)` for manual call-stack dependencies. +- `Updates(...)` for rare ordered duplicate writers. +- `every=period::Dates.Period` and related multirate policies. +- `Environment(...)` for optional environment resolver/backend overrides. + +Rules: + +- a model kernel remains generic and declares `inputs_`, `outputs_`, optional + `dep`, optional `environment_inputs_`, and `run!`; +- a model application decides where the kernel runs, at what rate, and how its + inputs, calls, updates, outputs, and environment are bound; +- application ids are stable and can be generated from explicit `name`, + process, object selector, and occurrence index; +- if several applications provide the same process on the same object set, + selectors must disambiguate by application name or another explicit filter. + +Acceptance tests: + +- a model can be applied twice to the same leaf objects with different names; +- a dependency selector can choose by process when unique and by name when not; +- structured explanations expose model kernel type, process, application name, + and target object ids. + +## Phase 1: CompositeModel Object Registry + +Goal: introduce the internal object model without changing public behavior yet. + +Implement: + +- `ObjectId` as the stable identity key for every runtime object. +- `ModelObject` metadata with labels: + `scale`, `kind`, `species`, optional `name`, parent id, child ids, and + optional geometry/position handle. +- `Advanced.ObjectRegistry` storing objects, parent/child relations, and indexes by + label. +- adapters from existing MTG state into the registry: + each selected root and each MTG node gets an object id; + single-status simulations get one object with `scale=:Default`. +- object lifecycle hooks for add/remove/reparent that mirror the existing MTG + runtime reindexing. + +Acceptance tests: + +- the MAESPA example registers five leaf objects, two plant objects, one soil + object, and one model object; +- `status(sim, :plant_A, :Leaf)` and `status(sim, :Leaf)` can be expressed as + registry queries; +- add/remove/reparent updates object registry relations and status views. + +## Phase 2: Selector And Scope Language + +Goal: make "which objects?" explicit and reusable. + +Implement selector types: + +```julia +SceneScope() +Self() +Subtree() +SelfPlant() +Ancestor(scale=:Plant) +Scope(name) +Relation(...) +``` + +Object labels use keyword criteria such as `kind=:plant`, +`species=:oil_palm`, `scale=:Leaf`, and `name=:leaf_1`. + +Implement multiplicity wrappers: + +```julia +One(selector...) +OptionalOne(selector...) +Many(selector...) +``` + +Selectors must normalize to `Diagnostics.ObjectAddress` objects with enough context to be +resolved relative to a consuming object. + +Implement `ModelSpec(...; on=...)` using the same selector system. The target object +set of a model application must never be hidden inside a mapping key or +implicit scale table. + +Definitions: + +- `Self()` means only the current object: the object on which the consuming + model application runs. It is a plant only when that object is the plant. +- `Subtree()` means the current object and its descendants. +- `SelfPlant()` means the nearest containing plant scope. +- `Ancestor(scale=:Plant)` is the generic selector form for `SelfPlant()`. +- `SceneScope()` means the whole model. +- `Scope(name)` means a named scope or object collection. + +Rules: + +- unqualified selectors inside a reusable plant application bundle default to + `within=Self()`; +- model-level selectors default to `within=SceneScope()`; +- `One(...)` errors unless exactly one object resolves per consumer; +- `Many(...)` preserves stable object-id order; +- object-id order replaces incidental traversal order as the semantic default. +- selectors are resolved during compilation or binding refresh, not inside the + inner model loop. + +Acceptance tests: + +- plant allocation on four oil palms reads only leaves under each plant; +- model LAI reads leaves across all plant objects; +- a species-specific model model can read only `species=:oil_palm` leaves; +- a model application target set declared with `ModelSpec(...; on=...)` produces stable + application/object pairs; +- selector errors report available labels and near matches. + +## Phase 3: Unified Value Inputs + +Goal: use `ModelSpec(...; inputs=...)` as the only user-facing value-dependency declaration. +Historical `MultiScaleModel(...)` mappings are migration sources only. + +Target API: + +```julia +ModelSpec(AllocationModel(); on=Many(kind=:plant, scale=:Plant), inputs=(:leaf_carbon => Many(scale=:Leaf, within=Subtree(), var=:leaf_carbon))) + +ModelSpec(LAIModel(area); on=One(scale=:Scene), inputs=(:leaf_areas => Many(kind=:plant, scale=:Leaf, within=SceneScope(), var=:leaf_area))) +``` + +Implement: + +- `ModelSpec(...; inputs=...)` as `ModelSpec` configuration. +- `Input(...)` or an equivalent internal wrapper that lets `dep(model)` + provide default value-input bindings. +- normalized input bindings from target variable to `Diagnostics.ObjectAddress`. +- compiler pass that decides carrier: + direct reference, `RefVector`, temporal stream, or materialization. +- status-default insertion for materialized target variables using the + consumer model's `inputs_` default. +- temporal policies on value inputs: + `HoldLast`, `Interpolate`, `Integrate`, `Aggregate`. +- `Dates.Period` windows on value inputs, for example `window=Day(1)`. +- copy/reference semantics reporting for every compiled input binding. + +Rules: + +- model authors still declare `inputs_`; scenario authors decide where those + inputs come from; +- `dep(model)` may provide defaults for common value-input bindings in + composite-model/object composition; +- scenario-level `ModelSpec(...; inputs=(...))` always wins over `dep(model)` + defaults; +- same-rate local links should keep reference semantics where possible; +- cross-rate links always go through temporal state; +- duplicate source candidates are errors unless the selector disambiguates; +- materialization carriers, when needed, are internal compiler details + and are not user-authored structs; +- same-rate scalar and many-object links should avoid copies when they can use + aliases, shared refs, `RefVector`, or an equivalent typed carrier; +- PlantSimEngine must preserve arbitrary value types, including units, + automatic differentiation numbers, uncertainty wrappers, and other + numeric-like values. + +Carrier expectations: + +| Binding kind | Runtime carrier | +| --- | --- | +| same-rate scalar | shared `Ref` or local alias | +| same-rate many-object | `RefVector` or equivalent typed reference collection | +| cross-rate | temporal stream sample | +| integrate/aggregate | temporal window reduction | +| materialized cross-object input | generated pre-run status assignment | +| environment | cached environment binding sample | + +Acceptance tests: + +- the MAESPA model LAI cross-object input is declared with `ModelSpec(...; inputs=...)` and + produces the same `lai` and `leaf_area`; +- historical plant allocation `MultiScaleModel([:leaf_carbon => [:Leaf => :leaf_carbon]])` + becomes `ModelSpec(...; inputs=...)` and remains plant-local; +- a same-scale rename currently expressed with `SameScale()` works through + `ModelSpec(...; inputs=...)`; +- multi-rate value inputs integrate object streams by object id. +- same-rate many-object bindings do not allocate per timestep in a benchmarked + hot loop beyond unavoidable model work. +- unitful or dual-number status values survive `ModelSpec(...; inputs=...)` without forced + conversion to `Float64`. + +## Phase 4: Unified Model Calls + +Goal: use `ModelSpec(...; calls=...)` as the only user-facing manual model-call declaration. +The same mechanism must also be usable from `dep(model)` so hard-dependency +traits become default call declarations. + +Target API: + +```julia +ModelSpec( + SceneEB(); + on=One(scale=:Scene), + calls=( + :leaf_energy => + Many(kind=:plant, scale=:Leaf, process=:energy_balance), + :soil => One(kind=:soil, application=:soil_water), + ), +) +``` + +Implement: + +- `ModelSpec(...; calls=...)` as `ModelSpec` configuration. +- `Call(...)` or an equivalent internal wrapper that lets `dep(model)` provide + default manual-call dependencies. +- call resolution from `Diagnostics.ObjectAddress` to concrete `ModelCall` handles, or an + equivalent callable runtime object if the final internal type name differs. +- same-status hard dependency calls using the same public API. +- publication semantics: + trial `run_call!(call)` mutates status only; + final `run_call!(call; publish=true)` appends outputs and temporal + streams. +- structured call explanations with parent application id, selected callee + application ids, selected object ids, selector, and publication behavior. + +Rules: + +- calls are manual call-stack dependencies and are not independently + scheduled under the parent; +- `dep(model)` call defaults are model-author defaults, not final wiring; +- scenario-level `ModelSpec(...; calls=(...))` overrides `dep(model)` defaults; +- hard target outputs still participate in dependency graph compilation through + the owning parent when needed; +- call selection must be visible through explanation helpers. + +Acceptance tests: + +- MAESPA model energy balance uses `ModelSpec(...; calls=...)` and still controls iterative + leaf energy calls; +- missing call selectors report `kind`, `scale`, `process`, and available + matches; +- final accepted calls publish exactly once per timestep. +- an iterative model model can run selected leaf and soil calls several times + with `publish=false` and publish only the accepted state. + +Implemented: + +- `run_call!(::CallTarget)` defaults to `publish=false`, matching the + iterative manual-call contract. +- One-shot accepted calls use `publish=true` explicitly. +- An iterative hard-call regression executes two default non-publishing trials + followed by one accepted call and verifies exactly one environment write and + one temporal output sample for the accepted state. +- `Diagnostics.explain_calls(compiled)` reports + `publication_policy=:explicit_accept`, `default_publish=false`, and + `accepted_publish=true` for every compiled call edge. +- `ModelSpec` now retains per-binding provenance for value inputs and manual + calls. Bindings from `dep(model)` are reported as `:model_default`, + scenario-level `ModelSpec(...; inputs=...)` and `ModelSpec(...; calls=...)` are reported as `:model_spec`, + and compiler-created same-object value links are reported as + `:inferred_same_object`. `Diagnostics.explain_bindings`, `Diagnostics.explain_calls`, and + `explain_model_specs` expose these origins for agent-readable diagnostics. +- Zero-match `OptionalOne(...)` dependencies remain compiled and visible. + Optional inputs retain the consumer `inputs_` default with + `carrier_kind=:optional_default`; optional calls expose an empty target set + and `resolved=false` instead of failing compilation. + +## Phase 5: Object Templates, Instances, And Overrides + +Goal: support several plants of the same species with shared default models and +selective per-instance differences. + +Target API: + +```julia +oil_palm = CompositeModelTemplate( + kind=:plant, + species=:oil_palm, + mapping=oil_palm_mapping, +) + +model = CompositeModel( + ObjectInstance(:palm_1, oil_palm; root=node1), + ObjectInstance(:palm_2, oil_palm; root=node2, overrides=( + stomatal_conductance = Tuzet(; g1=3.2), + )), +) +``` + +Implement: + +- template-level model specs and parameters; +- instance-level model/parameter overrides by process; +- object-level overrides for exceptional organs; +- conflict validation when two overrides target the same process/object. +- shared parameter/model storage when template instances do not override + anything, with explicit copy/ownership behavior when they do. + +Rules: + +- templates do not prescribe topology; they attach mappings to whatever object + tree the instance provides; +- default `Self()` selectors resolve inside the current instance; +- model-wide models must opt into wider scope. + +Acceptance tests: + +- four oil palm instances share model objects/parameters when not overridden; +- one palm instance can override one process parameter; +- allocation remains per plant while model LAI sees all leaves. + +MAESPA status: + +- the unified composite-model/object MAESPA path uses `CompositeModelTemplate` and + `ObjectInstance` for species A and B. + +## Phase 5B: Object Lifecycle And Cache Invalidation + +Goal: make growth, pruning, and moving organs update every compiled binding +through one mutation path. + +Implement public lifecycle hooks: + +```julia +register_object!(model, object; parent) +remove_object!(model, object) +reparent_object!(model, object, new_parent) +move_object!(model, object, geometry_or_position) +Advanced.refresh_bindings!(model) +``` + +Implement invalidation for: + +- object selector caches; +- model application target sets; +- `RefVector` or equivalent many-object carriers; +- temporal stream ownership; +- writer validation; +- environment bindings. + +Rules: + +- topology and geometry changes do not silently leave stale carriers; +- object creation should bind the new object to model applications selected by + `ModelSpec(...; on=...)` before the next timestep; +- moving an object should refresh environment bindings without rebuilding + unrelated model bindings unless the move changes object relations or labels. + +Acceptance tests: + +- creating a new leaf adds it to plant-local allocation and model LAI before + the next timestep; +- pruning/removing a leaf removes it from many-object carriers and temporal + stream ownership; +- changing a leaf insertion angle can refresh only the affected environment + binding when topology is unchanged. + +## Phase 6: Environment Binding Cache + +Goal: make environment and microclimate sampling automatic and fast. + +Implement: + +- `EnvironmentBinding` cache: + object id, backend/provider id, cell/layer id, required variables. +- default environment resolver: + global environment data for non-spatial backends; + object position for spatial backends; + parent position fallback; + global fallback or validation error. +- dirty flags and batched refresh: + `mark_environment_binding_dirty!`; + `update_geometry!(...; invalidate_environment=true)`; + automatic dirty marking on object creation, removal, reparenting, and + environment grid rebuild. +- explanation helper: + `Diagnostics.explain_environment_bindings(sim)`. +- minimal geometry accessors or traits: + `position`, `geometry`, and `bounds`. +- backend protocol: + `Advanced.EnvironmentAPI.bind_environment`, opaque handles, committed/transient `sample`, + `commit_environment!`, and `EnvironmentAPI.update_index!`. +- `Environment(...)` overrides for scenario-specific resolver/backend choices. +- `Environment(; sources=(CO2=:Ca,))` for scenario-specific environment source + remapping without changing model kernels. + +Runtime rule: + +```text +object -> cached binding -> backend cell/layer -> current environment values +``` + +Spatial lookup must happen only during binding refresh, not inside every model +call. + +Acceptance tests: + +- global environment data gives the same values to all objects; +- missing global environment variables fail during environment binding refresh when + the backend can enumerate variables; +- `Environment(; sources=...)` remaps backend variables to model-facing + `environment_inputs_` names and is visible in explanations; +- a model running every two hours over hourly global meteorology receives a + windowed weather sample rather than only the current raw row; +- model `environment_hint` reducers/windows are honored, and an + `Environment(; sources=...)` override changes the source without discarding + the reducer; +- all objects targeted by one application reuse one global weather sample per + application/timestep; +- mock grid backend binds leaves to cells once at initialization; +- moving one leaf marks only that leaf binding dirty and refreshes it before + the next timestep; +- model `environment_inputs_` changes update required variables without recomputing + spatial links unless necessary. +- `commit_environment!(context, accepted_state)` commits mutable microclimate + state back to the active backend. + +## Phase 7: Compiler, Scheduler, And Explanation Cleanup + +Goal: make the unified graph the source of truth. + +Implement: + +- one compiler that builds a global dependency graph over object addresses; +- materialization and multiscale reference wiring as internal carriers; +- object/scope dependency scheduling; +- writer validation through the same graph, including `Updates(...)`; +- model application scheduling from `ModelSpec(...; on=...)` target sets; +- multirate scheduling based on `Dates.Period` values in `ModelSpec(...; every=...)` and + input windows; +- typed compiled bindings that avoid selector resolution in timestep hot loops; +- typed homogeneous execution batches that move dynamic dispatch outside the + per-object inner loop while preserving ordered heterogeneous overrides; +- arbitrary value type preservation through status, input carriers, temporal + storage, and environment samples; +- structured explanation: + `Diagnostics.explain_objects`, `Diagnostics.explain_scopes`, `Diagnostics.explain_bindings`, + `Diagnostics.explain_calls`, `Diagnostics.explain_environment_bindings`, `Diagnostics.explain_schedule`, + `Diagnostics.explain_writers`. + +Acceptance tests: + +- old `MultiScaleModel` examples rewritten with `ModelSpec(...; inputs=...)` produce matching + outputs; +- historical cross-object examples rewritten with `ModelSpec(...; inputs=...)` produce + matching outputs; +- MAESPA hard-call example rewritten with `ModelSpec(...; calls=...)` produces matching + outputs; +- explanation helpers include enough concrete object ids, scales, processes, + and variables for an AI agent to repair bad mappings. +- `Diagnostics.explain_bindings(sim)` reports whether each dependency came from inference, + `dep(model)`, or `ModelSpec`, and reports carrier/copy semantics. +- no selector resolution occurs inside the per-object, per-model timestep loop + for static composite models. +- a warmed homogeneous execution batch performs no allocations beyond model, + output-stream, or backend work requested by the application itself; +- multirate simulations use the same object-address graph as same-rate + simulations. + +## Phase 8: Breaking API Removal And Migration Docs + +Goal: remove the old configuration surface once parity is proven. + +Removed: + +- `MultiScaleModel(...)` as public scenario configuration; +- superseded scenario containers and value-transfer authoring; +- superseded manual-dependency selectors. + +Write migration notes: + +- `MultiScaleModel([:x => [:Leaf => :y]])` -> `inputs=(:x => Many(scale=:Leaf, var=:y),)`; +- cross-object value declarations -> consumer `ModelSpec(...; inputs=...)`; +- manual dependency declarations -> `ModelSpec(...; calls=...)`; +- repeated species assemblies -> `CompositeModelTemplate` plus `ObjectInstance`; +- explicit environment wiring -> environment resolver/binding backend. +- `InputBindings(...)` -> source and temporal policy information inside + `ModelSpec(...; inputs=...)`; +- `MeteoBindings(...)` and `MeteoWindow(...)` -> `Environment(...)` and + environment sampling/window policy; +- `ModelSpec(...; output_routing=...)` -> model-application output policy; +- `PreviousTimeStep(...)` -> temporal policy/cycle-breaking marker in the + unified graph; +- `ScopeModel(...)` -> `ModelSpec(...; on=...)` plus selector scope. + +Regression tests must cover all migrated examples before removal. + +Migration documentation progress: + +- Added `docs/src/migration_composite_model.md` with direct translations for + `MultiScaleModel`, repeated object assemblies, + `TimeStepModel`, `InputBindings`, `MeteoBindings`, `ScopeModel`, and + `SameScale`. +- Documentation navigation and the home page now identify the composite-model/object API + as the target for new multiscale and multi-plant work. +- The documentation home page now uses executable composite-model/object examples as the + primary quickstart. It shows `CompositeModel`, `Object`, `ModelSpec`, `on`, + `inputs`, `every`, automatic same-object binding inference, multi-object + `Many(...)` inputs, and manual `ModelSpec(...; calls=...)` syntax. +- The repository README now mirrors the composite-model/object entry point instead of + teaching `ModelMapping` first. It includes smoke-tested `CompositeModel`/`Object` + quickstart code, `ModelSpec(...; inputs=...)` multi-object coupling, conceptual + `ModelSpec(...; calls=...)` syntax, and links to the migration guide. +- Added `docs/src/composite_model/quickstart.md` as the first native + composite-model/object tutorial page and promoted it in the documentation navigation. + The page contains docs-tested examples for one-object model chaining, + inferred same-object bindings, `OutputRequest` retention, multi-object + `ModelSpec(...; inputs=...)`, `RefVector` carrier explanations, and manual `ModelSpec(...; calls=...)` + syntax. +- The repository agent skill teaches the unified public vocabulary. +- The public API page now starts with curated composite-model/object groups for scenario + construction, selectors, coupling, lifecycle, environment, runtime, and + structured explanations. + +Current removal audit: + +- The unreleased intermediate scenario and runtime subsystem has been deleted, + including its carriers, dependency selectors, target helpers, tests, + examples, and documentation. +- Public manual-call control now uses vector-like `CallTargets`, + `run_call!(context, name)`, `call_targets`, and `run_call!(target)`. +- `RunContext` defines Symbol-named `run_call!` and `call_targets` directly. +- The legacy mapping transforms are removed: + `MultiScaleModel`, `SameScale`, `TimeStepModel`, `InputBindings`, + `MeteoBindings`, `MeteoWindow`, and `ScopeModel` are not retained as + compatibility constructors. +- `ModelMapping` is removed. Retained documentation mentions it only as + historical migration context. +- Historical MTG mapping and mapping-level multirate pages were removed from + the active documentation navigation. A future documentation cleanup can + replace + these historical pages with equivalent composite-model/object tutorials rather than + retaining them as migration reference. +- The model execution page has been rewritten as a composite-model/object-first guide. + It now documents compilation, same-rate reference carriers, temporal + `ModelSpec(...; inputs=...)`, manual `ModelSpec(...; calls=...)`, `Updates(...)`, `ModelSpec(...; every=...)`, + environment binding, output retention, lifecycle cache invalidation, and + compatibility translations from the historical mapping runtime. +- The detailed first simulation tutorial now starts from the composite-model/object API + instead of `ModelMapping`. It introduces model kernels, object status, + compiled applications, inferred same-object bindings, model outputs, and a + short compatibility note for historical mapping examples. +- The quick examples page now uses copy-pasteable composite-model/object examples for + Beer light interception, degree-days/LAI/light coupling, biomass growth, and + retained `OutputRequest` exports. `ModelMapping` appears only in the + compatibility note. +- The standard model coupling, model switching, and coupling more complex + models step-by-step tutorials now teach `CompositeModel`, `Object`, `ModelSpec`, + `on`, `every`, inferred soft `ModelSpec(...; inputs=...)`, and manual + `ModelSpec(...; calls=...)` first. Historical `PlantSimEngine.ModelMapping(...)` appears + only in compatibility notes on those pages. +- The home page has been replaced by native composite-model/object examples. The + repository README has also been replaced by native composite-model/object examples, + and a dedicated composite-model/object quickstart is now available in the main + documentation navigation. +- CompositeModel/object tests cover scheduling, temporal policies, binding inference + and overrides, environment contracts and aggregation, output routing and + application-qualified export, and structured explanations. Legacy mapping + regression tests were removed with the old runtime. +- CompositeModel/object tests now include public environment-contract validation parity for + missing environment variables, explicit `Environment(; sources=...)` + remapping, model-author `environment_hint` source defaults, and validation against + an explicit replacement environment object/backend. +- Test code uses the canonical `ModelSpec(...; every=...)` spelling and composite-model/object + modifiers. Legacy transform tests were removed with the old compatibility + constructors. +- The unified MAESPA path is implemented and tested through `on`, + `inputs`, `calls`, `call_targets`, and `run_call!`. + +## Resolved API Decisions + +- `SceneScope`, `Self`, `Subtree`, `SelfPlant`, `Ancestor`, `Scope`, and + `Relation` are the public topology selector names. Object labels use + `kind=`, `species=`, `scale=`, and `name=` keyword criteria. +- `ModelSpec(...; inputs=...)` is the only scenario-level value-binding + construction form. +- `ModelSpec(...; every=...)` is the canonical timestep configuration. +- `Environment(...)` owns provider/resolver/source configuration. Temporal + value windows belong to the consuming `ModelSpec(...; inputs=...)` selector. +- Object templates own reusable model applications and parameters, not plant + topology construction. They consume explicit object trees or MTGs adapted + through `objects_from_mtg`. +- The old multiscale and mapping-transform implementations have been removed. + +## Completion Evidence + +The requirement-by-requirement evidence and final verification commands are +recorded in `composite_model_completion_audit.md`. diff --git a/docs/src/dev/maespa_model_handoff.md b/docs/src/dev/maespa_model_handoff.md new file mode 100644 index 000000000..b04d9edf1 --- /dev/null +++ b/docs/src/dev/maespa_model_handoff.md @@ -0,0 +1,161 @@ +# MAESPA-Style CompositeModel Example Handoff + +The executable acceptance example is `examples/maespa_model_example.jl`, with +focused coverage in `test/test-maespa-model-example.jl`. + +## CompositeModel Shape + +- One `:Scene` object owns canopy microclimate and model-scale fluxes. +- One shared `:Soil` object owns soil water state. +- Species A and B are reusable `CompositeModelTemplate`s mounted as independent + `ObjectInstance`s. +- Each plant instance contains one plant object, one internode object, and its + own leaf objects. +- Species parameters differ while the model application structure is shared. + +Leaf applications use the copied PlantBiophysics subsample models: + +- `Monteith` for `:energy_balance`; +- `Fvcb` for `:photosynthesis`; +- `Tuzet` for `:stomatal_conductance`. + +## Coupling + +The model energy-balance application controls iterative canopy-air, leaf, and +soil calls. `ModelSpec(...; calls=...)` expresses execution ownership only: the scene model +decides when subprocesses run. + +```julia +ModelSpec(scene_model; name=:scene_eb, on=One(scale=:Scene), inputs=(:psi_soil => + One(kind=:soil, scale=:Soil, application=:soil_water, var=:psi_soil),), calls=(:energy_balance => + Many(kind=:plant, scale=:Leaf, process=:energy_balance), + :soil => + One(kind=:soil, scale=:Soil, application=:soil_water),), environment=Environment(provider=:forcing, sink=:canopy), every=Dates.Hour(1)) +``` + +The scene receives above-canopy forcing from the `:forcing` provider and has +`:canopy` as its explicit commit sink. Trial leaf calls use +`run_call!(context, :energy_balance; environment=trial_environment)`, so all hard-called +leaves sample the trial canopy atmosphere through their compiled handles without +committing it. After convergence, the scene commits the accepted canopy +atmosphere with `commit_environment!(context, accepted_environment)` and publishes one +accepted leaf call against that committed environment. + +Scene/soil values are wired declaratively with `ModelSpec(...; inputs=...)`, not by manually +writing another object's status. The soil model receives accepted scene fluxes +through live references: + +```julia +ModelSpec(SoilWater(...); name=:soil_water, on=One(kind=:soil, scale=:Soil), inputs=(:transpiration => + One( + scale=:Scene, + within=SceneScope(), + application=:scene_eb, + var=:scene_transpiration, + ), + :infiltration => + One( + scale=:Scene, + within=SceneScope(), + application=:scene_eb, + var=:scene_infiltration, + ),), every=Dates.Hour(1)) +``` + +This creates a parent-controlled feedback loop: the scene reads mapped +`psi_soil` when it starts its energy-balance solve, computes accepted scene +water fluxes, writes `scene_transpiration` and `scene_infiltration`, then calls +the soil model. The soil call sees those scene values through input carriers +and publishes the updated soil state. If the intended science is an explicit +lag rather than same-step parent control, use `PreviousTimeStep(:psi_soil)` on +the scene input. + +CompositeModel LAI receives live references to every leaf area: + +```julia +ModelSpec(LAIModel(ground_area); name=:lai_dynamic, on=One(scale=:Scene), inputs=(:leaf_areas => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + process=:leaf_state, + var=:leaf_area, + ),), every=Dates.Day(1)) +``` + +The scene energy-balance model uses the same mapping mechanism for leaf-scale +values needed during the hard-call solve. It maps leaf area, leaf carbon, trial +leaf inputs (`Ra_SW_f`, `aPPFD`, `Ψₗ`), and accepted leaf fluxes (`Rn`, `λE`, +`H`, `A`) into scene-level vector inputs. The scene model then writes or reads +those vectors, while the referenced leaf statuses remain the single source of +truth. + +```julia +ModelSpec(scene_model; name=:scene_eb, on=One(scale=:Scene), inputs=(:leaf_areas => Many(kind=:plant, scale=:Leaf, within=SceneScope(), var=:leaf_area), + :leaf_carbon => Many(kind=:plant, scale=:Leaf, within=SceneScope(), var=:leaf_carbon), + :leaf_Ra_SW_f => Many(kind=:plant, scale=:Leaf, within=SceneScope(), var=:Ra_SW_f), + :leaf_aPPFD => Many(kind=:plant, scale=:Leaf, within=SceneScope(), var=:aPPFD), + :Ψₗ => Many(kind=:plant, scale=:Leaf, within=SceneScope(), var=:Ψₗ), + :leaf_rn => Many(kind=:plant, scale=:Leaf, within=SceneScope(), policy=HoldLast(), var=:Rn), + :leaf_lambda_e => Many(kind=:plant, scale=:Leaf, within=SceneScope(), policy=HoldLast(), var=:λE), + :leaf_h => Many(kind=:plant, scale=:Leaf, within=SceneScope(), policy=HoldLast(), var=:H), + :leaf_a => Many(kind=:plant, scale=:Leaf, within=SceneScope(), policy=HoldLast(), var=:A),)) +``` + +`HoldLast()` is intentional for the leaf flux vectors: it asks the compiler for +live references to the current held status values, so the parent scene solve can +iterate hard-call trial states without materializing temporal streams. + +Allocation is plant-local because its leaf selector uses `within=Subtree()`: + +```julia +ModelSpec(allocation; name=:allocation, on=One(scale=:Plant), inputs=(:leaf_carbon => Many(scale=:Leaf, within=Subtree(), var=:leaf_carbon)), every=Dates.Day(1)) +``` + +## Meteorology + +Input meteorology is above-canopy forcing wrapped in a +`MaespaSingleLayerEnvironment`. The backend stores two meteorological states: + +- `forcing`: the above-canopy `Weather`/time series sampled by the scene; +- `canopy`: the mutable canopy `Atmosphere` sampled by every leaf. + +The scene application uses `Environment(provider=:forcing, sink=:canopy)`. +Leaf energy-balance applications use `Environment(provider=:canopy)`. The +one-layer backend does not look at process names, geometry, or cells; all leaves +intentionally sample the same current canopy atmosphere. + +`canopy_air_update(...)` is a plain helper, not a model application. It reads +canopy-scale leaf fluxes aggregated in the scene, computes the MAESPA-style +canopy air update, and returns a new `Atmosphere`. The accepted solution is +committed directly with: + +```julia +commit_environment!(context, accepted_environment) +``` + +CompositeModel status also stores diagnostics for the resulting below-canopy +microclimate: + +- `canopy_tair`; +- `canopy_vpd`; +- `canopy_rh`; +- `canopy_htot`; +- `canopy_gcanop`. + +Trial iterations pass the candidate atmosphere through `run_call!`, preserving +the leaf applications' compiled provider handles. The accepted state is the +only state committed to the mutable environment backend. + +## Acceptance Checks + +The focused test verifies: + +- five leaves across two species and one shared soil object; +- instance membership and mounted application ids; +- model calls to all leaf energy-balance applications and the soil model; +- nested `Monteith -> Fvcb -> Tuzet` call bundles; +- live-reference LAI and plant-local allocation bindings; +- hourly energy balance and daily LAI/allocation schedules; +- exactly one accepted publication per manually called target and timestep; +- finite canopy microclimate, leaf energy, photosynthesis, soil feedback, and + species-specific allocation after a 25-hour run. diff --git a/docs/src/dev/public_api_refinement_completion_audit.md b/docs/src/dev/public_api_refinement_completion_audit.md new file mode 100644 index 000000000..023b63fb8 --- /dev/null +++ b/docs/src/dev/public_api_refinement_completion_audit.md @@ -0,0 +1,43 @@ +# Public API Refinement Completion Audit + +This audit records the supported contract and the evidence used to stabilize it. +It complements the [decision record](public_api_refinement_decisions.md) and the +[public symbol inventory](../API/public_symbols.md). + +## Contract evidence + +| Requirement | Supported contract | Evidence | +|:--|:--|:--| +| Public boundary | Composition, model-author, diagnostic, and extension symbols are exported by default; compiler/cache representations live under `PlantSimEngine.Advanced`. | `test-model-api-stabilization.jl` checks the namespace boundary; Documenter's missing-doc check covers exported docstrings. | +| Application identity | Repeated process applications require explicit names. Inputs, calls, outputs, overrides, and `Updates(...; after=...)` use canonical application IDs. Singular process references are rejected; `Many(process=...)` remains an explicit discovery query. | Stabilization, binding-inference, hard-call, output, override, and update tests cover repeated applications and actionable errors. | +| Selector grammar | `Self()` is one object, `Subtree()` is that object plus descendants, `SelfPlant()` is the containing plant, and `SceneScope()` is the model. `One`, `OptionalOne`, and `Many` share the same criteria across targeting, coupling, lookup, and outputs. | Multi-plant selector tests, instance/template tests, lifecycle tests, and XPalm downstream tests. | +| Outputs | `outputs=:none` is the safe default; `:all` and selector-based `OutputRequest`s are explicit. Request names are unique, application identity is preserved, and removed-object history remains collectable. | Output-boundary, runtime-matrix, multirate, lifecycle-history, and allocation tests. | +| Execution ownership | `run!` starts a fresh simulation; `continue!` and `step!` advance its live handle without resetting time, streams, schedules, or environment position. | Split-run equivalence, multirate-boundary, environment-resume, and lifecycle-continuation tests. | +| Construction and initialization | `CompositeModel(models...; status=...)` lowers to ordinary objects and `ModelSpec`s. `Diagnostics.explain_initialization` reports application, object, origin, defaults, expected/provided types, and remedies without running kernels. | Concise/explicit lowering equivalence and initialization report tests. | +| Diagnostics | Supported explanation functions accept `CompositeModel` directly and compiled views where useful; simulation overloads avoid field inspection. Results are structured vectors that can be filtered with ordinary Julia predicates. | Structured explanation assertions throughout the model test matrix and documentation examples. | +| Lifecycle | Registration, MTG growth, removal, reparenting, movement, and geometry updates are the supported mutation paths. Cycle/self-parent failures are atomic; structural and geometry invalidation remain targeted. | Stabilization, unified integration, environment, and lifecycle-output tests. | +| Model-author API | The kernel is `run!(model, status, environment, constants, context)`. Model parameters come from `model`; `runtime_model`, call-target accessors, traits, and lifecycle helpers are the supported context surface. | `test-model-contract.jl`, hard-call tests, growing-plant tutorial, and downstream model suites. | +| Compatibility | `tracked_outputs`, singular scenario `process=` references, output-request `process=`, and process-only overrides are removed. Mapping runtimes are not restored. | Migration guide plus rejection tests. | + +## Validation matrix + +The release gate is: + +1. complete PlantSimEngine package tests, including allocation gates and doctests; +2. a full Documenter build with missing-doc and executable-example checks; +3. full PlantBiophysics and XPalm downstream suites against this checkout; +4. benchmark smoke tests for native, multirate, PlantBiophysics, and XPalm paths; +5. `git diff --check` and searches for transitional spellings outside explicit + migration/history documentation. + +This matrix covers one/many objects, all selector multiplicities, soft inputs, +hard calls, duplicate writers, temporal policies, global/spatial environments, +templates, instances, overrides, lifecycle mutation, generic values, output +retention modes, fresh/continued execution, and homogeneous hot-loop allocation. + +## Deliberate compatibility boundary + +Compiled structs and cache controls are qualified advanced APIs and may evolve. +Direct mutation of `Object` or `CompositeModel` fields is unsupported. Historical +`ModelMapping`, executor, and status-vector runtimes are outside the compatibility +surface and must not be reintroduced. diff --git a/docs/src/dev/public_api_refinement_decisions.md b/docs/src/dev/public_api_refinement_decisions.md new file mode 100644 index 000000000..fbc768925 --- /dev/null +++ b/docs/src/dev/public_api_refinement_decisions.md @@ -0,0 +1,105 @@ +# Public API refinement decisions + +This decision record defines the target public contract for the CompositeModel/Object +API. The CompositeModel/Object compiler and runtime remain the only supported scenario +runtime. + +## Terminology and identity + +- An **object** is one runtime entity with a stable `ObjectId`. +- A **model** is one scientific implementation of a process. +- A **process** is model metadata and may have several applications. +- An **application** is one named, configured occurrence of a model in a model. +- User declarations that identify a producer, writer, update predecessor, call + target, or output stream use application identity. +- Process queries are discovery filters. They are not substitutes for an + application identifier when more than one application matches. +- Every application receives a deterministic identifier. An explicit + `ModelSpec(...; name=...)` is used verbatim. An unnamed application uses its + process name only when that identifier is unique; repeated unnamed + applications are rejected with instructions to name them. +- Mounted template applications are qualified as + `instance_name__application_name`. + +## Object selectors and scope + +The same `One`, `OptionalOne`, and `Many` selector values are accepted by +application targeting, inputs, calls, object queries, and output requests. + +Scope names have one meaning: + +- `Self()` selects only the current object. +- `Subtree()` selects the current object and all of its descendants. +- `SelfPlant()` selects the current object's plant root and its descendants. +- `Ancestor(...)` selects the matching ancestor's subtree. +- `SceneScope()` searches the whole model. +- `Scope(name)` searches the named object's subtree. +- `Relation(...)` selects objects with the requested topological relationship. + +Selectors that require a current object fail when used without a context. +Cross-object coupling is always visible in the declaration through `Subtree`, +`SelfPlant`, `Ancestor`, `Scope`, `SceneScope`, or `Relation`. + +## Outputs + +`run!` uses an explicit `outputs` keyword: + +```julia +run!(model; outputs=:none) +run!(model; outputs=:all) +run!(model; outputs=request) +run!(model; outputs=requests) +``` + +The default is `outputs=:none`. Temporal dependency streams required by the +runtime are still retained with bounded histories; they are not user-retained +outputs. + +The former `tracked_outputs` keyword has been removed. Use `outputs` directly; +there is no dual spelling. + +An `OutputRequest` contains an object selector, a variable, an optional +application identifier, a unique result name, and optional temporal resampling +policy. `OutputRequest(:Leaf, :x)` remains a convenience spelling that lowers +to `OutputRequest(Many(scale=:Leaf), :x)` during migration. + +## Execution and continuation + +`run!(model; steps=n, ...)` starts a fresh result timeline at step one while +mutating model status. It returns a live `Simulation` execution handle. + +`continue!(simulation; steps=n)` advances that simulation from its current +step, preserving retained streams, temporal dependency history, environment +position, and multirate clock phase. It returns the same simulation. + +`step!(simulation)` is equivalent to `continue!(simulation; steps=1)`. + +Calling `run!` on an already-mutated model intentionally creates a new result +timeline. Users who intend temporal continuation use `continue!`; the distinct +operation prevents an accidental step-index reset. + +Lifecycle mutations between calls to `continue!` are compiled before the next +timestep using the existing targeted invalidation contract. + +## Public namespaces + +The default namespace is organized around: + +- model composition and execution; +- model-author declarations and kernel helpers; +- supported structured explanations; +- documented environment extension interfaces. + +Compiled representation types, cache dirty flags, raw compiler stages, and +low-level invalidation helpers are qualified advanced/internal APIs unless a +documented external extension requires them. Removing an export does not make a +symbol inaccessible through `PlantSimEngine.Symbol`; it removes the accidental +promise that ordinary users should depend on it. + +## Compatibility policy + +- Removed legacy mapping/executor APIs are not restored. +- Superseded CompositeModel/Object spellings are removed rather than retained + as aliases or fallback methods. +- Benchmarks, examples, documentation, PlantBiophysics, and XPalm target the + canonical API. diff --git a/docs/src/dev/release_notes_handoff.md b/docs/src/dev/release_notes_handoff.md new file mode 100644 index 000000000..43eca1ac5 --- /dev/null +++ b/docs/src/dev/release_notes_handoff.md @@ -0,0 +1,513 @@ +# Release Notes Handoff + +This page is the persistent release-note source for the composite-model/object redesign +and cleanup branch. Keep it factual: mark what is implemented, what is removed, +and what is only planned. + +## Implemented Breaking Cleanup + +Source details live in `code_cleanup_audit.md`. + +- Removed `ModelList`, `ModelMapping`, `GraphSimulation`, `MultiScaleModel`, + and the separate mapping dependency/runtime stack. Use `CompositeModel`, `Object`, + and model applications. +- Removed direct and batch mapping `run!` methods. +- Removed string scale names. Use symbols, for example `:Leaf`. +- Removed mapping-specific type-promotion configuration. +- Removed `ModelMapping` completely; it is not retained as a qualified + compatibility API. +- Removed old multiscale output indexing helpers. Convert outputs explicitly + before indexing. +- Replaced mapping-specific same-scale rename sentinels with + `inputs=(:local => One(within=Self(), var=:source),)`. +- Removed unused parallel-executor traits after deleting the executor runtime. +- Removed dead mapping-era wrappers and traits: `UninitializedVar`, + `RefVariable`, `TreeAlike`, and `StatusView`. +- Removed the unreleased `CompositeModelTemplate(...; mapping=...)` alias and dead + selector-to-mapping conversion helpers. +- Removed stale `PlantSimEngine.Examples` exports for the deleted + `ToyInternodeEmergence` example. +- Replaced many source-side validation `@assert`s with explicit errors. +- Added `Updates(:var; after=:application)` for ordered duplicate writers. +- Added `runtime_model(runtime)` as the sanctioned live-model accessor for + `RunContext` and `Simulation`; kernels no longer need to inspect + `context.compiled.model`. +- Added `Diagnostics.explain_initialization(model)` with structured `:required`, + `:defaulted`, `:supplied`, `:generated`, `:producer_bound`, and + `:environment_bound` dispositions. +- Added `CompositeModel(model, models...; status=...)` as a thin one-object constructor + that lowers to the normal object and `ModelSpec` representation. +- Calendar-aligned windows remain unsupported. Temporal windows use + duration-based `Dates.Period` semantics. + +## Removed Unreleased Scenario Prototype + +An experimental scenario runtime was developed and replaced on this branch +before release. Its source, tests, examples, and documentation were removed +rather than retained as compatibility code. + +The removed API included `Domain`, `SimulationMapping`, `Route`, +`AllDomains`, and `HardDomains`, together with the domain scheduler, run loops, +route materialization, environment bridge, graph runner, and output publisher. +Because this API was never released, there is no compatibility layer or user +migration path for it. + +The reusable behavior now lives in the composite-model/object runtime: object selectors, +compiled `ModelSpec(...; inputs=...)`, manual `ModelSpec(...; calls=...)`, `Dates`-based scheduling, +environment backends, dynamic object lifecycle handling, and structured +explanations. + +Dynamic MTG growth now has one public high-level operation: `add_organ!`. +An MTG-backed `CompositeModel` retains the accessors and status initializer used during +initial adaptation. `add_organ!` reuses that policy for new nodes, merges +explicit initial values, attaches the resulting `Status`, registers the model +object, and invalidates runtime bindings. `register_object!` remains available +as the low-level registry operation. XPalm and PlantGeom were migrated away +from package-local wrappers that duplicated this lifecycle sequence. + +## Implemented MAESPA-Style Example Changes + +The current `examples/maespa_model_example.jl` is the main executable example +for multi-plant model coupling. + +- Uses copied PlantBiophysics subsample models: + `Monteith`, `Fvcb`, and `Tuzet`. +- Uses two plant instances with different parameters and shared scale names + such as `:Plant` and `:Leaf`. +- Uses a shared soil model. +- Uses `SceneEB` with `ModelSpec(...; calls=(...))` to manually run leaf + `:energy_balance` and soil `:soil_water` targets. +- Ports MAESPA-style canopy air temperature and VPD update through the + `canopy_air_update(...)` helper and `gbcanms`. +- Treats input meteorology as above-canopy forcing, runs trial leaves with + `run_call!(...; environment=trial_state)`, commits accepted canopy + meteorology with `commit_environment!`, and writes + below-canopy microclimate diagnostics to model status fields: + `canopy_tair`, `canopy_vpd`, `canopy_rh`, `canopy_htot`, and + `canopy_gcanop`. +- Adds `LAIModel` and declares plant leaf-area materialization with + `ModelSpec(...; inputs=(...))`. +- Computes plant allocation daily from plant-local `leaf_carbon` vectors. +- Adds `run_call!` for manually executing compiled model call targets. +- Adds model-level `Input(...)` and `Call(...)` dependency defaults through + `dep(model)`, with scenario-level `ModelSpec(...; inputs=...)` and `ModelSpec(...; calls=...)` overriding + those defaults in `ModelSpec`. +- Adds initial registry-backed model selector resolution with + `resolve_object_ids` and `resolve_objects` for global, self-relative, + plant-relative, ancestor-relative, and named-scope object selections. +- Adds `Diagnostics.explain_scopes(model)` for structured scope diagnostics. It reports + the model scope, object subtree scopes, named `Scope(...)` entries, and + scale/kind/species label groups with concrete object ids. +- Selector failures now include context, matched object ids, requested + criteria, available labels, and near-match suggestions. Misspelled labels + such as `scale=:Leef` therefore suggest `:Leaf` instead of returning only a + cardinality count. +- `Relation(...)` now supports `:self`, `:parent`, `:children`, `:ancestors`, + `:descendants`, and `:siblings` in object-relative input, call, and query + selectors. Relation results are compiled to concrete object ids and may be + constrained by an explicit scope. Application targets reject relations + because they have no current object context. +- Selector labels now have one spelling (`scale=:Leaf`, `kind=:plant`, + `species=:oil_palm`, and `name=:leaf_1`); the duplicate `Scale`, `Kind`, and + `Species` wrappers were removed. `Diagnostics.ObjectAddress` preserves all normalized + object, routing, temporal, and status-ordering fields, while positional + topology selectors such as `Relation(:parent)` remain supported. +- Adds the first compiled composite-model/object view with `Advanced.compile_composite_model`, + `Advanced.CompiledCompositeModel`, `Advanced.CompiledModelApplication`, `Advanced.CompiledModelInputBinding`, + `Advanced.CompiledModelCallBinding`, `Diagnostics.explain_applications`, + `Diagnostics.explain_bindings`, and `Diagnostics.explain_calls`. +- The compiled model view resolves `ModelSpec(...; on=...)`, `ModelSpec(...; inputs=...)`, and + `ModelSpec(...; calls=...)` to object ids ahead of runtime, and reports temporal policy, + window, carrier hints, and callee application ids for agent-readable + diagnostics. +- Unscoped composite-model/object dependency selectors now infer scope from the consumer: + model consumers default to `SceneScope()`, while non-model consumers default + to `Self()`. Cross-scope shared dependencies, such as leaf models reading + soil state, should use `within=SceneScope()` explicitly. +- Adds status-backed compiled input carriers for the composite-model/object view: + scalar shared refs, homogeneous `RefVector`s, and `Advanced.ObjectRefVector` fallback + carriers. `Diagnostics.input_carrier`, `Diagnostics.input_value`, and `Diagnostics.has_reference_carrier` expose + them for tests, diagnostics, and future runtime execution. +- Same-rate model inputs are now wired into consumer `Status` references once + during compilation. Scalar and `Many(...)` inputs remain live references, + missing bound input fields are compiler-generated without inventing + canonical values for `Required(T)`, and repeated non-temporal input + materialization is allocation-free. +- Same-rate `ModelSpec(...; inputs=...)` carriers preserve arbitrary concrete value types. + Regression coverage passes a dual-like `BigFloat` wrapper through a typed + `RefVector`, model arithmetic, source mutation, and output publication + without conversion to `Float64`. +- Same-object variable renaming now uses normal `ModelSpec(...; inputs=...)` syntax instead of + `SameScale()`. Renamed inputs share the producer reference and contribute the + expected producer-to-consumer scheduling edge. +- `Diagnostics.explain_bindings` now reports stable carrier kind and copy/reference + semantics, making reference-wired inputs and materialized temporal values + explicit for users and agents. +- Adds model binding cache helpers: + `Advanced.refresh_bindings!`, `Advanced.bindings_dirty`, `Advanced.compiled_bindings`, and + `Advanced.model_revision`. Object registration, removal, and reparenting invalidate + cached compiled bindings before the next refresh. +- Adds composite-model/object environment binding cache helpers: + `Advanced.refresh_environment_bindings!`, `Advanced.compile_environment_bindings`, + `Advanced.CompiledEnvironmentBinding`, `Advanced.CompiledEnvironmentBindings`, + `Advanced.environment_bindings_dirty`, `Advanced.compiled_environment_bindings`, + `Advanced.environment_revision`, and `Diagnostics.explain_environment_bindings`. +- Adds `geometry`, `position`, and `bounds` accessors for model objects/statuses. + Environment binding refreshes call `EnvironmentAPI.update_index!(backend, changed_entities, removed_object_ids)` before + binding objects to backend cells/layers, so spatial backends can precompute + model-wide lookup structures. +- Spatial environment binding now falls back to the nearest ancestor geometry + for objects without their own geometry. Binding explanations expose the + geometry provenance, and moving an ancestor refreshes only descendants that + inherit its geometry. +- Environment binding refresh can now update changed `environment_inputs_` metadata + without repeating spatial indexing or cell lookup when the + application/object/provider/geometry contract is otherwise unchanged. +- `Environment(; sources=(CO2=:Ca,))` now remaps model-facing environment + variables to backend source variables. CompositeModel environment binding refresh + validates missing source variables for enumerable backends such as + `EnvironmentAPI.GlobalConstant`, and explanations expose both `required_inputs` and + `source_inputs`. +- `validate_environment_inputs(model)` and + `validate_environment_inputs(compiled_scene, environment_or_backend)` now validate + composite-model/object environment contracts directly. Missing-variable diagnostics use + model application ids, and validation honors both scenario + `Environment(; sources=...)` remaps and model-author `environment_hint` defaults. +- Object movement now invalidates environment bindings without rebuilding the + structural object/model binding cache. +- Adds public geometry lifecycle helpers: + `update_geometry!(model, object, geometry; invalidate_environment=true)` and + object-scoped `mark_environment_binding_dirty!(model, object)`. They + currently invalidate the model environment binding cache and leave room for + finer-grained dirty tracking later. +- Adds the first composite-model/object runtime with `run!(model; steps=...)`. + It materializes compiled `ModelSpec(...; inputs=...)` carriers, samples bound environment + inputs, and executes generic model kernels on object `Status` values. +- CompositeModel/object compiler now infers simple same-object value bindings from + `inputs_`/`outputs_` when one producer is unambiguous. `Diagnostics.explain_bindings` + reports each binding origin, including `:model_default`, `:model_spec`, and + `:inferred_same_object`. +- Compiled input bindings now validate `ModelSpec(...; inputs=...)` `process=`/`application=` + filters when they are provided, and `Diagnostics.explain_bindings` reports + `source_application_ids`, `process`, and `application`. +- `Advanced.compile_composite_model` now errors for required `inputs_(model)` variables that are + neither bound through `ModelSpec(...; inputs=...)`/inference nor present on the target object + `Status`. +- `Advanced.compile_composite_model` now prepares model-owned status schemas automatically: + model-targeted objects may omit `Status`, declared outputs and `Default` + inputs are inserted from their initial values, and bound `Required` inputs + are installed through their compiled carriers. External unbound `Required` + inputs still need explicit initialization. +- `Advanced.compile_composite_model` now rejects `ModelSpec(...; inputs=...)` entries whose receiving variable is + not declared by the model's `inputs_`, making binding typos explicit at + compile time. +- `Advanced.compile_composite_model` now validates status-backed non-temporal `ModelSpec(...; inputs=...)` + source availability, so bindings that select existing source objects but no + source `Status` reference fail at compile time instead of becoming no-ops. +- CompositeModel/object runtime now publishes model outputs to model-local temporal + streams and resolves temporal `ModelSpec(...; inputs=...)` with `HoldLast`, `Integrate`, + and `Aggregate` policies before consumer execution. +- CompositeModel temporal `ModelSpec(...; inputs=...)` now use producer `output_policy(...)` traits as + the default when the selector omits `policy=...` and resolves to a unique + source application. Explicit selector policies override the trait. +- CompositeModel applications now infer model-author default environment source remaps + from `environment_hint(...).bindings` when the scenario does not provide explicit + environment bindings. Scenario `Environment(; sources=...)` remains the override. +- CompositeModel/object runtime exposes `run_call!(...; environment=trial_state)` + for non-committing trial meteorology and `commit_environment!` for accepted + mutable environment + commits from model kernels. +- CompositeModel/object root applications now honor `ModelSpec(...; every=...)` values backed by + `Dates.Period` scheduling. `Diagnostics.explain_schedule` reports normalized clocks and + whether an application is root-scheduled or manual-call-only. +- CompositeModel/object root applications now also honor `timespec(...)` model traits + when no explicit `ModelSpec(...; every=...)` is provided. Scenario-level `ModelSpec(...; every=...)` + remains the override. +- CompositeModel/object root applications now validate `timestep_hint(...)` required + bounds for clocks derived from the model base step. Hints remain + compatibility constraints, not scheduling overrides. +- CompositeModel/object execution now uses a stable topological application order + compiled from `ModelSpec(...; inputs=...)` producer edges and `Updates(...)` ordering. + Dependencies on manual-call-only applications are redirected to their parent + caller, same-timestep cycles fail during compilation, and + `Diagnostics.explain_schedule` reports `execution_index`. +- `Advanced.CompiledCompositeModel` now pre-indexes input and call bindings by application and + object id. Runtime input materialization and hard-call lookup no longer scan + all model bindings for every object/model invocation. +- `Advanced.CompiledCompositeModel` now pre-indexes applications by application id, removing + application scans from hard-call target resolution and dictionary rebuilding + from ordered execution setup. +- `Advanced.CompiledEnvironmentBindings` now pre-indexes environment bindings by + application and object id, removing the model-wide binding scan from + environment sampling and output scattering. +- Adds `RunContext` and `CallTarget`; composite-model/object models can use + `run_call!(context, :name)` plus `call_targets(context, :name)` for fine-grained manual `ModelSpec(...; calls=...)` + execution. +- Applications selected by `ModelSpec(...; calls=...)` are skipped by the root + `run!(model)` loop and execute only through explicit `run_call!`, preserving + parent-controlled hard-call execution. +- Adds composite-model/object duplicate-writer validation in `Advanced.compile_composite_model`. A variable + may have only one canonical writer per object unless later writers declare + `Updates(:var; after=...)`, where `after` can match a previous application + id/name or process. +- Adds `Diagnostics.explain_writers(compiled)` to report object-variable writer groups, + duplicate writers, and the `Updates(...)` declarations that validate ordered + updates. +- Adds the first reusable object-template path with `CompositeModelTemplate` and + `ObjectInstance`. Templates bundle reusable `ModelSpec`s and default + `kind`/`species` labels; instances mount them inside a named object subtree. +- `CompositeModel(...)` accepts mounted instances whose roots are either owned objects + or references to separately supplied model objects. +- Template applications are scoped to their instance and receive stable + instance-prefixed application ids. Unmodified instances share the template's + model objects, while instance overrides can replace one application by name + or process when the replacement implements the same process. +- Adds `Override(...)` and `ObjectInstance(...; object_overrides=...)` for + exceptional organs. Overrides are resolved during compilation to concrete + object ids without splitting the logical application or changing its + dependency bindings. +- Template models, template parameter metadata, and replacement models are + retained by reference. The runtime does not copy models or mutate fields to + apply parameter overrides. +- Override validation requires the same process and declared status/environment + variable names. Application explanations report model storage, dispatch + mode, overridden object ids, and replacement model types. +- Adds `Diagnostics.explain_instances(model)` and instance membership in + `Diagnostics.explain_objects(model)`. Instance rows expose roots, current object + membership, mounted applications, overrides, template labels, and + reference-based parameter ownership. +- Objects created below a mounted instance inherit missing template `kind` and + `species` labels. Membership explanations use the current topology rather + than a copied instance object list. +- CompositeModel hard calls now support trial microclimate through + `run_call!(context, name; environment=local_state)`, so hard-called + descendants resample the temporary environment through their normal + environment bindings. +- CompositeModel hard calls now default to `publish=false`. Trial calls mutate target + status without publishing temporal samples or environment writes; accepted + states must use `run_call!(target; publish=true)`. Iterative-call tests verify + that several trials followed by one accepted call publish exactly once. +- `Diagnostics.explain_calls(compiled)` now exposes the manual-call publication contract + through `publication_policy`, `default_publish`, and `accepted_publish` + fields. +- `ModelSpec` now keeps provenance for `ModelSpec(...; inputs=...)` and `ModelSpec(...; calls=...)`. + Declarations coming from `dep(model)` are `:model_default`, scenario-level + declarations and overrides are `:model_spec`, and structured explanations + expose these origins for release-note and migration diagnostics. +- Compiled `OptionalOne(...)` inputs and calls now accept zero matches. + Optional inputs keep their declared model default, optional calls return an + empty target collection, and both remain visible in structured explanations. +- Model kernels read their own parameters from the `model` argument. Hard-call + models and targets are available through focused context APIs such as + `call_targets`, `run_call!`, and `runtime_model`. +- CompositeModel duplicate-writer validation now ignores manual-call-only applications + when validating canonical root writers, so hard-dependency children are not + treated as independent root writers for variables they update inside a parent + call stack. +- Adds `build_maespa_scene(...)` and `run_maespa_example(...)`. + This unified composite-model/object MAESPA path uses `CompositeModelTemplate`, + `ObjectInstance`, `on`, `inputs`, `calls`, and + `every=Dates.Period` with two plant species, one shared soil object, + model LAI, and model energy balance. +- `test/test-maespa-model-example.jl` verifies the unified composite-model/object + MAESPA path. +- `run!(model)` now returns a `Simulation` wrapper containing the mutated + model, compiled object bindings, compiled environment bindings, and + model-local temporal output streams. +- Adds model output inspection helpers: + `outputs(sim::Simulation)`, `collect_outputs(sim)`, and + `Diagnostics.explain_outputs(sim)`. These expose object ids, variables, publishing + application ids, sample counts, time bounds, and value types. +- `run!(model; tracked_outputs=...)` now accepts `OutputRequest` for + composite-model/object runs. Requested outputs are collected from retained typed model + streams after the run, can be read with `collect_outputs(sim)` or + `collect_outputs(sim, :request_name)`, support the standard temporal + policies and `Dates.Period` export clocks, and respect dynamic object + lifetimes by exporting each object only across its own sample interval. This + now prunes retained streams at publisher level: `tracked_outputs=nothing` + keeps all streams, explicit requests keep requested application/variable + streams plus streams required by temporal `ModelSpec(...; inputs=...)`, and + `tracked_outputs=OutputRequest[]` keeps no streams unless temporal + dependencies require them. Dependency-only streams now have bounded + policy-specific histories: latest-only for `HoldLast`, the required window + for `Integrate`/`Aggregate`, and sufficient recent source samples for + `Interpolate`/`PreviousTimeStep`. Requested and default retain-all streams + still preserve complete histories, and export remains post-run rather than + fully online. +- Adds `Diagnostics.explain_output_retention(sim)` for structured diagnostics of retained + model output streams, their reasons, and the compiled retention horizon for + dependency-only streams. +- CompositeModel temporal streams are now keyed by application id, object id, and + variable, so two applications can publish the same variable on the same + object without overwriting each other's stream samples. +- CompositeModel output-export tests now cover requested-output `DataFrame` + materialization, canonical publisher inference without `process=...`, + rejection when only stream-only publishers exist, and ambiguity when an + explicit process matches both a stream-only and a canonical publisher. +- `OutputRequest(...)` now accepts `application=...` for composite-model/object runs. + This disambiguates repeated applications of the same process and permits + explicit export of a named `:stream_only` publisher. +- CompositeModel temporal streams now retain a concrete value type per + application/object/output stream. Type changes fail explicitly, while + generic values such as `BigFloat` remain typed through publication, + interpolation, and integration. +- CompositeModel temporal `ModelSpec(...; inputs=...)` now implement the complete `Interpolate(...)` + policy used by the existing multirate runtime: linear interpolation when + samples bracket the requested time, online linear extrapolation from the + last two samples, and configurable hold behavior. Interpolation modes are + validated during model compilation, and arithmetic preserves generic value + types such as `BigFloat` instead of coercing model values to `Float64`. +- CompositeModel `ModelSpec(...; inputs=...)` accepts + `PreviousTimeStep(:input) => One(...)` or `Many(...)` for explicit lagged + dependencies. These bindings read the previous model timestep, use the + consumer status initialization before history exists, and are excluded from + same-timestep dependency edges so feedback loops can be compiled. +- CompositeModel `output_routing=(var=:stream_only,)` is honored by canonical writer + validation and same-object input inference. Stream-only outputs are excluded + from canonical ownership, but remain available in output streams and explicit + `inputs=(... One(application=:name), ...)` bindings. +- CompositeModel execution now refreshes dirty structural bindings between timesteps. + Objects created, removed, or reparented by a model update application target + sets, input carriers, call targets, writer validation, and scheduling before + the next timestep. +- Geometry-only changes refresh environment bindings at the next timestep + without rebuilding structural bindings. `Simulation` returns the final + compiled structural and environment state, including changes made during the + last timestep. +- Geometry-only environment invalidation is now object-scoped. Moving or + explicitly marking one organ dirty preserves unaffected compiled environment + bindings and rebinds only model applications targeting that object; + structural model changes still trigger a full rebuild. +- Added runtime lifecycle coverage for organ creation, pruning, plant-local + `RefVector` refresh, historical output retention for removed objects, and + movement between mock microclimate cells. +- CompositeModel root execution now uses compiled homogeneous target batches. Models, + statuses, input bindings, and environment bindings are + prebound, so dynamic dispatch happens once per batch instead of once per + object. Heterogeneous object overrides split into ordered concrete batches. +- Adds `Diagnostics.explain_execution_plan(scene_or_simulation)` and a zero-allocation + warmed 128-leaf inner-loop regression gate. +- Manual `ModelSpec(...; calls=...)` handles now use the public + vector-like `run_call!(context, name)` execute-all API, with + `call_targets(context, name)` followed by `run_call!(target)` for fine-grained control. +- Removed the unreleased intermediate authoring and runtime subsystem after + composite-model/object feature parity was established. +- Adds `objects_from_mtg(root; ...)` and `CompositeModel(mtg; ...)` so existing MTG + topology can be adapted once into the unified registry while preserving + node-derived identity, parent relations, labels, geometry, and existing + status objects. +- CompositeModel applications now sample global tabular meteorology at their compiled + `Dates.Period` clock. PlantMeteo reducers and windows from `environment_hint` are + honored; `Environment(; sources=...)` overrides the source while preserving + the reducer. Prepared samplers are shared, and one sampled row is cached per + application/timestep for all selected objects. + +## Downstream and Performance Validation + +The first complete remote XPalm performance artifact passed on 31 July 2026 in +[GitHub Actions run 30617676544](https://github.com/VirtualPlantLab/PlantSimEngine.jl/actions/runs/30617676544). +The Ubuntu 24.04 / Julia 1.12.1 single-threaded job resolved the four +path-developed repositories, then passed all four correctness assertions in +the complete 4,160-step profile. The correctness matrix took 12 minutes +10 seconds; the full job, including resolution and precompilation, took +16 minutes 55 seconds. + +The retained artifact is +`xpalm-full-performance-30617676544-1` (artifact id `8788421206`, 90-day +retention). It contains the resolved `Manifest.toml` and 363 CSV measurement +rows covering all 16 stages. Every output-retention mode reached the same +committed final state: step 4,160, 344 phytomers, LAI +`5.0587602356164405`, and FTSW `0.7991179101191218`. + +The CSV records these exact source revisions: + +- PlantSimEngine: `a715e2bf4407870f7dcae5fedaca7eab00f2a826` +- XPalm: `460d3b5161732a195517d5be9a4bdbb4cfc41846` +- PlantBiophysics: `b733e05032cde9b60e527cc2b33a472281c995fb` +- PlantGeom: `f53e5633da1a56d546c4a4433e6d1cd3a898ecf9` + +On that runner, the minimum complete-cycle measurements were 20.255 seconds +with no retained outputs, 22.492 seconds with the small request, 23.246 seconds +with the reference request, 61.324 seconds with all outputs, and 15.650 seconds +for the historical end-to-end helper. These runner-specific measurements are a +persisted comparison baseline, not a replacement for the faster local +acceptance-machine targets. + +## Compatibility Boundary + +The composite-model/object runtime and its MAESPA acceptance path are implemented. +Historical mapping APIs and the unreleased intermediate prototype were +removed. The design, implementation history, and completion evidence are +documented in: + +- `composite_model_design.md` +- `composite_model_implementation_plan.md` +- `composite_model_completion_audit.md` + +The completed public migration is: + +- replace historical tutorials with native composite-model/object tutorials where + long-term coverage is still valuable; +- model mappings should be described as model applications: + `ModelSpec(model; name=..., on=..., inputs=(...), calls=(...))`; +- `MultiScaleModel(...)` -> `ModelSpec(...; inputs=...)`. +- `dep(model)` remains the model-level trait for default dependency intent: + defaults can become `Input(...)` value bindings or `Call(...)` manual model + calls, and scenario-level `ModelSpec` configuration overrides them. +- model target scales -> `ModelSpec(...; on=...)` object selectors. +- `InputBindings(...)` -> source, policy, and window information on + `ModelSpec(...; inputs=...)`. +- `MeteoBindings(...)` and `MeteoWindow(...)` -> automatic environment + binding plus `Environment(...)` provider/source overrides. +- `ModelSpec(...; output_routing=...)` -> model-application output policy. +- `ScopeModel(...)` -> `ModelSpec(...; on=...)` plus selector scopes. +- `PreviousTimeStep(...)` remains supported as a temporal/cycle-breaking + marker in the unified object-address graph. +- explicit per-model environment wiring -> automatic environment resolver plus + cached environment bindings. + +Historical mapping examples, tests, and runtime files were removed after the +composite-model/object acceptance path reached feature parity. Migration information is +kept in this release-note handoff and the user-facing migration guide. + +## Migration Documentation Added + +- Added `docs/src/migration_composite_model.md` as the user-facing migration guide + from historical mappings to the composite-model/object API. +- Updated documentation navigation, home-page guidance, multiscale warnings, + and the canonical repository agent skill to direct new + scenarios toward `CompositeModel`, `Object`, `on`, `inputs`, `calls`, + `Updates`, `every`, and `Environment`. +- Replaced the documentation home-page quickstart with executable + composite-model/object examples. The page now introduces `CompositeModel`, `Object`, + `ModelSpec`, `on`, `inputs`, `every`, inferred same-object + bindings, multi-object `Many(...)` inputs, and manual `ModelSpec(...; calls=...)` syntax + before linking to the migration guide. +- Replaced the repository README examples with composite-model/object-first examples. + The README now introduces `CompositeModel`, `Object`, model applications, + multi-object `ModelSpec(...; inputs=...)`, and `ModelSpec(...; calls=...)`. +- Added a native composite-model/object quickstart page to the main documentation + navigation. It provides docs-tested examples for one-object model chaining, + inferred bindings, requested output retention, multi-object `ModelSpec(...; inputs=...)`, + reference carrier explanations, and manual `ModelSpec(...; calls=...)` syntax. +- Rewrote the model execution page as the current composite-model/object execution + guide. It now covers compilation, reference carriers, temporal `ModelSpec(...; inputs=...)`, + manual `ModelSpec(...; calls=...)`, `Updates(...)`, `ModelSpec(...; every=...)`, environment binding, + retained outputs, lifecycle invalidation, and migration translations for + historical mapping constructs. +- Rewrote the detailed first simulation tutorial to use the composite-model/object API. + It now introduces `CompositeModel`, `Object`, `ModelSpec`, `on`, `every`, + compiled applications, inferred same-object bindings, model outputs, and a + migration note for historical examples. +- Rewrote the quick examples page to use native composite-model/object snippets for + Beer light interception, degree-days/LAI/light coupling, biomass growth, and + retained `OutputRequest` exports. Historical mapping usage is confined to + migration records. +- Rewrote the standard model coupling, model switching, and coupling more + complex models tutorials around the composite-model/object API. These pages now show + inferred same-object value bindings, switching one `ModelSpec` application, + execution-plan explanations, and `ModelSpec(...; calls=...)` manual-call wiring. +- Removed legacy mapping transforms and their runtime implementations: + `MultiScaleModel`, `SameScale`, `TimeStepModel`, `InputBindings`, + `MeteoBindings`, `MeteoWindow`, and `ScopeModel`. +- Added a curated unified composite-model/object map to the public API page. diff --git a/docs/src/developers.md b/docs/src/developers.md index acaebb76e..d5eec475e 100644 --- a/docs/src/developers.md +++ b/docs/src/developers.md @@ -26,10 +26,6 @@ PlantSimEngine currently has three main local environments: - `docs/` for the Documenter build; - `benchmark/` for benchmark scripts used to compare performance locally. -The graph viewer/editor also has a small frontend workspace in `frontend/`. It -is a Vite/React application that is compiled into `frontend/dist/` and then -embedded by the Julia static viewer and graph editor extension. - ## Running checks locally ### Main test suite @@ -40,8 +36,9 @@ Run the standard test suite from the repository root: julia --project=test test/runtests.jl ``` -Some tests exercise threaded execution, so it is worth running them with more -than one Julia thread when validating parallel behavior. +The current public runtime is sequential. Running with multiple Julia threads +does not enable a parallel Composite model executor; parallel execution remains roadmap +work and requires dedicated correctness tests before it becomes public. ### Documentation @@ -55,85 +52,77 @@ The docs environment includes the extra packages needed for examples and API documentation, such as `Documenter`, `CairoMakie`, `PlantMeteo`, and `MultiScaleTreeGraph`. -### Graph viewer frontend +### Benchmarks -The graph viewer and editor UI lives in `frontend/`. Use Node 22 or newer, then -install the JavaScript dependencies from the repository root with: +Benchmark scripts live in `benchmark/`. They are useful when a change may alter +runtime characteristics, but they are not a substitute for the main test suite +or downstream integration checks. -```bash -cd frontend -npm ci -``` +## CI workflows -For local development, run the Vite server: +The repository currently relies on these GitHub Actions workflows: -```bash -npm run dev -``` +- `CI.yml` for the main test matrix, docs build, and coverage; +- `Integration.yml` for downstream checks against packages that depend on + PlantSimEngine; +- `Benchmarks.yml` for pull-request benchmark runs; +- `register.yml` and `TagBot.yml` for release automation. -This is useful for frontend-only iteration. The Julia package, however, serves -the compiled assets from `frontend/dist/`, so rebuild the bundle before testing -the Julia viewer/editor or before committing frontend changes: +If a change affects public APIs or execution behavior, check both `CI` and +`Integration` before merging. Benchmark results are useful for regressions, but +should be interpreted alongside the test results. -```bash -npm run build -``` +## Graph Viewer Frontend -`frontend/dist/` is intentionally committed because registered Julia packages -need the browser assets without requiring users to run a Node build step. +The static viewer and HTTP editor share the React application under +`frontend/`. PlantSimEngine releases include the production bundle in +`frontend/dist`, because Julia package installations do not run Node or Vite. +The content hash in asset filenames is intentional: it prevents browsers and +documentation hosts from reusing stale JavaScript after a release. -Run the lightweight frontend checks with: +Install the frontend development dependencies from the repository root: -```bash -npm run typecheck -npm test +```sh +cd frontend +npm ci ``` -The end-to-end tests use Playwright and start a real Julia graph editor session. -Install the Chromium browser once, then run the suite: +Run the fast checks while developing: -```bash -npx playwright install --with-deps chromium -npm run test:e2e +```sh +npm run typecheck +npm test ``` -The E2E helper starts Julia with `julia --project=test --startup-file=no`, loads -`PlantSimEngine`, `PlantSimEngine.Examples`, and `HTTP`, then drives the browser -against the local editor URL. If you already have an editor session running and -want Playwright to use it, set `PSE_GRAPH_EDITOR_URL` to the full session URL, -including the `token` query parameter. +Build the production assets after changing TypeScript, CSS, or frontend +dependencies: -After changing the viewer UI, rebuild the docs to verify the static embedded -viewer too: - -```bash -cd .. -julia --project=docs docs/make.jl +```sh +npm run build ``` -The docs build writes `docs/src/www/simple_dependency_graph.html` as an -intermediate generated asset and copies it into `docs/build/`; that source-side -HTML file is ignored by git. +Commit the resulting `frontend/dist` changes together with the source changes. +Do not commit `frontend/node_modules`, Playwright reports, screenshots, videos, +or local test output. -### Benchmarks +The end-to-end suite starts a real Julia `GraphEditor.edit_graph` session and controls it +with Chromium: -Benchmark scripts live in `benchmark/`. They are useful when a change may alter -runtime characteristics, but they are not a substitute for the main test suite -or downstream integration checks. - -## CI workflows - -The repository currently relies on these GitHub Actions workflows: +```sh +npx playwright install chromium +npm run test:e2e +``` -- `CI.yml` for the main test matrix, docs build, and coverage; -- `Integration.yml` for downstream checks against packages that depend on - PlantSimEngine; -- `Benchmarks.yml` for pull-request benchmark runs; -- `register.yml` and `TagBot.yml` for release automation. +Use `npm run test:e2e:ui` for a headed local debugging session. The tests use +stable `data-testid` attributes for commands and confirm mutations through the +Julia `/state` endpoint. Avoid assertions against generated CSS classes or +implementing PlantSimEngine selector semantics in TypeScript. -If a change affects public APIs or execution behavior, check both `CI` and -`Integration` before merging. Benchmark results are useful for regressions, but -should be interpreted alongside the test results. +Core graph DTO and edit tests live in `test/test-model-graph-view.jl`. +HTTP-extension tests live in `test/test-model-graph-editor-extension.jl`. +When changing the graph schema, update those Julia tests, frontend types, unit +tests, Playwright scenarios, and the committed production bundle in the same +change. ## Documentation impact @@ -159,16 +148,6 @@ were editing. ## Implementation notes -### Generated models from status vectors - -Some multiscale helpers turn status vectors into internal runtime models so that -they can be used in mapping-based simulations. The implementation is kept -deliberately data-driven to avoid top-level `eval()` and world-age issues. - -The relevant code lives in `src/mtg/mapping/model_generation_from_status_vectors.jl`. -If you touch that area, preserve the ability to generate the mapping and build a -`GraphSimulation` within the same function scope. - ### Coverage gaps to keep in mind Not every combination of weather structure, status shape, mapping layout, and diff --git a/docs/src/guides/coupling.md b/docs/src/guides/coupling.md new file mode 100644 index 000000000..545121304 --- /dev/null +++ b/docs/src/guides/coupling.md @@ -0,0 +1,90 @@ +# Coupling Models + +Use `inputs` when a model reads a value produced by another application. A +unique same-object producer is inferred; cross-object sources should use an +explicit `One`, `OptionalOne`, or `Many` selector. Inspect the resolved +references with `Diagnostics.explain_bindings`. + +Use `calls` only when a parent algorithm owns child execution or iteration. +Use `run_call!(context, :name)` to execute every resolved target. Pass +`sampled_environment=value` to this bulk path when the caller already has one +model-facing environment for all targets. Use `call_model(context, :name)` to +inspect a singular dependency model without materializing a public target. For +selection, target status access, custom ordering, or distinct environments, +retrieve the vector-like collection with `call_targets(context, :name)` and +execute individual targets. Trial calls use `publish=false`; accepted state is +published once. +Nested calls inherit publication suppression, so a descendant cannot publish +inside an unpublished ancestor trial. `Diagnostics.explain_calls` and `Diagnostics.explain_schedule` +show call-only targets and ordering. + +`Diagnostics.explain_initialization(model)` classifies values as supplied, generated, +producer-bound, defaulted, required, or environment-bound before execution. + +## Value coupling + +A consumer on the same object needs no scenario syntax when exactly one +canonical producer exists. Make cross-object intent explicit: + +```julia +ModelSpec(PlantBalance(); name=:balance, on=Many(scale=:Plant), inputs=(:assimilation => Many( + scale=:Leaf, + within=Subtree(), + application=:photosynthesis, + var=:carbon, + ), + :soil_water => One( + scale=:Soil, + within=SceneScope(), + application=:soil, + var=:water, + ),)) +``` + +`One` is a contract: zero or multiple matches are errors. Use `OptionalOne` +only when absence has a scientific meaning, and `Many` when aggregation is +part of the consumer model. `within=Subtree()` searches descendants of the +current target; `within=SelfPlant()` anchors repeated plant instances; and +`SceneScope()` is deliberately global. + +By default, an input selector also identifies applications that produce the +selected variable, and those producers are scheduled before the consumer. Use +`from_status=true` only when the input deliberately reads the objects' current +`Status` references independently of any producer: + +```julia +ModelSpec( + ReserveConsumer(); + inputs=( + :organ_reserves => Many( + scale=(:Leaf, :Internode), + within=Subtree(), + var=:reserve, + from_status=true, + after=:plant_allocation, + ), + ), +) +``` + +This is a same-step live-reference binding. It cannot be combined with +`process`, `application`, `policy`, or `window`. It does not infer a producer +edge; use `after=:application_id` when the state must be read or mutated after +a particular application. Otherwise, the scenario's application order is +preserved. + +## Manual calls + +```julia +ModelSpec(Optimizer(); name=:optimizer, on=Many(scale=:Plant), calls=(:leaf_energy => Many(scale=:Leaf, within=Subtree()))) +``` + +Inside `Optimizer`, iterate over `call_targets(context, :leaf_energy)`. Run +candidate states with `run_call!(target; publish=false)` and the accepted state +with `publish=true`. A call-only target is excluded from root scheduling, and +an unpublished outer call suppresses publication by every nested descendant. + +After compilation, inspect `Diagnostics.explain_bindings(compiled)` for source identity +and carrier type, `Diagnostics.explain_calls(compiled)` for call-only targets, and +`Diagnostics.explain_schedule(compiled)` for root execution order. These rows are the +supported diagnostic surface; compiled fields are internal. diff --git a/docs/src/guides/data/environment_inputs.md b/docs/src/guides/data/environment_inputs.md new file mode 100644 index 000000000..abd2c9907 --- /dev/null +++ b/docs/src/guides/data/environment_inputs.md @@ -0,0 +1,10 @@ +# Weather And Environment Inputs + +An environment may be a constant named tuple, one tabular row, or regular +multi-row weather. Every row in a timed sequence needs a positive fixed +`duration`; inconsistent base durations and application substeps are rejected. + +Use `Environment(sources=...)` to map model-facing environment names to +provider columns. Values retain compatible user numeric types. Spatial +providers implement the same model-facing contract and refresh bindings after +object movement or geometry changes. diff --git a/docs/src/guides/data/forcing_observations.md b/docs/src/guides/data/forcing_observations.md new file mode 100644 index 000000000..0b1448d5b --- /dev/null +++ b/docs/src/guides/data/forcing_observations.md @@ -0,0 +1,10 @@ +# Forcing Observed Variables + +Supply a constant observed value in object status when it does not vary. For a +time-varying observation, use a small environment-driven source model that +publishes the canonical variable; downstream applications remain unchanged. + +Replace a process for an entire template instance through instance overrides, +or use `Override` for one exceptional object. The replacement must implement +the same process and input/output contract. + diff --git a/docs/src/guides/data/numerical_reliability.md b/docs/src/guides/data/numerical_reliability.md new file mode 100644 index 000000000..6d5a6aec6 --- /dev/null +++ b/docs/src/guides/data/numerical_reliability.md @@ -0,0 +1,11 @@ +# Numerical Reliability + +Use exact assertions for deliberately exact integer/rational scenarios and +`isapprox` for floating-point scientific results. Splitting a computation +across objects may change reduction order without changing the model. + +PlantSimEngine preserves compatible numeric types through parameters, status, +carriers, meteorology, and streams. Avoid forced `Float64` conversion. For long +or ill-conditioned sums, use pairwise or compensated accumulation inside the +scientific model and test its error tolerance explicitly. + diff --git a/docs/src/guides/data/outputs_plotting.md b/docs/src/guides/data/outputs_plotting.md new file mode 100644 index 000000000..309b802a6 --- /dev/null +++ b/docs/src/guides/data/outputs_plotting.md @@ -0,0 +1,58 @@ +# Collecting And Plotting Outputs + +Run a model with `outputs=:all` or an explicit `OutputRequest`, then call +`collect_outputs(sim)` for ordinary analysis. Rows identify application, +object, variable, timestep/time, and value, so repeated processes cannot +overwrite one another. Convert the rows to a `DataFrame`, filter by +application/object/variable, group, and plot. Use `final_state(sim)` when only +the latest values are needed. + +Runs default to `outputs=:none`. Use `outputs=:all` only when complete stream +history is intentional; selected requests are the memory-safe choice for large +composite models. Raw rows have the stable columns `timestep`, `time`, `application_id`, +`object_id`, `variable`, and `value`. Requested/resampled rows additionally +identify `scale` and `process`. A temporal request emits `missing` when its +policy cannot produce a value for a scheduled output time. +`time` is expressed in model base-step coordinates; application clock metadata +is reported by `Diagnostics.explain_schedule(simulation)`. Values retain their concrete +types, so unit-bearing model outputs remain unit-bearing in collected rows. + +`OutputRequest` controls requested retention or resampling. Dependency streams +may also be retained for runtime correctness. Use +`Diagnostics.explain_output_retention(sim)` to see why each stream exists. Removed objects +retain accepted historical rows. + +```@example collect-output +using Dates +using DataFrames +using PlantSimEngine + +PlantSimEngine.@process "docs_output_counter" verbose = false +struct DocsOutputCounter <: AbstractDocs_Output_CounterModel end +PlantSimEngine.inputs_(::DocsOutputCounter) = NamedTuple() +PlantSimEngine.outputs_(::DocsOutputCounter) = (value=0,) +PlantSimEngine.run!(::DocsOutputCounter, status, environment, constants, context) = + (status.value += 1) + +model = CompositeModel(DocsOutputCounter(); environment=(duration=Hour(1),)) +simulation = run!( + model; + steps=3, + outputs=OutputRequest( + One(scale=:Scene), + :value; + name=:counter, + application=:docs_output_counter, + ), +) +rows = collect_outputs(simulation, :counter; sink=nothing) +table = DataFrame(rows) +@assert table.value == [1, 2, 3] +table +``` + +For plotting, filter the table first and map `time` to the horizontal axis and +`value` to the vertical axis. Group by `application_id` and `object_id` before +drawing lines; grouping by variable alone can accidentally connect different +objects. CairoMakie and other plotting packages consume the resulting columns +without any PlantSimEngine-specific adapter. diff --git a/docs/src/guides/extensions/environment_backends.md b/docs/src/guides/extensions/environment_backends.md new file mode 100644 index 000000000..4c157dc09 --- /dev/null +++ b/docs/src/guides/extensions/environment_backends.md @@ -0,0 +1,94 @@ +# Environment Backend Extensions + +This page is for package authors who connect a meteorology, canopy-layer, +voxel, grid, or other spatial provider to PlantSimEngine. Simulation users +normally configure an existing backend with `Environment(...)` and do not need +this protocol. + +## The boundary + +An extension backend subtypes +`PlantSimEngine.EnvironmentAPI.AbstractEnvironmentBackend` and extends +functions in `PlantSimEngine.EnvironmentAPI`. Keep the concrete backend and +handle types in the extension package. They do not belong in PlantSimEngine's +root namespace. + +The required methods are: + +- `base_step_seconds(backend)`: duration of one base step; +- `get_nsteps(backend)`: available number of steps; +- `bind_environment(backend, object, context, config)`: compile one opaque + handle for an application/object pair; +- `sample(backend, handle, variable, time)`: read committed state. + +Implement `environment_variables(backend)` when the variable names can be +enumerated cheaply. PlantSimEngine then validates model environment inputs +while compiling. + +Mutable or structurally indexed backends add only the capabilities they need: + +- `sample(backend, handle, trial_state, variable, time)` for transient trial + states supplied to `run_call!`; +- `commit_environment!(backend, handle, accepted_state, time)` for accepted + state; +- `update_index!(backend, changed_entities, removed_object_ids)` when topology + or geometry changes require a spatial-index refresh. Initial compilation + supplies all entities; later refreshes supply only the structural delta. + +[`ToySpatialEnvironment`](@ref) is the small, tested implementation used by +the user journeys. + +## Compile routing into the handle + +`bind_environment` receives the target `Object`, an +`EnvironmentAPI.EnvironmentContext`, and the payload configured with +`Environment(...)`. Resolve geometry, layer, voxel, provider, and commit sink +there. Return a concrete handle containing everything later sampling and +committing need. + +PlantSimEngine caches that handle. The hot `sample` methods receive it directly, +so they should not search the object registry or repeat spatial routing. +`EnvironmentContext` contains application id, object id, scale, and process; +runtime status is deliberately absent. + +A controller that reads one provider and writes another can encode both routes +in its handle. For example, the scenario may configure +`Environment(provider=:forcing, sink=:canopy)`, while the backend decides what +those names mean. + +## Trial and commit semantics + +Transient sampling and committing are separate backend operations: + +1. a controller passes its typed trial state to + `run_call!(context, name; environment=trial_state, publish=false)`; +2. PlantSimEngine invokes the transient `sample` overload through each target's + already-compiled handle; +3. the controller accepts a state and calls + `commit_environment!(context, accepted_state)`; +4. PlantSimEngine validates the caller's `environment_outputs_` declaration, + then invokes the backend commit through the caller's handle; +5. the controller publishes accepted called-model outputs explicitly with + `publish=true`. + +The model-facing `commit_environment!(context, state)` is root API. The +backend-facing method belongs to `PlantSimEngine.EnvironmentAPI`; extension +packages should qualify it when adding methods. + +## Refresh and diagnostics + +PlantSimEngine calls `update_index!` once per distinct spatial backend before +binding or rebinding affected targets. Geometry changes invalidate the affected +handles; structural changes can also change the set of bound targets. + +Use these public checks instead of reading compiler fields: + +- `validate_environment_inputs(model)` checks declared variables; +- `Diagnostics.explain_environment_bindings(model)` reports each + application/object handle and geometry source; +- `Diagnostics.explain_environment(simulation)` reports the active backend, + variables, step count, and base-step duration. + +Backend tests should cover at least two objects with distinct handles, +committed and transient sampling, rejected undeclared commits, and handle +refresh after movement or geometry changes. diff --git a/docs/src/guides/graph_visualizer_editor.md b/docs/src/guides/graph_visualizer_editor.md new file mode 100644 index 000000000..b3b620da4 --- /dev/null +++ b/docs/src/guides/graph_visualizer_editor.md @@ -0,0 +1,294 @@ +```@meta +CurrentModule = PlantSimEngine +``` + +# Visualize And Edit A CompositeModel + +The CompositeModel graph shows how model applications, objects, and compiled value +bindings fit together before a simulation runs. Use the static visualizer when +you want an inspectable HTML artifact, and the interactive editor when you want +browser actions to update a Julia [`CompositeModel`](@ref). + +## A Small CompositeModel + +This example applies three toy models to one plant object. The compiler infers +the same-object `TT_cu` and `LAI` bindings from the declared input and output +names. + +```@example graph_viewer +using PlantSimEngine +using PlantSimEngine.Examples + +model = CompositeModel( + ToyDegreeDaysCumulModel(), + ToyLAIModel(), + Beer(0.6); + status=(TT=12.0,), + id=:plant, + scale=:Plant, + kind=:plant, +) + +view = GraphEditor.model_graph_view(model) +view.metadata +``` + +The documentation build writes that graph as a self-contained HTML page and +embeds it below. + +```@raw html + + +``` + +The default **Applications** projection groups all concrete executions of one +application into one card. Use **Objects** to inspect topology and **Executions** +to inspect concrete `(application, object)` pairs. Search, diagnostics, +initialization, selectors, parameters, and resolved edge details remain +available in the static viewer. The topology projection includes model, +template, and instance containers; selecting an instance or object subtree scopes the +application and execution projections until the filter is cleared. + +## Write A Static Viewer + +The static visualizer is part of PlantSimEngine core and does not load a web +server: + +```julia +path = GraphEditor.write_model_graph_view("model-graph.html", model) +``` + +The output bundles the graph payload, JavaScript, and CSS in one HTML file. It +can be opened locally or embedded in Documenter documentation. A downstream +package can generate the file from `docs/make.jl` and place it under +`docs/src/assets`: + +```julia +mkpath(joinpath(@__DIR__, "src", "assets")) +GraphEditor.write_model_graph_view( + joinpath(@__DIR__, "src", "assets", "default_scene.html"), + default_scene(), +) +``` + +Then embed it from a Markdown page with an HTML `iframe`. The graph is +read-only, but its projection controls, search, inspector, and diagnostics are +interactive in the browser. + +## Start The Editor + +The mutable editor is an optional package extension activated by HTTP.jl. Add +HTTP once to the environment that will launch the editor: + +```julia +using Pkg +Pkg.add("HTTP") +``` + +Then start a session: + +```julia +using PlantSimEngine +using HTTP + +session = GraphEditor.edit_graph(model) +``` + +The default browser opens automatically. The returned session also prints its +URL and shutdown command. Julia remains authoritative: browser edits are sent +as semantic commands, applied transactionally to a candidate CompositeModel, compiled, +and returned as a fresh graph state. + +Inspect the current result or stop the server with: + +```julia +edited_scene = GraphEditor.current_model(session) +close(session) +``` + +Call `GraphEditor.edit_graph()` without a CompositeModel to start from an empty scenario. Use +`open_browser=false` on remote machines or when a test controls the browser. + +## Templates And Several Plants + +A template is a reusable set of already coupled applications. Mounting the same +template twice creates two instance-local application sets. Unqualified selectors +remain inside their own plant, so a model in `plant_a` does not accidentally read +values from `plant_b`. + +```julia +using Dates + +plant_template = CompositeModelTemplate(( + ModelSpec( + ToyDegreeDaysCumulModel(); + name=:degree_days, + on=Many(scale=:Plant), + every=Hour(1), + ), + ModelSpec( + ToyLAIModel(); + name=:leaf_area, + on=Many(scale=:Plant), + ), +); kind=:plant, species=:oil_palm) + +plant_a = ObjectInstance( + :plant_a, + plant_template; + root=Object(:plant_a; name=:plant_a, scale=:Plant), +) +plant_b = ObjectInstance( + :plant_b, + plant_template; + root=Object(:plant_b; name=:plant_b, scale=:Plant), +) + +model = CompositeModel(plant_a, plant_b) +session = GraphEditor.edit_graph( + model; + templates=(oil_palm=plant_template,), +) +``` + +The **Add instance** wizard can mount a catalog template on an existing unclaimed +root and its descendants, or create a minimal root and mount the template in one +transaction. Preview the claimed subtree and resolved application targets before +committing. Unmounting removes the applications but keeps the object subtree. + +Catalog templates are presets. The first edit to a mounted preset creates a +model-local replacement shared by all instances that currently use it. The original +preset remains available when adding another instance. Template application names +are fixed because they are part of the template contract. + +## Overrides + +Use an override when one plant or organ needs a different parameterization without +changing the shared template: + +```julia +plant_b = ObjectInstance( + :plant_b, + plant_template; + root=Object(:plant_b; name=:plant_b, scale=:Plant), + overrides=( + degree_days=ToyDegreeDaysCumulModel(T_base=12.0), + ), +) +``` + +The editor offers the same operation at instance or object scope. Julia checks that +the replacement implements the same process and variable contract. + +## Environment Catalogs And Routing + +Environment values remain in Julia. Give the editor a named catalog rather than +serializing backends to the browser: + +```julia +session = GraphEditor.edit_graph( + model; + templates=(oil_palm=plant_template,), + environments=( + weather=weather, + canopy=canopy_backend, + ), +) +``` + +The scene environment can be replaced from this catalog. Each application can use +the scene backend or a catalog backend and can configure `provider`, model-facing +input-to-source mappings, `sink`, and backend-specific typed options. The editor +shows `environment_hint(model)` and the effective compiled bindings read-only, then +asks Julia to validate the candidate routing before it is committed. + +Application cadence and temporal windows use `Dates.Second`, `Dates.Minute`, +`Dates.Hour`, or `Dates.Day`. Whole-scene targeting is also explicit: +`SceneScope()` must be selected deliberately. Omitting the scope keeps a template +application local to each mounted instance. + +## What Can Be Edited + +The editor supports: + +- model objects, metadata, status initialization, and parent topology; +- model applications, constructor parameters, target selectors, and cadence; +- explicit value bindings, hard calls, output routing, and update ordering; +- template catalogs, transactional instance mounting, shared template edits, and overrides; +- named scene and application environment backends, providers, sources, and sinks; +- dependency cycles through an explicit `PreviousTimeStep` break action; +- undo, redo, temporary recovery autosaves, and readable Julia CompositeModel scripts. + +Application target and binding dialogs can ask Julia to preview the concrete +objects selected by a declaration. This is important for `Many`, relative +scopes such as `SelfPlant`, and composite models containing several plant instances. + +## Models From Other Packages + +The model browser reflects concrete `AbstractModel` subtypes currently loaded +in Julia. There is no separate registration API. Loading a model package before +starting the editor makes its models available automatically: + +```julia +using PlantSimEngine +using PlantBiophysics +using HTTP + +session = GraphEditor.edit_graph(model) +``` + +The `+` buttons next to ports use exact declared variable names only. For an +input named `LAI`, the editor lists loaded models whose `outputs_` contains +`LAI`. For an output named `LAI`, it lists models whose `inputs_` contains +`LAI`, as well as compatible applications already present in the CompositeModel. This is +a composition aid, not a scientific compatibility inference. + +When the CompositeModel is saved as Julia code, required package imports are emitted for +the model types used by the CompositeModel. + +## Invalid And Cyclic Composite Models + +Simulation compilation remains strict, but graph compilation preserves as much +structure as possible and attaches diagnostics. This lets the editor display +incomplete selectors, missing initialization, ambiguous writers, and cycles. + +Cycle edges are shown in red. The break workflow asks which consumer input +should read its previous accepted timestep value and asks for initial values +when the affected target objects do not already provide one. The action changes +the application input policy for every target selected by that application. + +!!! warning + `PreviousTimeStep` changes model semantics. It disconnects the selected + input from current-step producers during one run step. Use it only when that + lag and its initialization value are scientifically intentional. + +## Saving And Recovery + +The **Save** action writes readable Julia code whose final binding is +`model = CompositeModel(...)`. Once a path is selected, every successful edit rewrites +that file. The editor also keeps a temporary recovery file and lists recent +CompositeModel scripts in **Open**. + +Generated code is best effort for arbitrary Julia values and external runtime +resources. Templates and instances are written inline. Named environment values are +referenced through an `editor_environments` named tuple, and the generated header +lists the keys that must be supplied when reopening the file: + +```julia +session = GraphEditor.edit_graph( + ; + recover_path="model.jl", + environments=(weather=weather, canopy=canopy_backend), +) +``` + +Missing environment keys fail while the file is opened. Review the generated code +and keep important scenario scripts under Git. diff --git a/docs/src/guides/modelers/port_existing_model.md b/docs/src/guides/modelers/port_existing_model.md new file mode 100644 index 000000000..4c6912fa8 --- /dev/null +++ b/docs/src/guides/modelers/port_existing_model.md @@ -0,0 +1,44 @@ +# Port An Existing Model + +Start with a one-step scientific function and separate four concerns: immutable +parameters, object state, environment forcing, and produced values. Keep the +arithmetic generic; a model should not convert compatible values to `Float64`. + +```@example port-existing-model +using Dates +using PlantSimEngine + +PlantSimEngine.@process "docs_lai_growth" verbose = false + +struct DocsLAIGrowth{T} <: AbstractDocs_Lai_GrowthModel + rate::T +end +PlantSimEngine.inputs_(::DocsLAIGrowth) = (lai=Required(Float64),) +PlantSimEngine.outputs_(::DocsLAIGrowth) = (lai_next=0.0,) +PlantSimEngine.environment_inputs_(::DocsLAIGrowth) = (T=0.0,) +function PlantSimEngine.run!(m::DocsLAIGrowth, status, environment, constants, context) + status.lai_next = status.lai + m.rate * environment.T +end + +model = CompositeModel( + DocsLAIGrowth(0.02); + status=(lai=1.0,), + environment=(T=10.0, duration=Day(1)), +) +simulation = run!(model) +@assert final_state(simulation).lai_next == 1.2 +``` + +Test the scientific function first, then the kernel directly with a `Status`, +and finally the same model through a model. These three levels separate a +scientific error from a model-contract error and a scenario-binding error. +`Diagnostics.explain_initialization(model)` should show `lai` as supplied, `T` as +environment-bound, and `lai_next` as generated. + +Use `Default(value)` only when the scientific model really defines a fallback. +Do not translate an old sentinel such as `-Inf` into a default: use +`Required(T)` when the value must come from the scenario. + +The concise constructor lowers to the ordinary CompositeModel compiler; it is not a +separate runtime. Move to explicit `Object` and `ModelSpec` construction only +when the scenario needs multiple objects, selectors, or named applications. diff --git a/docs/src/guides/modelers/stateful_models.md b/docs/src/guides/modelers/stateful_models.md new file mode 100644 index 000000000..cc6b59ffb --- /dev/null +++ b/docs/src/guides/modelers/stateful_models.md @@ -0,0 +1,11 @@ +# State, History, And Repeated Updates + +Object `Status` is current state, not timestep storage. Use +`PreviousTimeStep(:x)` for a one-step lag, or keep a model-owned ring buffer +when the algorithm requires deeper history. Accepted output streams provide +simulation history. + +Several writers to one canonical variable are rejected unless the application +declares `Updates`. Iterative trial execution belongs to `calls`; use +`publish=false` until a state is accepted. + diff --git a/docs/src/guides/multiscale/concepts.md b/docs/src/guides/multiscale/concepts.md new file mode 100644 index 000000000..9d201c6e4 --- /dev/null +++ b/docs/src/guides/multiscale/concepts.md @@ -0,0 +1,32 @@ +# How Multiscale Composite Models Execute + +One application executes once for every object selected by its +`ModelSpec(...; on=...)` selector. State belongs to the object, while topology +and labels belong to the scenario. +`Self()` is the current object, `SelfPlant()` is its plant-instance root, and +`SceneScope()` is model-wide. Cardinality wrappers decide whether zero, one, +or many matches are valid. + +More objects mean more qualified streams. Removing an object stops future +execution but preserves its accepted historical samples. + +Canonical selector patterns are: + +| Relationship | Pattern | +| --- | --- | +| application targets every leaf | `ModelSpec(model; on=Many(scale=:Leaf))` | +| input from this same object | omit `inputs` when the producer is unique | +| input from one ancestor | `One(Ancestor(scale=:Plant))` | +| input from this plant's leaves | `Many(scale=:Leaf, within=SelfPlant())` | +| input from shared soil | `One(scale=:Soil, within=SceneScope())` | +| optional named organ | `OptionalOne(name=:fruit, within=SelfPlant())` | + +`Self()` always means the current target object. It never implicitly means the +model, process, species, or plant. Prefer object IDs and labels for identity, +and use `Scope(name)` only when the model explicitly defines that scope. + +One application produces a separate stream for every selected object and +output variable. Stream keys also include application identity, so repeated +applications of the same process cannot overwrite each other. Use +`Diagnostics.explain_applications`, `Diagnostics.explain_objects`, and `Diagnostics.explain_bindings` to +verify target and source multiplicities before a long run. diff --git a/docs/src/guides/multiscale/from_one_object.md b/docs/src/guides/multiscale/from_one_object.md new file mode 100644 index 000000000..3ebfa4ca1 --- /dev/null +++ b/docs/src/guides/multiscale/from_one_object.md @@ -0,0 +1,10 @@ +# From One Object To A Multiscale CompositeModel + +First run all models on one object with the concise `CompositeModel(models...; +status=...)` constructor. Then move organ-specific applications to leaf +objects and aggregate their outputs on a plant with `Many(..., +within=SelfPlant())` or an instance-local selector. + +Compare collected, application-qualified outputs with `isapprox`. Exact bitwise +identity is not generally a valid requirement after changing reduction order. + diff --git a/docs/src/guides/multiscale/import_mtg.md b/docs/src/guides/multiscale/import_mtg.md new file mode 100644 index 000000000..a5c01cb57 --- /dev/null +++ b/docs/src/guides/multiscale/import_mtg.md @@ -0,0 +1,10 @@ +# Importing An MTG + +`objects_from_mtg(root)` converts MTG topology and labels into ordinary model +objects. `CompositeModel(root; applications=...)` performs the same adaptation and then +uses the normal CompositeModel compiler. The MTG is an input representation, not a +second runtime. + +For growth, prefer `add_organ!`: it creates the MTG node, applies the model's +status policy, attaches status, and registers the corresponding object. + diff --git a/docs/src/guides/multiscale/manual_calls.md b/docs/src/guides/multiscale/manual_calls.md new file mode 100644 index 000000000..341ee54e3 --- /dev/null +++ b/docs/src/guides/multiscale/manual_calls.md @@ -0,0 +1,43 @@ +# Manual Calls Across Objects + +Declare parent-owned execution with +`ModelSpec(model; calls=(:name => One(...),))` or a `Many(...)` selector. In +the kernel, execute every resolved target with `run_call!(context, :name)`. +The returned `CallTargets` collection is always vector-like, including for +`One` and `OptionalOne`. + +Use the narrowest execution path that matches the algorithm: + +- `run_call!(context, :name; sampled_environment=environment)` executes all + targets directly through cached typed batches. Prefer it when the caller has + already sampled one model-facing environment for every target. +- `call_model(context, :name)` returns the concrete model for a call that + resolves to exactly one target. It is useful when dispatch or model + parameters must be inspected before the bulk call. +- `call_targets(context, :name)` followed by `run_call!(target)` supports + object selection, custom ordering, target status inspection, or a different + sampled environment per target. + +`environment=trial_state` has different semantics from +`sampled_environment=value`. The former is a transient backend state that each +target samples through its compiled environment handle. The latter is already +in the model-facing form and is forwarded without sampling. + +A target used only by calls is absent from root scheduling. Trial calls default +to `publish=false`; publish only an accepted execution. + +## Compiled plans and changing objects + +The call declaration is compiled once with the scenario. Its call name, +applications, selector, multiplicity, ordering, and execution batches remain +fixed during the simulation. Ordinary calls therefore do not resolve selectors +or rebuild public target wrappers in their execution loop. + +Objects may still be created, removed, or reparented during growth. At the +structural refresh barrier, PlantSimEngine updates only the affected resolved +target buffers. Later applications in the same timestep see the new targets; +applications that already ran are not repeated. The following ordinary +timestep returns to the cached execution path. + +Explicit target cadence must match the caller. A target without an explicit +cadence inherits the caller's invocation timing. diff --git a/docs/src/guides/multiscale/value_coupling.md b/docs/src/guides/multiscale/value_coupling.md new file mode 100644 index 000000000..9fe7675a7 --- /dev/null +++ b/docs/src/guides/multiscale/value_coupling.md @@ -0,0 +1,10 @@ +# Coupling Values Across Objects + +- `One(...)` requires exactly one source. +- `OptionalOne(...)` accepts zero or one. +- `Many(...)` supplies a stable object-ID ordered carrier. + +Use `var=` to rename a source and `application=` to distinguish repeated +processes. Homogeneous many-source values use a `RefVector`; heterogeneous +values use an object-aware reference carrier. Inspect both through +`Diagnostics.input_carrier`, `Diagnostics.input_value`, and `Diagnostics.explain_bindings`, not internal fields. diff --git a/docs/src/guides/multiscale/visualizing_structure.md b/docs/src/guides/multiscale/visualizing_structure.md new file mode 100644 index 000000000..abb2acf14 --- /dev/null +++ b/docs/src/guides/multiscale/visualizing_structure.md @@ -0,0 +1,6 @@ +# Visualizing Composite model Structure + +Use `Diagnostics.explain_objects`, `Diagnostics.explain_scopes`, and `Diagnostics.explain_instances` to +obtain stable rows for plotting. Draw nodes by object ID and edges from parent +to child; color by scale, species, or instance. Keep simulation visualization +outside model kernels so model code remains independent of topology packages. diff --git a/docs/src/guides/time/advanced_time_environment.md b/docs/src/guides/time/advanced_time_environment.md new file mode 100644 index 000000000..9fd6a2054 --- /dev/null +++ b/docs/src/guides/time/advanced_time_environment.md @@ -0,0 +1,12 @@ +# Advanced Time And Environment Configuration + +Disambiguate a producer with an explicit selector containing `application`, +`var`, and `within`. Put temporal `policy` and `window` on that input. Configure +environment source renaming and reducers with `Environment`; scenario values +override model-level `environment_hint` entries. + +Use `Diagnostics.explain_bindings`, `Diagnostics.explain_environment_bindings`, and +`Diagnostics.explain_schedule` to inspect the final source, reducer, window, cadence, and +clock origin. All periods that require seconds must be fixed `Dates` periods; +`Month(1)` is intentionally rejected. + diff --git a/docs/src/guides/time/hourly_daily_weekly.md b/docs/src/guides/time/hourly_daily_weekly.md new file mode 100644 index 000000000..759377e8d --- /dev/null +++ b/docs/src/guides/time/hourly_daily_weekly.md @@ -0,0 +1,63 @@ +# Hourly, Daily, And Weekly Models + +Use one hourly leaf application, a daily plant application with +`Many(scale=:Leaf, within=Subtree(), policy=Integrate(), window=Day(1))`, and a +weekly application consuming the daily stream. Each application remains a +normal `ModelSpec`; only its `every` value and input policy differ. + +Runtime dependency streams are retained because consumers need them. Output +resampling is independent: create named `OutputRequest`s for hourly, daily, +and weekly analysis, then compare `Diagnostics.explain_schedule` sample counts with rows +from `collect_outputs`. + +The following reduced example checks the important physical contract: two +leaf rates are integrated independently for 24 hourly samples and then summed +on their plant. + +```@example hourly-daily +using Dates +using PlantSimEngine + +PlantSimEngine.@process "docs_hourly_flux" verbose = false +PlantSimEngine.@process "docs_daily_total" verbose = false +struct DocsHourlyFlux <: AbstractDocs_Hourly_FluxModel end +struct DocsDailyTotal <: AbstractDocs_Daily_TotalModel end +PlantSimEngine.inputs_(::DocsHourlyFlux) = (rate=Required(Float64),) +PlantSimEngine.outputs_(::DocsHourlyFlux) = (flux=0.0,) +PlantSimEngine.run!(::DocsHourlyFlux, status, environment, constants, context) = + (status.flux = status.rate) +PlantSimEngine.inputs_(::DocsDailyTotal) = (fluxes=Required(Vector{Float64}),) +PlantSimEngine.outputs_(::DocsDailyTotal) = (total=0.0,) +PlantSimEngine.run!(::DocsDailyTotal, status, environment, constants, context) = + (status.total = sum(status.fluxes)) + +model = CompositeModel( + Object(:plant; scale=:Plant), + Object(:leaf_1; scale=:Leaf, parent=:plant, status=Status(rate=1.0)), + Object(:leaf_2; scale=:Leaf, parent=:plant, status=Status(rate=2.0)); + applications=( + ModelSpec(DocsHourlyFlux(); name=:hourly, on=Many(scale=:Leaf), every=Hour(1)), + ModelSpec( + DocsDailyTotal(); + name=:daily, + on=One(scale=:Plant), + inputs=( + :fluxes => Many( + scale=:Leaf, within=Subtree(), application=:hourly, var=:flux, + policy=Integrate(), window=Day(1), + ), + ), + every=Day(1), + ), + ), + environment=[(duration=Hour(1),) for _ in 1:25], +) +simulation = run!(model; steps=25) +@assert only(object.status.total for object in model_objects(model) + if object.id == ObjectId(:plant)) == 72.0 +``` + +A weekly consumer uses the same pattern with `every=Week(1)` and a +seven-day window over the daily application. Keep `Integrate` for rates; +choose `Aggregate(reducer)` for states or observations whose physical meaning +is a mean, minimum, maximum, or custom statistic. diff --git a/docs/src/guides/time/multirate_concepts.md b/docs/src/guides/time/multirate_concepts.md new file mode 100644 index 000000000..77f0b5807 --- /dev/null +++ b/docs/src/guides/time/multirate_concepts.md @@ -0,0 +1,12 @@ +# Understanding Model Cadence + +`ModelSpec(...; every=Dates.Period)` sets application cadence. Without +`every`, an application uses `timespec(model)` when non-default and otherwise +the environment base step. `timestep_hint` validates a scientifically +acceptable range; it does not silently change cadence. + +Temporal input policies have different physical meanings: `HoldLast` samples +the latest state, `Aggregate` reduces observations, and `Integrate` multiplies +rates by sample durations. `PreviousTimeStep` deliberately breaks a same-step +cycle. Windows are rolling fixed-duration windows. Civil-day or +previous-complete-calendar-period alignment is not a supported public feature. diff --git a/docs/src/index.md b/docs/src/index.md index d276ef42f..9537e521f 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -2,33 +2,6 @@ CurrentModule = PlantSimEngine ``` -```@setup readme -using PlantSimEngine, PlantMeteo, Dates - -# Import the examples defined in the `Examples` sub-module: -using PlantSimEngine.Examples - -# Import the example meteorological data: -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -# Define the model mapping: -model = ModelMapping( - ToyLAIModel(); - status=(TT_cu=1.0:2000.0,), # Pass the cumulated degree-days as input to the model -) - -out = run!(model) - -# Define the mapping for coupled models: -model2 = ModelMapping( - ToyLAIModel(), - Beer(0.6); - status=(TT_cu=cumsum(meteo_day[:, :TT]),), # Pass the cumulated degree-days as input to `ToyLAIModel`, this could also be done using another model -) -out2 = run!(model2, meteo_day) - -``` - # PlantSimEngine [![Build Status](https://github.com/VirtualPlantLab/PlantSimEngine.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/VirtualPlantLab/PlantSimEngine.jl/actions/workflows/CI.yml?query=branch%3Amain) @@ -40,334 +13,280 @@ out2 = run!(model2, meteo_day) ```@contents Pages = ["index.md"] -Depth = 5 +Depth = 4 ``` ## Overview -`PlantSimEngine` is a comprehensive framework for building models of the soil-plant-atmosphere continuum. It includes everything you need to **prototype, evaluate, test, and deploy** plant/crop models at any scale, with a strong emphasis on performance and efficiency, so you can focus on building and refining your models. - -**Why choose PlantSimEngine?** - -- **Simplicity**: Write less code, focus on your model's logic, and let the framework handle the rest. -- **Modularity**: Each model component can be developed, tested, and improved independently. Assemble complex simulations by reusing pre-built, high-quality modules. -- **Standardisation**: Clear, enforceable guidelines ensure that all models adhere to best practices. This built-in consistency means that once you implement a model, it works seamlessly with others in the ecosystem. -- **Optimised Performance**: Don't re-invent the wheel. Delegating low-level tasks to PlantSimEngine guarantees that your model will benefit from every improvement in the framework. Enjoy faster prototyping, robust simulations, and efficient execution using Julia's high-performance capabilities. - -## Unique Features - -### Automatic Model Coupling - -**Seamless Integration:** PlantSimEngine leverages Julia's multiple-dispatch capabilities to automatically compute the dependency graph between models. This allows researchers to effortlessly couple models without writing complex connection code or manually managing dependencies. +`PlantSimEngine` is a Julia framework for building soil-plant-atmosphere +simulations from small process models. A modeler writes reusable kernels with +`inputs_`, `outputs_`, optional dependency traits, and `run!`. A simulation +author then assembles those kernels on objects in a `CompositeModel`. -**Intuitive Multi-Scale Support:** The framework naturally handles models operating at different scales—from organelle to ecosystem—connecting them with minimal effort and maintaining consistency across scales. +The public scenario API has one application-construction form: -Model coupling can be done in Julia scripts or interactively in the graph view (or both): - -```@raw html - +```julia +ModelSpec( + model; + name=:application, + on=Many(scale=:Leaf), + inputs=(...), + calls=(...), + every=Dates.Hour(1), + environment=Environment(...), + output_routing=(...), + updates=Updates(...), +) ``` -### Flexibility with Precision Control - -**Effortless Model Switching:** Researchers can switch between different component models using a simple syntax without rewriting the underlying model code. This enables rapid comparison between different hypotheses and model versions, accelerating the scientific discovery process. - -### Multi-rate Execution - -**Mix model cadences in one simulation:** PlantSimEngine can run models at different timesteps within the same MTG simulation. This makes it possible to combine, for example, hourly leaf processes with daily plant balances and weekly reporting models without writing custom scheduling glue. - -**Explicit bindings between rates:** `TimeStepModel`, `InputBindings`, `MeteoBindings`, `ScopeModel`, and `OutputRequest` let you declare how model inputs, meteorology, and exported outputs should behave when rates differ. - -## Batteries included - -- **Interactive graph editor**: Compose your model by interactively adding sub-models in a graph editor, and let the framework handle the coupling and execution. -- **Automated Management**: Seamlessly handle inputs, outputs, time-steps, objects, and dependency resolution. -- **Iterative Development**: Fast and interactive prototyping of models with built-in constraints to avoid errors and sensible defaults to streamline the model writing process. -- **Control Your Degrees of Freedom**: Fix variables to constant values or force to observations, use simpler models for specific processes to reduce complexity. -- **Multi-Rate Scheduling**: Combine hourly, daily, and coarser models in the same simulation, with explicit policies for input aggregation and meteorological sampling. -- **High-Speed Computations**: Achieve impressive performance with benchmarks showing operations in the 100th of nanoseconds range for complex models (see this [benchmark script](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/benchmark.jl)). -- **Parallelize and Distribute Computing**: Out-of-the-box support for sequential, multi-threaded, or distributed computations over objects, time-steps, and independent processes, thanks to [Floops.jl](https://juliafolds.github.io/FLoops.jl/stable/). -- **Scale Effortlessly**: Methods for computing over objects, time-steps, and [Multi-Scale Tree Graphs](https://github.com/VEZY/MultiScaleTreeGraph.jl). -- **Compose Freely**: Use any types as inputs, including [Unitful](https://github.com/PainterQubits/Unitful.jl) for unit propagation and [MonteCarloMeasurements.jl](https://github.com/baggepinnen/MonteCarloMeasurements.jl) for measurement error propagation. - -## Performance - -PlantSimEngine delivers impressive performance for plant modeling tasks. On an M1 MacBook Pro: - -- A toy model for leaf area over a year at daily time-scale took only 260 μs (about 688 ns per day) -- The same model coupled to a light interception model took 275 μs (756 ns per day) - -These benchmarks demonstrate performance on par with compiled languages like Fortran or C, far outpacing typical interpreted language implementations. For example, PlantBiophysics.jl, which implements ecophysiological models using PlantSimEngine, has been measured to run up to 38,000 times faster than equivalent implementations in other scientific computing languages. - -## Ask Questions - -If you have any questions or feedback, [open an issue](https://github.com/VirtualPlantLab/PlantSimEngine.jl/issues) or ask on [discourse](https://fspm.discourse.group/c/software/virtual-plant-lab). +### Models And Applications + +A model is a reusable implementation of a process. A model application is one +configured use of that model in a model: it gives the use a name, selects its +target objects, and configures its inputs, calls, timestep, and environment. + +| Concept | Meaning | +|:--|:--| +| Process | The biological or physical operation, such as light interception | +| Model | An implementation of that process, such as `Beer` | +| Application | One configured use of a model in a `CompositeModel` | +| Target | An object on which that application executes | + +One application can target many objects. The same model can also be used in +several named applications with different parameters, selectors, or cadence. +During compilation, PlantSimEngine resolves each application into its concrete +`(application, object)` executions. + +This means the same model can be reused on one object, many leaves, several +plant species, a shared soil object, or a model-scale energy-balance solver +without changing the model implementation. + +## Why PlantSimEngine? + +- **Modular models**: each process model can be developed, tested, calibrated, + and replaced independently. +- **Explicit coupling**: `ModelSpec(...; inputs=...)` declares value + dependencies, while `calls=...` gives iterative parent solvers manual + control over hard model calls. +- **Object-based multiscale composite models**: scales are labels on objects, so a plant + can be described as plants, axes, internodes, leaves, roots, voxels, or any + topology the model requires. +- **Multirate execution**: use `every=Dates.Hour(1)` or + `every=Dates.Day(1)`, with temporal policies such as `Integrate()` or + `HoldLast()` in the same model. +- **Automatic environment binding**: global weather and spatial microclimate + backends are bound through `Environment(...)`, model `environment_inputs_`, and + explicit accepted-state commits with `commit_environment!`. +- **Performance-oriented internals**: selectors and bindings are compiled + before the timestep loop, same-rate inputs use references when possible, and + homogeneous object batches are specialized. +- **Generic values**: status, model parameters, meteorology, and outputs can + carry units, automatic-differentiation values, uncertainty wrappers, or other + compatible Julia types. ## Installation -To install the package, enter the Julia package manager mode by pressing `]` in the REPL, and execute the following command: +To install the package, enter Julia package mode by pressing `]` in the REPL, +then run: ```julia add PlantSimEngine ``` -To use the package, execute this command from the Julia REPL: +Use it from Julia with: ```julia using PlantSimEngine ``` -## Example usage +## Quickstart: One CompositeModel Object -The package is designed to be easy to use, and to help users avoid errors when implementing, coupling and simulating models. +This example runs three existing toy models on one model object: -### Simple example +1. `ToyDegreeDaysCumulModel` computes daily thermal time. +2. `ToyLAIModel` consumes cumulative thermal time and computes LAI. +3. `Beer` consumes LAI and meteorology to compute absorbed PAR. -Here's a simple example of a model that simulates the growth of a plant, using a simple exponential growth model: +The model kernels are unchanged; the model application layer says where they +run. Since no `every` is specified, these applications use the daily +cadence of `meteo_day`. ```@example readme -# ] add PlantSimEngine -using PlantSimEngine - -# Import the examples defined in the `Examples` sub-module +using PlantSimEngine, PlantMeteo, Dates, DataFrames using PlantSimEngine.Examples -# Define the model mapping: -model = ModelMapping( - ToyLAIModel(); - status=(TT_cu=1.0:2000.0,), # Pass the cumulated degree-days as input to the model +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, ) -out = run!(model) # run the model and extract its outputs - -out[1:3,:] -``` - -> **Note** -> The `ToyLAIModel` is available from the [examples folder](https://github.com/VirtualPlantLab/PlantSimEngine.jl/tree/main/examples), and is a simple exponential growth model. It is used here for the sake of simplicity, but you can use any model you want, as long as it follows `PlantSimEngine` interface. - -Of course you can plot the outputs quite easily: - -```@example readme -# ] add CairoMakie -using CairoMakie - -lines(out[:TT_cu], out[:LAI], color=:green, axis=(ylabel="LAI (m² m⁻²)", xlabel="Cumulated growing degree days since sowing (°C)")) -``` - -### Model coupling - -Model coupling is done automatically by the package, and is based on the dependency graph between the models. To couple models, we just have to add them to the `ModelMapping`. For example, let's couple the `ToyLAIModel` with a model for light interception based on Beer's law: - -```@example readme -# ] add PlantSimEngine, PlantMeteo -using PlantSimEngine, PlantMeteo, Dates - -# Import the examples defined in the `Examples` sub-module -using PlantSimEngine.Examples - -# Import the example meteorological data: -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -# Define the mapping for coupled models: -model2 = ModelMapping( +model = CompositeModel( + ToyDegreeDaysCumulModel(), ToyLAIModel(), Beer(0.6); - status=(TT_cu=cumsum(meteo_day[:, :TT]),), # Pass the cumulated degree-days as input to `ToyLAIModel`, this could also be done using another model + environment=meteo_day, ) -# Run the simulation: -out2 = run!(model2, meteo_day) -out2[1:3,:] +sim = run!(model; steps=30, outputs=:all) +out = collect_outputs(sim; sink=DataFrame) +first(out, 6) ``` -The `ModelMapping` couples the models by automatically computing the dependency graph of the models. The resulting dependency graph is: +`ToyLAIModel` does not know where `TT_cu` comes from, and `Beer` does not know +where `LAI` comes from. The compiler infers the unambiguous same-object +bindings from each model's declared inputs and outputs: -``` -╭──── Dependency graph ──────────────────────────────────────────╮ -│ ╭──── LAI_Dynamic ─────────────────────────────────────────╮ │ -│ │ ╭──── Main model ────────╮ │ │ -│ │ │ Process: LAI_Dynamic │ │ │ -│ │ │ Model: ToyLAIModel │ │ │ -│ │ │ Dep: nothing │ │ │ -│ │ ╰────────────────────────╯ │ │ -│ │ │ ╭──── Soft-coupled model ─────────╮ │ │ -│ │ │ │ Process: light_interception │ │ │ -│ │ └──│ Model: Beer │ │ │ -│ │ │ Dep: (LAI_Dynamic = (:LAI,),) │ │ │ -│ │ ╰─────────────────────────────────╯ │ │ -│ ╰──────────────────────────────────────────────────────────╯ │ -╰────────────────────────────────────────────────────────────────╯ +```@example readme +select( + DataFrame(Diagnostics.explain_bindings(model)), + :application_id, + :input, + :source_application_ids, + :carrier_kind, + :copy_semantics, +) ``` -We can plot the results by indexing the outputs with the variable name (e.g. `out2[:LAI]`): +The outputs can be plotted like any other tabular result: ```@example readme using CairoMakie +lai = out[out.variable .== :LAI, :value] +appfd = out[out.variable .== :aPPFD, :value] +tt_cu = out[out.variable .== :TT_cu, :value] + fig = Figure(resolution=(800, 600)) ax = Axis(fig[1, 1], ylabel="LAI (m² m⁻²)") -lines!(ax, out2[:TT_cu], out2[:LAI], color=:mediumseagreen) +lines!(ax, tt_cu, lai, color=:mediumseagreen) ax2 = Axis(fig[2, 1], xlabel="Cumulated growing degree days since sowing (°C)", ylabel="aPPFD (mol m⁻² d⁻¹)") -lines!(ax2, out2[:TT_cu], out2[:aPPFD], color=:firebrick1) - +lines!(ax2, tt_cu, appfd, color=:firebrick1) fig ``` -### Multi-scale modeling - -> See the [Multi-scale modeling](#multi-scale-modeling) section for more details. +## Multi-Object Inputs -The package is designed to be easily scalable, and can be used to simulate models at different scales. For example, you can simulate a model at the leaf scale, and then couple it with models at any other scale, *e.g.* internode, plant, soil, scene scales. Here's an example of a simple model that simulates plant growth using sub-models operating at different scales: +Use `ModelSpec(...; inputs=...)` when a model needs values from selected objects. Here the +model-scale LAI model reads live references to all plant surfaces in the model: ```@example readme -mapping = ModelMapping( - :Scene => ToyDegreeDaysCumulModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.6), - MultiScaleModel( - model=ToyAssimModel(), - mapped_variables=[:soil_water_content => :Soil], - ), - MultiScaleModel( - model=ToyCAllocationModel(), - mapped_variables=[ - :carbon_demand => [:Leaf, :Internode], - :carbon_allocation => [:Leaf, :Internode] - ], - ), - MultiScaleModel( - model=ToyPlantRmModel(), - mapped_variables=[:Rm_organs => [:Leaf => :Rm, :Internode => :Rm],], - ), - ), - :Internode => ( - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], - ), - MultiScaleModel( - model=ToyInternodeEmergence(TT_emergence=20.0), - mapped_variables=[:TT_cu => :Scene], - ), - ToyMaintenanceRespirationModel(1.5, 0.06, 25.0, 0.6, 0.004), - Status(carbon_biomass=1.0) - ), - :Leaf => ( - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], - ), - ToyMaintenanceRespirationModel(2.1, 0.06, 25.0, 1.0, 0.025), - Status(carbon_biomass=1.0) +plant_scene = CompositeModel( + Object(:scene; scale=:Scene, kind=:scene), + Object(:plant_1; scale=:Plant, kind=:plant, parent=:scene, + status=Status(surface=12.0)), + Object(:plant_2; scale=:Plant, kind=:plant, parent=:scene, + status=Status(surface=8.0)); + applications=( + ModelSpec(ToyLAIfromLeafAreaModel(100.0); name=:scene_lai, on=One(scale=:Scene), inputs=(:plant_surfaces => Many( + scale=:Plant, + within=SceneScope(), + var=:surface, + ),)), ), - :Soil => ( - ToySoilWaterModel(), - ), -); -nothing # hide -``` - -We can import an example plant from the package: - -```@example readme -mtg = import_mtg_example() -``` - -Make a fake meteorological data: - -```@example readme -meteo = Weather( - [ - Atmosphere(T=20.0, Wind=1.0, Rh=0.65, Ri_PAR_f=300.0), - Atmosphere(T=25.0, Wind=0.5, Rh=0.8, Ri_PAR_f=500.0) -] -); -nothing # hide -``` - -And run the simulation: - -```@example readme -out_vars = Dict( - :Scene => (:TT_cu,), - :Plant => (:carbon_allocation, :carbon_assimilation, :soil_water_content, :aPPFD, :TT_cu, :LAI), - :Leaf => (:carbon_demand, :carbon_allocation), - :Internode => (:carbon_demand, :carbon_allocation), - :Soil => (:soil_water_content,), ) -out = run!(mtg, mapping, meteo, tracked_outputs=out_vars, executor=SequentialEx()); -nothing # hide -``` - -We can then extract the outputs and convert them to a `DataFrame` for each scale and sort them: - -```@example readme -using DataFrames -df_outputs = convert_outputs(out, DataFrame) -leaf_df = df_outputs isa AbstractDict ? df_outputs[:Leaf] : df_outputs -sort!(leaf_df, [:timestep, :node]) +plant_sim = run!(plant_scene) +scene_status = final_state(plant_sim, One(scale=:Scene)) +scene_status ``` -An example output of a multiscale simulation is shown in the documentation of PlantBiophysics.jl: - -![Plant growth simulation](www/image.png) +The same `Many(...)` selector would be plant-local if the consumer ran on a +plant and used `within=Subtree()`. This is the same mechanism used for plant +allocation models that sum their own leaves, model models that aggregate all +plants, and microclimate solvers that select objects inside one environment +cell. -### Multi-rate modeling +When a selector reads a value produced by another model application, prefer +`application=...` to identify the concrete producer. A process name describes +the reusable scientific contract; an application name identifies the mounted +producer in this scenario. This matters as soon as several applications +implement the same process or publish the same variable on different objects. -PlantSimEngine also supports multi-rate MTG simulations, where different models run at different cadences inside the same execution. A typical use case is to run leaf-scale processes hourly, aggregate them into daily plant-scale balances, and then export weekly summary series from the same simulation. +## Manual Calls For Iterative Solvers -The dedicated documentation now has three pages: a short introduction to the -core ideas, a fuller step-by-step tutorial, and an advanced configuration page: +Use `ModelSpec(...; calls=...)` when a parent model must directly run another model, for +example a model energy-balance solver that iterates leaf temperatures until +convergence: -- [Introduction to multi-rate execution](./multirate/introduction.md) -- [Step-by-step hourly, daily, weekly simulation](./multirate/multirate_tutorial.md) -- [Advanced multi-rate configuration](./multirate/advanced_configuration.md) - -## State of the field +```julia +ModelSpec(SceneEnergyBalance(); name=:scene_energy, on=One(scale=:Scene), calls=(:leaf_energy => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + application=:energy_balance, + ), + :soil => One( + kind=:soil, + scale=:Soil, + within=SceneScope(), + application=:soil_water, + ),), every=Hour(1)) +``` -PlantSimEngine is a state-of-the-art plant simulation software that offers significant advantages over existing tools such as OpenAlea, STICS, APSIM, or DSSAT. +The same rule applies to manual calls: scenario wiring should select the +concrete callee application with `application=...`. Model authors use process +requirements in `dep(model)` when they declare generic dependencies, because +they cannot know the application names that a user will choose later. + +Inside `run!`, use `run_call!(context, :leaf_energy)` to execute every target and +receive a vector-like collection. Pass `sampled_environment=value` to the same +bulk call when the parent has already sampled one environment for all targets. +Use `call_model(context, :leaf_energy)` when a singular call's concrete model +must guide an iterative algorithm. Reserve `call_targets` and +`run_call!(target; publish=false)` for selection, custom ordering, target status +inspection, or different per-target environments. Publish the accepted state +once, so temporal outputs and mutable environment writes are recorded exactly +once. + +## Where To Go Next + +- [A mental model](journeys/users/mental_model.md) introduces the seven ideas + used throughout the framework without configuration details. +- [Couple models on one object](journeys/users/one_object.md) is the first + executable journey and runs a coupled simulation over many timesteps. +- [Run the coupling on several objects](journeys/users/several_objects.md) + introduces stable object identity and `Many`. +- [Public API](API/API_public.md) lists the composite-model/object constructors, + selectors, lifecycle hooks, and explanation helpers. +- [Model traits](model_traits.md) explains `inputs_`, `outputs_`, `dep`, + `timespec`, `output_policy`, and `environment_inputs_`. +- [Migration guide](migration_composite_model.md) covers upgrades from earlier + PlantSimEngine releases. -The use of Julia programming language in PlantSimEngine allows for: +## Performance -- Quick and easy prototyping compared to compiled languages -- Significantly better performance than typical interpreted languages -- No need for translation into another compiled language +PlantSimEngine keeps model kernels close to regular Julia functions while the +runtime handles dependency scheduling, object selection, temporal aggregation, +and environment sampling. On an M1 MacBook Pro, toy daily simulations run in +hundreds of microseconds, and PlantBiophysics.jl models using PlantSimEngine +have been measured much faster than equivalent implementations in typical +scientific scripting languages. -Julia's features enable PlantSimEngine to provide: +For performance-sensitive composite models, inspect the supported structured +explanations: -- Multiple-dispatch for automatic computation of model dependency graphs -- Type stability for optimized performance -- Seamless compatibility with powerful tools like MultiScaleTreeGraph.jl for multi-scale computations +```julia +Diagnostics.explain_bindings(model) +Diagnostics.explain_schedule(model) +Diagnostics.explain_execution_plan(model) +``` -PlantSimEngine's approach streamlines the process of model development by automatically managing: +These helpers expose resolved objects, carriers, copy/reference semantics, +application clocks, and homogeneous execution batches. -- Model coupling with automated dependency graph computation -- Time-steps and parallelization -- Input and output variables -- Various types of objects used for simulations (vectors, dictionaries, multi-scale tree graphs) +## Ask Questions -## Projects that use PlantSimEngine +If you have questions or feedback, [open an issue](https://github.com/VirtualPlantLab/PlantSimEngine.jl/issues) +or ask on [discourse](https://fspm.discourse.group/c/software/virtual-plant-lab). -Take a look at these projects that use PlantSimEngine: +## Projects That Use PlantSimEngine - [PlantBiophysics.jl](https://github.com/VEZY/PlantBiophysics.jl) - [XPalm](https://github.com/PalmStudio/XPalm.jl) -## Make it yours - -The package is developed so anyone can easily implement plant/crop models, use it freely and as you want thanks to its MIT license. +## Make It Yours -If you develop such tools and it is not on the list yet, please make a PR or contact me so we can add it! 😃 +PlantSimEngine is distributed under the MIT license. If you develop a package +or model suite that uses it and want it listed here, please open a pull request +or contact the maintainers. diff --git a/docs/src/introduction/why_plantsimengine.md b/docs/src/introduction/why_plantsimengine.md index ed8759658..6813f1051 100644 --- a/docs/src/introduction/why_plantsimengine.md +++ b/docs/src/introduction/why_plantsimengine.md @@ -82,7 +82,10 @@ PlantSimEngine's approach to plant modeling represents a paradigm shift in how s - **Automatic Dependency Resolution:** The system automatically determines the relationships between different models and processes, eliminating the need for manual coupling. -- **Seamless Parallelization:** Out-of-the-box support for parallel and distributed computation allows researchers to focus on the science rather than implementation details. +- **Concrete Batched Execution:** The model compiler groups compatible object + targets into concrete execution batches. A public parallel or distributed + executor is not currently provided; parallel execution remains planned work + that requires explicit correctness and independence guarantees. - **Flexible Model Integration:** The ability to easily combine models from different sources and at different scales facilitates more comprehensive and realistic simulations. diff --git a/docs/src/journeys/modelers/basic_model.md b/docs/src/journeys/modelers/basic_model.md new file mode 100644 index 000000000..4e7cce2e7 --- /dev/null +++ b/docs/src/journeys/modelers/basic_model.md @@ -0,0 +1,156 @@ +# Implement A Basic Model + +**New concept:** the complete one-step model contract. This page then proves +that the same kernel composes automatically on one object and runs unchanged +over several objects. + +For the simulation-user view of these scenarios, see +[Couple Models On One Object](@ref) and +[Run The Coupling On Several Objects](@ref). + +## Model 1: declare the complete contract + +`ToyDevelopmentModel` has one generic parameter, one required input, one true +default, one output initial value, and the final five-argument kernel. This is +the complete tested implementation from `examples/ToyModelDeveloper.jl`: + +```julia +struct ToyDevelopmentModel{T} <: AbstractToy_DevelopmentModel + efficiency::T +end + +PlantSimEngine.inputs_(::ToyDevelopmentModel) = ( + TT=Required(Real), + stress=Default(1.0), +) +PlantSimEngine.outputs_(model::ToyDevelopmentModel) = ( + growth=zero(model.efficiency), +) + +function PlantSimEngine.run!( + model::ToyDevelopmentModel, + status, + environment, + constants, + context, +) + status.growth = model.efficiency * status.TT * status.stress + return nothing +end +``` + +`Required(Real)` is a contract, not an initialization value. `Default(1.0)` +means the scientific model genuinely defines unstressed growth as its +fallback. Output values initialize model state and should match the parameter's +numeric type where practical. + +Test the kernel directly before involving a scenario: + +```@example modeler_basic +using Dates, PlantMeteo, PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +development = ToyDevelopmentModel(0.5) +status = Status(TT=8.0, stress=0.75, growth=0.0) +PlantSimEngine.run!( + development, + status, + nothing, + nothing, + nothing, +) +status.growth +``` + +## Model 2: let one object couple it automatically + +`ToyDegreeDaysCumulModel` publishes `TT`; `ToyDevelopmentModel` requires `TT`. +Because both applications target the same object and the producer is unique, +the scenario needs no explicit `inputs` wiring: + +```@example modeler_basic +one_object = CompositeModel( + Object(:leaf; scale=:Leaf); + applications=( + ModelSpec( + ToyDegreeDaysCumulModel(T_base=10.0); + name=:thermal_time, + on=One(scale=:Leaf), + ), + ModelSpec( + development; + name=:development, + on=One(scale=:Leaf), + ), + ), + environment=Atmosphere( + T=18.0, + Wind=1.0, + Rh=0.7, + duration=Day(1), + ), +) + +select( + DataFrame(Diagnostics.explain_bindings(one_object)), + :application_id, + :input, + :origin, + :source_application_ids, + :carrier_kind, +) +``` + +```@example modeler_basic +one_simulation = run!(one_object) +final_state(one_simulation) +``` + +PlantSimEngine creates `stress=1.0` from the model default and connects `TT` +through a shared `Ref`. The development kernel knows neither fact. + +## Model 3: reuse the kernel over several objects + +Change only application multiplicity from `One` to `Many`: + +```@example modeler_basic +several_objects = CompositeModel( + Object(:leaf_1; scale=:Leaf), + Object(:leaf_2; scale=:Leaf); + applications=( + ModelSpec( + ToyDegreeDaysCumulModel(T_base=10.0); + name=:thermal_time, + on=Many(scale=:Leaf), + ), + ModelSpec( + development; + name=:development, + on=Many(scale=:Leaf), + ), + ), + environment=Atmosphere( + T=18.0, + Wind=1.0, + Rh=0.7, + duration=Day(1), + ), +) + +final_state(run!(several_objects), Many(scale=:Leaf)) +``` + +Do not loop over objects inside `ToyDevelopmentModel.run!`. PlantSimEngine +compiles homogeneous execution targets and invokes the one-target kernel for +each selected object. + +## Model-author recap + +- **You implemented:** parameters, `Required`/`Default` inputs, output initial + state, and one-target arithmetic. +- **PlantSimEngine inferred:** default initialization, same-object coupling, + execution order, and repeated targets. +- **The scenario author keeps explicit:** objects, application names, + multiplicity, and environment data. +- **New API names:** `AbstractModel`, `inputs_`, `outputs_`, `Required`, + `Default`, and `run!`. diff --git a/docs/src/journeys/modelers/cross_object_values.md b/docs/src/journeys/modelers/cross_object_values.md new file mode 100644 index 000000000..4c3c764ff --- /dev/null +++ b/docs/src/journeys/modelers/cross_object_values.md @@ -0,0 +1,158 @@ +# Implement Cross-Object Values + +**New concept:** scalar and vector-like inputs use the same one-step kernel +contract. Object selection and topology remain scenario concerns. + +See [Build One Multiscale Plant](@ref) for the simulation-user construction +journey. + +The plain Julia block below is an excerpt from a shipped example whose +declarations and compositions are tested in `test/test-toy_models.jl`. + +## Model 4: consume one scalar from another object + +`ToyDevelopmentModel` already declares `stress=Default(1.0)`. A scenario may +replace that fallback with one live scalar from a soil object: + +```@example modeler_cross_object +using Dates, PlantMeteo, PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +cross_object = CompositeModel( + Object(:soil; scale=:Soil, status=Status(stress=0.4)), + Object(:leaf; scale=:Leaf, status=Status(TT=10.0)); + applications=( + ModelSpec( + ToyDevelopmentModel(0.5); + name=:development, + on=One(scale=:Leaf), + inputs=( + :stress => One( + scale=:Soil, + within=SceneScope(), + var=:stress, + from_status=true, + ), + ), + ), + ), +) + +cross_simulation = run!(cross_object) +( + leaf=final_state(cross_simulation, :leaf), + binding=only(Diagnostics.explain_bindings(cross_object)), +) +``` + +The model kernel still reads only `status.stress`. It does not search for soil, +know object ids, or copy the scalar each step. The scenario's `One` selector +resolves a shared `Ref`. + +## Model 5: consume a vector-like multiscale value + +`ToyMaintenanceRespirationModel` runs once per leaf and publishes `Rm`. +`ToyPlantRmModel` declares one vector-like input and reduces it: + +```julia +PlantSimEngine.inputs_(::ToyPlantRmModel) = ( + Rm_organs=Required(AbstractVector{<:Real}), +) +PlantSimEngine.outputs_(::ToyPlantRmModel) = (Rm=-Inf,) + +function PlantSimEngine.run!( + model::ToyPlantRmModel, + status, + environment, + constants, + context, +) + status.Rm = sum(status.Rm_organs) + return nothing +end +``` + +The scenario decides that `Rm_organs` means all descendant leaf outputs: + +```@example modeler_cross_object +respiration = ToyMaintenanceRespirationModel( + 2.0, + 0.06, + 25.0, + 0.5, + 0.02, +) + +multiscale = CompositeModel( + Object(:plant; scale=:Plant), + Object( + :leaf_1; + scale=:Leaf, + parent=:plant, + status=Status(carbon_biomass=10.0), + ), + Object( + :leaf_2; + scale=:Leaf, + parent=:plant, + status=Status(carbon_biomass=20.0), + ); + applications=( + ModelSpec( + respiration; + name=:maintenance, + on=Many(scale=:Leaf), + ), + ModelSpec( + ToyPlantRmModel(); + name=:plant_maintenance, + on=One(scale=:Plant), + inputs=( + :Rm_organs => Many( + scale=:Leaf, + within=Subtree(), + application=:maintenance, + var=:Rm, + ), + ), + ), + ), + environment=Atmosphere( + T=25.0, + Wind=1.0, + Rh=0.7, + duration=Hour(1), + ), +) + +multiscale_simulation = run!(multiscale) +( + plant=final_state(multiscale_simulation, :plant), + leaves=final_state(multiscale_simulation, Many(scale=:Leaf)), +) +``` + +```@example modeler_cross_object +select( + DataFrame(Diagnostics.explain_bindings(multiscale)), + :application_id, + :input, + :source_ids, + :carrier_kind, + :copy_semantics, +) +``` + +The `Many` carrier is a live `RefVector`; the aggregation kernel operates on an +`AbstractVector` and stays independent of object count and identity. + +## Model-author recap + +- **You implemented:** scalar or vector-compatible input schemas and ordinary + one-step arithmetic. +- **PlantSimEngine inferred:** shared `Ref` and `RefVector` carriers plus + producer-before-consumer order. +- **The scenario author keeps explicit:** cross-object scope, multiplicity, + source application, and variable remapping. +- **New API names:** `One`, `Many`, `SceneScope`, `Subtree`, `from_status`, + `RefVector`, and `input_carrier`. diff --git a/docs/src/journeys/modelers/environment_and_cadence.md b/docs/src/journeys/modelers/environment_and_cadence.md new file mode 100644 index 000000000..043fdbe88 --- /dev/null +++ b/docs/src/journeys/modelers/environment_and_cadence.md @@ -0,0 +1,152 @@ +# Implement Environment And Cadence Traits + +**New concept:** model-authored runtime traits. Environment declarations name +the fields a kernel samples, while cadence and output-policy traits state when +the same kernel runs and how its values cross clocks. + +Simulation users configure providers in [Understand Environments](@ref) and +application clocks in [Give Models Different Cadences](@ref). + +## Model 6: declare sampled environment inputs + +`ToyMaintenanceRespirationModel` reads object state and sampled temperature. +The tested contract names that environment field explicitly: + +```julia +PlantSimEngine.inputs_(::ToyMaintenanceRespirationModel) = ( + carbon_biomass=Required(Real), +) +PlantSimEngine.environment_inputs_( + model::ToyMaintenanceRespirationModel, +) = (T=zero(model.T_ref),) +PlantSimEngine.outputs_(model::ToyMaintenanceRespirationModel) = ( + Rm=oftype(model.Rm_base, -Inf), +) +``` + +The kernel reads model parameters from `model`, object state from `status`, and +forcing from `environment`: + +```julia +function PlantSimEngine.run!( + model::ToyMaintenanceRespirationModel, + status, + environment, + constants, + context, +) + status.Rm = + status.carbon_biomass * + model.P_alive * + model.nitrogen_content * + model.Rm_base * + model.Q10^((environment.T - model.T_ref) / 10) + return nothing +end +``` + +```@example modeler_environment_time +using Dates, PlantMeteo, PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +respiration = ToyMaintenanceRespirationModel( + 2.0, + 0.06, + 25.0, + 0.5, + 0.02, +) +model = CompositeModel( + Object( + :leaf; + scale=:Leaf, + status=Status(carbon_biomass=10.0), + ); + applications=( + ModelSpec( + respiration; + name=:maintenance, + on=One(scale=:Leaf), + ), + ), + environment=Atmosphere( + T=25.0, + Wind=1.0, + Rh=0.7, + duration=Hour(1), + ), +) + +( + declared=PlantSimEngine.environment_inputs_(respiration), + final=final_state(run!(model)), +) +``` + +The model does not name a provider or inspect raw weather storage. +`Environment(...)` remains scenario configuration. + +## Model 7: declare cadence and output semantics + +`ToyDailyDevelopmentModel` accumulates one increment whenever it runs. Its +model-level traits say “every 24 simulation steps, starting at step 1” and +“consumers may hold the last daily value between publications”: + +```julia +PlantSimEngine.timespec(::Type{<:ToyDailyDevelopmentModel}) = + ClockSpec(24.0, 1.0) +PlantSimEngine.output_policy( + ::Type{<:ToyDailyDevelopmentModel}, +) = (daily_growth=HoldLast(),) +``` + +`ClockSpec` is expressed in simulation steps. Use +`ModelSpec(...; every=Day(1))` when a scenario should express a +duration-relative cadence or override the model default. + +```@example modeler_environment_time +daily = ToyDailyDevelopmentModel(2.0) +daily_model = CompositeModel( + Object(:plant; scale=:Plant); + applications=( + ModelSpec( + daily; + name=:daily_development, + on=One(scale=:Plant), + ), + ), + environment=[ + (duration=Hour(1),) + for _ in 1:25 + ], +) + +daily_simulation = + run!(daily_model; steps=25, outputs=:all) +( + traits=( + clock=PlantSimEngine.timespec(daily), + outputs=PlantSimEngine.output_policy(daily), + ), + schedule=DataFrame(Diagnostics.explain_schedule(daily_model)), + final=final_state(daily_simulation), + retained=DataFrame( + Diagnostics.explain_outputs(daily_simulation), + ), +) +``` + +The model runs at steps 1 and 25. A downstream application can override +`HoldLast` with an explicit selector policy when its scientific interpretation +requires `Integrate`, `Aggregate`, or `Interpolate`. + +## Model-author recap + +- **You implemented:** declared environment reads, a model default clock, and + per-output temporal meaning. +- **PlantSimEngine inferred:** environment validation/sampling, execution + steps, and the default cross-clock policy. +- **The scenario author keeps explicit:** concrete environment provider, + simulation base step, cadence overrides, and input-policy overrides. +- **New API names:** `environment_inputs_`, `timespec`, `ClockSpec`, + `output_policy`, and `HoldLast`. diff --git a/docs/src/journeys/modelers/hard_dependencies.md b/docs/src/journeys/modelers/hard_dependencies.md new file mode 100644 index 000000000..203d11126 --- /dev/null +++ b/docs/src/journeys/modelers/hard_dependencies.md @@ -0,0 +1,167 @@ +# Implement A Hard Dependency + +**New concept:** a process-level hard dependency, used only when the parent +kernel must control another model's execution. Value dependencies should stay +in `inputs_`. + +Simulation users wire and inspect advanced calls in +[Control Advanced Execution](@ref). + +The plain Julia blocks below are excerpts from the shipped, tested +`ToySelectiveCallControllerModel`. + +## Model 8: declare and execute the call + +`ToySelectiveCallControllerModel` declares a reusable default by process, +scale, and relative scope. It cannot know future application names: + +```julia +PlantSimEngine.dep(::ToySelectiveCallControllerModel) = ( + readers=Call(Many( + scale=:Leaf, + process=:toy_environment_reader, + within=Subtree(), + )), +) +``` + +Inside `run!`, the controller inspects the vector-like collection, restricts +the declared call by object id, runs trials without publication, and publishes +one accepted execution: + +```julia +targets = call_targets(context, :readers) +selected = only(call_targets( + context, + :readers; + objects=(ObjectId(model.selected_object),), +)) + +for temperature in model.trial_temperatures + run_call!( + selected; + sampled_environment=(T=temperature,), + publish=false, + ) +end +run_call!( + selected; + sampled_environment=(T=model.accepted_temperature,), + publish=true, +) +``` + +The source excerpt is exercised by the example-model contract suite. Build a +scenario without a `calls` keyword to use that model default: + +```@example modeler_hard_dependency +using PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +environment = ToySpatialEnvironment( + Dict( + :sun => (T=26.0,), + :shade => (T=18.0,), + ); + step_seconds=3600.0, +) +model = CompositeModel( + Object(:plant; scale=:Plant), + Object( + :sun_leaf; + scale=:Leaf, + parent=:plant, + geometry=(cell=:sun,), + ), + Object( + :shade_leaf; + scale=:Leaf, + parent=:plant, + geometry=(cell=:shade,), + ); + applications=( + ModelSpec( + ToyEnvironmentReaderModel(); + name=:reader, + on=Many(scale=:Leaf), + environment=Environment(backend=environment), + ), + ModelSpec( + ToySelectiveCallControllerModel( + (28.0, 31.0), + 22.0; + selected_object=:sun_leaf, + ); + name=:controller, + on=One(scale=:Plant), + ), + ), +) + +DataFrame(Diagnostics.explain_calls(model)) +``` + +```@example modeler_hard_dependency +simulation = run!(model; outputs=:all) +( + controller=final_state(simulation, :plant), + leaves=final_state(simulation, Many(scale=:Leaf)), + publications=filter( + row -> row.application_id == :reader, + DataFrame(Diagnostics.explain_outputs(simulation)), + ), +) +``` + +`origin=:model_default` identifies the `dep(model)` contract. A concrete +scenario can replace it with `ModelSpec(...; calls=...)` when application +identity or target selection differs. + +## Keep the common path bulk and concrete + +The selective example above intentionally materializes one public target +because it chooses an object and gives each trial its own sampled value. If the +algorithm executes every resolved target with the same already-sampled +environment, use the bulk path instead: + +```julia +run_call!( + context, + :readers; + sampled_environment=environment, + publish=false, +) +``` + +This executes the compiler's cached typed batches directly. It avoids creating +or indexing `CallTarget` wrappers inside a timestep loop. + +Some iterative algorithms must inspect a singular dependency model before +executing it. Keep that dispatch concrete with `call_model`, then execute the +same declared call in bulk: + +```julia +reader_model = call_model(context, :reader) +trial = prepare_trial(reader_model, status, environment) +run_call!(context, :reader; sampled_environment=trial, publish=false) +``` + +`call_model` requires exactly one resolved target. Use `call_targets` when the +algorithm also needs target status, object selection, a custom order, or +several distinct sampled environments. + +The dependency definition is immutable after compilation, while its selected +objects are not. Growth, removal, and reparenting refresh the affected target +buffers once at the lifecycle barrier; normal timesteps continue through the +same compiled plan. + +## Model-author recap + +- **You implemented:** a process-level `Call` requirement and explicit + execution inside the parent kernel. +- **PlantSimEngine inferred:** call-only scheduling, resolved targets, nested + context, and publication boundaries. +- **The scenario author keeps explicit:** application overrides and any + architecture-specific target choice. +- **New API names:** `dep`, `Call`, `call_model`, `call_targets`, + `CallTargets`, `run_call!`, `sampled_environment`, and `publish`. diff --git a/docs/src/journeys/modelers/mutable_environment.md b/docs/src/journeys/modelers/mutable_environment.md new file mode 100644 index 000000000..1034f3c19 --- /dev/null +++ b/docs/src/journeys/modelers/mutable_environment.md @@ -0,0 +1,125 @@ +# Implement A Mutable Environment Controller + +**New concept:** accepted mutable environment state. A controller declares +which variables it may commit, evaluates typed trial states, and commits one +accepted state explicitly. + +Simulation users first encounter this workflow in +[Modify The Environment](@ref). Backend packages implement the separate +[Environment Backend Extensions](@ref) contract. + +The plain Julia blocks below are excerpts from the shipped, tested +`ToyEnvironmentControllerModel`. + +## Model 9: declare commit permission + +`ToyEnvironmentControllerModel` declares its reader hard dependency and the +environment variable it may commit: + +```julia +PlantSimEngine.dep(::ToyEnvironmentControllerModel) = ( + reader=Call(One(process=:toy_environment_reader)), +) +PlantSimEngine.environment_outputs_( + model::ToyEnvironmentControllerModel, +) = (T=zero(model.accepted_temperature),) +``` + +Its tested kernel keeps trial, commit, and accepted publication separate: + +```julia +trial_environment = (T=model.trial_temperature,) +trial_target = only(run_call!( + context, + :reader; + environment=trial_environment, + publish=false, +)) + +accepted_environment = (T=model.accepted_temperature,) +commit_environment!(context, accepted_environment) +accepted_target = only(run_call!( + context, + :reader; + environment=accepted_environment, + publish=true, +)) +``` + +`environment_outputs_` is commit permission, not object-status output. +PlantSimEngine validates that the accepted state provides every declared +variable before invoking the backend through the controller's compiled handle. + +## Compose the controller + +The reader needs only a provider. The controller additionally receives +`sink=:cells`; the backend defines what that sink means: + +```@example modeler_mutable_environment +using PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +environment = ToySpatialEnvironment( + Dict(:canopy => (T=20.0,)); + step_seconds=3600.0, +) +model = CompositeModel( + Object( + :leaf; + scale=:Leaf, + geometry=(cell=:canopy,), + ); + applications=( + ModelSpec( + ToyEnvironmentReaderModel(); + name=:reader, + on=One(scale=:Leaf), + environment=Environment(backend=environment), + ), + ModelSpec( + ToyEnvironmentControllerModel(30.0, 22.0); + name=:controller, + on=One(scale=:Leaf), + environment=Environment( + backend=environment, + sink=:cells, + ), + ), + ), +) + +( + call=DataFrame(Diagnostics.explain_calls(model)), + environment=DataFrame( + Diagnostics.explain_environment_bindings(model), + ), +) +``` + +```@example modeler_mutable_environment +simulation = run!(model; outputs=:all) +( + final=final_state(simulation), + committed=environment.cells[:canopy], + publications=filter( + row -> row.application_id == :reader, + DataFrame(Diagnostics.explain_outputs(simulation)), + ), +) +``` + +The rejected `T=30` trial mutates only the reader's trial status. The accepted +`T=22` state is committed once and produces the reader's only retained sample. +If the controller itself runs as an unpublished ancestor call, PlantSimEngine +also suppresses its descendant publications and environment writes. + +## Model-author recap + +- **You implemented:** declared commit variables, typed trial construction, + acceptance logic, explicit commit, and one accepted publication. +- **PlantSimEngine inferred:** permission validation, backend/handle routing, + nested trial suppression, and retained output history. +- **The scenario author keeps explicit:** provider, commit sink, concrete + backend, and any hard-call override. +- **New API names:** `environment_outputs_`, `commit_environment!`, + `Environment`, `environment`, and `publish`. diff --git a/docs/src/journeys/users/advanced_execution.md b/docs/src/journeys/users/advanced_execution.md new file mode 100644 index 000000000..b7db5eea3 --- /dev/null +++ b/docs/src/journeys/users/advanced_execution.md @@ -0,0 +1,219 @@ +# Control Advanced Execution + +## New concept: parent-controlled execution and explicit publication + +Most coupling should remain a value dependency through `inputs`. Use a hard +call only when a parent algorithm must decide whether, when, or how often +another model runs—for example, while iterating toward an accepted leaf +temperature. + +## Declare parent-controlled targets + +Start with one plant and two leaves. The reader application is selected by the +controller's `calls` declaration, so it is call-only rather than independently +scheduled: + +```@example journey_advanced_execution +using PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +environment = ToySpatialEnvironment( + Dict( + :sun => (T=26.0,), + :shade => (T=18.0,), + ); + step_seconds=3600.0, +) + +model = CompositeModel( + Object(:plant; scale=:Plant, kind=:plant), + Object( + :sun_leaf; + scale=:Leaf, + kind=:leaf, + parent=:plant, + geometry=(cell=:sun,), + ), + Object( + :shade_leaf; + scale=:Leaf, + kind=:leaf, + parent=:plant, + geometry=(cell=:shade,), + ); + applications=( + ModelSpec( + ToyEnvironmentReaderModel(); + name=:reader, + on=Many(scale=:Leaf), + environment=Environment(backend=environment), + ), + ModelSpec( + ToySelectiveCallControllerModel( + (28.0, 31.0), + 22.0; + selected_object=:sun_leaf, + ); + name=:controller, + on=One(scale=:Plant), + calls=( + :readers => Many( + scale=:Leaf, + within=Subtree(), + application=:reader, + ), + ), + ), + ), +) + +select( + DataFrame(Diagnostics.explain_calls(model)), + :application_id, + :call, + :callee_application_ids, + :callee_object_ids, + :publication_policy, +) +``` + +`run_call!(context, :readers)` executes every resolved target and returns a +vector-like `CallTargets` collection. `One` still returns a collection of one; +`OptionalOne` returns zero or one; `Many` returns zero or more. + +## Inspect, select, iterate, then publish once + +`ToySelectiveCallControllerModel` needs different treatment per target, so its +kernel first calls `call_targets(context, :readers)` without executing +anything. It records the total, restricts the same declared call to +`:sun_leaf`, runs two temperature trials, and accepts one result: + +```@example journey_advanced_execution +function run_selected_trials!( + target, + trial_temperatures, + accepted_temperature, +) + for temperature in trial_temperatures + run_call!( + target; + sampled_environment=(T=temperature,), + publish=false, + ) + end + run_call!( + target; + sampled_environment=(T=accepted_temperature,), + publish=true, + ) +end +``` + +`publish=false` is the default. Trials may update the called model's current +status for convergence checks, but they neither append output samples nor +commit mutable environment state. Publish exactly the accepted execution. + +```@example journey_advanced_execution +simulation = run!(model; outputs=:all) +( + controller=final_state(simulation, :plant), + leaves=final_state(simulation, Many(scale=:Leaf)), +) +``` + +The controller resolved two targets but selected only `:sun_leaf`. Object +selection uses `call_targets(context, name; objects=(ObjectId(:sun_leaf),))`; +it does not depend on iteration order. Two trials +left no history; its accepted call published once, while `:shade_leaf` was +never executed: + +```@example journey_advanced_execution +filter( + row -> row.application_id == :reader, + DataFrame(Diagnostics.explain_outputs(simulation)), +) +``` + +Use `run_call!(context, name; environment=trial_state)` when every target +should sample the same provider-aware trial state through its own compiled +handle. If the caller has already sampled the model-facing environment, use +`run_call!(context, name; sampled_environment=value)` to execute all targets +through cached typed batches. Use `call_targets` and +`run_call!(target; sampled_environment=...)` only for selection, custom order, +status inspection, or distinct already-sampled environments. For one target, +`call_model(context, name)` provides allocation-free access to its concrete +model when an algorithm must dispatch on model type or read its parameters. + +## Order intentional duplicate writers + +One canonical variable normally has one writer. Two applications that both +claim `stock` therefore fail compilation unless their relationship is +intentional and ordered. `Updates` makes that ownership explicit: + +```@example journey_advanced_execution +writer_model = CompositeModel( + Object(:reserve; scale=:Organ); + applications=( + ModelSpec( + ToyStockWriterModel(4); + name=:initial_stock, + on=One(scale=:Organ), + ), + ModelSpec( + ToyStockWriterModel(8); + name=:adjusted_stock, + on=One(scale=:Organ), + updates=Updates(:stock; after=:initial_stock), + ), + ModelSpec( + ToyStockWriterModel(99); + name=:alternative_stock, + on=One(scale=:Organ), + output_routing=(stock=:stream_only,), + ), + ), +) + +select( + DataFrame(Diagnostics.explain_writers(writer_model)), + :object_id, + :variable, + :application_ids, + :update_application_ids, + :update_after, +) +``` + +`initial_stock` owns the first canonical write and `adjusted_stock` explicitly +updates it afterward. The alternative value is useful as a retained comparison +but must not replace canonical status, so `output_routing` marks it +`:stream_only`. + +```@example journey_advanced_execution +writer_simulation = run!(writer_model; outputs=:all) +( + canonical_stock=final_state(writer_simulation).stock, + published=collect_outputs( + writer_simulation, + :reserve, + :stock; + sink=nothing, + ), +) +``` + +The canonical result is `8`; the three application-specific streams retain +`4`, `8`, and `99`. A stream-only output is not a fallback writer and is not +selected by an application-free `OutputRequest`; request its application +explicitly when retaining only selected outputs. + +## Page recap + +- **You added:** one declared hard call, selective trials, one accepted + publication, explicit update ordering, and one stream-only alternative. +- **PlantSimEngine inferred:** the call-only schedule, concrete targets, + canonical writer ownership, and update edge. +- **You keep explicit:** when each target runs, `publish`, per-target forcing, + intentional duplicate writers, and non-canonical streams. +- **New API names:** `calls`, `call_targets`, `run_call!`, `CallTargets`, + `Updates`, `output_routing`, and `:stream_only`. diff --git a/docs/src/journeys/users/cadences.md b/docs/src/journeys/users/cadences.md new file mode 100644 index 000000000..b5d0184fa --- /dev/null +++ b/docs/src/journeys/users/cadences.md @@ -0,0 +1,203 @@ +# Give Models Different Cadences + +## New concept: application clocks and temporal input policies + +Running a whole composite over many timesteps was introduced on the first +journey. This page changes one thing: applications no longer all run at the +environment base step. + +## Hold a daily state for an hourly model + +Reuse the thermal-time, LAI, and light chain. The environment advances hourly; +thermal time and LAI run daily; light interception runs hourly. `HoldLast` +makes each hourly light execution read the latest published daily LAI. + +```@example journey_cadences +using PlantSimEngine, Dates, DataFrames +using PlantSimEngine.Examples + +hourly_forcing = [ + (T=20.0, Ri_PAR_f=300.0, duration=Hour(1)) + for _ in 1:25 +] + +model = CompositeModel( + Object(:plant; scale=:Plant, kind=:plant); + applications=( + ModelSpec( + ToyDegreeDaysCumulModel(); + name=:degree_days, + on=One(scale=:Plant), + every=Day(1), + ), + ModelSpec( + ToyLAIModel(); + name=:lai, + on=One(scale=:Plant), + every=Day(1), + ), + ModelSpec( + Beer(0.6); + name=:light, + on=One(scale=:Plant), + inputs=( + :LAI => One( + within=Self(), + application=:lai, + var=:LAI, + policy=HoldLast(), + window=Day(1), + ), + ), + every=Hour(1), + ), + ), + environment=hourly_forcing, +) + +simulation = run!(model; steps=25, outputs=:all) +``` + +The schedule reports physical cadence in seconds and in base steps: + +```@example journey_cadences +select( + DataFrame(Diagnostics.explain_schedule(model)), + :application_id, + :dt_seconds, + :dt_steps, +) +``` + +The temporal binding is explicit even though the producer and consumer share +an object: + +```@example journey_cadences +select( + DataFrame(Diagnostics.explain_bindings(model)), + :application_id, + :input, + :policy, + :window, + :carrier_kind, +) +``` + +The daily applications publish at steps 1 and 25; the hourly application +publishes on all 25 steps: + +```@example journey_cadences +select( + DataFrame(Diagnostics.explain_outputs(simulation)), + :application_id, + :variable, + :nsamples, +) +``` + +`HoldLast` is appropriate because LAI is a state: between daily updates, its +latest value remains meaningful. + +## Integrate a rate into an amount + +`Integrate` has a different physical meaning. If a leaf publishes a constant +rate in units per second, integrating 24 hourly samples produces a daily +amount. The consumer below sums the independently integrated amounts from two +leaves. + +```@example journey_cadences +PlantSimEngine.@process "cadence_hourly_flux" verbose = false +PlantSimEngine.@process "cadence_daily_amount" verbose = false + +struct CadenceHourlyFlux <: AbstractCadence_Hourly_FluxModel end +struct CadenceDailyAmount <: AbstractCadence_Daily_AmountModel end + +PlantSimEngine.inputs_(::CadenceHourlyFlux) = (rate=Required(Real),) +PlantSimEngine.outputs_(::CadenceHourlyFlux) = (flux=0.0,) +PlantSimEngine.run!( + ::CadenceHourlyFlux, + status, + environment, + constants, + context, +) = (status.flux = status.rate) + +PlantSimEngine.inputs_(::CadenceDailyAmount) = ( + leaf_amounts=Required(AbstractVector{<:Real}), +) +PlantSimEngine.outputs_(::CadenceDailyAmount) = (amount=0.0,) +PlantSimEngine.run!( + ::CadenceDailyAmount, + status, + environment, + constants, + context, +) = (status.amount = sum(status.leaf_amounts)) +``` + +```@example journey_cadences +flux_model = CompositeModel( + Object(:plant; scale=:Plant), + Object( + :leaf_1; + scale=:Leaf, + parent=:plant, + status=Status(rate=1.0), + ), + Object( + :leaf_2; + scale=:Leaf, + parent=:plant, + status=Status(rate=2.0), + ); + applications=( + ModelSpec( + CadenceHourlyFlux(); + name=:hourly_flux, + on=Many(scale=:Leaf), + every=Hour(1), + ), + ModelSpec( + CadenceDailyAmount(); + name=:daily_amount, + on=One(scale=:Plant), + inputs=( + :leaf_amounts => Many( + scale=:Leaf, + within=Subtree(), + application=:hourly_flux, + var=:flux, + policy=Integrate(), + window=Day(1), + ), + ), + every=Day(1), + ), + ), + environment=[(duration=Hour(1),) for _ in 1:25], +) + +flux_simulation = run!(flux_model; steps=25) +final_state(flux_simulation, One(scale=:Plant)).amount +``` + +The result is `(1 + 2) × 24 × 3600 = 259200` rate-seconds. Use +`Aggregate(reducer)` instead when the desired quantity is a mean, minimum, +maximum, or another reduction of observations rather than a time integral. + +There is no same-step feedback cycle in either example, so +`PreviousTimeStep` is not needed. It should be introduced only when a real +scientific dependency intentionally reads the preceding step to break such a +cycle. + +## Page recap + +- **You added:** daily and hourly application clocks, `HoldLast` for a state, + and then `Integrate` for a rate. +- **PlantSimEngine inferred:** the base-step ratios, publication schedule, and + bounded temporal storage needed by the consumers. +- **You keep explicit:** each application cadence, the physical meaning of its + temporal policy, and the integration window. +- **New API names:** `every`, `HoldLast`, `Integrate`, `Aggregate`, + `window`, `Diagnostics.explain_schedule`, and + `Diagnostics.explain_outputs`. diff --git a/docs/src/journeys/users/environments.md b/docs/src/journeys/users/environments.md new file mode 100644 index 000000000..d3ab194d7 --- /dev/null +++ b/docs/src/journeys/users/environments.md @@ -0,0 +1,166 @@ +# Understand Environments + +## New concept: declared sampling from global and spatial sources + +The first simulation used a weather file as supplied forcing. This page now +makes that contract explicit. A model declares the names it reads from its +model-facing environment: + +```@example journey_environments +using PlantSimEngine, Dates, DataFrames +using PlantSimEngine.Examples + +( + degree_days=PlantSimEngine.environment_inputs_( + ToyDegreeDaysCumulModel(), + ), + light=PlantSimEngine.environment_inputs_(Beer(0.6)), +) +``` + +`ToyDegreeDaysCumulModel` reads `environment.T`; `Beer` reads +`environment.Ri_PAR_f`. These are not status inputs and are not outputs owned +by the target object. + +## Global sampling and source names + +The source does not need to use the model-facing names. Here a global provider +has `air_temperature` and `incident_par`; `Environment(...; sources=...)` +remaps them for the two model applications. + +```@example journey_environments +forcing = ( + air_temperature=20.0, + incident_par=300.0, + duration=Day(1), +) + +global_model = CompositeModel( + Object(:plant; scale=:Plant, kind=:plant); + applications=( + ModelSpec( + ToyDegreeDaysCumulModel(); + name=:degree_days, + on=One(scale=:Plant), + environment=Environment( + provider=:global, + sources=(T=:air_temperature,), + ), + ), + ModelSpec( + ToyLAIModel(); + name=:lai, + on=One(scale=:Plant), + ), + ModelSpec( + Beer(0.6); + name=:light, + on=One(scale=:Plant), + environment=Environment( + provider=:global, + sources=(Ri_PAR_f=:incident_par,), + ), + ), + ), + environment=forcing, +) + +validate_environment_inputs(global_model) +global_simulation = run!(global_model) +global_state = final_state(global_simulation) +(TT_cu=global_state.TT_cu, LAI=global_state.LAI, aPPFD=global_state.aPPFD) +``` + +The environment diagnostic distinguishes the variables seen by each model from +the actual source names: + +```@example journey_environments +select( + DataFrame(Diagnostics.explain_environment_bindings(global_model)), + :application_id, + :object_id, + :required_inputs, + :source_inputs, + :handle, +) +``` + +Global sampling has no spatial handle. The forcing above is intentionally +strict: apart from timeline `duration`, it exposes only the two remapped source +variables. Removing either source makes `validate_environment_inputs` fail +before simulation. + +## Spatial sampling + +Spatial backends keep the same model-facing declaration. They additionally +compile an opaque handle for each application/object target. The small +`ToySpatialEnvironment` example maps object geometry to either a sunny or +shaded cell: + +```@example journey_environments +spatial_environment = ToySpatialEnvironment( + Dict( + :sun => (Ri_PAR_f=400.0,), + :shade => (Ri_PAR_f=100.0,), + ); + step_seconds=3600.0, +) + +spatial_model = CompositeModel( + Object( + :sun_leaf; + scale=:Leaf, + kind=:leaf, + geometry=(cell=:sun,), + status=Status(LAI=2.0), + ), + Object( + :shade_leaf; + scale=:Leaf, + kind=:leaf, + geometry=(cell=:shade,), + status=Status(LAI=2.0), + ); + applications=( + ModelSpec( + Beer(0.6); + name=:light, + on=Many(scale=:Leaf), + environment=Environment(backend=spatial_environment), + ), + ), +) + +spatial_simulation = run!(spatial_model) +spatial_states = final_state(spatial_simulation, Many(scale=:Leaf)) +Dict(id => state.aPPFD for (id, state) in spatial_states) +``` + +The one `Many` application retains two distinct compiled handles: + +```@example journey_environments +select( + DataFrame(Diagnostics.explain_environment_bindings(spatial_model)), + :application_id, + :object_id, + :geometry_source, + :handle, +) +``` + +The scientific `Beer` kernel is unchanged. It sees only +`environment.Ri_PAR_f`; the backend owns the meaning of each handle. Backend +authors can inspect the implementation of `ToySpatialEnvironment` in the +environment extension reference. + +## Page recap + +- **You added:** explicit environment declarations, global source remapping, + and then a spatial backend with object geometry. +- **PlantSimEngine inferred:** global sampling, validation of required source + names, and one cached spatial handle per application/object target. +- **You keep explicit:** model-facing environment names, scenario source + remaps, provider/backend choice, and geometry used by a spatial backend. +- **New API names:** `environment_inputs_`, `Environment`, + `validate_environment_inputs`, `ToySpatialEnvironment`, and + `Diagnostics.explain_environment_bindings`. diff --git a/docs/src/journeys/users/maespa_synthesis.md b/docs/src/journeys/users/maespa_synthesis.md new file mode 100644 index 000000000..3b298f3a1 --- /dev/null +++ b/docs/src/journeys/users/maespa_synthesis.md @@ -0,0 +1,242 @@ +# MAESPA-Style Synthesis + +## New concept: synthesis without another runtime mechanism + +This page is an integrated reference, not an onboarding example. It combines +the ideas developed independently in the earlier journeys into a small +MAESPA-style stand: two species, five leaves, hourly canopy and soil exchange, +daily allocation and LAI, iterative leaf calls, and accepted mutable canopy +air. + +If any individual mechanism is unfamiliar, follow its focused link in +[How the pieces compose](@ref) before reading the implementation. + +## Run the reference case + +The complete, tested source lives in +`examples/maespa_model_example.jl`. Run 25 hours so both hourly and daily +applications cross a day boundary: + +```@example journey_maespa_synthesis +using PlantSimEngine, DataFrames + +include(joinpath( + pkgdir(PlantSimEngine), + "examples", + "maespa_model_example.jl", +)) + +result = run_maespa_example(; nhours=25, check=true) +simulation = result.simulation +model = result.model +nothing +``` + +The model contains one scene, one soil object, and two template instances with +different species parameters and leaf counts: + +```@example journey_maespa_synthesis +( + instances=DataFrame(Diagnostics.explain_instances(model)), + plants=length(model_objects(model; scale=:Plant)), + leaves=length(model_objects(model; scale=:Leaf)), + species_A=length(model_objects(model; scale=:Leaf, species=:A)), + species_B=length(model_objects(model; scale=:Leaf, species=:B)), +) +``` + +## Inspect the compiled architecture + +The execution schedule makes the two cadences and parent-controlled +applications visible. Leaf energy balance and soil water are call-only under +the scene controller; allocation and LAI run daily: + +```@example journey_maespa_synthesis +schedule = DataFrame(Diagnostics.explain_schedule(result.compiled)) +select( + filter( + row -> row.application_id in ( + :scene_eb, + :soil_water, + :lai_dynamic, + :plant_A__energy_balance, + :plant_A__allocation, + :plant_B__allocation, + ), + schedule, + ), + :application_id, + :root_scheduled, + :manual_call_only, + :dt_steps, +) +``` + +The scene energy-balance application resolves all five leaves through one +`Many` hard call and the soil through one `One` hard call: + +```@example journey_maespa_synthesis +calls = DataFrame(Diagnostics.explain_calls(result.compiled)) +select( + filter(row -> row.application_id == :scene_eb, calls), + :call, + :callee_application_ids, + :callee_object_ids, + :publication_policy, +) +``` + +Each plant allocation application receives a live vector of only its own +descendant leaves. The scene receives stand-wide vectors and one scalar soil +potential: + +```@example journey_maespa_synthesis +bindings = DataFrame(Diagnostics.explain_bindings(result.compiled)) +select( + filter( + row -> ( + row.application_id in ( + :plant_A__allocation, + :plant_B__allocation, + ) && row.input == :leaf_carbon + ) || ( + row.application_id == :scene_eb && + row.input in (:leaf_areas, :psi_soil) + ), + bindings, + ), + :application_id, + :input, + :source_ids, + :carrier_kind, + :copy_semantics, +) +``` + +## Follow trial canopy air to its accepted state + +The scene controller reads above-canopy `:forcing`, iterates leaf models +against typed trial canopy air with `publish=false`, commits the converged +state to `sink=:canopy`, and then publishes one accepted leaf execution. Leaf +applications read the committed `:canopy` provider. Those routes are compiled +into opaque handles: + +```@example journey_maespa_synthesis +environment_bindings = DataFrame( + Diagnostics.explain_environment_bindings(result.environment), +) +select( + filter( + row -> row.application_id in ( + :scene_eb, + :plant_A__energy_balance, + :plant_B__energy_balance, + ), + environment_bindings, + ), + :application_id, + :object_id, + :handle, + :required_inputs, + :produced_outputs, +) +``` + +`MaespaSingleLayerEnvironment` is intentionally a one-layer canopy backend. +Its handle still separates forcing, canopy, and commit-sink routes per +application/object. A voxel or multilayer backend can replace it without +changing the model-facing environment contract; the two-cell proof is in +[Modify The Environment](@ref), and backend implementation belongs in +[Environment Backend Extensions](@ref). + +## Check the scientific handoffs + +The final snapshots expose canonical state independently of retained history: + +```@example journey_maespa_synthesis +scene = final_state(simulation, :model) +soil = final_state(simulation, :soil) +plants = final_state(simulation, Many(scale=:Plant)) + +( + lai=scene.lai, + canopy_temperature=scene.canopy_tair, + transpiration=scene.scene_transpiration, + soil_water_potential=soil.psi_soil, + daily_growth=Dict( + id => state.daily_growth + for (id, state) in plants + ), +) +``` + +Retained output counts confirm the cadence boundary: hourly scene and leaf +variables have 25 samples, while daily LAI and allocation variables have two: + +```@example journey_maespa_synthesis +output_summary = DataFrame(Diagnostics.explain_outputs(simulation)) +select( + filter( + row -> ( + row.object_id == :model && + row.variable in (:scene_transpiration, :lai) + ) || ( + row.object_id in (:plant_A, :plant_B) && + row.variable == :daily_growth + ) || ( + row.object_id == :plant_A_leaf_1 && + row.variable == :λE + ), + output_summary, + ), + :application_id, + :object_id, + :variable, + :nsamples, +) +``` + +## How the pieces compose + +| Construct in this synthesis | Role here | Focused journey | +|---|---|---| +| `CompositeModelTemplate` and two `ObjectInstance`s | Reuse one species-specific application set across several plants | [Instantiate Several Plants](@ref) | +| Scene, plant, internode, leaf, and soil objects | Represent one registry without prescribing plant architecture | [Build One Multiscale Plant](@ref) | +| Scalar and `Many` live-reference bindings | Couple soil-to-scene and leaf-to-plant/scene values | [Build One Multiscale Plant](@ref) | +| Hourly and daily applications with `HoldLast` | Keep canopy exchange and allocation on scientific cadences | [Give Models Different Cadences](@ref) | +| Forcing and canopy providers with compiled handles | Sample global forcing and committed canopy state through one contract | [Understand Environments](@ref) | +| Typed trials and explicit accepted commit | Iterate canopy air without publishing rejected states | [Modify The Environment](@ref) | +| Nested hard calls and accepted publication | Let scene energy balance control leaf and soil execution | [Control Advanced Execution](@ref) | +| `Simulation`, final state, and retained streams | Separate current canonical state from requested history | [Couple Models On One Object](@ref) | + +This 25-hour reference keeps plant topology fixed because organogenesis is not +part of its scientific question. A growth model can add, reparent, or remove +organs through the same registry and refresh machinery; that independent +lifecycle is demonstrated in [Modify Plant Structure](@ref). Keeping it out of +this synthesis prevents canopy iteration, daily allocation, and topology +mutation from becoming one inseparable example. + +## Reference invariants + +The automated example test verifies the important handoffs rather than exact +floating-point trajectories: + +- the stand contains two isolated instances and five correctly routed leaves; +- plant allocation vectors contain only descendant leaves; +- the scene call resolves every leaf and the shared soil application; +- hourly and daily output counts match their cadences; +- accepted canopy air is committed separately from above-canopy forcing; +- leaf fluxes are finite and aggregate consistently at scene scale; +- both species grow, while their parameterized allocations remain distinct. + +## Page recap + +- **You added:** no new primitive; you assembled the earlier topology, + cadence, hard-call, environment, and output mechanisms into one stand. +- **PlantSimEngine inferred:** application order, plant-local bindings, + concrete call targets, environment handles, and the hourly/daily schedule. +- **You keep explicit:** species parameters, topology, scientific iteration, + accepted state, output requests, and the invariants used to validate the + result. +- **New API names:** none. Every API in this synthesis was introduced on a + focused earlier journey. diff --git a/docs/src/journeys/users/mental_model.md b/docs/src/journeys/users/mental_model.md new file mode 100644 index 000000000..ffec0a6b2 --- /dev/null +++ b/docs/src/journeys/users/mental_model.md @@ -0,0 +1,55 @@ +# A Mental Model For PlantSimEngine + +## New concept: composition + +PlantSimEngine is a framework for composing and running scientific models. It +does not prescribe a plant architecture, and it is not itself a library of +crop, tree, or organ equations. Model packages provide those equations; +PlantSimEngine connects them to simulated entities, orders their execution, and +manages time, environments, and retained results. + +Seven ideas are enough to read a PlantSimEngine simulation: + +| Idea | Meaning | +|:--|:--| +| **Process** | A scientific responsibility, such as thermal time or light interception | +| **Model** | One reusable implementation of a process | +| **Application** | One configured use of a model in a simulation | +| **Object** | A simulated entity with stable identity, such as a scene, plant, leaf, or soil layer | +| **Status** | The current values owned by an object | +| **Environment** | Values sampled from outside object status, such as weather or microclimate | +| **Simulation** | A running timeline, including the live model, current step, and any retained output streams | + +The distinction between a model and an application is important. A model +author writes an equation once. A simulation author can then apply it to one +whole plant, every leaf, selected soil layers, or several named groups without +putting an object loop inside the equation. + +Objects are equally general. Scales and parent/child links describe the +topology chosen by the simulation author; PlantSimEngine does not require a +particular hierarchy. A simple simulation can have one object. A detailed one +can have scenes, several plants, organs, voxels, and shared resources. + +Values reach a model in two ways: + +- status inputs come from the target object or from outputs of other model + applications; +- environment inputs are sampled from the environment selected for that + application and object. + +Before running, PlantSimEngine compiles applications into concrete +application/object targets, resolves value connections, and determines a valid +execution order. During the timestep loop, model kernels work with their own +parameters, the resolved status view, the sampled environment, constants, and +a runtime context. + +## Page recap + +- **You added:** no configuration yet—only the vocabulary used by every later + journey. +- **PlantSimEngine infers:** application order and unambiguous value + connections once a simulation is assembled. +- **You keep explicit:** scientific equations, object topology, ambiguous + cross-object connections, time policies, and requested output history. +- **New API names:** none yet. The next page introduces `CompositeModel`, + `run!`, `Simulation`, `final_state`, and `collect_outputs`. diff --git a/docs/src/journeys/users/mutable_environments.md b/docs/src/journeys/users/mutable_environments.md new file mode 100644 index 000000000..6840a6214 --- /dev/null +++ b/docs/src/journeys/users/mutable_environments.md @@ -0,0 +1,181 @@ +# Modify The Environment + +## New concept: trial state versus accepted state + +The previous environment journey sampled read-only global and spatial values. +Now a controller evaluates one typed trial state, accepts a different state, +and commits it explicitly. + +Start with one cell. `ToyEnvironmentReaderModel` declares `T` as an environment +input. The controller declares `T` as an environment output: this is permission +to commit that variable, not an ordinary object-status output. + +```@example journey_mutable_environment +using PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +( + reader_inputs=PlantSimEngine.environment_inputs_( + ToyEnvironmentReaderModel(), + ), + controller_commit_permissions=PlantSimEngine.environment_outputs_( + ToyEnvironmentControllerModel(30.0, 22.0), + ), +) +``` + +The controller's kernel uses the current typed trial-state path. A trial call +changes the callee status for inspection but does not publish output history or +commit backend state: + +```@example journey_mutable_environment +function run_trial!(context, trial_environment) + return only(run_call!( + context, + :reader; + environment=trial_environment, + publish=false, + )) +end +``` + +Accepted state is explicit and separate: + +```@example journey_mutable_environment +function commit_and_publish!(context, accepted_environment) + commit_environment!(context, accepted_environment) + return only(run_call!( + context, + :reader; + environment=accepted_environment, + publish=true, + )) +end +``` + +`ToyEnvironmentControllerModel` applies those two operations in its kernel. +Configure the reader as its one hard-call target and give only the controller a +commit sink: + +```@example journey_mutable_environment +environment = ToySpatialEnvironment( + Dict(:canopy => (T=20.0,)); + step_seconds=3600.0, +) + +model = CompositeModel( + Object( + :leaf; + scale=:Leaf, + kind=:leaf, + geometry=(cell=:canopy,), + ); + applications=( + ModelSpec( + ToyEnvironmentReaderModel(); + name=:reader, + on=One(scale=:Leaf), + environment=Environment(backend=environment), + ), + ModelSpec( + ToyEnvironmentControllerModel(30.0, 22.0); + name=:controller, + on=One(scale=:Leaf), + calls=( + :reader => One( + scale=:Leaf, + application=:reader, + ), + ), + environment=Environment( + backend=environment, + sink=:cells, + ), + ), + ), +) + +simulation = run!(model; outputs=:all) +state = final_state(simulation) +( + trial_seen=state.trial_temperature_seen, + accepted_seen=state.accepted_temperature_seen, + committed=environment.cells[:canopy].T, +) +``` + +The trial was `30`, but the accepted and committed temperature is `22`. +Only the accepted reader call published: + +```@example journey_mutable_environment +select( + DataFrame(Diagnostics.explain_outputs(simulation)), + :application_id, + :variable, + :nsamples, +) +``` + +## Preserve distinct handles under `Many` + +Extend the same backend to two spatial cells. One `Many` application samples +both, while each target retains its own compiled handle: + +```@example journey_mutable_environment +spatial_environment = ToySpatialEnvironment( + Dict( + :sun => (T=26.0,), + :shade => (T=18.0,), + ); + step_seconds=3600.0, +) + +spatial_model = CompositeModel( + Object( + :sun_leaf; + scale=:Leaf, + geometry=(cell=:sun,), + ), + Object( + :shade_leaf; + scale=:Leaf, + geometry=(cell=:shade,), + ); + applications=( + ModelSpec( + ToyEnvironmentReaderModel(); + name=:temperature, + on=Many(scale=:Leaf), + environment=Environment(backend=spatial_environment), + ), + ), +) + +spatial_simulation = run!(spatial_model) +spatial_states = final_state(spatial_simulation, Many(scale=:Leaf)) +Dict(id => state.temperature_seen for (id, state) in spatial_states) +``` + +```@example journey_mutable_environment +select( + DataFrame(Diagnostics.explain_environment_bindings(spatial_model)), + :object_id, + :handle, +) +``` + +This ordinary user page does not require the backend implementation protocol. +Framework builders can follow [Environment Backend Extensions](@ref); the +complete MAESPA-style synthesis later combines mutable microclimate, several +plants, and iterative leaf calls. + +## Page recap + +- **You added:** one typed trial, one explicit accepted commit, one accepted + publication, and then two spatial cells. +- **PlantSimEngine inferred:** the reader call target, publication boundary, + commit permission check, and distinct `Many` handles. +- **You keep explicit:** trial and acceptance logic, `publish`, the committed + variables, controller sink, and backend state type. +- **New API names:** `environment_outputs_`, `run_call!`, + `commit_environment!`, `publish`, and `calls`. diff --git a/docs/src/journeys/users/one_object.md b/docs/src/journeys/users/one_object.md new file mode 100644 index 000000000..25091a6fe --- /dev/null +++ b/docs/src/journeys/users/one_object.md @@ -0,0 +1,96 @@ +# Couple Models On One Object + +## New concept: automatic same-object coupling over time + +This first executable simulation couples three existing models on one object: + +1. `ToyDegreeDaysCumulModel` reads temperature and accumulates thermal time. +2. `ToyLAIModel` reads cumulative thermal time and computes LAI. +3. `Beer` reads LAI and radiation and computes absorbed PAR. + +The weather file is supplied forcing data for now. Environments get their own +journey later. + +```@example journey_one_object +using PlantSimEngine, PlantMeteo, Dates, DataFrames +using PlantSimEngine.Examples + +weather = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Day, +) + +model = CompositeModel( + ToyDegreeDaysCumulModel(), + ToyLAIModel(), + Beer(0.6); + environment=weather, +) +``` + +No `ModelSpec` or selector is needed when all models run on the one object made +by the concise constructor. Run thirty daily steps and retain the model +outputs: + +```@example journey_one_object +simulation = run!(model; steps=30, outputs=:all) +results = collect_outputs(simulation) + +thermal_time = results[results.variable .== :TT_cu, :value] +lai = results[results.variable .== :LAI, :value] +evolution = DataFrame( + step=1:length(thermal_time), + TT_cu=thermal_time, + LAI=lai, +) +vcat(first(evolution, 3), last(evolution, 3)) +``` + +The table is retained history. The latest values are also available directly, +whether or not history was requested: + +```@example journey_one_object +state_at_day_30 = final_state(simulation) +( + current_step=current_step(simulation), + TT_cu=state_at_day_30.TT_cu, + LAI=state_at_day_30.LAI, + aPPFD=state_at_day_30.aPPFD, + retained_streams=length(outputs(simulation)), +) +``` + +PlantSimEngine inferred both status connections because each has one +unambiguous producer on the same object. This focused diagnostic shows the +resolved sources and the live reference carriers: + +```@example journey_one_object +select( + DataFrame(Diagnostics.explain_bindings(model)), + :application_id, + :input, + :source_application_ids, + :carrier_kind, +) +``` + +A `Simulation` owns a continuing timeline. Advancing it does not rebuild a +separate result object: + +```@example journey_one_object +step!(simulation) +state_at_day_31 = final_state(simulation) +(current_step=current_step(simulation), TT_cu=state_at_day_31.TT_cu) +``` + +## Page recap + +- **You added:** three models, supplied weather, a 30-step run, and retained + outputs. +- **PlantSimEngine inferred:** the one object, three applications, their + execution order, and the `TT_cu` and `LAI` connections. +- **You keep explicit:** model parameters, forcing data, number of steps, and + whether output history is retained. +- **New API names:** `CompositeModel`, `run!`, `Simulation`, `final_state`, + `collect_outputs`, `outputs`, `current_step`, `step!`, and + `Diagnostics.explain_bindings`. diff --git a/docs/src/journeys/users/one_plant.md b/docs/src/journeys/users/one_plant.md new file mode 100644 index 000000000..cbb13eae8 --- /dev/null +++ b/docs/src/journeys/users/one_plant.md @@ -0,0 +1,200 @@ +# Build One Multiscale Plant + +## New concept: topology and cross-object values + +The previous journey used independent objects at one scale. A multiscale plant +adds parent/child topology: one plant object owns two leaf objects. + +The scope picture for this page is: + +> `:plant` — `Subtree()` from here contains `:plant`, `:leaf_1`, and `:leaf_2`
+> ├─ `:leaf_1` — `Self()` is `:leaf_1`; `SelfPlant()` resolves to `:plant`
+> └─ `:leaf_2` — `Self()` is `:leaf_2`; `SelfPlant()` resolves to `:plant` + +Selectors still filter that scope. For example, +`Many(scale=:Leaf, within=Subtree())` selects the two leaves when evaluated for +the plant application. + +## First pass: one scalar value from plant to leaves + +Start with leaf surfaces and total plant surface supplied as status. The only +new value connection sends the plant-level absorbed light to each leaf. + +```@example journey_one_plant +using PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +objects = ( + Object( + :plant; + scale=:Plant, + kind=:plant, + status=Status(aPPFD=120.0, surface=3.0), + ), + Object( + :leaf_1; + scale=:Leaf, + kind=:leaf, + parent=:plant, + status=Status(surface=1.0), + ), + Object( + :leaf_2; + scale=:Leaf, + kind=:leaf, + parent=:plant, + status=Status(surface=2.0), + ), +) + +scalar_model = CompositeModel( + objects...; + applications=( + ModelSpec( + ToyLightPartitioningModel(); + name=:leaf_light, + on=Many(scale=:Leaf), + inputs=( + :aPPFD_larger_scale => One( + scale=:Plant, + within=SelfPlant(), + var=:aPPFD, + ), + :total_surface => One( + scale=:Plant, + within=SelfPlant(), + var=:surface, + ), + ), + ), + ), +) + +scalar_simulation = run!(scalar_model; outputs=:all) +scalar_states = final_state(scalar_simulation, Many(scale=:Leaf)) +Dict(id => state.aPPFD for (id, state) in scalar_states) +``` + +The leaf model reads its own `surface` directly from each leaf status. +`SelfPlant()` makes the other two scalar sources plant-local: + +```@example journey_one_plant +select( + DataFrame(Diagnostics.explain_bindings(scalar_model)), + :consumer_id, + :input, + :source_ids, + :carrier_kind, +) +``` + +## Second pass: compute and aggregate leaf surfaces + +Now replace the supplied surfaces with two existing models: + +- `ToyLeafSurfaceModel` computes each leaf surface from its carbon biomass; +- `ToyPlantLeafSurfaceModel` sums those leaf surfaces on the plant. + +This is the first vector-like cross-object input. It comes after the scalar +connection above, and differs only in the new `:leaf_surfaces` binding. + +```@example journey_one_plant +computed_objects = ( + Object( + :plant; + scale=:Plant, + kind=:plant, + status=Status(aPPFD=120.0), + ), + Object( + :leaf_1; + scale=:Leaf, + kind=:leaf, + parent=:plant, + status=Status(carbon_biomass=50.0), + ), + Object( + :leaf_2; + scale=:Leaf, + kind=:leaf, + parent=:plant, + status=Status(carbon_biomass=100.0), + ), +) + +computed_model = CompositeModel( + computed_objects...; + applications=( + ModelSpec( + ToyLeafSurfaceModel(0.02); + name=:leaf_surface, + on=Many(scale=:Leaf), + ), + ModelSpec( + ToyPlantLeafSurfaceModel(); + name=:plant_surface, + on=One(scale=:Plant), + inputs=( + :leaf_surfaces => Many( + scale=:Leaf, + within=Subtree(), + application=:leaf_surface, + var=:surface, + ), + ), + ), + ModelSpec( + ToyLightPartitioningModel(); + name=:leaf_light, + on=Many(scale=:Leaf), + inputs=( + :aPPFD_larger_scale => One( + scale=:Plant, + within=SelfPlant(), + var=:aPPFD, + ), + :total_surface => One( + scale=:Plant, + within=SelfPlant(), + application=:plant_surface, + var=:surface, + ), + ), + ), + ), +) + +computed_simulation = run!(computed_model; outputs=:all) +plant_state = final_state(computed_simulation, One(scale=:Plant)) +leaf_states = final_state(computed_simulation, Many(scale=:Leaf)) +( + plant_surface=plant_state.surface, + leaf_surfaces=Dict(id => state.surface for (id, state) in leaf_states), + leaf_light=Dict(id => state.aPPFD for (id, state) in leaf_states), +) +``` + +The plant aggregation uses a live `RefVector`; the scalar connections remain +single references: + +```@example journey_one_plant +select( + DataFrame(Diagnostics.explain_bindings(computed_model)), + :application_id, + :consumer_id, + :input, + :source_ids, + :carrier_kind, +) +``` + +## Page recap + +- **You added:** parent/child topology, plant-to-leaf scalar connections, and + one plant-local vector aggregation. +- **PlantSimEngine inferred:** same-leaf `surface` coupling, application order, + and live scalar/vector reference carriers. +- **You keep explicit:** object parentage, the scope of cross-object searches, + and the source application when selecting a produced value. +- **New API names:** `parent`, `Self`, `SelfPlant`, `Subtree`, and the + `application` and `var` selector fields. diff --git a/docs/src/journeys/users/several_objects.md b/docs/src/journeys/users/several_objects.md new file mode 100644 index 000000000..19fba3432 --- /dev/null +++ b/docs/src/journeys/users/several_objects.md @@ -0,0 +1,102 @@ +# Run The Coupling On Several Objects + +## New concept: stable object identity and `Many` + +The previous page ran one model chain on one automatically created object. The +smallest extension is to create two same-scale objects and target both with one +reusable `Many` selector. + +```@example journey_several_objects +using PlantSimEngine, PlantMeteo, Dates, DataFrames +using PlantSimEngine.Examples + +weather = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Day, +) + +plants = ( + Object( + :plant_a; + scale=:Plant, + kind=:plant, + status=Status(TT_cu=0.0), + ), + Object( + :plant_b; + scale=:Plant, + kind=:plant, + status=Status(TT_cu=200.0), + ), +) +plant_targets = Many(scale=:Plant) + +model = CompositeModel( + plants...; + applications=( + ModelSpec( + ToyDegreeDaysCumulModel(); + name=:degree_days, + on=plant_targets, + ), + ModelSpec(ToyLAIModel(); name=:lai, on=plant_targets), + ModelSpec(Beer(0.6); name=:light, on=plant_targets), + ), + environment=weather, +) +``` + +`:plant_a` and `:plant_b` are stable object identities. Their initial +cumulative thermal times differ, but the same three model kernels execute for +both. The model implementations contain no loop over plants. + +The application diagnostic confirms that each application compiled to both +objects: + +```@example journey_several_objects +select( + DataFrame(Diagnostics.explain_applications(model)), + :application_id, + :target_ids, +) +``` + +Run five steps and inspect each independent final status: + +```@example journey_several_objects +simulation = run!(model; steps=5, outputs=:all) +states = final_state(simulation, Many(scale=:Plant)) +Dict( + id => (TT_cu=state.TT_cu, LAI=state.LAI, aPPFD=state.aPPFD) + for (id, state) in states +) +``` + +Retained streams are keyed by application, object, and variable, so the two +objects do not overwrite one another: + +```@example journey_several_objects +rows = collect_outputs(simulation) +lai_rows = rows[rows.variable .== :LAI, [ + :timestep, + :application_id, + :object_id, + :value, +]] +first(lai_rows, 6) +``` + +This remains a same-scale simulation. Parent/child topology and cross-object +value selection are introduced on the next journey, after independent object +execution is established. + +## Page recap + +- **You added:** two explicit `Object`s, stable ids, one shared `Many` selector, + and named `ModelSpec` applications. +- **PlantSimEngine inferred:** two targets per application plus independent + same-object `TT_cu` and `LAI` connections for each plant. +- **You keep explicit:** which objects exist, their initial status, application + names, and the selector describing the target set. +- **New API names:** `Object`, `Status`, `ModelSpec`, `Many`, and + `Diagnostics.explain_applications`. diff --git a/docs/src/journeys/users/several_plants.md b/docs/src/journeys/users/several_plants.md new file mode 100644 index 000000000..a468532c1 --- /dev/null +++ b/docs/src/journeys/users/several_plants.md @@ -0,0 +1,204 @@ +# Instantiate Several Plants + +## New concept: templates, instances, and overrides + +The previous journey configured one plant explicitly. Its three applications +can become a `CompositeModelTemplate`, then be mounted on several independent +object topologies without duplicating that model configuration. + +```@example journey_several_plants +using PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +plant_template = CompositeModelTemplate(( + ModelSpec( + ToyLeafSurfaceModel(0.02); + name=:leaf_surface, + on=Many(scale=:Leaf), + ), + ModelSpec( + ToyPlantLeafSurfaceModel(); + name=:plant_surface, + on=One(scale=:Plant), + inputs=( + :leaf_surfaces => Many( + scale=:Leaf, + within=Subtree(), + application=:leaf_surface, + var=:surface, + ), + ), + ), + ModelSpec( + ToyLightPartitioningModel(); + name=:leaf_light, + on=Many(scale=:Leaf), + inputs=( + :aPPFD_larger_scale => One( + scale=:Plant, + within=SelfPlant(), + var=:aPPFD, + ), + :total_surface => One( + scale=:Plant, + within=SelfPlant(), + application=:plant_surface, + var=:surface, + ), + ), + ), +)) +``` + +An `ObjectInstance` supplies the concrete root and organs. These two instances +reuse the same template while keeping different initial plant radiation and +leaf biomasses: + +```@example journey_several_plants +plant_a = ObjectInstance( + :plant_a, + plant_template; + root=Object( + :plant_a_root; + scale=:Plant, + kind=:plant, + status=Status(aPPFD=120.0), + ), + objects=( + Object( + :plant_a_leaf_1; + scale=:Leaf, + kind=:leaf, + parent=:plant_a_root, + status=Status(carbon_biomass=50.0), + ), + Object( + :plant_a_leaf_2; + scale=:Leaf, + kind=:leaf, + parent=:plant_a_root, + status=Status(carbon_biomass=100.0), + ), + ), +) + +plant_b = ObjectInstance( + :plant_b, + plant_template; + root=Object( + :plant_b_root; + scale=:Plant, + kind=:plant, + status=Status(aPPFD=200.0), + ), + objects=( + Object( + :plant_b_leaf_1; + scale=:Leaf, + kind=:leaf, + parent=:plant_b_root, + status=Status(carbon_biomass=50.0), + ), + Object( + :plant_b_leaf_2; + scale=:Leaf, + kind=:leaf, + parent=:plant_b_root, + status=Status(carbon_biomass=50.0), + ), + ), +) + +model = CompositeModel(plant_a, plant_b) +simulation = run!(model; outputs=:all) +plant_states = final_state(simulation, Many(scale=:Plant)) +Dict(id => (surface=state.surface, aPPFD=state.aPPFD) for (id, state) in plant_states) +``` + +Plant A aggregates surfaces `1 + 2 = 3`; plant B aggregates `1 + 1 = 2`. +Those totals prove that `Subtree()` did not mix leaves between instances. +Likewise, each pair of leaf-level light outputs sums to its own plant's +supplied light: + +```@example journey_several_plants +leaf_states = final_state(simulation, Many(scale=:Leaf)) +( + plant_a_light=sum( + leaf_states[id].aPPFD + for id in (:plant_a_leaf_1, :plant_a_leaf_2) + ), + plant_b_light=sum( + leaf_states[id].aPPFD + for id in (:plant_b_leaf_1, :plant_b_leaf_2) + ), +) +``` + +The instance diagnostic shows the mounted object and application ids. Template +application names are prefixed automatically, so the two mounted graphs remain +unambiguous: + +```@example journey_several_plants +select( + DataFrame(Diagnostics.explain_instances(model)), + :name, + :root_id, + :object_ids, + :application_ids, +) +``` + +## Override one instance + +Only after the two unchanged instances work, override one application for a +new instance. This plant uses a larger specific leaf area while retaining the +same logical `:leaf_surface` application and all other template wiring: + +```@example journey_several_plants +plant_c = ObjectInstance( + :plant_c, + plant_template; + root=Object( + :plant_c_root; + scale=:Plant, + kind=:plant, + status=Status(aPPFD=120.0), + ), + objects=( + Object( + :plant_c_leaf_1; + scale=:Leaf, + kind=:leaf, + parent=:plant_c_root, + status=Status(carbon_biomass=50.0), + ), + Object( + :plant_c_leaf_2; + scale=:Leaf, + kind=:leaf, + parent=:plant_c_root, + status=Status(carbon_biomass=100.0), + ), + ), + overrides=(leaf_surface=ToyLeafSurfaceModel(0.04),), +) + +override_simulation = run!(CompositeModel(plant_c)) +override_state = final_state(override_simulation, One(scale=:Plant)) +override_state.surface +``` + +There is no `SceneScope()` in this example because nothing is deliberately +shared between plants. Introduce scene-wide scope only when adding a real +shared source, such as a soil object or scene-level forcing controller. + +## Page recap + +- **You added:** one reusable `CompositeModelTemplate`, two independent + `ObjectInstance`s, and then one application override. +- **PlantSimEngine inferred:** instance-local selector scopes, prefixed mounted + application ids, and the same compiled coupling graph for each plant. +- **You keep explicit:** each instance's objects and initial values, plus the + exact application replaced by an override. +- **New API names:** `CompositeModelTemplate`, `ObjectInstance`, `overrides`, + and `Diagnostics.explain_instances`. diff --git a/docs/src/journeys/users/structure_changes.md b/docs/src/journeys/users/structure_changes.md new file mode 100644 index 000000000..f745b2b8c --- /dev/null +++ b/docs/src/journeys/users/structure_changes.md @@ -0,0 +1,209 @@ +# Modify Plant Structure + +## New concept: lifecycle changes refresh compiled targets + +Start with one plant, one branch, and two leaves. Each leaf computes carbon +demand, then treats that fully met demand as accepted carbon allocation for +`ToyCBiomassModel`. This small chain gives us a conserved quantity to check +while topology changes. + +```@example journey_structure +using PlantSimEngine, DataFrames +using PlantSimEngine.Examples + +model = CompositeModel( + Object(:plant; scale=:Plant, kind=:plant), + Object(:branch; scale=:Axis, kind=:axis, parent=:plant), + Object( + :leaf_1; + scale=:Leaf, + kind=:leaf, + parent=:plant, + status=Status(TT=10.0), + ), + Object( + :leaf_2; + scale=:Leaf, + kind=:leaf, + parent=:plant, + status=Status(TT=15.0), + ); + applications=( + ModelSpec( + ToyCDemandModel( + optimal_biomass=12.0, + development_duration=120.0, + ); + name=:carbon_demand, + on=Many(scale=:Leaf), + ), + ModelSpec( + ToyCBiomassModel(1.2); + name=:biomass, + on=Many(scale=:Leaf), + inputs=( + :carbon_allocation => One( + within=Self(), + application=:carbon_demand, + var=:carbon_demand, + ), + ), + ), + ), +) + +simulation = run!(model; outputs=:all) +initial_targets = only( + row for row in Diagnostics.explain_applications(simulation) + if row.application_id == :biomass +).target_ids +``` + +## Add one leaf + +Registering an object mutates the live model and marks affected compiled state +dirty. Because this call happens between simulation steps, the new leaf is +compiled before the next step: + +```@example journey_structure +register_object!( + model, + Object( + :leaf_3; + scale=:Leaf, + kind=:leaf, + status=Status(TT=20.0), + ); + parent=:plant, +) + +targets_before_refresh = only( + row for row in Diagnostics.explain_applications(simulation) + if row.application_id == :biomass +).target_ids + +continue!(simulation) + +targets_after_refresh = only( + row for row in Diagnostics.explain_applications(simulation) + if row.application_id == :biomass +).target_ids + +( + initial_targets=initial_targets, + before_refresh=targets_before_refresh, + after_refresh=targets_after_refresh, + leaf_3_parent=only( + object.parent.value + for object in model_objects(model) + if object.id == ObjectId(:leaf_3) + ), +) +``` + +When a lifecycle operation occurs *inside* a model kernel, PlantSimEngine +refreshes after that application. A newly registered object may therefore run +applications that remain later in the same timestep, but it never +retroactively runs applications that already completed. + +## Reparent, then remove + +Creation now works, so make two further changes in order. First move the new +leaf under the branch and advance: + +```@example journey_structure +reparent_object!(model, :leaf_3, :branch) +continue!(simulation) + +leaf_3_parent = only( + object.parent.value + for object in model_objects(model) + if object.id == ObjectId(:leaf_3) +) +``` + +Then remove `:leaf_2` and advance once more: + +```@example journey_structure +removed = remove_object!(model, :leaf_2) +continue!(simulation) + +( + removed=removed.id.value, + current_leaves=sort!([ + object.id.value + for object in model_objects(model; scale=:Leaf) + ]), + leaf_3_parent=leaf_3_parent, + current_targets=only( + row for row in Diagnostics.explain_applications(simulation) + if row.application_id == :biomass + ).target_ids, +) +``` + +## Check conservation and history + +For every retained leaf sample, accepted carbon allocation equals demand. The +biomass model partitions it into biomass increment plus growth respiration: + +```@example journey_structure +rows = collect_outputs(simulation; sink=nothing) + +demand = Dict( + (row.timestep, row.object_id) => row.value + for row in rows + if row.application_id == :carbon_demand && + row.variable == :carbon_demand +) +increment = Dict( + (row.timestep, row.object_id) => row.value + for row in rows + if row.application_id == :biomass && + row.variable == :carbon_biomass_increment +) +respiration = Dict( + (row.timestep, row.object_id) => row.value + for row in rows + if row.application_id == :biomass && + row.variable == :growth_respiration +) + +all( + demand[key] ≈ increment[key] + respiration[key] + for key in keys(demand) +) +``` + +Removed-object history remains queryable even though the object is no longer +in the registry: + +```@example journey_structure +history_counts = Dict( + id => length(collect_outputs( + simulation, + id, + :carbon_biomass; + sink=nothing, + )) + for id in (:leaf_1, :leaf_2, :leaf_3) +) +``` + +`:leaf_2` keeps the three samples published before removal; `:leaf_3` begins at +step 2, after registration, and also has three samples. + +`ToyCAllocationModel` is useful when supply is limiting and a plant controller +must divide carbon among many organ demands. This journey deliberately assumes +all demand is accepted so lifecycle timing and conservation stay visible +without introducing a controller or hard calls. + +## Page recap + +- **You added:** one leaf, then one reparenting operation, then one removal. +- **PlantSimEngine inferred:** the affected application targets, status views, + reference binding, execution batch extension, and retained stream keys. +- **You keep explicit:** initialized status for a new object, its parent, + conservation assumptions, and when removal or reparenting occurs. +- **New API names:** `register_object!`, `reparent_object!`, `remove_object!`, + and `Diagnostics.explain_applications(simulation)`. diff --git a/docs/src/migration_composite_model.md b/docs/src/migration_composite_model.md new file mode 100644 index 000000000..8dec94b75 --- /dev/null +++ b/docs/src/migration_composite_model.md @@ -0,0 +1,497 @@ +# Migrating To The CompositeModel/Object API + +## Refining early CompositeModel/Object code + +The stabilized public surface makes several early CompositeModel/Object behaviors +explicit: + +| Early spelling or behavior | Stabilized API | +| --- | --- | +| `Self()` searched self and descendants | `Self()` selects only the current object; use `Subtree()` for self plus descendants | +| omitted `tracked_outputs` retained everything | use explicit `outputs=:all`; the safe default is `outputs=:none` | +| `tracked_outputs=requests` | `outputs=requests` | +| `OutputRequest(:Leaf, :x; process=:p)` | `OutputRequest(Many(scale=:Leaf), :x; application=:app)` | +| repeated unnamed applications gained numbered IDs | name every repeated application with `ModelSpec(...; name=...)` | +| calling `run!(model)` again implicitly looked like continuation | use `continue!(simulation)` or `step!(simulation)` | +| compiler/cache types imported from the default namespace | qualify them through `PlantSimEngine.Advanced` | + +`tracked_outputs` has been removed. Use `outputs=:all`, `outputs=:none`, or +`outputs=requests` directly. Singular scenario `inputs` and `calls`, +`OutputRequest`, object overrides, and `Updates(...; after=...)` now identify +the target by canonical `application=...` or application ID. Model-authored +`Input`/`Call` defaults may still discover a process because they cannot know +scenario application names, and `Many(process=...)` remains an explicit +multi-application discovery query. + +Calling `run!(model; ...)` always creates a fresh result timeline starting at +step one, even when object status has already been mutated by an earlier run. +Continue the same timeline, environment position, temporal histories, and +multirate phase with: + +```julia +simulation = run!(model; steps=24, outputs=requests) +continue!(simulation; steps=24) +step!(simulation) +@assert current_step(simulation) == 49 +``` + +The composite-model/object API replaces the historical multiscale mapping system with +one object-address graph. + +New scenario code should be organized around: + +```julia +CompositeModel +Object +ModelSpec +Updates +Environment +``` + +Process-model implementations do not need to know about composite models, plants, objects, or +timesteps. They keep the existing kernel contract: + +```julia +inputs_(model) +outputs_(model) +dep(model) +environment_inputs_(model) +run!(model, status, environment, constants, context) +``` + +This page maps the legacy configuration concepts to their composite-model/object +equivalents. + +## Explicit Input Initialization + +Input literals no longer double as ambiguous placeholder values. Declare +whether each model input is required or genuinely has a fallback: + +```julia +# Old, ambiguous +inputs_(::GrowthModel) = ( + temperature=-Inf, + efficiency=0.8, +) + +# Current +inputs_(::GrowthModel) = ( + temperature=Required(Float64), + efficiency=Default(0.8), +) +``` + +`Required(T)` means object state or another application must supply the value. +`Default(value)` means PlantSimEngine may initialize it when absent. Output +literals remain initial output-state values. Plain input literals are rejected; +there is no compatibility interpretation of `-Inf` or another sentinel. + +Replace helpers that previously merged every input literal into initial state +with `init_variables(model)`. It returns only real input defaults and output +initial values, omitting required inputs. + +## Scenario Structure + +Legacy simulations split configuration between `ModelMapping` and +`MultiScaleModel`. The unified API stores runtime entities in one `CompositeModel`: + +`ModelMapping` has been removed. Historical code must be translated to the +composite-model/object form below. + +```julia +model = CompositeModel( + Object(:scene; scale=:Scene, kind=:scene), + Object(:plant_1; scale=:Plant, kind=:plant, parent=:scene), + Object(:leaf_1; scale=:Leaf, kind=:plant, parent=:plant_1), + Object(:soil; scale=:Soil, kind=:soil, parent=:scene); + applications=( + ModelSpec(LeafModel(); name=:leaf_model, on=Many(scale=:Leaf)), + + ModelSpec(SoilModel(); name=:soil_model, on=One(scale=:Soil)), + ), + environment=(T=25.0, Rh=0.6, Wind=1.0), +) +``` + +`Object` labels describe runtime entities. They do not prescribe plant +topology. A plant may use any hierarchy of plants, axes, internodes, segments, +leaves, roots, fruits, or application-specific objects. + +### Existing MTG Topologies + +An existing MTG can be adapted without rebuilding its topology manually: + +```julia +model = CompositeModel( + mtg; + applications=applications, + environment=environment, + kind=node_kind, + species=node_species, + geometry=node_geometry, +) +``` + +`objects_from_mtg(mtg; ...)` exposes the intermediate object list when it is +useful to inspect or modify labels before constructing the model. By default, +the adapter uses MTG node ids and scales, and reuses an existing +`:plantsimengine_status` attribute when present. + +## Multiscale Inputs + +Replace `MultiScaleModel(...)` variable mappings with consumer-side +`ModelSpec(...; inputs=...)`. + +Legacy: + +```julia +MultiScaleModel( + AllocationModel(), + [:leaf_carbon => [:Leaf => :leaf_carbon]], +) +``` + +Unified: + +```julia +ModelSpec( + AllocationModel(); + name=:allocation, + on=Many(scale=:Plant), + inputs=( + :leaf_carbon => Many( + scale=:Leaf, + within=Subtree(), + var=:leaf_carbon, + ), + ), +) +``` + +`Self()` selects only the object where the consumer runs. A plant-scale +allocation model uses `Subtree()` to read leaves below that plant. Use +`SceneScope()` for model-wide aggregation and `SelfPlant()` to select the +nearest containing plant and its subtree from an organ. + +Same-object renaming uses the same syntax: + +```julia +ModelSpec( + ConsumerModel(); + inputs=( + :consumer_name => One( + within=Self(), + application=:producer, + var=:producer_name, + ), + ), +) +``` + +Same-rate bindings use shared references or reference vectors when possible. +Cross-rate bindings use typed temporal streams. + +## CompositeModel-Wide Values + +Use an input selector on the consuming application: + +```julia +ModelSpec(SceneWaterBalance(); name=:scene_water, on=One(scale=:Scene), inputs=(:leaf_transpiration => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + application=:transpiration, + var=:transpiration, + ),)) +``` + +The compiler chooses the carrier. Scenario authors declare the source objects, +source variable, and temporal policy rather than a route implementation. + +## Manual Hard Calls + +Use `ModelSpec(...; calls=...)` when a parent model must control child execution. + +```julia +ModelSpec(SceneEnergyBalance(); name=:scene_energy, on=One(scale=:Scene), calls=(:leaf_energy => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + application=:energy_balance, + ), + :soil => One( + kind=:soil, + scale=:Soil, + within=SceneScope(), + application=:soil_water, + ),)) +``` + +The parent model controls execution: + +```julia +function PlantSimEngine.run!(model::SceneEnergyBalance, status, environment, + constants, context) + for iteration in 1:model.max_iterations + trial = trial_environment(model, status) + run_call!(context, :leaf_energy; environment=trial, publish=false) + converged(model, status) && break + end + + accepted = accepted_environment(model, status) + commit_environment!(context, accepted) + run_call!(context, :leaf_energy; publish=true) + return nothing +end +``` + +`run_call!` defaults to `publish=false`. Trial calls mutate target status but +do not publish temporal samples or commit mutable environment updates. +do not append temporal samples or write environment outputs. The accepted +state must use `publish=true`. + +## Multiple Plants And Species + +Represent repeated plant configurations with `CompositeModelTemplate` and +`ObjectInstance`. + +```julia +oil_palm = CompositeModelTemplate( + ( + ModelSpec(LeafEnergy(); on=Many(scale=:Leaf)), + + ModelSpec(Allocation(); on=One(scale=:Plant), inputs=(:leaf_carbon => Many( + scale=:Leaf, + within=Subtree(), + var=:leaf_carbon, + ),)), + ); + kind=:plant, + species=:oil_palm, +) + +palm_1 = ObjectInstance( + :palm_1, + oil_palm; + root=Object(:plant_1; scale=:Plant, parent=:scene), + objects=(Object(:palm_1_leaf_1; scale=:Leaf, parent=:plant_1),), +) + +palm_2 = ObjectInstance( + :palm_2, + oil_palm; + root=Object(:plant_2; scale=:Plant, parent=:scene), + objects=(Object(:palm_2_leaf_1; scale=:Leaf, parent=:plant_2),), +) + +model = CompositeModel( + Object(:scene; scale=:Scene, kind=:scene), + palm_1, + palm_2, +) +``` + +Unmodified instances share model objects and parameters. Use instance +overrides for one plant and `Override(...)` for exceptional organs. + +## Multirate Inputs + +Replace `TimeStepModel(...)` with `ModelSpec(...; every=...)`. Put temporal policy and +window information on the consuming `ModelSpec(...; inputs=...)` selector. + +```julia +ModelSpec(HourlyLeafModel(); name=:leaf_flux, on=Many(scale=:Leaf), every=Hour(1)) + +ModelSpec(DailyPlantModel(); name=:daily_plant, on=Many(scale=:Plant), inputs=(:leaf_fluxes => Many( + scale=:Leaf, + within=Subtree(), + application=:leaf_flux, + var=:flux, + policy=Integrate(), + window=Day(1), + ),), every=Day(1)) +``` + +Use `HoldLast()`, `Interpolate()`, `Integrate()`, or `Aggregate()` according to +the physical meaning of the input. `PreviousTimeStep(:x) => selector` expresses +an explicit lag and breaks a same-timestep dependency cycle. + +If the input selector omits `policy=...`, the model compiler uses the +producer's `output_policy(...)` trait for the selected source variable when the +publisher is unique. An explicit selector policy always wins over the trait. + +If a model defines `timespec(::Type{<:MyModel})`, the model scheduler uses that +cadence when the application has no explicit `ModelSpec(...; every=...)`. A scenario-level +`ModelSpec(...; every=...)` always wins over the model trait. + +If the clock falls back to the model base step, `timestep_hint(...)` required +bounds are validated against that base step. The hint is a compatibility +constraint, not a scheduling override. + +## Ordered Variable Updates + +When several models intentionally write the same variable, declare the order +on the later application: + +```julia +ModelSpec(CarbonAllocation(); name=:allocation, on=Many(scale=:Leaf)) + +ModelSpec(LeafPruning(); name=:pruning, on=Many(scale=:Leaf), updates=Updates(:leaf_biomass; after=:allocation)) +``` + +Do not encode this coupling in either model implementation. The scenario owns +the writer order. + +## Environment And Microclimate + +Models declare sampled environment variables with `environment_inputs_`. The scenario +binds each object/application to the active environment backend: + +```julia +ModelSpec(LeafEnergy(); name=:leaf_energy, on=Many(scale=:Leaf), environment=Environment(provider=:grid)) +``` + +Spatial bindings are cached. The default resolver uses the object's geometry, +then the nearest ancestor geometry, then the backend's global behavior. +Changing geometry invalidates only affected environment bindings. + +Per-model source remapping also moves to `Environment(...)`: + +```julia +ModelSpec(LeafGasExchange(); name=:gas_exchange, on=Many(scale=:Leaf), environment=Environment(provider=:global, sources=(CO2=:Ca,))) +``` + +The model still declares and reads `CO2`; the model samples `Ca` from the +active environment backend and exposes it to the model as `environment.CO2`. +`Diagnostics.explain_environment_bindings(...)` reports both `required_inputs` and +`source_inputs`, so remapped meteorology is visible to users and agents. + +Model authors can also provide default source remaps with +`environment_hint(::Type{<:Model}) = (bindings=(CO2=(source=:Ca,),),)`. CompositeModel +applications use those defaults when the scenario does not provide an explicit +source for the same variable. `Environment(; sources=...)` remains the +scenario-level override. + +For global `Weather` tables, sampling follows the application's +`ModelSpec(...; every=...)`. A slower model receives a PlantMeteo windowed sample using its +`environment_hint` reducer and window instead of receiving only the current raw +weather row. A scenario source override preserves that reducer: + +```julia +environment_hint(::Type{<:GasExchange}) = ( + bindings=(CO2=(source=:Ca, reducer=MeanReducer()),), +) + +ModelSpec(GasExchange(); on=Many(scale=:Leaf), every=Hour(2), environment=Environment(provider=:global, sources=(CO2=:canopy_CO2,))) +``` + +Every leaf still reads `environment.CO2`; the two-hour mean is computed from +`:canopy_CO2`. The sampled row is computed once per application and timestep, +then reused for all selected leaves. + +## Growth, Pruning, And Movement + +Use the public lifecycle operations: + +```julia +register_object!(model, new_leaf; parent=:plant_1) +new_leaf_status = add_organ!( + parent_node, + model, + :+, + :Leaf, + 3; + initial_status=(biomass=0.0,), +) +remove_object!(model, :old_leaf) +reparent_object!(model, :leaf_2, :axis_3) +move_object!(model, :leaf_3, new_geometry) +``` + +For MTG-backed growth, prefer `add_organ!`: it creates the MTG node and its +model object together and reuses the status initialization policy from +`CompositeModel(mtg; status=...)`. Use `register_object!` when adapting another topology +backend or when a complete `Object` already exists. + +Structural changes refresh application targets, input carriers, call targets, +writer validation, and schedules after the application that made the change. +New objects can therefore run applications that remain later in the current +timestep, but never applications that already ran. Geometry-only changes +refresh environment bindings without rebuilding unrelated structural bindings. + +The refreshed runtime also rebuilds homogeneous execution batches. Use +`Diagnostics.explain_execution_plan(scene_or_simulation)` to inspect the concrete +model/status/carrier types and the objects grouped into each specialized inner +loop. Exceptional per-object model overrides appear as separate ordered +batches. + +## Output Collection + +`run!(model; steps=...)` returns a `Simulation`. Use `final_state(sim)` for the +latest one-object state, `outputs(sim)` for retained typed streams, +`Diagnostics.explain_outputs(sim)` for structured diagnostics, and +`collect_outputs(sim)` for tabular rows. + +```julia +request = OutputRequest( + Many(scale=:Leaf), + :transpiration; + name=:leaf_transpiration_daily, + application=:leaf_energy, + policy=Integrate(), + clock=Day(1), +) + +sim = run!(model; steps=48, outputs=request) +daily = collect_outputs(sim, :leaf_transpiration_daily) +``` + +CompositeModel output requests are materialized from retained temporal streams after +the run. They use the same temporal policies as multirate inputs and export +dynamic objects only over the interval where that object published samples. +If several model applications implement the same process, add +`application=:application_name` to select one explicitly. This is also the +way to request a named `:stream_only` publisher. +`outputs=:none` retains no user streams. Passing explicit requests retains only +their application/variable streams plus streams needed by temporal +`ModelSpec(...; inputs=...)`. Use `Diagnostics.explain_output_retention(sim)` +to inspect why each retained stream was kept. Dependency-only streams retain a +bounded policy-specific horizon, while requested streams keep complete +histories for post-run export. Export is not yet a fully online path. + +## Inspecting The Compiled Scenario + +Use structured explanations instead of inspecting internal dictionaries: + +```julia +Diagnostics.explain_objects(model) +Diagnostics.explain_instances(model) +Diagnostics.explain_scopes(model) +Diagnostics.explain_applications(model) +Diagnostics.explain_bindings(model) +Diagnostics.explain_calls(model) +Diagnostics.explain_environment_bindings(model) +Diagnostics.explain_schedule(model) +Diagnostics.explain_writers(model) +``` + +These functions return structured rows with concrete object ids, application +ids, processes, variables, temporal policies, carrier semantics, and resolved +targets. They are intended for both users and coding agents. + +## Migration Table + +| Legacy configuration | CompositeModel/object replacement | +| --- | --- | +| `ModelMapping` scale assembly | `CompositeModel` objects plus model applications | +| `MultiScaleModel(...)` | consumer `ModelSpec(...; inputs=...)` | +| `TimeStepModel(...)` | `ModelSpec(...; every=...)` | +| `InputBindings(...)` | source, policy, and window on `ModelSpec(...; inputs=...)` | +| `MeteoBindings(...)` | automatic environment binding or `Environment(...)` | +| `ScopeModel(...)` | `ModelSpec(...; on=...)` and selector scopes | +| `SameScale()` rename | `inputs=(:local => One(within=Self(), var=:source),)` | + +The executable MAESPA migration in +`examples/maespa_model_example.jl` demonstrates two plant species, shared +soil, plant-local aggregation, model-wide iterative energy balance, hourly and +daily models, and automatic environment binding. diff --git a/docs/src/model_coupling/model_coupling_user.md b/docs/src/model_coupling/model_coupling_user.md deleted file mode 100644 index b24be6931..000000000 --- a/docs/src/model_coupling/model_coupling_user.md +++ /dev/null @@ -1,173 +0,0 @@ -# Model coupling for users - -```@setup usepkg -using PlantSimEngine, PlantMeteo, Dates -# Import the example models defined in the `Examples` sub-module: -using PlantSimEngine.Examples - -m = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - Process4Model(), - Process5Model(), - Process6Model(), - Process7Model(), -) -``` - -`PlantSimEngine.jl` is designed to make model coupling simple for both the modeler and the user. For example, `PlantBiophysics.jl` implements the [`Fvcb`](https://vezy.github.io/PlantBiophysics.jl/stable/functions/#PlantBiophysics.Fvcb) model to simulate the photosynthesis process. This model needs the stomatal conductance process to be simulated, so it calls again `run!` inside its implementation at some point. Note that it does not force any kind of conductance model over another, just that there is one to simulate the process. This ensures that users can choose whichever model they want to use for this simulation, independent of the photosynthesis model. - -We provide an example script that implements seven dummy processes in [`examples/dummy`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/dummy.jl). The processes are simply called "process1", "process2"..., and the model implementations are called `Process1Model`, `Process2Model`... - -## Hard coupled models - -The `Process3Model` calls `Process2Model`, and `Process2Model` calls `Process1Model`. This explicit call is called a hard-dependency in PlantSimEngine. - -The other models for the other processes are called `Process4Model`, `Process5Model`... and they do not call explicitly other models when running, but some outputs of the models are used as inputs of other models. This is called a soft-dependency in PlantSimEngine. - -!!! tip - Hard-coupling of models is usually done when there are some kind of iterative computation in one of the models that depend on one another. This is not the case in our example here as it is obviously just a simple one. In this case the coupling is not really necessary as models could just be called sequentially one after the other. For a more representative example, you can look at the energy balance computation of Monteith in `PlantBiophysics.jl`, which is hard-coupled to a photosynthesis model. - -Back to our example, using `Process3Model` requires a "process2" model, and in our case the only model available is `Process2Model`. The latter also requires a "process1" model, and again we only have one model implementation for this process, which is `Process1Model`. - -Let's use the `Examples` sub-module so we can play around: - -```julia -# Import the example models defined in the `Examples` sub-module: -using PlantSimEngine.Examples -``` - -!!! tip - Use subtype(x) to know which models are available for a process, e.g. for "process1" you can do `subtypes(AbstractProcess1Model)`. - -Here is how we can make the model coupling: - -```@example usepkg -m = ModelMapping(Process1Model(2.0), Process2Model(), Process3Model()) -nothing # hide -``` - -We can see that only the first model has a parameter. You can usually know that by looking at the help of the structure (*e.g.* `?Process1Model`), else, you can still look at the field names of the structure like so `fieldnames(Process1Model)`. - -Note that the user only declares the models, not the way the models are coupled because `PlantSimEngine.jl` deals with that automatically. - -Now the example above returns some warnings saying we need to initialize some variables: `var1` and `var2`. `PlantSimEngine.jl` automatically computes which variables should be initialized based on the inputs and outputs of all models, considering their hard or soft-coupling. - -For example, `Process1Model` requires the following variables as inputs: - -```@example usepkg -inputs(Process1Model(2.0)) -``` - -And `Process2Model` requires the following variables: - -```@example usepkg -inputs(Process2Model()) -``` - -We see that `var1` is needed as inputs of both models, but we also see that `var3` is an output of `Process2Model`: - -```@example usepkg -outputs(Process2Model()) -``` - -So considering those two models, we only need `var1` and `var2` to be initialized, as `var3` is computed. This is why we recommend [`to_initialize`](@ref) instead of [`inputs`](@ref), because it returns only the variables that need to be initialized, considering that some inputs are duplicated between models, and some are computed by other models (they are outputs of a model): - -```@example usepkg -m = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - variables_check=false # Just so we don't have the warning printed out -) - -to_initialize(m) -``` - -The most straightforward way of initializing a model list is by giving the initializations to the `status` keyword argument during instantiation: - -```@example usepkg -m = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - status = (var1=15.0, var2=0.3) -) -nothing # hide -``` - -Our component models structure is now fully parameterized and initialized for a simulation! - -Let's simulate it: - -```@example usepkg -using PlantMeteo -meteo = Atmosphere(T = 22.0, Wind = 0.8333, P = 101.325, Rh = 0.4490995) - -run!(m, meteo) - -m[:var5] -``` - - -## Soft coupled models - -All following models (`Process4Model` to `Process7Model`) do not call explicitly other models when running, but some outputs of the models are used as inputs of other models. This is called a soft-dependency in PlantSimEngine. - -Let's make a new model list including the soft-coupled models: - -```@example usepkg -m = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - Process4Model(), - Process5Model(), - Process6Model(), - Process7Model(), -) -nothing # hide -``` - -With this list of models, we only need to initialize `var0`, that is an input of `Process4Model` and `Process7Model`: - -```@example usepkg -to_initialize(m) -``` - -We can initialize it like so: - -```@example usepkg -m = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - Process4Model(), - Process5Model(), - Process6Model(), - Process7Model(), - status = (var0=15.0,) -) -nothing # hide -``` - -Let's simulate it: - -```@example usepkg -using PlantMeteo -meteo = Atmosphere(T = 22.0, Wind = 0.8333, P = 101.325, Rh = 0.4490995) - -run!(m, meteo) - -status(m) -``` - -## Simulation order - -When calling `run!`, the models are run in the right order using a dependency graph that is computed automatically based on the hard and soft dependencies of the models following a simple set of rules: - -1. Independent models are run first. A model is independent if it can be run alone, or only using initializations. It is not dependent on any other model. -2. From their children dependencies: - 1. Hard dependencies are always run before soft dependencies. Inner hard dependency graphs are considered as a whole, *i.e.* as a single soft dependency. - 2. Soft dependencies are then run sequentially. If a soft dependency has several parent nodes (*i.e.* its inputs are computed by several models), it is run only if all its parent nodes have been run already. In practice, when we visit a node that has one of its parent that did not run already, we stop the visit of this branch. The node will eventually be visited from the branch of the last parent that was run. diff --git a/docs/src/model_execution.md b/docs/src/model_execution.md index 3d1c575f3..0a0352dd7 100644 --- a/docs/src/model_execution.md +++ b/docs/src/model_execution.md @@ -1,219 +1,404 @@ -# Model execution +# Model Execution -## Simulation order +This page describes how the native composite-model/object runtime executes model +applications. Use this path for new multi-object, multi-plant, soil, +microclimate, and multirate simulations. -`PlantSimEngine.jl` uses the [`ModelMapping`](@ref) to automatically compute a dependency graph between the models and run the simulation in the correct order. When running a simulation with [`run!`](@ref), the models are then executed following this simple set of rules: +The public configuration surface has one application constructor: -1. Independent models are run first. A model is independent if it can be run independently from other models, only using initializations (or nothing). -2. Then, models that have a dependency on other models are run. The first ones are the ones that depend on an independent model. Then the ones that are children of the second ones, and then their children ... until no children are found anymore. There are two types of children models (*i.e.* dependencies): hard and soft dependencies: - 1. Hard dependencies are always run before soft dependencies. A hard dependency is a model that is directly called by another model. It is declared as such by its parent that lists its hard-dependencies as `dep`. See [this example](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/3d91bb053ddbd087d38dcffcedd33a9db35a0fcc/examples/dummy.jl#L39) that shows `Process2Model` defining a hard dependency on any model that simulates `process1`. - 2. Soft dependencies are then run sequentially. A model has a soft dependency on another model if one or more of its inputs is computed by another model. If a soft dependency has several parent nodes (*e.g.* two different models compute two inputs of the model), it is run only if all its parent nodes have been run already. In practice, when we visit a node that has one of its parent that did not run already, we stop the visit of this branch. The node will eventually be visited from the branch of the last parent that was run. +```julia +ModelSpec( + model; + name=:application, + on=Many(scale=:Leaf), + inputs=(...), + calls=(...), + every=Dates.Hour(1), + environment=Environment(...), + output_routing=(...), + updates=Updates(...), +) +``` -## Multi-rate model configuration (experimental) - -For multiscale simulations, model usage is configured in the mapping through `ModelSpec` transforms: - -- `TimeStepModel(...)`: sets model execution clock. -- `InputBindings(...)`: sets producer, source variable, optional source scale, and policy for each consumer input. -- `MeteoBindings(...)`: sets weather aggregation rules at the model clock for meteo variables. -- `MeteoWindow(...)`: sets weather row selection strategy (`RollingWindow()` or `CalendarWindow(...)`). -- `OutputRouting(...)`: sets whether an output is canonical (`:canonical`) or stream-only (`:stream_only`). -- `ScopeModel(...)`: partitions producer streams by scope (`:global`, `:plant`, `:scene`, `:self`) for multi-entity simulations. +Scenarios start from `CompositeModel` and model applications. -For a compact overview of all model traits and precedence rules, see [Model traits](model_traits.md). +## Model Kernels And Applications -If users do not provide `MeteoBindings(...)` or `MeteoWindow(...)`, -the runtime can infer defaults from model traits: -- `timespec(::Type{<:MyModel})` -- `output_policy(::Type{<:MyModel})` -- `timestep_hint(::Type{<:MyModel})` -- `meteo_hint(::Type{<:MyModel})` +A model kernel is still an ordinary PlantSimEngine model: -For timestep specifically, runtime is meteo-first (see decision flow below): `timestep_hint` -is used for compatibility validation (and user guidance), not to auto-assign model clocks. +- `inputs_(model)` declares each status input as `Required(T)` or + `Default(value)`; +- `outputs_(model)` declares variables the model computes and their initial + output-state values; +- `environment_inputs_(model)` declares environment variables it reads; +- `commit_environment!(context, state)` commits accepted mutable environment + state when the model intentionally controls microclimate; +- `dep(model)` may declare model-author defaults; +- `run!(model, status, environment, constants, context)` contains the model +equations. -If users do not provide `InputBindings(...)`, runtime infers same-name bindings: -- first from a unique producer at the same scale; -- otherwise from a unique producer at another scale; -- if no producer exists, input stays unresolved (so initialization/forced values can be used); -- if multiple producers are possible, runtime errors and asks for explicit `InputBindings(...)`. +`Required(T)` has no initialization value: object state or a producer +application must satisfy it. `Default(value)` is installed only when the target +does not already have the input. Plain input literals are rejected because +they are ambiguous. -For inferred bindings, default policy is resolved as: -- producer `output_policy` for the source output when defined; -- otherwise `HoldLast()`. +The composite-model/object layer does not change that kernel contract. It adds a +scenario-specific application around the kernel: -`output_policy` is a default hint, applied only when an output stream is actually read -by another model input (or output export). Unused outputs do not trigger integration/reduction work. +```julia +ModelSpec( + LeafEnergyBalance(); + name=:leaf_energy, + on=Many(kind=:plant, scale=:Leaf), + inputs=(...), + calls=(...), + every=Dates.Hour(1), + environment=Environment(provider=:canopy), +) +``` -Explicit mapping policies still have priority (`InputBindings(..., policy=...)`) and can -complement trait defaults by defining additional bindings with different policies. +`ModelSpec` decides where the model runs, where its inputs come from, which +models it may call manually, which timestep it uses, and which environment +provider is bound to it. The model implementation stays reusable. -For timestep hints: -- `timestep_hint.required` is a hard compatibility constraint when runtime uses meteo-derived timestep. -- `timestep_hint.preferred` is informational only (it does not set runtime timestep by itself). -- Explicit `TimeStepModel(...)` always takes precedence. +## Compilation Before Runtime -For meteo hints: -- return `(; bindings=..., window=...)` where `bindings` matches `MeteoBindings(...)` - and `window` matches `MeteoWindow(...)`. -- Explicit `MeteoBindings(...)` / `MeteoWindow(...)` always take precedence. +Before the timestep loop, PlantSimEngine compiles the model into concrete +runtime carriers: -Inspection helpers: -- `resolved_model_specs(mapping)` returns resolved specs after inference/validation. -- `explain_model_specs(mapping_or_sim)` prints a compact summary (`timestep`, - `input_bindings`, `meteo_bindings`, `meteo_window`) for each model process. +1. `ModelSpec(...; on=...)` selectors are resolved to stable object ids. +2. `ModelSpec(...; inputs=...)` selectors are resolved to source object/application ids. +3. Same-rate inputs are wired as shared `Ref`s, `RefVector`s, or + heterogeneous object-reference vectors. +4. Temporal inputs are compiled as stream lookups with a policy such as + `HoldLast`, `Interpolate`, `Integrate`, or `Aggregate`. +5. `ModelSpec(...; calls=...)` declarations are compiled to callable target lists. +6. `Environment(...)` is bound to backend cells, layers, voxels, or global + weather providers. +7. The root application order is topologically sorted from value inputs and + `Updates(...)` ordering. +8. Root execution batches are grouped by concrete model/status/environment + types where possible. -Policy parameterization: -- `Integrate()` defaults to `SumReducer()`; you can pass another reducer, e.g. `Integrate(MeanReducer())` or `Integrate(vals -> maximum(vals) - minimum(vals))`. -- `Aggregate()` defaults to `MeanReducer()`; you can pass reducers such as `Aggregate(MaxReducer())`. -- Difference between `Integrate` and `Aggregate`: with the same reducer they are runtime-equivalent. - In practice, only defaults and naming intent differ (`Integrate` for accumulation, `Aggregate` for summary statistics). -- `Interpolate()` defaults to `mode=:linear, extrapolation=:linear`; use `Interpolate(; mode=:hold, extrapolation=:hold)` for hold behavior. -- The same reducer objects are reused by meteo sampling (`MeteoBindings`) and by windowed policies (`Integrate`, `Aggregate`). -- Custom reducers/callables can accept either `(values)` or `(values, durations_seconds)`. -- For flux-to-amount conversions, use `Integrate(PlantMeteo.DurationSumReducer())` - (equivalent to `sum(values .* durations_seconds)`), instead of hardcoding a fixed factor. +Selectors are not resolved in the hot loop. Runtime execution uses the +compiled indexes and carriers. -`TimeStepModel(...)` accepts either step counts (`Real`), `ClockSpec`, or fixed `Dates` periods -(for example `Dates.Hour(1)`, `Dates.Day(1)`). Fixed periods are converted internally using -the meteo base timestep duration. +Useful inspection helpers: -### Timestep decision flow +```julia +Diagnostics.explain_applications(model) +Diagnostics.explain_bindings(model) +Diagnostics.explain_calls(model) +Diagnostics.explain_environment_bindings(model) +Diagnostics.explain_schedule(model) +Diagnostics.explain_execution_plan(model) +Diagnostics.explain_writers(model) +``` -When meteo is provided, `duration` is mandatory for each row (or the simulation errors). +These explanations are intended for both users and agents. They report the +compiled object ids, applications, carriers, clocks, environment bindings, and +manual-call targets that the runtime will use. -Runtime picks each model effective clock with this order: +## Soft Dependencies With Inputs -1. If `ModelSpec` has `TimeStepModel(...)`, use it. -2. Else if `timespec(model)` is non-default, use it. -3. Else use meteo base timestep (`duration`) for that model. +Soft dependencies are value dependencies. A consumer model reads a variable +produced by another model through `ModelSpec(...; inputs=...)`. -Then runtime applies constraints: +```julia +ModelSpec(SceneLAI(ground_area); name=:scene_lai, on=One(scale=:Scene), inputs=(:leaf_areas => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + application=:leaf_state, + var=:leaf_area, + ),)) +``` + +For same-rate inputs, the runtime installs a reference carrier into the +consumer status during compilation. A model-scale model reading all leaf areas +therefore sees a `RefVector`-like object: reading pulls current values from +source leaf statuses, and writing through the carrier mutates source refs when +the carrier supports it. + +If an input is not explicitly declared with `ModelSpec(...; inputs=...)`, the compiler can +infer simple same-object bindings when exactly one producer on the same object +outputs the same variable. Ambiguous producers are errors and should be +disambiguated with `application=...` and, when names differ, `var=...`. -1. If the model clock is meteo-derived (rule 3), `timestep_hint.required` is validated: - - fixed required period: meteo timestep must match exactly; - - required range: meteo timestep must be inside the range. -2. `timestep_hint.preferred` never overrides the clock when timestep is unset. -3. Meteo aggregation/integration is applied only when effective model timestep is coarser than meteo timestep. +Use `PreviousTimeStep(:x) => selector` when a feedback dependency should read +the previous sample instead of creating a same-timestep scheduling edge. -Practical consequences: +## Hard Calls With Calls -- Unset `TimeStepModel` + required includes meteo + preferred is coarser: - model still runs at meteo timestep. -- Explicit coarser `TimeStepModel(Dates.Hour(2))` with hourly meteo: - model runs every 2 hours and receives aggregated meteo over that window. -- Unset `TimeStepModel` + required excludes meteo: - runtime errors with an actionable compatibility message. - -Developer note on period conversion: -- Runtime time is indexed on a 1-based timeline (`t = 1, 2, 3, ...`). -- `TimeStepModel(Dates.Day(1))` is converted to a clock step count using: - `dt = day_seconds / meteo_step_seconds`. -- For hourly meteo (`duration = Dates.Hour(1)`), this gives `dt = 24` and the default phase is `1`, - so the model runs at `t = 1, 25, 49, ...`. -- This is equivalent to `ClockSpec(24.0, 1.0)`. -- If you need runs at `t = 24, 48, 72, ...`, set an explicit phase with `ClockSpec(24.0, 0.0)`. - -Typical pipeline form: +Hard dependencies are manual calls. Use `ModelSpec(...; calls=...)` when a parent model must +control the call stack, for example during an iterative energy-balance solve. ```julia -ModelSpec(MyModel()) |> -TimeStepModel(ClockSpec(24.0, 1.0)) |> -MeteoWindow(CalendarWindow(:day; anchor=:current_period, week_start=1, completeness=:strict)) |> -MeteoBindings(; T=MeanWeighted()) |> -InputBindings(; x=(process=:producer, var=:y, policy=HoldLast())) |> -OutputRouting(; z=:stream_only) +ModelSpec(SceneEnergyBalance(); name=:scene_energy, on=One(scale=:Scene), calls=(:leaf_energy => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + application=:energy_balance, + ), + :soil => One( + kind=:soil, + scale=:Soil, + within=SceneScope(), + application=:soil_water, + ),), every=Dates.Hour(1)) ``` -### Calendar-aligned meteo windows +Inside `run!`, the parent can execute every resolved target directly. The +return value is always vector-like: `One` returns one element, `OptionalOne` +returns zero or one, and `Many` returns zero or more. -`MeteoWindow(...)` controls how rows are selected before reducers are applied: -- `RollingWindow()` (default): trailing window based on `dt` (for example "last 24 steps"). -- `CalendarWindow(period; anchor, week_start, completeness)`: -: `period` in `:day`, `:week`, `:month` -: `anchor` in `:current_period`, `:previous_complete_period` -: `week_start` in `1:7` (1 = Monday) -: `completeness` in `:allow_partial`, `:strict` +```julia +soil_targets = run_call!(context, :soil; publish=true) +soil_status = only(soil_targets).status +``` -`CalendarWindow(:day; anchor=:current_period, ...)` guarantees that a model running inside a day sees -aggregates over that civil day (including later timesteps from that day when available). +For finer-grained iterative control, retrieve targets without executing them +and decide when to publish the accepted state: -### Hold-last coupling (default policy) +```julia +function PlantSimEngine.run!(model::SceneEnergyBalance, status, environment, + constants, context) + trial = trial_environment(model, status) + run_call!(context, :leaf_energy; environment=trial, publish=false) + + accepted = accepted_environment(model, status) + commit_environment!(context, accepted) + run_call!(context, :leaf_energy; publish=true) + + return nothing +end +``` + +`run_call!` defaults to `publish=false`. Trial calls mutate target statuses but +do not publish temporal samples or commit mutable environment updates. Use +`environment=trial_state` when hard-called descendants should sample temporary +state through their compiled environment handles. Call `commit_environment!` and +`run_call!(...; publish=true)` once for the accepted state. + +Applications selected only by `ModelSpec(...; calls=...)` are marked manual-call-only in +`Diagnostics.explain_schedule(model)` and are skipped by the root `run!(model)` loop. + +## Duplicate Writers With Updates + +By default, one application owns each `(object, output variable)` canonical +writer. If a scenario intentionally lets several models update the same +variable, later writers must declare that order explicitly: ```julia -mapping = ModelMapping( - :Leaf => ( - ModelSpec(LeafSourceModel()) |> TimeStepModel(1.0), - ModelSpec(LeafConsumerModel()) |> - TimeStepModel(ClockSpec(2.0, 1.0)) |> - InputBindings(; C=(process=:leafsource, var=:S)), - ), -) +ModelSpec(CarbonAllocation(); name=:carbon_allocation, on=Many(scale=:Leaf)) + +ModelSpec(LeafPruning(); name=:leaf_pruning, on=Many(scale=:Leaf), updates=Updates(:leaf_biomass; after=:carbon_allocation)) ``` -### Daily integration from hourly stream +This keeps ordinary duplicate outputs as errors while allowing cases such as +allocation followed by pruning. `Diagnostics.explain_writers(model)` reports writer +groups and the `Updates(...)` declarations that validate them. +The `after` value is the canonical application identifier shown by +`Diagnostics.explain_applications(model)`, not the process name. + +## Multirate Execution + +Use `ModelSpec(...; every=...)` with `Dates.Period` values for model application clocks: ```julia -mapping = ModelMapping( - :Leaf => ( - ModelSpec(HourlyAssimModel()) |> TimeStepModel(1.0), - ), - :Plant => ( - ModelSpec(DailyCarbonOfferModel()) |> - TimeStepModel(ClockSpec(24.0, 1.0)) |> - InputBindings(; A=(process=:hourlyassim, var=:A, scale=:Leaf, policy=Integrate())), - ), -) +ModelSpec(HourlyLeafAssimilation(); name=:leaf_assim, on=Many(scale=:Leaf), every=Dates.Hour(1)) + +ModelSpec(DailyPlantAllocation(); name=:allocation, on=Many(scale=:Plant), inputs=(:leaf_assimilation => Many( + scale=:Leaf, + within=Subtree(), + application=:leaf_assim, + var=:A, + policy=Integrate(), + window=Dates.Day(1), + ),), every=Dates.Day(1)) +``` + +Clock precedence is: + +1. explicit `ModelSpec(...; every=...)` on the `ModelSpec`; +2. non-default `timespec(model)` trait; +3. the model environment base step. + +`timestep_hint(model)` is a compatibility constraint and explanation hint. It +does not silently choose a clock. If a model uses the environment base step and +that step violates `timestep_hint.required`, model compilation errors. + +Temporal input policy precedence is: + +1. explicit selector policy, such as `policy=Integrate()`; +2. producer `output_policy(model)` for that output; +3. `HoldLast()`. + +Supported policies are: + +- `HoldLast()`: use the latest producer sample; +- `Interpolate()`: interpolate or extrapolate from producer samples; +- `Integrate()`: reduce values over a window, defaulting to `SumReducer()`; +- `Aggregate()`: reduce values over a window, defaulting to `MeanReducer()`. + +`Integrate(...)` and `Aggregate(...)` accept reducer objects or callables that +take either `(values)` or `(values, durations_seconds)`. +For duration-aware reducers, each producer value is held until the next +producer execution and weighted by the portion of that interval overlapping +the consumer window. This includes the last value published before the window +when it remains active inside the window. + +Temporal windows are duration-based rolling windows. Calendar-aligned civil +days and "previous complete period" selection are not part of the public API; +there is no `CalendarWindow` compatibility type. + +## Environment Sampling + +`Environment(...)` chooses a provider and optional source-variable remapping: + +```julia +ModelSpec(CO2Probe(); name=:co2_probe, on=Many(scale=:Leaf), environment=Environment(provider=:canopy, sources=(CO2=:Ca,))) ``` -### Interpolate slow producer to fast consumer +The compiler binds each application/object pair to the selected backend before +runtime. Constant weather, global tabular meteorology, grid, layer, voxel, or +octree-style microclimate backends all use the same contract: + +- `environment_inputs_(model)` says what the model reads; +- `environment_outputs_(model)` says what the model may commit; +- `commit_environment!(context, accepted_environment)` commits accepted mutable + meteorology from a controller model; +- `run_call!(context, name; environment=trial_state)` exposes non-committing + trial state while preserving every target's compiled backend handle; +- `Environment(; sources=...)` maps model-facing names to backend names; +- geometry and position are used by spatial backends when available; +- object-to-environment links are cached and refreshed when objects move. + +Backend authors implement an opaque-handle protocol: ```julia -mapping = ModelMapping( - :Leaf => ( - ModelSpec(SlowSourceModel()) |> TimeStepModel(ClockSpec(2.0, 1.0)), - ModelSpec(FastConsumerModel()) |> - TimeStepModel(1.0) |> - InputBindings(; X=(process=:slowsource, var=:X, policy=Interpolate())), - ), -) +handle = EnvironmentAPI.bind_environment(backend, object, context, config) + +EnvironmentAPI.sample(backend, handle, variable, time) # committed state +EnvironmentAPI.sample(backend, handle, trial_state, variable, time) # transient state +commit_environment!(backend, handle, accepted_state, time) ``` -When the `ModelMapping` declares multirate configuration, the runtime resolves inputs from producer temporal streams according to these policies. -Meteo rows are also sampled at each model clock. By default, meteo variables are aggregated from -the finest weather step (for example `T` and `Rh` as weighted means, `Tmin/Tmax`, and radiation -quantity aliases such as `Ri_SW_q` in MJ m-2). You can override these rules with `MeteoBindings(...)` -on each `ModelSpec`. +`EnvironmentAPI.EnvironmentContext` identifies the application, object, scale, and process +while the handle is compiled. Runtime status and geometry are not passed to +sampling: a spatial backend resolves them once in `EnvironmentAPI.bind_environment` and stores +the resulting provider, layer, voxel, or other routing data in its concrete +handle. A controller that reads from one provider and commits to another should +encode both routes in the handle, for example +`Environment(provider=:forcing, sink=:canopy)`. + +Model-level `environment_hint(...)` can provide default source bindings and +aggregation rules. Scenario-level `Environment(...)` keeps precedence for +source names, while explicit sampling policy on `ModelSpec(...; inputs=...)` controls +model-to-model temporal values. -### Current limitations +## Running And Outputs -- Multi-rate MTG runs currently execute sequentially. Passing `executor=ThreadedEx()` or `executor=DistributedEx()` falls back to sequential execution with a warning. -- Sub-step execution is currently unsupported: model timesteps shorter than the meteo base step (for example `TimeStepModel(Dates.Minute(30))` with hourly meteo) raise an error. +Run a model with: -## Multi-rate output export (experimental) +```julia +sim = run!(model; steps=30) +``` -You can export selected variables at a requested rate from temporal streams: +The returned `Simulation` contains the mutated model, compiled bindings, +environment bindings, execution plan, and retained temporal output streams. + +By default, model runs retain no user output streams. Pass `outputs=:all` to +retain every published stream, or pass `OutputRequest` values to retain only +selected outputs and required temporal dependency streams: ```julia -req = OutputRequest(:Leaf, :carbon_assimilation; - name=:A_daily, - process=:toyassim, +request = OutputRequest( + Many(scale=:Leaf), + :A; + name=:leaf_assimilation_daily, + application=:leaf_assimilation, policy=Integrate(), - clock=ClockSpec(24.0, 1.0) + clock=Dates.Day(1), ) -run!(sim, meteo; tracked_outputs=[req], executor=SequentialEx()) -exported = collect_outputs(sim; sink=DataFrame) +sim = run!(model; steps=72, outputs=request) +collect_outputs(sim, :leaf_assimilation_daily; sink=nothing) +Diagnostics.explain_output_retention(sim) +``` + +When several applications publish the same process and variable, use +`application=:application_name` in the request. This selects the named +application directly and can also request an explicitly named +`:stream_only` publisher. + +`outputs=:none` retains no user output streams. Histories required by temporal +dependencies are still maintained with bounded retention. + +`run!(model; ...)` always starts a fresh result timeline. Continue an existing +simulation without resetting its step index, environment position, multirate +phase, or temporal histories with: + +```julia +continue!(sim; steps=24) +step!(sim) +current_step(sim) ``` -`tracked_outputs` accepts `OutputRequest` values for these resampled exports. -You can also return them directly from `run!`: +Temporal dependency streams that are not explicitly requested retain only the +history required by their input policy. `HoldLast` keeps the latest sample, +`Integrate` and `Aggregate` keep their input window, and `Interpolate` and +`PreviousTimeStep` keep sufficient recent source samples. Requested streams +retain complete histories for post-run export. `Diagnostics.explain_output_retention(sim)` +reports `retention_steps` for bounded dependency-only streams and `nothing` +for full-history streams. + +## Lifecycle Changes + +CompositeModel objects may be added, removed, reparented, moved, or have their geometry +updated between or during timesteps: ```julia -out_status, exported = run!( - sim, - meteo; - tracked_outputs=[req], - return_requested_outputs=true, +register_object!(model, Object(:new_leaf; scale=:Leaf); parent=:plant_1) +leaf_status = add_organ!( + parent_node, + model, + :+, + :Leaf, + 3; + index=4, + attributes=(area=0.01,), + initial_status=(biomass=0.0,), ) +remove_object!(model, :old_leaf) +reparent_object!(model, :leaf_3, :plant_2) +move_object!(model, :leaf_4, new_geometry) +update_geometry!(model, :leaf_5, new_geometry) ``` + +Use `add_organ!` for an MTG-backed model. It creates the MTG node, initializes +and attaches its `Status` with the model's MTG policy, registers the model +object, and invalidates the affected bindings. `register_object!` is the +low-level operation for callers that already own a complete `Object`. + +Structural changes invalidate compiled object/model bindings. Movement and +geometry changes invalidate environment bindings without rebuilding structural +input carriers. The next `run!` or `continue!` timestep refreshes the necessary +caches. + +Do not mutate `Object` topology, labels, or geometry fields directly. Direct +field mutation bypasses registry indexes and cache invalidation and is +unsupported. Use the lifecycle functions above. They validate prerequisites +before mutating; in particular, `reparent_object!` rejects self-parenting and +descendant cycles without changing existing links. `ObjectInstance` roots are +immutable lifecycle anchors: removing or reparenting a root, or an ancestor +whose subtree contains one, is rejected atomically. Ordinary descendants may +still be added, removed, or reparented. + +Inside a lifecycle-capable model kernel, use `runtime_model(context)` to obtain +the live model. Objects created during a kernel call do not recursively execute +inside that call. Structural targets, value carriers, call targets, writer +validation, schedules, and output-request matches are refreshed at the next +timestep boundary. Geometry-only mutations refresh affected environment +bindings at that boundary; already published streams remain available for +removed objects. diff --git a/docs/src/model_traits.md b/docs/src/model_traits.md index 6c9633451..58288c237 100644 --- a/docs/src/model_traits.md +++ b/docs/src/model_traits.md @@ -1,154 +1,123 @@ -# Model traits +# Model Traits -This page centralizes the model-level traits that can be defined in `PlantSimEngine`. -It complements: +Model traits describe intrinsic model behavior. Scenario-specific coupling +belongs in `ModelSpec` through `on`, `inputs`, `calls`, `every`, +`Environment`, `output_routing`, and `Updates`. -- [Model execution](model_execution.md) for runtime behavior, -- [Parallelization](step_by_step/parallelization.md) for execution over objects/time-steps. +## Variables -## Trait inventory for models - -### `timespec(::Type{<:MyModel})` - -Defines the default execution clock of a model. - -Default: +Implement `inputs_(model)` with an explicit declaration for every status input: ```julia -PlantSimEngine.timespec(::Type{<:AbstractModel}) = ClockSpec(1.0, 0.0) +PlantSimEngine.inputs_(::MyModel) = ( + leaf_area=Required(Float64), + efficiency=Default(0.8), +) +PlantSimEngine.outputs_(::MyModel) = (assimilation=0.0,) ``` -Use it when your model has a natural native clock (for example daily by default). +`Required(T)` means the value must be present on the target object's `Status` +or bound from another application. `T` is an expected type, not a placeholder +value. It may be abstract or parametric, so use the scientific type contract +instead of forcing `Float64`. -### `output_policy(::Type{<:MyModel})` +`Default(value)` means the model can run without user initialization or a +producer for that input. PlantSimEngine installs a private copy of `value` on +each target object when the value is absent. Mutable defaults are therefore +not shared between objects. -Defines per-output default schedule policy for produced streams. +Output literals remain initial output-state values. In the example, +`assimilation` starts at `0.0` before the first accepted model call. -Default: +These declarations are used for status initialization, dependency inference, +validation, and type construction. Plain input literals are rejected because +they do not say whether the value is required or genuinely optional. -```julia -PlantSimEngine.output_policy(::Type{<:AbstractModel}) = NamedTuple() -``` - -Behavior: +Use `init_variables(model)` to inspect only values PlantSimEngine can +initialize by itself: `Default` input values and output initial values. +Required inputs are intentionally omitted. -- unspecified outputs fall back to `HoldLast()`; -- used by runtime when resolving cross-clock reads; -- used as default policy for inferred `InputBindings(...)` when users do not provide explicit bindings; -- hint-only and lazy: policy is applied only for outputs that are actually consumed/exported. - Declaring a policy for an unused output does not trigger integration work. +Before running a scenario, `Diagnostics.explain_initialization(model)` classifies inputs as +`:required`, `:defaulted`, `:supplied`, or `:producer_bound`. A +`:required` row must be resolved before compilation can succeed. -Example: - -```julia -PlantSimEngine.output_policy(::Type{<:MyModel}) = ( - carbon_assimilation=Integrate(), - leaf_temperature=Aggregate(MeanReducer()), -) -``` +## Manual Dependencies -Users can always override or complement this trait at mapping level: +Implement `dep(model)` only when the model directly calls another process from +inside its own `run!` method: ```julia -ModelSpec(MyConsumerModel()) |> -InputBindings( - ; - carbon_assimilation=(process=:myproducer, var=:carbon_assimilation, policy=HoldLast()), # override trait default - carbon_assimilation_max=(process=:myproducer, var=:carbon_assimilation, policy=Aggregate(MaxReducer())), # complement with extra derived input +PlantSimEngine.dep(::EnergyBalance) = ( + photosynthesis=AbstractPhotosynthesisModel, ) ``` -### `timestep_hint(::Type{<:MyModel})` +The scenario binds the dependency with `ModelSpec(...; calls=...)`. The parent executes all +resolved targets with `run_call!(context, :photosynthesis)`, which always returns +a vector-like collection. Use `call_targets` plus `run_call!(target)` when the +parent needs selective trials and accepted publication. -Optional compatibility hint when `TimeStepModel(...)` is not provided. +## Timing -Default: +`timespec(model)` declares the model's default clock. The default is +`ClockSpec(1.0, 0.0)`. ```julia -PlantSimEngine.timestep_hint(::Type{<:AbstractModel}) = nothing +PlantSimEngine.timespec(::Type{<:DailyGrowth}) = ClockSpec(Dates.Day(1)) ``` -Supported forms include: +`output_policy(model)` declares the default temporal policy per output: -- fixed period: `Dates.Hour(1)`; -- range: `(Dates.Minute(30), Dates.Hour(2))`; -- named tuple: `(; required=..., preferred=...)`. +```julia +PlantSimEngine.output_policy(::Type{<:MyModel}) = ( + assimilation=Integrate(), + leaf_temperature=Aggregate(MeanReducer()), +) +``` -`required` is enforced when runtime uses meteo-derived timestep. -`preferred` is informational only. +Unspecified outputs use `HoldLast()`. A scenario can select another clock with +`ModelSpec(...; every=...)` and another input policy in `ModelSpec(...; inputs=...)`. -### `meteo_hint(::Type{<:MyModel})` +`timestep_hint(model)` can declare required or preferred timestep constraints. +`environment_hint(model)` can provide default environment sampling configuration. -Optional inference trait for weather sampling configuration. +## Environment Variables -Default: +Use `environment_inputs_(model)` for variables sampled from the active environment +backend: ```julia -PlantSimEngine.meteo_hint(::Type{<:AbstractModel}) = nothing +PlantSimEngine.environment_inputs_(::LeafEnergyBalance) = ( + T=0.0, + Rh=0.0, + Wind=0.0, + Ri_PAR_f=0.0, + CO2=400.0, +) ``` -Expected value: +Mutable microclimate updates should be committed explicitly by controller +models: ```julia -(; bindings=..., window=...) +commit_environment!(context, accepted_environment) ``` -Where: - -- `bindings` is compatible with `MeteoBindings(...)`, -- `window` is compatible with `MeteoWindow(...)`. - -### `TimeStepDependencyTrait(::Type{<:MyModel})` -### `ObjectDependencyTrait(::Type{<:MyModel})` - -Parallelization traits (single-scale runtime): - -- `TimeStepDependencyTrait`: depends or not on other timesteps; -- `ObjectDependencyTrait`: depends or not on other objects. - -Defaults are conservative (`dependent`) and can be overridden when safe. - -## Precedence rules - -Runtime precedence is intentionally explicit: - -1. Input policy: - explicit `InputBindings(..., policy=...)` > inferred from producer `output_policy` > `HoldLast()`. -1. Timestep: - `TimeStepModel(...)` > `timespec(model)` when non-default > meteo base step. -1. Meteo sampling: - explicit `MeteoBindings(...)`/`MeteoWindow(...)` > `meteo_hint(...)` > runtime defaults. +For trial solves, pass a backend-specific state with `environment` so each +hard-called model keeps its compiled provider or spatial handle: -## Is everything documented? - -For model-level traits, the documented set is now: - -- `timespec`, -- `output_policy`, -- `timestep_hint`, -- `meteo_hint`, -- `TimeStepDependencyTrait`, -- `ObjectDependencyTrait`. - -Outside model traits, `PlantSimEngine` also exposes data-format traits such as `DataFormat` for input containers (see [Input types](working_with_data/inputs.md)). - -## Naming conventions and API consistency - -Current API uses two naming styles on purpose: - -- snake_case for trait/query functions (`timespec`, `output_policy`, `timestep_hint`, `meteo_hint`); -- CamelCase for `ModelSpec` pipeline transforms (`TimeStepModel`, `InputBindings`, `MeteoBindings`, `MeteoWindow`, `OutputRouting`, `ScopeModel`). +```julia +run_call!(context, :leaf_energy; environment=trial_environment, publish=false) +``` -This distinction reflects role: +Diagnostic variables such as canopy temperature or vapor-pressure deficit can +still be regular `outputs_`, but status fields are not the transport mechanism +for mutable environment state. -- snake_case: "what the model declares"; -- CamelCase: "what the mapping config applies". +## Precedence -For future unification, a non-breaking path would be: +Scenario configuration has precedence over model defaults: -1. keep existing names as stable API, -1. avoid plain snake_case aliases that would collide with existing getter names - (`input_bindings`, `meteo_bindings`, `output_routing`, `model_scope`), -1. if needed, add explicit config-oriented aliases with distinct names - (for example `*_config` forms) and keep current constructors, -1. evaluate deprecations only after one full release cycle and user feedback. +1. `ModelSpec(...; inputs=...)` policy, then producer `output_policy`, then `HoldLast()`. +2. `ModelSpec(...; every=...)`, then `timespec(model)`, then the environment base step. +3. `Environment(...)`, then `environment_hint(model)`, then backend defaults. diff --git a/docs/src/multirate/advanced_configuration.md b/docs/src/multirate/advanced_configuration.md deleted file mode 100644 index 28197648b..000000000 --- a/docs/src/multirate/advanced_configuration.md +++ /dev/null @@ -1,208 +0,0 @@ -# Advanced multi-rate configuration - -This page collects the multi-rate features that were intentionally kept in the -background on the first two pages: - -- [Introduction to multi-rate execution](introduction.md) explains the core - scheduling rules; -- [Step-by-step multi-rate tutorial](multirate_tutorial.md) shows a complete - hourly/daily/weekly MTG example with minimal configuration; -- this page covers the explicit configuration tools you reach for when defaults - are no longer enough. - -The goal here is not to build another full simulation from scratch. Instead, the -objective is to explain when and why you should add more explicit multi-rate -declarations to a mapping. - -## 1. When the defaults are enough - -PlantSimEngine tries to keep simple mappings concise: - -- if a model does not declare `TimeStepModel(...)`, it follows the meteo - cadence; -- if an input has a unique producer, `InputBindings(...)` can often be omitted; -- if a model consumes common `Atmosphere` variables at a coarser cadence, - PlantMeteo default transforms can often replace explicit `MeteoBindings(...)`; -- if an exported variable has a unique canonical publisher, `OutputRequest(...)` - can often omit `process=`. - -The sections below focus on the cases where that implicit behavior becomes too -ambiguous or too limiting. - -## 2. Explicit model-to-model bindings with `InputBindings(...)` - -The tutorial pages rely on unique-producer inference plus `output_policy(...)` -declared on the source models. That is the simplest setup, but it stops being -enough as soon as several candidate producers exist or when you want to override -the default resampling rule. - -Use explicit `InputBindings(...)` when: - -- several models can produce the same input variable; -- the same process exists at several reachable scales; -- the source variable has a different name than the consumer input; -- the producer default policy is not the policy you want for this particular - connection. - -For example, a daily plant model may need to say explicitly that it consumes the -hourly leaf assimilation stream from the `:Leaf` scale and integrates it over -the day: - -```julia -plant_daily_spec = ModelSpec(TutorialPlantDailyModel()) |> - TimeStepModel(ClockSpec(24.0, 0.0)) |> - InputBindings(; - leaf_assim_h=( - process=:tutorialleafhourly, - scale=:Leaf, - var=:leaf_assim_h, - policy=Integrate(), - ), - ) -``` - -This is more verbose than inference, but the resulting mapping is also more -explicit: anyone reading it can see exactly where the data comes from and how it -is reduced. - -## 3. Explicit meteorological aggregation with `MeteoBindings(...)` - -For common `Atmosphere` variables, PlantSimEngine delegates weather sampling to -PlantMeteo, and PlantMeteo already defines default transforms. In practice, this -means you often do not need `MeteoBindings(...)` for variables such as `T`, -`Rh`, or aliases like `Ri_SW_q`. - -Add explicit `MeteoBindings(...)` when: - -- you want a non-default reducer; -- the target variable should come from a differently named source variable; -- the variable is not covered by PlantMeteo defaults; -- you want the mapping itself to document the intended weather aggregation rule. - -For example, this daily model makes the defaults explicit for temperature and -shortwave radiation energy: - -```julia -plant_daily_spec = ModelSpec(TutorialPlantDailyModel()) |> - TimeStepModel(ClockSpec(24.0, 0.0)) |> - MeteoBindings( - ; - T=MeanWeighted(), - Ri_SW_q=(source=:Ri_SW_f, reducer=RadiationEnergy()), - ) -``` - -And this variant shows a more genuinely custom rule: - -```julia -plant_daily_spec = ModelSpec(TutorialPlantDailyModel()) |> - TimeStepModel(ClockSpec(24.0, 0.0)) |> - MeteoBindings( - ; - T=(source=:T, reducer=MaxReducer()), - rad_peak=(source=:Ri_SW_f, reducer=MaxReducer()), - ) -``` - -The important point is that `MeteoBindings(...)` is not only about reducing -weather from fast to slow. It is also a way to state the semantics of that -reduction explicitly. - -## 4. Calendar-aligned windows with `MeteoWindow(...)` - -By default, coarser meteo sampling uses rolling windows that follow the model -clock. That is often sufficient, but some models are tied to civil periods such -as "the current day" or "the current week". - -In those cases, use `MeteoWindow(...)` to replace the default trailing window -with a calendar-aligned one: - -```julia -plant_daily_spec = ModelSpec(TutorialPlantDailyModel()) |> - TimeStepModel(ClockSpec(24.0, 0.0)) |> - MeteoWindow( - CalendarWindow( - :day; - anchor=:current_period, - week_start=1, - completeness=:strict, - ), - ) -``` - -This becomes important when a daily or weekly model should aggregate over civil -days or weeks rather than over "the last 24 hours" or "the last 168 hours". - -## 5. Exporting streams with `OutputRequest(...)` - -The second tutorial page uses `OutputRequest(...)` to materialize clean -hourly/daily/weekly tables from the simulation streams. The simple form works -well when the requested variable has a unique canonical publisher: - -```julia -req_plant_daily = OutputRequest(:Plant, :plant_assim_d; - name=:plant_assim_daily, - clock=ClockSpec(24.0, 0.0), -) -``` - -More complex mappings often need more explicit requests. In particular, add -`process=` when several models can publish the same variable, and add `policy=` -when you need a specific export-time resampling behavior: - -```julia -req_daily_energy = OutputRequest(:Leaf, :leaf_assim_h; - name=:leaf_energy_daily, - process=:tutorialleafhourly, - policy=Integrate(), - clock=ClockSpec(24.0, 0.0), -) - -req_hourly_hold = OutputRequest(:Plant, :plant_assim_d; - name=:plant_assim_hold_hourly, - process=:tutorialplantdaily, - policy=HoldLast(), - clock=ClockSpec(1.0, 0.0), -) -``` - -So `OutputRequest(...)` is not just a way to rename a column. It is also a -declaration of which stream you want, at which cadence, and with which -resampling policy. - -## 6. Inspect resolved configuration - -When a mapping mixes inferred bindings, explicit bindings, custom meteo -aggregation, scopes, and export requests, it becomes difficult to reason about -the final resolved configuration by inspection alone. - -That is where `explain_model_specs(...)` and `resolved_model_specs(...)` become -useful: - -```julia -explain_model_specs(mapping) - -resolved = resolved_model_specs(mapping) -resolved[:Plant] -``` - -These helpers let you confirm: - -- the effective timestep of each model; -- the resolved input bindings; -- the resolved meteo bindings; -- the active meteo window. - -In practice, this is often the fastest way to debug a multi-rate mapping before -running a larger simulation. - -## 7. How to choose between the three pages - -Use the pages in this order: - -1. start with [Introduction to multi-rate execution](introduction.md) if you - want to understand the scheduling rules; -2. continue with [Step-by-step multi-rate tutorial](multirate_tutorial.md) for - a complete but compact MTG example; -3. come back to this page when you need explicit bindings, explicit meteo - aggregation, custom export requests, scopes, or debugging helpers. diff --git a/docs/src/multirate/introduction.md b/docs/src/multirate/introduction.md deleted file mode 100644 index a0556ceae..000000000 --- a/docs/src/multirate/introduction.md +++ /dev/null @@ -1,200 +0,0 @@ -# Introduction to multi-rate execution - -This page introduces the basic ideas behind multi-rate execution in -PlantSimEngine. - -The goal here is not to build a realistic plant model. Instead, the objective is -to make the mechanics of multi-rate execution easy to see: - -- how PlantSimEngine decides when a model runs; -- how values are transferred from a faster model to a slower one; -- how meteorological inputs are reduced over a coarse time window. - -Once those ideas are clear, the -[step-by-step multi-rate tutorial](multirate_tutorial.md) shows how to assemble -a more complete hourly/daily/weekly MTG simulation. - -## Decision flow quick examples - -Before building a larger example, it helps to establish two important rules: - -1. if a model does not declare an explicit timestep, it follows the meteo cadence; -2. if a model is forced to run more coarsely than its inputs, then explicit input - and meteo binding policies determine how information is aggregated. - -### Simple example with implicit meteo cadence - -Model may define a trait calles `timestep_hint` that describes the acceptable and preferred cadences for that model. However, that trait is purely descriptive: it does not force the model to run at any particular rate. If you want to force a model to run at a specific cadence, you must declare an explicit `TimeStepModel(...)` in the mapping. Otherwise, the model will simply run whenever the meteo cadence allows it to, and the `timestep_hint` can be used for validation or explanation but does not silently reschedule the model. - -Let's define a tiny model that simply counts how many times it ran, then feed it -three 30-minute weather rows: - -```@example multirate_timestep_flow -using PlantSimEngine -using PlantMeteo -using MultiScaleTreeGraph -using DataFrames -using Dates - -mtg = Node(NodeMTG("/", :Scene, 1, 0)) -plant = Node(mtg, NodeMTG("+", :Plant, 1, 1)) -internode = Node(plant, NodeMTG("/", :Internode, 1, 2)) -Node(internode, NodeMTG("+", :Leaf, 1, 2)) - -PlantSimEngine.@process "tutorialmeteodriven" verbose=false -struct TutorialMeteoDrivenModel <: AbstractTutorialmeteodrivenModel - n::Base.RefValue{Int} -end -PlantSimEngine.inputs_(::TutorialMeteoDrivenModel) = NamedTuple() -PlantSimEngine.outputs_(::TutorialMeteoDrivenModel) = (count=-Inf,) -function PlantSimEngine.run!(m::TutorialMeteoDrivenModel, models, status, meteo, constants=nothing, extra=nothing) - m.n[] += 1 - status.count = float(m.n[]) -end -PlantSimEngine.timestep_hint(::Type{<:TutorialMeteoDrivenModel}) = (; required=(Minute(30), Hour(2)), preferred=Hour(1)) -``` - -This model is designed to run between every 30 minutes and every 2 hours, with a preferred cadence of 1 hour. Let's make a mapping with the model but without an explicit `TimeStepModel(...)`: - -```@example multirate_timestep_flow -mapping = ModelMapping(:Leaf => (TutorialMeteoDrivenModel(Ref(0)),)) -``` - -Let's define a 30-minute weather table with three rows: - -```@example multirate_timestep_flow -meteo_30min = Weather([ - Atmosphere(date=DateTime(2025, 6, 12, 12, 0, 0), duration=Minute(30), T=20.0, Wind=1.0, Rh=0.6), - Atmosphere(date=DateTime(2025, 6, 12, 12, 30, 0), duration=Minute(30), T=21.0, Wind=1.0, Rh=0.6), - Atmosphere(date=DateTime(2025, 6, 12, 13, 0, 0), duration=Minute(30), T=22.0, Wind=1.0, Rh=0.6), -]) -``` - -Now we run the model and check how many times it ran over those three 30-minute rows: - -```@example multirate_timestep_flow -out_meteo_driven = run!( - mtg, - mapping, - meteo_30min; - executor=SequentialEx(), - tracked_outputs=Dict(:Leaf => (:count,)), -) -out_meteo_driven[:Leaf][end] -``` - -The last value for `:count` is `3.0`, showing the model ran on all three 30-minute meteo rows, -even though `preferred=Hour(1)`. - -That is the key point: without `TimeStepModel`, the model still follows the -incoming meteo table. The preferred timestep can be used for validation or for -explanation, but it does not silently reschedule the model. - -### Using `TimeStepModel` to manage multi-rate coupling - -The second example shows the complementary case. Here we explicitly ask one model -to run hourly, even though its source data arrives every 30 minutes. Once we do -that, PlantSimEngine needs instructions for two distinct questions: - -- how to combine the 30-minute source output into an hourly model input; -- how to combine 30-minute meteorological rows into the hourly meteo seen by the - coarse model. - -That is what `InputBindings(...)` and `MeteoBindings(...)` are for. -In this tiny example, we keep the mapping simple by declaring the default -reduction policy on the source model itself with `output_policy(...)`. Since `A` -has a unique producer on the same scale, PlantSimEngine can infer the source -automatically and reuse that policy. - -Let's define a simple 30-minute source model that produces a constant value `A=1.0` every time it runs, and declare that its output should be integrated when consumed by a slower model: - -```@example multirate_timestep_flow -PlantSimEngine.@process "tutorialhalfhoursource" verbose=false -struct TutorialHalfHourSourceModel <: AbstractTutorialhalfhoursourceModel - n::Base.RefValue{Int} -end -PlantSimEngine.inputs_(::TutorialHalfHourSourceModel) = NamedTuple() -PlantSimEngine.outputs_(::TutorialHalfHourSourceModel) = (A=-Inf,) -function PlantSimEngine.run!(m::TutorialHalfHourSourceModel, models, status, meteo, constants=nothing, extra=nothing) - m.n[] += 1 - status.A = 1.0 # umol m-2 s-1 -end -PlantSimEngine.output_policy(::Type{<:TutorialHalfHourSourceModel}) = (; A=Integrate(DurationSumReducer())) -``` - -Note that `output_policy(...)` says that when a slower model consumes `A`, the default is to integrate it over the coarser time window, using the duration of each source row as weights. - -Now we define a simple hourly model that consumes `A` and also reads hourly mean temperature from the meteo: - -```@example multirate_timestep_flow -PlantSimEngine.@process "tutorialhourlyintegrator" verbose=false -struct TutorialHourlyIntegratorModel <: AbstractTutorialhourlyintegratorModel end -PlantSimEngine.inputs_(::TutorialHourlyIntegratorModel) = (A=-Inf,) -PlantSimEngine.outputs_(::TutorialHourlyIntegratorModel) = (A_hourly=-Inf, T_hourly=-Inf,) -function PlantSimEngine.run!(::TutorialHourlyIntegratorModel, models, status, meteo, constants=nothing, extra=nothing) - status.A_hourly = status.A - status.T_hourly = meteo.T -end -``` - -!!! note - We make two deliberate simplifications here to keep the example compact: - 1. The hourly model simply copies the integrated `A` value into a new variable called `A_hourly`. This is bad design in a real model because it creates unnecessary variables and makes the data flow less transparent. In a real model, you would typically consume `A` directly and let the integrated value be called `A` as well. However, here we create a separate variable to make it obvious that the hourly model is receiving an aggregated version of the original `A`. - 2. We don't define an `output_policy(...)` for the hourly model, because it is not consumed by any slower model. Usually, developers are encouraged to define `output_policy(...)` for all models, but here we omit it for the hourly model to keep the example compact. - -Now we can declare a mapping that says the hourly model runs every hour, even though its source data arrives every 30 minutes. We also declare how to reduce the meteorological inputs to match the hourly cadence: - -```@example multirate_timestep_flow -mapping_coarse = ModelMapping( - :Leaf => ( - ModelSpec(TutorialHalfHourSourceModel(Ref(0))), - ModelSpec(TutorialHourlyIntegratorModel()) |> - TimeStepModel(Hour(1)) |> - MeteoBindings(; T=MeanWeighted()), - ), -) -``` - -Setting the `TimeStepModel(Hour(1))` forces the second model to run hourly. Since it consumes `A` from the first model, PlantSimEngine looks at the source model's `output_policy(...)` and sees that it should integrate `A` over the hour using the duration of each 30-minute row as weights. - -!!! note - If we had omitted `TimeStepModel(Hour(1))`, the hourly model would have simply run on each 30-minute row, and the `output_policy(...)` on the source model would not have been triggered. The hourly model would have received the original 30-minute `A` values instead of an hourly aggregate. This illustrates the key point: `TimeStepModel(...)` is what triggers the multi-rate coupling and the use of reduction policies. - -In our example, the hourly model does not declare a `timestep_hint`, so it can run at any cadence. By declaring `TimeStepModel(Hour(1))`, we explicitly force it to run hourly, which means it will receive aggregated inputs and meteo. - -!!! note - Because our hourly model does not declare a `timestep_hint`, it is flexible and can run at any cadence. However, if we had declared a `timestep_hint` that did not include hourly as an acceptable cadence, then PlantSimEngine would have raised an error when we tried to force it to run hourly. Consequently, it is usually a good practice to declare a `timestep_hint` when writing a model, because it helps to ensure that the model is used in a way that is consistent with its design and intended use. - -Let's now run the simulation: - -```@example multirate_timestep_flow -meteo_30min_4 = Weather([ - Atmosphere(date=DateTime(2025, 6, 12, 12, 0, 0), duration=Minute(30), T=20.0, Wind=1.0, Rh=0.6), - Atmosphere(date=DateTime(2025, 6, 12, 12, 30, 0), duration=Minute(30), T=22.0, Wind=1.0, Rh=0.6), - Atmosphere(date=DateTime(2025, 6, 12, 13, 0, 0), duration=Minute(30), T=24.0, Wind=1.0, Rh=0.6), - Atmosphere(date=DateTime(2025, 6, 12, 13, 30, 0), duration=Minute(30), T=26.0, Wind=1.0, Rh=0.6), -]) - -out_coarse = run!( - mtg, - mapping_coarse, - meteo_30min_4; - executor=SequentialEx(), - tracked_outputs=Dict(:Leaf => (:A_hourly, :T_hourly)), -) -out_coarse[:Leaf][end] -``` - -The final timestep outputs are `3600.0` for `A_hourly` and `23.0` for `T_hourly`: hourly integrated assimilation -(`sum(A .* duration_seconds)` over two 30-minute rows) and hourly mean temperature over the coarse window. - -So this example already captures the core multi-rate idea: the fast model still -runs at the fine cadence, while the coarse model sees explicitly reduced inputs -and meteorology at its own cadence. - -From here, there are two natural next steps: - -- [Step-by-step multi-rate tutorial](multirate_tutorial.md) for a more complete - MTG example; -- [Advanced multi-rate configuration](advanced_configuration.md) for explicit - bindings, meteo windows, export requests, scopes, and debugging helpers. diff --git a/docs/src/multirate/multirate_tutorial.md b/docs/src/multirate/multirate_tutorial.md deleted file mode 100644 index 49c76dd58..000000000 --- a/docs/src/multirate/multirate_tutorial.md +++ /dev/null @@ -1,429 +0,0 @@ -# Step-by-step multi-rate tutorial (hourly + daily + weekly) - -This page builds a more complete MTG simulation that mixes three model rates: -- hourly at `Leaf`, -- daily at `Plant`, -- weekly at `Plant`. - -It runs for one week and exports clean series at each rate. - -If you want the conceptual overview first, start with -[Introduction to multi-rate execution](introduction.md). This page assumes you -already understand the two basic ideas introduced there: - -1. without `TimeStepModel(...)`, a model follows the meteo cadence; -2. once a model is forced to run more coarsely than its inputs, PlantSimEngine - must reduce both model outputs and meteorological inputs to match that slower - cadence. - -The goal of this second page is to put those ideas into a more contextualized -MTG example, where we mix hourly, daily, and weekly models in the same -simulation and export clean time series at each rate. - -## 1. Setup and example data - -This tutorial is more contextualized than the previous one. To keep the mechanics -readable, we work with a minimal MTG containing only one plant and one leaf. That -way the exported tables stay small enough to inspect directly. - -We also reuse package example assets instead of inventing new input files. In particular, we use a weather file available from the package examples: - -- `examples/meteo_day.csv` for weather. - -We start by importing the packages we need and by creating a very small MTG with -only four nodes: a `Scene`, a `Plant`, one `Internode`, and one `Leaf`. - -```@example multirate_tutorial -using PlantSimEngine -using PlantMeteo -using MultiScaleTreeGraph -using DataFrames -using CSV -using Dates - -# Minimal plant: Scene -> Plant -> Internode -> Leaf -mtg = Node(NodeMTG("/", :Scene, 1, 0)) -plant = Node(mtg, NodeMTG("+", :Plant, 1, 1)) -internode = Node(plant, NodeMTG("/", :Internode, 1, 2)) -Node(internode, NodeMTG("+", :Leaf, 1, 2)) -``` - -Next, we point to the bundled weather file and confirm that it exists: - -```@example multirate_tutorial -meteo_path = joinpath(pkgdir(PlantSimEngine), "examples", "meteo_day.csv") -@assert isfile(meteo_path) -``` - -The weather file bundled with the package is daily. Since this tutorial is about -mixing several rates, we first convert one week of daily weather into an -hourly weather table. The values are simply repeated within each day, which is -perfectly fine here because the purpose is to illustrate scheduling and data flow -rather than to create a realistic forcing dataset. - -The first step is to read the file and keep only one week of rows: - -```@example multirate_tutorial -daily_df = CSV.read(meteo_path, DataFrame, header=18) -week_df = first(daily_df, 7) -``` - -We then expand each day into 24 hourly `Atmosphere` rows: - -```@example multirate_tutorial -hourly_rows = Atmosphere[] -for row in eachrow(week_df) - for h in 0:23 - push!(hourly_rows, - Atmosphere( - date=DateTime(row.date) + Hour(h), - duration=Hour(1), - T=row.T, - Wind=row.Wind, - P=row.P, - Rh=row.Rh, - Ri_PAR_f=row.Ri_PAR_f, - Ri_SW_f=row.Ri_SW_f, - ) - ) - end -end -``` - -Finally, we wrap those rows into a `Weather` object, which is what `run!` expects: - -```@example multirate_tutorial -meteo_hourly = Weather(hourly_rows) -meteo_hourly[1:3] # show the first 3 rows of the hourly weather table -``` - -## 2. Defining simple models - -Next we define three deliberately simple models: - -- an hourly `Leaf` model that turns incoming radiation into an hourly - assimilation value; -- a daily `Plant` model that sums hourly leaf assimilation over a day and also - consumes daily meteorological aggregates; -- a weekly `Plant` model that sums daily plant assimilation into one weekly - value. - -These models are intentionally minimal. Their role is to make the rate changes -and aggregation policies obvious. - -We begin with the hourly leaf model. It reads hourly meteorological radiation and -produces an hourly assimilation value: - -```@example multirate_tutorial -PlantSimEngine.@process "tutorialleafhourly" verbose=false -struct TutorialLeafHourlyModel <: AbstractTutorialleafhourlyModel end -PlantSimEngine.inputs_(::TutorialLeafHourlyModel) = NamedTuple() -PlantSimEngine.outputs_(::TutorialLeafHourlyModel) = (leaf_assim_h=0.0,) -function PlantSimEngine.run!(::TutorialLeafHourlyModel, models, status, meteo, constants=nothing, extra=nothing) - status.leaf_assim_h = 0.004 * meteo.Ri_PAR_f -end -PlantSimEngine.output_policy(::Type{<:TutorialLeafHourlyModel}) = (; leaf_assim_h=Integrate()) -``` - -The `output_policy(...)` declaration matters for multi-rate use: it says that -when a slower model consumes `leaf_assim_h`, the natural default is to integrate -it over the coarser time window. - -Now we define the daily plant model. It receives leaf assimilation values, -aggregates them over a day, and also reads daily reduced meteo variables: - -```@example multirate_tutorial -PlantSimEngine.@process "tutorialplantdaily" verbose=false -struct TutorialPlantDailyModel <: AbstractTutorialplantdailyModel end -PlantSimEngine.inputs_(::TutorialPlantDailyModel) = (leaf_assim_h=[0.0],) -PlantSimEngine.outputs_(::TutorialPlantDailyModel) = (plant_assim_d=0.0, rad_sw_day=0.0, T=0.0) -function PlantSimEngine.run!(::TutorialPlantDailyModel, models, status, meteo, constants=nothing, extra=nothing) - status.plant_assim_d = sum(status.leaf_assim_h) - status.rad_sw_day = meteo.Ri_SW_q - status.T = meteo.T -end -PlantSimEngine.output_policy(::Type{<:TutorialPlantDailyModel}) = (; plant_assim_d=Integrate()) -``` - -Again, `output_policy(...)` is used so that a coarser consumer can infer the -appropriate default behavior for `plant_assim_d`. - -Finally, we define the weekly plant model. It simply sums the daily plant -assimilation values over one week: - -```@example multirate_tutorial -PlantSimEngine.@process "tutorialplantweekly" verbose=false -struct TutorialPlantWeeklyModel <: AbstractTutorialplantweeklyModel end -PlantSimEngine.inputs_(::TutorialPlantWeeklyModel) = (plant_assim_d=[0.0],) -PlantSimEngine.outputs_(::TutorialPlantWeeklyModel) = (plant_assim_w=0.0,) -function PlantSimEngine.run!(::TutorialPlantWeeklyModel, models, status, meteo, constants=nothing, extra=nothing) - status.plant_assim_w = sum(status.plant_assim_d) -end -``` - -At this point nothing is multi-rate yet. We have simply defined three processes -whose intended cadences are hourly, daily, and weekly. The multi-rate behavior is -declared in the mapping. - -## 3. Configure multi-rate mapping - -This is the heart of the tutorial. The mapping below does three things at once: - -1. it assigns each model to a scale; -2. it declares the timestep at which each model should run; -3. it defines how values move between rates and between scales. - -Two pieces are especially important here: - -- `TimeStepModel(...)` states the model cadence; -- PlantMeteo reduces meteorological inputs automatically when a model runs more - coarsely than the weather data. - -For model-to-model bindings, this tutorial relies on automatic source inference -plus `output_policy(...)` on the source models. That keeps the main example -compact while still exercising multi-rate input aggregation. - -We start by defining the three clocks used in the simulation. These are the -cadences that will later be assigned to the three models: - -```@example multirate_tutorial -hourly = 1.0 -daily = ClockSpec(24.0, 0.0) -weekly = ClockSpec(168.0, 0.0) -``` - -The leaf model is straightforward: it runs hourly and is scoped to the current -plant. There is no multiscale mapping or meteo reduction to declare here, because -the leaf model is the fastest model in this example and directly consumes the -hourly weather rows: - -```@example multirate_tutorial -leaf_spec = TutorialLeafHourlyModel() |> ModelSpec |> TimeStepModel(hourly) -``` - -So at this point we have simply said: "run the leaf model every hour" - -The daily plant model is where multi-rate coupling becomes visible. It: - -- receives `leaf_assim_h` from the `:Leaf` scale through `MultiScaleModel(...)`; -- runs daily; -- receives daily meteorological aggregates from the hourly weather automatically. - -The important idea is that this model does not read the raw hourly values -directly. Instead, it sees a daily view of those data: - -- `leaf_assim_h` is integrated over the daily window because of the source - model's `output_policy(...)`; -- `T` is turned into a daily mean by the default PlantMeteo sampling rules; -- `Ri_SW_q` is computed by integrating `Ri_SW_f` over the day. - -```@example multirate_tutorial -plant_daily_spec = - TutorialPlantDailyModel() |> - ModelSpec |> - MultiScaleModel([:leaf_assim_h => :Leaf]) |> - TimeStepModel(daily) -``` - -This block is the first place where the "multi-rate" behavior is really visible: -one model consumes fine-grained biological outputs and fine-grained meteorology, -but only after both have been reduced to the model's own daily cadence. - -The weekly plant model is simpler again: it only needs to run weekly and receive -the daily plant output automatically. Since `plant_assim_d` has a unique producer -and already declares its own `output_policy(...)`, we do not need to add any -explicit binding here: - -```@example multirate_tutorial -plant_weekly_spec = - TutorialPlantWeeklyModel() |> - ModelSpec |> - TimeStepModel(weekly) -``` - -So this weekly model effectively says: "take the daily plant assimilation stream, -reduce it again to my weekly cadence, and run once per week." - -We can now assemble the full mapping: - -```@example multirate_tutorial -mapping = ModelMapping( - :Leaf => (leaf_spec,), - :Plant => (plant_daily_spec, plant_weekly_spec), -) -``` - -Reading this mapping from top to bottom: - -- the `Leaf` model runs hourly and produces `leaf_assim_h`; -- the daily `Plant` model receives leaf values from the `Leaf` scale through - `MultiScaleModel([:leaf_assim_h => :Leaf])`, then integrates them over a day; -- that same daily model also receives daily meteorological summaries through the - default PlantMeteo sampling rules; -- the weekly `Plant` model integrates the daily plant output into one weekly - value. - -!!! note - In this tutorial, explicit `InputBindings(...)` are omitted because each - input has a unique, inferable producer and the default reduction policy is - declared on the source model with `output_policy(...)`. - - In more complex mappings, you should use explicit `InputBindings(process=..., scale=..., var=..., policy=...)` when: - - several models can produce the same input variable; - - the same process exists at several reachable scales; - - the source variable has a different name than the consumer input; - - you want to override the producer's default policy for a specific mapping. - -!!! note - `MeteoBindings(...)` is also omitted on purpose in the main example. - PlantSimEngine delegates weather sampling to PlantMeteo, which already - defines default transformations for common `Atmosphere` variables such as - `T`, `Rh`, and radiation aliases like `Ri_SW_q`. - - Add explicit `MeteoBindings(...)` when: - - you want a non-default reducer; - - the model expects a target variable with a different source name; - - the variable is not covered by PlantMeteo default transforms; - - you want the mapping to state the weather aggregation rule explicitly. - - ```@example multirate_tutorial - # The same daily model, with weather aggregation rules written explicitly. - plant_daily_spec_explicit_meteo = ModelSpec(TutorialPlantDailyModel()) |> - MultiScaleModel([:leaf_assim_h => :Leaf]) |> - TimeStepModel(daily) |> - MeteoBindings( - ; - T=MeanWeighted(), - Ri_SW_q=(source=:Ri_SW_f, reducer=RadiationEnergy()), - ) - ``` - -## 4. Run and export hourly/daily/weekly series - -Now we run the simulation and request three exported series. This is a good place -to distinguish two related outputs returned by `run!`: - -- the regular simulation outputs (`out_status` below), which still contain the - model outputs tracked during the run; -- the explicitly requested exported series (`exported` below), which are the - clean hourly/daily/weekly tables we asked PlantSimEngine to materialize. - -We use `OutputRequest(...)` to say which variable we want and on which clock. -Here again we keep the example minimal: `process=` is omitted because each -requested output has a unique canonical publisher. - -We first declare the export requests. One request keeps the hourly leaf series, -another exports the daily plant series, and the last one exports the weekly plant -series. - -The point of these requests is to obtain three clean tables that each live at a -single rate, instead of having to reconstruct those time series manually from -the full simulation outputs: - -```@example multirate_tutorial -req_leaf_hourly = OutputRequest(:Leaf, :leaf_assim_h; - name=:leaf_assim_hourly, -) - -req_plant_daily = OutputRequest(:Plant, :plant_assim_d; - name=:plant_assim_daily, - clock=daily, -) - -req_plant_weekly = OutputRequest(:Plant, :plant_assim_w; - name=:plant_assim_weekly, - clock=weekly, -) -``` - -Then we run the simulation and ask PlantSimEngine to return both the regular -simulation outputs and the explicitly requested exported series: - -- `out_status` contains the regular tracked outputs of the simulation; -- `exported` contains the resampled, per-request tables defined above. - -```@example multirate_tutorial -out_status, exported = run!( - mtg, - mapping, - meteo_hourly; - executor=SequentialEx(), - tracked_outputs=[req_leaf_hourly, req_plant_daily, req_plant_weekly], - return_requested_outputs=true, -) -``` - -Finally, we extract the exported tables we want to inspect. At this point we are -no longer dealing with abstract stream definitions: we now have actual `DataFrame` -objects containing hourly, daily, and weekly series. - -```@example multirate_tutorial -leaf_hourly_df = exported[:leaf_assim_hourly] -plant_daily_df = exported[:plant_assim_daily] -plant_weekly_df = exported[:plant_assim_weekly] -``` - -The exported tables already have the cadence we asked for, so they are much -easier to inspect than a single mixed output table. - -We can start with a few basic checks on the number of rows. These checks are a -simple way to confirm that the export clocks did what we expected: - -```@example multirate_tutorial -@show nrow(leaf_hourly_df) # 168 (1 leaf x 168 hours) -@show nrow(plant_daily_df) # 7 (1 plant x 7 days) -@show nrow(plant_weekly_df) # 1 (1 plant x 1 week) -``` - -The hourly table has one row per hour, the daily table one row per day, and the -weekly table one row for the whole run. - -To compare the hourly and daily outputs directly, we group the hourly series by -day and sum it manually. This lets us check that the daily plant model really did -receive the integrated hourly leaf assimilation: - -```@example multirate_tutorial -leaf_hourly_df.day = repeat(1:7, inner=24) -leaf_hourly_sum = combine(groupby(leaf_hourly_df, :day), :value => sum => :leaf_assim_h_sum) -``` - -Those row counts match the intended design of the example: one hourly series for -seven days, one daily series for seven days, and one weekly aggregate for the -whole run. - -We can also manually recompute the daily sums from the hourly exported series and -compare them with the daily model output: - -```@example multirate_tutorial -plant_daily_df -``` - -This confirms that the daily assimilation values correspond to the sum of the -hourly leaf assimilation collected over each day. - -The regular outputs returned by `run!` are still available as well, and can be -converted to `DataFrame`s in the usual way. This is useful when you want both: - -- clean resampled exports for analysis; -- the usual simulation outputs for debugging or broader inspection. - -```@example multirate_tutorial -outs = convert_outputs(out_status, DataFrame) -outs[:Plant][1:3,:] -``` - -## 5. Where to go next - -This page keeps the main walkthrough focused on a complete but still compact -example. Once that example is clear, the next step is usually to learn the -explicit configuration tools that become useful in larger mappings: - -- `InputBindings(...)` when inference is ambiguous or too implicit; -- `MeteoBindings(...)` when PlantMeteo defaults are not enough; -- `MeteoWindow(...)` for calendar-aligned aggregation; -- `OutputRequest(...)` when you want explicit export-time clocks and policies; -- `ScopeModel(...)`, `explain_model_specs(...)`, and `resolved_model_specs(...)` - for larger and harder-to-debug MTGs. - -Those topics are grouped in -[Advanced multi-rate configuration](advanced_configuration.md). diff --git a/docs/src/multiscale/multiscale.md b/docs/src/multiscale/multiscale.md deleted file mode 100644 index 062520811..000000000 --- a/docs/src/multiscale/multiscale.md +++ /dev/null @@ -1,255 +0,0 @@ -# Multi-scale variable mapping - -The previous page showed how to convert a single-scale simulation to multi-scale. - -This page provides another example showcasing the nuances in variable mapping, with a more complex fully multiscale version of a prior simulation. The models will all be taken form the [examples folder](https://github.com/VirtualPlantLab/PlantSimEngine.jl/tree/main/examples). - -```@contents -Pages = ["multiscale.md"] -Depth = 3 -``` - -## Starting with a single-model mapping - -Let's import the `PlantSimEngine` package and all the example models we will use in this tutorial: - -```@example usepkg -using PlantSimEngine -using PlantSimEngine.Examples # Import some example models -``` - -Let's create a simple mapping with only one initial model, the carbon assimilation process ToyAssimModel, which will operate on leaves. -It resembles the ToyAssimGrowth model used in the single-scale simulation [Model switching](@ref) subsection. - -Our mapping between scale and model is therefore: - -```@example usepkg -mapping = ModelMapping(:Leaf => ToyAssimModel()) -``` - -Just like in single-scale simulations, we can call `to_initialize` to check whether variables need to be initialised. It will this time index by scale: - -```@example usepkg -to_initialize(mapping) -``` - -In this example, the ToyAssimModel needs `:aPPFD` and `:soil_water_content` as inputs, which aren't initialised in our mapping. - -The initialization values for the variables can be passed along via a [`Status`](@ref) object: - -```@example usepkg -mapping = ModelMapping( - :Leaf => ( - ToyAssimModel(), - Status(aPPFD=1300.0, soil_water_content=0.5), - ), -) -``` - -If we call [`to_initialize`](@ref) on this new mapping, it returns an empty dictionary, meaning the mapping is valid, and we can start the simulation: - -```@example usepkg -to_initialize(mapping) -``` - -## Multiscale mapping between models and scales - -The `soil_water_content` variable was provided via the mapping. No model affects it, so it is constant in the above example. We could instead provide a model that computes it based on weather data, and/or a more realistic physical process. - -It also makes sense to have that model operate at a different scale than the :Leaf scale. There is a dummy soil model called `ToySoilModel` in the examples folder. Let's put it at a new :Soil scale level. - -ToyAssimModel is now makes use of the `soil_water_content` variable from the `:Soil` scale, instead of at its own scale via the `Status` initialization. We therefore need to map `soil_water_content` from the :Soil to the :Leaf scale by wrapping `ToyAssimModel` in a `MultiScaleModel`: - -```@example usepkg -mapping = ModelMapping( - :Soil => ToySoilWaterModel(), - :Leaf => ( - MultiScaleModel( - model=ToyAssimModel(), - mapped_variables=[:soil_water_content => :Soil => :soil_water_content,], - ), - Status(aPPFD=1300.0), - ), -); -nothing # hide -``` - -In this example, we map the `soil_water_content` variable at scale :Leaf to the `soil_water_content` variable at the `:Soil` scale. If the name of the variable is the same between both scales, we can omit the variable name at the origin scale, *e.g.* `[:soil_water_content => :Soil]`. - -The variable `aPPFD` is still provided in the `Status` type as a constant value. - -We can check again if the mapping is valid by calling [`to_initialize`](@ref): - -```@example usepkg -to_initialize(mapping) -``` - -Once again, `to_initialize` returns an empty dictionary, meaning the mapping is valid. - -## A more elaborate multiscale model mapping - -Let's now expand this mapping, to showcase other ways in which variables can be mapped from one scale to another. We'll keep the first two models, and add several more to simulate a couple of other processes within our plant. - -```@example usepkg -mapping = ModelMapping( - :Scene => ToyDegreeDaysCumulModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.6), - MultiScaleModel( - model=ToyCAllocationModel(), - mapped_variables=[ - :carbon_assimilation => [:Leaf], - :carbon_demand => [:Leaf, :Internode], - :carbon_allocation => [:Leaf, :Internode] - ], - ), - MultiScaleModel( - model=ToyPlantRmModel(), - mapped_variables=[:Rm_organs => [:Leaf => :Rm, :Internode => :Rm],], - ), - ), - :Internode => ( - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], - ), - ToyMaintenanceRespirationModel(1.5, 0.06, 25.0, 0.6, 0.004), - Status(carbon_biomass=1.0), - ), - :Leaf => ( - MultiScaleModel( - model=ToyAssimModel(), - mapped_variables=[:soil_water_content => :Soil, :aPPFD => :Plant], - ), - MultiScaleModel( - model=ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - mapped_variables=[:TT => :Scene,], - ), - ToyMaintenanceRespirationModel(2.1, 0.06, 25.0, 1.0, 0.025), - Status(carbon_biomass=0.5), - ), - :Soil => ( - ToySoilWaterModel(), - ), -); -nothing # hide -``` - -This mapping might seem a little more daunting than previous examples, but several models should be recognizable in passing. In fact, you can consider this mapping to be an enhanced and more complex multi-scale version of a previous single-scale example, the coupling between photosynthesis model, a LAI model and a carbon biomass increment model, used in the [Model switching](@ref) subsection. - -```julia -models2 = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyAssimGrowthModel(); - status=(TT_cu=cumsum(meteo_day.TT),), -) -``` - -The multi-scale models simulate carbon capture via photosynthesis and carbon allocation for the plant organs' maintenance respiration and development. - -The LAI and photosynthesis models are the same as in the single-scale mapping example. The [`ToyDegreeDaysCumulModel`](@ref) provides the Cumulative Thermal Time to the plant. - -The newly introduced models have the following dynamic : - -Carbon allocation is determined (ToyCAllocationModel) for the different organs of the plant (`:Leaf` and `:Internode`) from the assimilation at the `:Leaf` scale (*i.e.* the offer) and their carbon demand (ToyCDemandModel). The `:Soil` scale is used to compute the soil water content (`ToySoilWaterModel`](@ref)), which is needed to calculate the assimilation at the `:Leaf` scale (ToyAssimModel). Also note that maintenance respiration at computed at the `:Leaf` and `:Internode` scales (ToyMaintenanceRespirationModel), and aggregated to compute the total maintenance respiration at the `:Plant` scale (ToyPlantRmModel). - -## Different possible variable mappings - -The above mapping showcases the different ways to define how the variables are mapped in a `MultiScaleModel` : - -```julia - mapped_variables=[:TT_cu => :Scene,], -``` - -- At the :Plant scale, the TT_cu variable is mapped as a scalar from the :Scene scale. There is only a single :Scene node in the MTG, and only a single "TT_cu" value per timestep for the simulation. - -```julia -:carbon_allocation => [:Leaf] -``` - -- On the other hand, we have `:carbon_allocation => [:Leaf]` at the plant scale for `ToyCAllocationModel`. The `carbon_assimilation` variable is mapped as a vector: there are multiple :Leaf nodes, but only one :Plant node, which aggregrates the value over every single leaf. This gives us a 'many-to-one' vector mapping, and in the [`run!`](@ref) functions for models at that scale `carbon_allocation` will be available in the `status` as a vector. - -```julia -:carbon_allocation => [:Leaf, :Internode] -``` - -- A third type of the mapping would be `:carbon_allocation => [:Leaf, :Internode]`, which provides values for a variable from several other scales simultaneously. In this case, the values are also available as a vector in the `carbon_assimilation` variable of the [`status`](@ref) inside the model, sorted in the same order as nodes are traversed in the graph. - -```julia -:Rm_organs => [:Leaf => :Rm, :Internode => :Rm] -``` - -- Finally, to map to a specific variable name at the target scale, *e.g.* `:Rm_organs => [:Leaf => :Rm, :Internode => :Rm]`. This syntax is useful when the variable name is different between scales, and we want to map to a specific variable name at the target scale. In this example, the variable `Rm_organs` at plant scale takes its values (is mapped) from the variable `Rm` at the `:Leaf` and `:Internode` scales. - -## Running a simulation - -Now that we have a valid mapping, we can run a simulation. Running a multiscale simulation requires a plant graph and the definition of the output variables we want dynamically for each scale. - -### Plant graph - -We can import an example multi-scale tree graph like so: - -```@example usepkg -mtg = import_mtg_example() -``` - -!!! note - You can use `import_mtg_example` only if you previously imported the `Examples` sub-module of PlantSimEngine, *i.e.* `using PlantSimEngine.Examples`. - -This graph has a root node that defines a scene, then a soil, and a plant with two internodes and two leaves. - -### Output variables - -For long simulations on plants with many organs, the output data can be very significant. It's possible to restrict the output variables that are tracked for the whole simulation to a subset of all the variables: - -```@example usepkg -outs = Dict( - :Scene => (:TT, :TT_cu,), - :Plant => (:aPPFD, :LAI), - :Leaf => (:carbon_assimilation, :carbon_demand, :carbon_allocation, :TT), - :Internode => (:carbon_allocation,), - :Soil => (:soil_water_content,), -) -``` - -This dictionary can be passed to the simulation via the optional `tracked_outputs` keyword argument to the [`run!`](@ref) function (see the next part). If no dictionary is provided, every variable will be tracked. - -These variables will be available in the output returned by [`run!`](@ref), with a value for each time step. The corresponding timestep and node in the MTG are also returned. - -### Meteorological data - -As for mono-scale models, we need to provide meteorological data to run a simulation. We can use the `PlantMeteo` package to generate some dummy data for two time steps: - -```@example usepkg -meteo = Weather( - [ - Atmosphere(T=20.0, Wind=1.0, Rh=0.65, Ri_PAR_f = 200.0), - Atmosphere(T=25.0, Wind=0.5, Rh=0.8, Ri_PAR_f = 180.0) -] -) -``` - -### Simulation - -Let's make a simulation using the graph and outputs we just defined: - -```@example usepkg -outputs_sim = run!(mtg, mapping, meteo, tracked_outputs = outs); -nothing # hide -``` - -And that's it! We can now access the outputs for each scale as a dictionary of vectors of NamedTuple objects. - -Or as a `DataFrame` dictionary using the [`DataFrames`](https://dataframes.juliadata.org) package: - -```@example usepkg -using DataFrames -df_dict = convert_outputs(outputs_sim, DataFrame) -``` diff --git a/docs/src/multiscale/multiscale_considerations.md b/docs/src/multiscale/multiscale_considerations.md deleted file mode 100644 index 091cf32e6..000000000 --- a/docs/src/multiscale/multiscale_considerations.md +++ /dev/null @@ -1,163 +0,0 @@ -# Multi-scale considerations - -```@contents -Pages = ["multiscale_considerations.md"] -Depth = 3 -``` - -This page briefly details the subtle ways in which multi-scale simulations differ from prior single-scale simulations. The next few pages will showcase some of these subtleties with examples. - -Declaring and running a multi-scale simulation follows the same general workflow as the single-scale version, but multi-scale simulations do have some differences : - -- a simulation requires a Multi-scale Tree Graph (MTG) to run and operates on that graph -- when running, models are tied to a scale and only access local information -- models can run multiple times per timestep - -The simulation dependency graph will still be computed automatically and handle most couplings, meaning users don't need to specify the order of model execution once the extra code to declare the models is written. You will still need to declare hard dependencies, with extra considerations for multi-scale hard dependencies. - -Multi-scale simulations also tend to require more extra ad hoc models to prepare some variables for some models. - -## Related pages - -Other pages in the multiscale section describe : - -- How convert a single-scale ModelMapping to a multi-scale one: [Converting a single-scale simulation to multi-scale](@ref), -- A more complex multi-scale version of the single-scale simulation showcasing different variable mappings between scales: [Multi-scale variable mapping](@ref), -- A three-part tutorial describing how to build up a combination of models to simulate a growing toy plant: [Writing a multiscale simulation](@ref), -- Ways to handle situations where a variable ends up causing a cyclic dependency: [Avoiding cyclic dependencies](@ref), -- Multi-scale specific coupling considerations and subtleties:[Handling dependencies in a multiscale context](@ref) - -## Multi-scale tree graphs - -Functional-Structural Plant Models are often about simulating plant growth. A multi-scale simulation is implicitely expected to operate on a plant-like object, represented by a multi-scale tree graph. - -A multi-scale tree graph (MTG) object (see the [Multi-scale Tree Graphs](@ref) subsection for a quick description) is therefore required to run a multi-scale simulations. It can be a dummy MTG if the simulation doesn't actually affect it, but is nevertheless a required argument to the multi-scale [`run!`](@ref) function. - -All the multi-scale examples make use of the companion package [MultiScaleTreeGraph.jl](https://github.com/VEZY/MultiScaleTreeGraph.jl), which we therefore recommend for running your own multi-scale simulations. Visualizing a Multi-scale Tree Graph can be done using [PlantGeom](https://github.com/VEZY/PlantGeom.jl). - -!!! note - Multi-scale Tree Graphs make use of conflicting terminology with PlantSimEngine's concepts, which is discussed in [Scale/symbol terminology ambiguity](@ref). If you are new to those concepts, make sure to read that section and keep note of it. - -## Models run once per organ instance, not once per organ level - -Some models, like the ones we've seen in single-scale simulations, work on a very simple model of a whole plant. - -More fine-grained models can be tied to a specific plant organ. - -For instance, a model computing a leaf's surface area depending on its age would operate at the `:Leaf` scale, and be called **for every leaf** at every timestep. On the other hand, a model computing the plant's total leaf area only needs to be run once per timestep, and can be run at the `:Plant` scale. - -This is a major difference between a single-scale simulation and a multi-scale one. By default, any model in a single-scale simulation will only run **once** per timestep. However, in multi-scale, if a plant has several instances of an organ type -say it has a hundred leaves- then any model operating at the :Leaf scale will by default run one hundred times per timestep, unless it is explicitely controlled by another model (which can happen in hard dependency configurations). - -## Mappings - -When users define which models they use, PlantSimEngine cannot determine in advance which scale level they operate at. This is partly because the plant organs in an MTG do not have standardized names, and partly because some plant organs might not be part of the initial MTG, so parsing it isn't enough to infer what scales are used. - -The user therefore needs to indicate for a simulation's which models are related to which scale. - -A multi-scale mapping links models to the scale at which they operate, and is also implemented in a [`ModelMapping`](@ref), tying a scale, such as :Leaf to models operating at that scale, such as "LeafSurfaceAreaModel". - -Multi-scale models can be similar models to the ones found in earlier sections, or, if they need to make use of variables at other scales, may need to be wrapped as part of a [`MultiScaleModel`](@ref) object. Many models are not tied to a particular scale, which means those models can be reused at different scales or in single-scale simulations. - -## The simulation operates on an MTG - -Unlike in single-scale simulations, which make use of a [`Status`](@ref) object to store the current state of every variable in a simulation, multi-scale simulations operate on a per-organ basis. - -This means every organ instance has its own [`Status`](@ref), with scale-specific attributes. - -This has two **important** consequences in terms of running a simulation : - -- First, **any scale absent from the MTG will not be run**. If your MTG contains no leaves, then no model operating at the scale :Leaf will be able to run until a :Leaf organ is created and a node is added in the MTG. Otherwise, it has no MTG node to operate on. The only exceptions are hard dependency models which can be called from a different scale, since they can be called directly by a model on a node at a different existing scale, even if there is no node at their own scale. - -- Secondly, models only have access to **local** organ information. The [`status`](@ref) argument in the [`run!`](@ref) function only contains variables **at the model's scale**, unless variables from other scales are mapped via a [`MultiScaleModel`](@ref) wrapping. - -## The run! function's signature - -The [`run!`](@ref) function differs slightly from its single-scale version. The current structure (excluding a couple of advanced/deprecated kwargs) is the following: - -```julia -run!(mtg, mapping::ModelMapping, meteo, constants, extra; nsteps, tracked_outputs) -``` - -Instead of a just the [`ModelMapping`](@ref), it also takes an MTG as the first argument. The optional `meteo` and `constants` argument are identical to the single-scale version. The `extra` argument is now reserved and should not be used. A new `nsteps` keyword argument is available to restrict the simulation to a specified number of steps. - -## Multi-scale output data structure - -The output structure, like the mapping, is a Julia `Dict` structure indexed by the scale name. Values are a per-scale `Vector{NamedTuple}` which lists the requested variables for every node at that scale, for every timestep in the simulation. Timestep and Multiscale Tree Graph nodes are also added to the output data, as a `:timestep`and a `:node` entry. - -This dictionary structure makes the outputs as-is a little more verbose to inspect than in single-scale, but the general usage is similar, and it is both compact, and fast to convert to a `Dict{String, DataFrame}` which can make queries easier. - -!!! note - Some of the mapped variables -those that map from scalar to vector- will not be added to the outputs to save some memory and space since they are redundant. - -To illustrate, here's an example output from part 3 of the Toy plant tutorial, zeroing in on a variable at the :Root scale: [Fixing bugs in the plant simulation](@ref): - -```julia -julia> outs - -Dict{String, Vector} with 5 entries: - :Internode => @NamedTuple{timestep::Int64, node::Node{NodeMTG, Dict{Symbol, Any}}, carbon_root_creation_consumed::Float64, TT_cu::Float64, carbon_… - :Root => @NamedTuple{timestep::Int64, node::Node{NodeMTG, Dict{Symbol, Any}}, carbon_root_creation_consumed::Float64, water_absorbed::Float64… - :Scene => @NamedTuple{timestep::Int64, node::Node{NodeMTG, Dict{Symbol, Any}}, TT_cu::Float64, TT::Float64}[(timestep = 1, node = / 1: Scene… - :Plant => @NamedTuple{timestep::Int64, node::Node{NodeMTG, Dict{Symbol, Any}}, carbon_root_creation_consumed::Float64, carbon_stock::Float64, … - :Leaf => @NamedTuple{timestep::Int64, node::Node{NodeMTG, Dict{Symbol, Any}}, carbon_captured::Float64}[(timestep = 1, node = + 4: Leaf… - -julia> outs[:Root] -3257-element Vector{@NamedTuple{timestep::Int64, node::Node{NodeMTG, Dict{Symbol, Any}}, carbon_root_creation_consumed::Float64, water_absorbed::Float64, root_water_assimilation::Float64}}: - (timestep = 1, node = + 9: Root -└─ < 10: Root - └─ < 11: Root - └─ < 12: Root - └─ < 13: Root - └─ < 14: Root - └─ < 15: Root - └─ < 16: Root - └─ < 17: Root -, carbon_root_creation_consumed = 50.0, water_absorbed = 0.5, root_water_assimilation = 1.0) - ⋮ -``` - -Values are more complex to query than in a single-scale simulation since the indexing isn't straightforward to map to a timestep: - -```julia -julia> [Pair(outs[:Root][i][:timestep], outs[:Root][i][:carbon_root_creation_consumed]) for i in 1:length(outs[:Root])] -3257-element Vector{Pair{Int64, Float64}}: - 1 => 50.0 - 1 => 50.0 - 2 => 50.0 - 2 => 50.0 - 2 => 50.0 - ⋮ - 365 => 50.0 - 365 => 50.0 - 365 => 50.0 - 365 => 50.0 - 365 => 50.0 - 365 => 50.0 - 365 => 50.0 - 365 => 50.0 - 365 => 50.0 -``` - -Converting to a dictionary of DataFrame objects can make such queries easier to write. - -!!! warning - Currently, the `:node` entry only shallow copies nodes. The `:node` values at each scale for every timestep actually reflect the final state of the node, meaning attribute values may not correspond to the value at that timestep. You may need to output these values via a dedicated model to keep track of them properly. - Also note that there currently is no way of removing nodes. Nodes corresponding to organs considered to be pruned/dead/aborted are still present in the output data structure. - -Multi-scale simulations, especially for plants which have thousands of leaves, internodes, root branches, buds and fruits, may compute huge amounts of data. Just like in single-scale simulations, it is possible to keep only variables whose values you want to track for every timestep, and filter the rest out, using the `tracked_outputs` keyword argument for the [`run!`](@ref) function. - -Those tracked variables also need to be indexed by scale to avoid ambiguity: - -```julia -outs = ModelMapping( - :Scene => (:TT, :TT_cu,), - :Plant => (:aPPFD, :LAI), - :Leaf => (:carbon_assimilation, :carbon_demand, :carbon_allocation, :TT), - :Internode => (:carbon_allocation,), - :Soil => (:soil_water_content,), -) -``` - -## Coupling and multi-scale hard dependencies - -Multi-scale brings new types of coupling: mappings are part of the approach used to handle variables used by models at different scales. A model can also have a hard dependency on another model that operates at another scale. This multi-scale-specific complexity is discussed in [Handling dependencies in a multiscale context](@ref) diff --git a/docs/src/multiscale/multiscale_coupling.md b/docs/src/multiscale/multiscale_coupling.md deleted file mode 100644 index 15d75ec29..000000000 --- a/docs/src/multiscale/multiscale_coupling.md +++ /dev/null @@ -1,171 +0,0 @@ - -# Handling dependencies in a multiscale context - -```@contents -Pages = ["multiscale_coupling.md"] -Depth = 3 -``` - -## Scalar and vector variable mappings - -In the detailed example discussed previously [Multi-scale variable mapping](@ref), there were several instances of mapping a variable from one scale to another, which we'll briefly describe again to help transition to the next and more advanced subsection. Here's a relevant exerpt from the mapping : - -```julia -:Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - ... - MultiScaleModel( - model=ToyCAllocationModel(), - mapped_variables=[ - :carbon_assimilation => [:Leaf], - :carbon_demand => [:Leaf, :Internode], - :carbon_allocation => [:Leaf, :Internode] - ], - ), - ... - ), -``` - -For flexibility reasons, instead of explicitely linking most models from different scales together, one only declares which variables are meant to be taken from another scale (or more accurately, a model at a different scale outputting those variables). This keeps the convenience of switching models while making few changes to the mapping. - -However, PlantSimEngine cannot infer which scales have multiple instances, and which are single-instance, as the scale names are user-defined. - -In the above example, there is only one scene at the :Scene, and one plant at the :Plant scale, meaning the `TT_cu` variable mapped between the two has a one-to-one scalar-to-scalar correspondance. - -On the other hand, the `carbon_assimilation` variable is computed for **every** leaf, of which there could be hundreds, or thousands, giving a scalar-to-vector correspondance. The carbon assimilation model runs many times every timestep, whereas the carbon allocation model only runs once per timestep. There may be initially be only a single leaf, though, meaning PlantSimEngine cannot currently guess from the initial configuration that there might be multiple leaves created during the simulation. - -Hence the difference in mapping declaration : `TT_cu`is declared as a scalar correspondence : -```julia -:TT_cu => :Scene, -``` -whereas `carbon_assimilation` (and other variables) will be declared as a vector correspondence : -```julia -:carbon_assimilation => [:Leaf], -``` - -Note that there may be instances where you might wish to write your own model to aggregate a variable from a multi-instance scale. - -## Hard dependencies between models at different scale levels - -If a model requires some input variable that is computed at another scale, then providing the appropriate mapping for that variable will resolve name conflicts and enable that model to run with no further steps for the user or the modeler when the coupling is a 'soft dependency'. - -In the case of a hard dependency that operates **at the same scale as its parent**, declaring the hard dependency is exactly the same as in single-scale simulations and there are also no new extra steps on the user-side: - -- The parent model directly handles the call to its hard dependency model(s), meaning they are not explicitely managed by the top-level dependency graph. -- This means only the owning model of that dependency is visible in the graph, and its hard dependency nodes are internal. -- When the caller (or any downstream model that requires some variables from the hard dependency model) operates at the same scale, variables are easily accessible, and no mapping is required. - -On the other hand, modelers do need to bear in mind a couple of subtleties when developing models that possess hard dependencies that operate **at a different organ level from their parent**: - -If an model needs to be directly called by a parent but operates at a different scale/organ level, a modeler must declare hard dependencies with their respective organ level, similarly to the way the user provides a mapping. - -Conceptually : - -```julia - PlantSimEngine.dep(m::ParentModel) = ( - name_provided_in_the_mapping=AbstractHardDependencyModel => [:Organ_Name_1], -) -``` - -### An example from the toy plant simulation tutorial - -You can find an example of a hard dependency discussed in the [A multi-scale hard dependency appears](@ref) subsection of the third part of toy plant tutorial. - -### An example from XPalm.jl - -Here's a concrete example in [XPalm](https://github.com/PalmStudio/XPalm.jl), an oil palm model developed on top of PlantSimEngine. - Organs are produced at the phytomer scale, but need to run an age model and a biomass model at the reproductive organs' scales. - -```julia - PlantSimEngine.dep(m::ReproductiveOrganEmission) = ( - initiation_age=AbstractInitiation_AgeModel => [m.male_symbol, m.female_symbol], - final_potential_biomass=AbstractFinal_Potential_BiomassModel => [m.male_symbol, m.female_symbol], -) -``` - -The user-mapping includes the required models at specific organ levels. Here's the relevant portion of the mapping for the male reproductive organ : - -```julia -mapping = ModelMapping( - ... - :Male => - MultiScaleModel( - model=XPalm.InitiationAgeFromPlantAge(), - mapped_variables=[:plant_age => :Plant,], - ), - ... - XPalm.MaleFinalPotentialBiomass( - p.parameters[:male][:male_max_biomass], - p.parameters[:male][:age_mature_male], - p.parameters[:male][:fraction_biomass_first_male], - ), - ... -) -``` - -The model's constructor provides convenient default names for the scale corresponding to the reproductive organs. A user may override that if their naming schemes or MTG attributes differ. - -```julia -function ReproductiveOrganEmission(mtg::MultiScaleTreeGraph.Node; phytomer_symbol=:Phytomer, male_symbol=:Male, female_symbol=:Female) - ... -end -``` - -## Implementation details: accessing a hard dependency's variables from a different scale - -But how does a model M calling a hard dependency H provide H's variables when calling H's [`run!`](@ref) function ? The [`status`](@ref) argument the user provides M operates at M's organ level, so if used to call H's run! function any required variable for H will be missing. - -PlantSimEngine provides what are called Status Templates in the simulation graph. Each organ level has its own Status template listing the available variables at that scale. -So when a model M calls a hard dependency H's [`run!`](@ref) function, any required variables can be accessed through the status template of H's organ level. - -### Back to the XPalm example - -Using the same example in XPalm, the oil palm FSPM: - -```julia -# Note that the function's 'status' parameter does NOT contain the variables required by the hard dependencies as the calling model's organ level is "Phytomer", not :Male or "Female" - -function PlantSimEngine.run!(m::ReproductiveOrganEmission, models, status, meteo, constants, sim_object) - ... - status.graph_node_count += 1 - - # Create the new organ as a child of the phytomer: - st_repro_organ = add_organ!( - status.node[1], # The phytomer's internode is its first child - sim_object, # The simulation object, so we can add the new status - "+", status.sex, 4; - index=status.phytomer_count, - id=status.graph_node_count, - attributes=Dict{Symbol,Any}() - ) - - # Compute the initiation age of the organ: - PlantSimEngine.run!(sim_object.models[status.sex].initiation_age, sim_object.models[status.sex], st_repro_organ, meteo, constants, sim_object) - PlantSimEngine.run!(sim_object.models[status.sex].final_potential_biomass, sim_object.models[status.sex], st_repro_organ, meteo, constants, sim_object) -end -``` - -In the above example the organ and its status template are created on the fly. -When that isn't the case, the status template can be accessed through the simulation graph : - -```julia -function PlantSimEngine.run!(m::ReproductiveOrganEmission, models, status, meteo, constants, sim_object) - - ... - - if status.sex == :Male - - status_male = sim_object.statuses[:Male][1] - run!(sim_object.models[:Male].initiation_age, models, status_male, meteo, constants, sim_object) - run!(sim_object.models[:Male].final_potential_biomass, models, status_male, meteo, constants, sim_object) - else - # Female - ... - end -end -``` diff --git a/docs/src/multiscale/multiscale_cyclic.md b/docs/src/multiscale/multiscale_cyclic.md deleted file mode 100644 index f0c62bb72..000000000 --- a/docs/src/multiscale/multiscale_cyclic.md +++ /dev/null @@ -1,115 +0,0 @@ -# Avoiding cyclic dependencies - -When defining a mapping between models and scales, it is important to avoid cyclic dependencies. A cyclic dependency occurs when a model at a given scale depends on a model at another scale that depends on the first model. Cyclic dependencies are bad because they lead to an infinite loop in the simulation (the dependency graph keeps cycling indefinitely). - -PlantSimEngine will detect cyclic dependencies and raise an error if one is found. The error message indicates the models involved in the cycle, and the model that is causing the cycle will be highlighted in red. - -For example the following mapping will raise an error: - -!!! details - Example mapping - - ```julia - mapping_cyclic = ModelMapping( - :Plant => ( - MultiScaleModel( - model=ToyCAllocationModel(), - mapped_variables=[ - :carbon_demand => [:Leaf, :Internode], - :carbon_allocation => [:Leaf, :Internode] - ], - ), - MultiScaleModel( - model=ToyPlantRmModel(), - mapped_variables=[:Rm_organs => [:Leaf => :Rm, :Internode => :Rm],], - ), - Status(total_surface=0.001, aPPFD=1300.0, soil_water_content=0.6), - ), - :Internode => ( - ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - ToyMaintenanceRespirationModel(1.5, 0.06, 25.0, 0.6, 0.004), - Status(TT=10.0, carbon_biomass=1.0), - ), - :Leaf => ( - ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - ToyMaintenanceRespirationModel(2.1, 0.06, 25.0, 1.0, 0.025), - ToyCBiomassModel(1.2), - Status(TT=10.0), - ) - ) - ``` - -Let's see what happens when we try to build the dependency graph for this mapping: - -```julia -julia> dep(mapping_cyclic) -ERROR: Cyclic dependency detected in the graph. Cycle: - Plant: ToyPlantRmModel - └ Leaf: ToyMaintenanceRespirationModel - └ Leaf: ToyCBiomassModel - └ Plant: ToyCAllocationModel - └ Plant: ToyPlantRmModel - - You can break the cycle using the `PreviousTimeStep` variable in the mapping. -``` - -How can we interpret the message? We have a list of five models involved in the cycle. The first model is the one causing the cycle, and the others are the ones that depend on it. In this case, the `ToyPlantRmModel` is the one causing the cycle, and the others are inter-dependent. We can read this as follows: - -1. `ToyPlantRmModel` depends on `ToyMaintenanceRespirationModel`, the plant-scale respiration sums up all organs respiration; -2. `ToyMaintenanceRespirationModel` depends on `ToyCBiomassModel`, the organs respiration depends on the organs biomass; -3. `ToyCBiomassModel` depends on `ToyCAllocationModel`, the organs biomass depends on the organs carbon allocation; -4. And finally `ToyCAllocationModel` depends on `ToyPlantRmModel` again, hence the cycle because the carbon allocation depends on the plant scale respiration. - -The models can not be ordered in a way that satisfies all dependencies, so the cycle can not be broken. To solve this issue, we need to re-think how models are mapped together, and break the cycle. - -There are several ways to break a cyclic dependency: - -- **Merge models**: If two models depend on each other because they need *e.g.* recursive computations, they can be merged into a third model that handles the computation and takes the two models as hard dependencies. Hard dependencies are models that are explicitly called by another model and do not participate on the building of the dependency graph. -- **Change models**: Of course models can be interchanged to avoid cyclic dependencies, but this is not really a solution, it is more a workaround. -- **PreviousTimeStep**: We can break the dependency graph by defining some variables as taken from the previous time step. A very well known example is the computation of the light interception by a plant that depends on the leaf area, which is usually the result of a model that also depends on the light interception. The cyclic dependency is usually broken by using the leaf area from the previous time step in the interception model, which is a good approximation for most cases. - -We can fix our previous mapping by computing the organs respiration using the carbon biomass from the previous time step instead. Let's see how to fix the cyclic dependency in our mapping (look at the leaf and internode scales): - -!!! details - ```@julia - mapping_nocyclic = ModelMapping( - :Plant => ( - MultiScaleModel( - model=ToyCAllocationModel(), - mapping=[ - :carbon_demand => [:Leaf, :Internode], - :carbon_allocation => [:Leaf, :Internode] - ], - ), - MultiScaleModel( - model=ToyPlantRmModel(), - mapped_variables=[:Rm_organs => [:Leaf => :Rm, :Internode => :Rm],], - ), - Status(total_surface=0.001, aPPFD=1300.0, soil_water_content=0.6, carbon_assimilation=5.0), - ), - :Internode => ( - ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - MultiScaleModel( - model=ToyMaintenanceRespirationModel(1.5, 0.06, 25.0, 0.6, 0.004), - mapped_variables=[PreviousTimeStep(:carbon_biomass),], #! this is where we break the cyclic dependency (first break) - ), - Status(TT=10.0, carbon_biomass=1.0), - ), - :Leaf => ( - ToyCDemandModel(optimal_biomass=10.0, development_duration=200.0), - MultiScaleModel( - model=ToyMaintenanceRespirationModel(2.1, 0.06, 25.0, 1.0, 0.025), - mapped_variables=[PreviousTimeStep(:carbon_biomass),], #! this is where we break the cyclic dependency (second break) - ), - ToyCBiomassModel(1.2), - Status(TT=10.0), - ) - ); - nothing # hide - ``` - -The `ToyMaintenanceRespirationModel` models are now defined as [`MultiScaleModel`](@ref), and the `carbon_biomass` variable is wrapped in a `PreviousTimeStep` structure. This structure tells PlantSimEngine to take the value of the variable from the previous time step, breaking the cyclic dependency. - -!!! note - [`PreviousTimeStep`](@ref) tells PlantSimEngine to take the value of the previous time step for the variable it wraps, or the value at initialization for the first time step. The value at initialization is the one provided by default in the models inputs, but is usually provided in the [`Status`](@ref) structure to override this default. - A [`PreviousTimeStep`](@ref) is used to wrap the **input** variable of a model, with or without a mapping to another scale *e.g.* `PreviousTimeStep(:carbon_biomass) => :Leaf`. \ No newline at end of file diff --git a/docs/src/multiscale/multiscale_example_1.md b/docs/src/multiscale/multiscale_example_1.md deleted file mode 100644 index 19dd671e0..000000000 --- a/docs/src/multiscale/multiscale_example_1.md +++ /dev/null @@ -1,289 +0,0 @@ -# Writing a multiscale simulation - -This three-part subsection walks you through building a multi-scale simulation from scratch. It is meant as an illustration of the iterative process you might go through when building and slowly tuning a Functional-Structural Plant Model, where previous multi-scale examples focused more on the API syntax. - -You can find the full script for the first part's toy simulation in the [ToyMultiScalePlantModel](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/ToyMultiScalePlantModel/ToyPlantSimulation1.jl) subfolder of the examples folder. - -```@contents -Pages = ["multiscale_example_1.md"] -Depth = 3 -``` - -## Disclaimer - -The actual plant being created, as well as some of the custom models, have no real physical meaning and are very much ad hoc (which is why most of them aren't standalone in the examples folder). Similarly, some of the parameter values are pulled out of thin air, and have no ties to research papers or data. - -The main purpose here is to showcase PlantSimEngine's multi-scale features and how to structure your models, not accuracy, realism or performance. - -## Initial setup - -We'll need to make use of a few packages, as usual, after adding them to our Julia environment: - -```@example usepkg -using PlantSimEngine -using PlantSimEngine.Examples # to import the ToyDegreeDaysCumulModel model -using PlantMeteo, Dates -using MultiScaleTreeGraph # multi-scale -``` - -## A basic growing plant - -At minimum, to simulate some kind of fake growth, we need : - -- A Multi-scale Tree Graph representing the plant -- Some way of adding organs to the plant -- Some kind of temporality to spread this growth over multiple timesteps - -Let's have some concept of 'leaves' that capture the (carbon) resource necessary for organ growth, and let's have the organ emergence happen at the 'internode' level, to illustrate multiple organs with different behavior. - -We'll make the assumption that the internodes make use of carbon from a common pool. We'll also make use of thermal time as a growth delay factor. - -To sum up, we have: -- a MTG with growing internodes and leaves -- Individual leaves that capture carbon fed into a common pool -- Internodes which take from that pool to create new organs, with a thermal time constraint. - -One way of modeling this approach translates into several scales and models: - -- a Scene scale, for thermal time. The [`ToyDegreeDaysCumulModel`](@ref) from the [examples folder](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/ToyDegreeDays.jl) provides thermal time from temperature data -- a Plant scale, where we'll define the carbon pool -- an Internode scale, which draws from the pool to create new organs -- a Leaf scale, which captures carbon - -Let's also add a very artificial limiting factor: if the total leaf surface area is above a threshold no new organs are created. - -We can expect the simulation mapping to look like a more complex version of the following: - -```julia -mapping = ModelMapping( -:Scene => ToyDegreeDaysCumulModel(), -:Plant => ToyStockComputationModel(), -:Internode => ToyCustomInternodeEmergence(), -:Leaf => ToyLeafCarbonCaptureModel(), -) -``` - -Some of the models will need to gather variables from scales other than their own, meaning they will need to be converted into MultiScaleModels. - -## Implementation - -### Carbon Capture - -Let's start with the simplest model. Our fake leaves will continuously capture some constant amount of carbon every timestep. No inputs or parameters are required. - -```@example usepkg -PlantSimEngine.@process "leaf_carbon_capture" verbose = false - -struct ToyLeafCarbonCaptureModel<: AbstractLeaf_Carbon_CaptureModel end - -function PlantSimEngine.inputs_(::ToyLeafCarbonCaptureModel) - NamedTuple() # No inputs -end - -function PlantSimEngine.outputs_(::ToyLeafCarbonCaptureModel) - (carbon_captured=0.0,) -end - -function PlantSimEngine.run!(::ToyLeafCarbonCaptureModel, models, status, meteo, constants, extra) - status.carbon_captured = 40 -end -``` - -### Resource storage - -The model storing resources for the whole plant needs a couple of inputs: the amount of carbon captured by the leaves, as well as the amount consumed by the creation of new organs. It outputs the current stock. - -```@example usepkg -PlantSimEngine.@process "resource_stock_computation" verbose = false - -struct ToyStockComputationModel <: AbstractResource_Stock_ComputationModel -end - -PlantSimEngine.inputs_(::ToyStockComputationModel) = -(carbon_captured=0.0,carbon_organ_creation_consumed=0.0) - -PlantSimEngine.outputs_(::ToyStockComputationModel) = (carbon_stock=-Inf,) - -function PlantSimEngine.run!(m::ToyStockComputationModel, models, status, meteo, constants=nothing, extra=nothing) - status.carbon_stock += sum(status.carbon_captured) - sum(status.carbon_organ_creation_consumed) -end -``` - -### Organ creation - -This model is a modified version of the ToyInternodeEmergence model found [in the examples folder](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/ToyInternodeEmergence.jl). An internode produces two leaves and a new internode. - -Let's first define a helper function that iterates across a Multiscale Tree Graph and returns the number of leaves : - -```@example usepkg -function get_n_leaves(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - nleaves = length(MultiScaleTreeGraph.traverse(root, x->1, symbol=:Leaf)) - return nleaves -end -``` - -Now that we have that, let's define a few parameters to the model. It requires : -- a thermal time emergence threshold -- a carbon cost for organ creation - -We'll also add a couple of other parameters, which could go elsewhere : -- the surface area of a leaf (no variation, no growth stages) -- the max leaf surface area beyond which organ creation stops - -```@example usepkg -PlantSimEngine.@process "organ_emergence" verbose = false - -struct ToyCustomInternodeEmergence{T} <: AbstractOrgan_EmergenceModel - TT_emergence::T - carbon_internode_creation_cost::T - leaf_surface_area::T - leaves_max_surface_area::T -end -``` - -!!! note - We make use of parametric types instead of the intuitive Float64 for flexibility. See [Parametric types](@ref) for a more in-depth explanation - -And give them some default values : - -```@example usepkg -ToyCustomInternodeEmergence(;TT_emergence=300.0, carbon_internode_creation_cost=200.0, leaf_surface_area=3.0, leaves_max_surface_area=100.0) = ToyCustomInternodeEmergence(TT_emergence, carbon_internode_creation_cost, leaf_surface_area, leaves_max_surface_area) -``` - -Our internode model requires thermal time, and the amount of available carbon, and outputs the amount of carbon consumed, as well as the last thermal time where emergence happened (this is useful when new organs can be produced multiple times, which won't be the case here). - -```@example usepkg -PlantSimEngine.inputs_(m::ToyCustomInternodeEmergence) = (TT_cu=0.0, carbon_stock=0.0) -PlantSimEngine.outputs_(m::ToyCustomInternodeEmergence) = (TT_cu_emergence=0.0, carbon_organ_creation_consumed=0.0) -``` -Finally, the [`run!`](@ref) function checks that conditions are met for new organ creation : -- thermal time threshold exceeded -- total leaf surface area not above limit -- carbon available -- no organs already created by that internode - -and then updates the MTG. - -```@example usepkg -function PlantSimEngine.run!(m::ToyCustomInternodeEmergence, models, status, meteo, constants=nothing, sim_object=nothing) - - leaves_surface_area = m.leaf_surface_area * get_n_leaves(status.node) - status.carbon_organ_creation_consumed = 0.0 - - if leaves_surface_area > m.leaves_max_surface_area - return nothing - end - - # if not enough carbon, no organ creation - if status.carbon_stock < m.carbon_internode_creation_cost - return nothing - end - - if length(MultiScaleTreeGraph.children(status.node)) == 2 && - status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - - status_new_internode.TT_cu_emergence = m.TT_emergence - status.TT_cu - status.carbon_organ_creation_consumed = m.carbon_internode_creation_cost - end - - return nothing -end -``` - -### Updated mapping - -We can now define the final mapping for this simulation. - -The carbon capture and thermal time models don't need to be changed from the earlier version. -The organ creation model at the :Internode scale needs the carbon stock from the :Plant scale, as well as thermal time from the :Scene scale. -The resource storing model at the :Plant scale needs the carbon captured by **every** leaf, and the carbon consumed by **every** internode that created new organs this timestep. This requires mapping vector variables : - -```julia - mapped_variables=[ - :carbon_captured=>[:Leaf], - :carbon_organ_creation_consumed=>[:Internode] - ], -``` -as opposed to the single-valued carbon stock mapped variable : - -```julia - mapped_variables=[:TT_cu => :Scene, - PreviousTimeStep(:carbon_stock)=>:Plant], -``` - -And of course, some variables need to be initialized in the status: - -```@example usepkg -mapping = ModelMapping( -:Scene => ToyDegreeDaysCumulModel(), -:Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured=>[:Leaf], - :carbon_organ_creation_consumed=>[:Internode] - ], - ), - Status(carbon_stock = 0.0) - ), -:Internode => ( - MultiScaleModel( - model=ToyCustomInternodeEmergence(),#TT_emergence=20.0), - mapped_variables=[:TT_cu => :Scene, - PreviousTimeStep(:carbon_stock)=>:Plant], - ), - Status(carbon_organ_creation_consumed=0.0), - ), -:Leaf => ToyLeafCarbonCaptureModel(), -) -``` - -!!! note - This excerpt (and the complete script file) showcase the final properly initialized mapping, but when developing, you are encouraged to make liberal use of the helper function [`to_initialize`](@ref) and check the PlantSimEngine user errors. - -### Running a simulation - -We only need an MTG, and some weather data, and then we'll be set. Let's create a simple MTG : - -```@example usepkg -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) -plant = MultiScaleTreeGraph.Node(mtg, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -internode1 = MultiScaleTreeGraph.Node(plant, MultiScaleTreeGraph.NodeMTG("/", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -internode2 = MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("<", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -``` - -Import some weather data: - -```@example usepkg -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) -nothing # hide -``` - -And we're good to go ! - -```@example usepkg -outs = run!(mtg, mapping, meteo_day) -``` - -If you query or display the MTG after simulation, you'll see it expanded and grew multiple internodes and leaves : - -```@example usepkg -mtg -#get_n_leaves(mtg) -``` - -And that's it ! Feel free to tinker with the parameters and see when things break down, to get a feel for the simulation. - -Of course, this is a very crude and unrealistic simulation, with many dubious assumptions and parameters. But significantly more complex modelling is possible using the same approach : XPalm runs using a few dozen models spread out over nine scales. - -This is a three-part tutorial and continues in the [Expanding on the multiscale simulation](@ref) page. \ No newline at end of file diff --git a/docs/src/multiscale/multiscale_example_2.md b/docs/src/multiscale/multiscale_example_2.md deleted file mode 100644 index 539399ddf..000000000 --- a/docs/src/multiscale/multiscale_example_2.md +++ /dev/null @@ -1,266 +0,0 @@ -# Expanding on the multiscale simulation - -Let's build on the previous example and add some other organ growth, as well as some very mild coupling between the two. - -You can find the full script for this simulation in the [ToyMultiScalePlantModel](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/ToyMultiScalePlantModel/ToyPlantSimulation2.jl) subfolder of the examples folder. - -```@contents -Pages = ["multiscale_example_2.md"] -Depth = 3 -``` - -## Setup - -Once again, with a properly set-up Julia environment: - -```@example usepkg -using PlantSimEngine -using PlantSimEngine.Examples -using PlantMeteo, Dates, Dates -using MultiScaleTreeGraph - -PlantSimEngine.@process "leaf_carbon_capture" verbose = false - -struct ToyLeafCarbonCaptureModel<: AbstractLeaf_Carbon_CaptureModel end - -function PlantSimEngine.inputs_(::ToyLeafCarbonCaptureModel) - NamedTuple() # No inputs -end - -function PlantSimEngine.outputs_(::ToyLeafCarbonCaptureModel) - (carbon_captured=0.0,) -end - -function PlantSimEngine.run!(::ToyLeafCarbonCaptureModel, models, status, meteo, constants, extra) - status.carbon_captured = 40 -end - -function get_n_leaves(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - nleaves = length(MultiScaleTreeGraph.traverse(root, x->1, symbol=:Leaf)) - return nleaves -end -``` - -## Adding roots to our plant - -We'll add a root that extracts water and adds it to the stock. Initial water stocks are low, so root growth is prioritized, then the plant also grows leaves and a new internode like it did before. Roots only grow up to a certain point, and don't branch. - -This leads to adding a new scale, :Root to the mapping, as well as two more models, one for water absorption, the other for root growth. Other models are updated here and there to account for water. The carbon capture model remains unchanged, and so is the `get_n_leaves` helper function. - -## Root models - -### Water absorption - -Let's implement a very fake model of root water absorption. It'll capture the amount of precipitation in the weather data multiplied by some assimilation factor. - -```@example usepkg -PlantSimEngine.@process "water_absorption" verbose = false - -struct ToyWaterAbsorptionModel <: AbstractWater_AbsorptionModel -end - -PlantSimEngine.inputs_(::ToyWaterAbsorptionModel) = (root_water_assimilation=1.0,) -PlantSimEngine.outputs_(::ToyWaterAbsorptionModel) = (water_absorbed=0.0,) - -function PlantSimEngine.run!(m::ToyWaterAbsorptionModel, models, status, meteo, constants=nothing, extra=nothing) - status.water_absorbed = meteo.Precipitations * status.root_water_assimilation -end -``` - -### Root growth - -The root growth model is similar to the internode growth one : it checks for a water threshold and that there is enough carbon, and adds a new organ to the MTG if the maximum length hasn't been reached. - -It also makes use of a couple of helper functions to find the end root and compute root length : - -```@example usepkg -function get_root_end_node(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return MultiScaleTreeGraph.traverse(root, x->x, symbol=:Root, filter_fun = MultiScaleTreeGraph.isleaf) -end - -function get_roots_count(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return length(MultiScaleTreeGraph.traverse(root, x->x, symbol=:Root)) -end - -PlantSimEngine.@process "root_growth" verbose = false - -struct ToyRootGrowthModel{T} <: AbstractRoot_GrowthModel - water_threshold::T - carbon_root_creation_cost::T - root_max_len::Int -end - -PlantSimEngine.inputs_(::ToyRootGrowthModel) = (water_stock=0.0,carbon_stock=0.0,) -PlantSimEngine.outputs_(::ToyRootGrowthModel) = (carbon_root_creation_consumed=0.0,) - -function PlantSimEngine.run!(m::ToyRootGrowthModel, models, status, meteo, constants=nothing, extra=nothing) - if status.water_stock < m.water_threshold && status.carbon_stock > m.carbon_root_creation_cost - - root_end = get_root_end_node(status.node) - - if length(root_end) != 1 - throw(AssertionError("Couldn't find MTG leaf node with symbol \"Root\"")) - end - root_len = get_roots_count(root_end[1]) - if root_len < m.root_max_len - st = add_organ!(root_end[1], extra, "<", :Root, 2, index=1) - status.carbon_root_creation_consumed = m.carbon_root_creation_cost - end - else - status.carbon_root_creation_consumed = 0.0 - end -end -``` - -## Updating other models to account for water - -### Resource storage - -Water absorbed must now be accumulated, and root carbon creation costs taken into account. - -```@example usepkg -PlantSimEngine.@process "resource_stock_computation" verbose = false - -struct ToyStockComputationModel <: AbstractResource_Stock_ComputationModel -end - -PlantSimEngine.inputs_(::ToyStockComputationModel) = -(water_absorbed=0.0,carbon_captured=0.0,carbon_organ_creation_consumed=0.0,carbon_root_creation_consumed=0.0) - -PlantSimEngine.outputs_(::ToyStockComputationModel) = (water_stock=-Inf,carbon_stock=-Inf) - -function PlantSimEngine.run!(m::ToyStockComputationModel, models, status, meteo, constants=nothing, extra=nothing) - status.water_stock += sum(status.water_absorbed) - status.carbon_stock += sum(status.carbon_captured) - sum(status.carbon_organ_creation_consumed) - sum(status.carbon_root_creation_consumed) -end -``` - -### Internode creation - -The minor change is that new organs are now created only if the water stock is above a given threshold. - -```@example usepkg -struct ToyCustomInternodeEmergence{T} <: AbstractOrgan_EmergenceModel - TT_emergence::T - carbon_internode_creation_cost::T - leaf_surface_area::T - leaves_max_surface_area::T - water_leaf_threshold::T -end - -ToyCustomInternodeEmergence(;TT_emergence=300.0, carbon_internode_creation_cost=200.0, leaf_surface_area=3.0,leaves_max_surface_area=100.0, -water_leaf_threshold=30.0) = ToyCustomInternodeEmergence(TT_emergence, carbon_internode_creation_cost, leaf_surface_area, leaves_max_surface_area, water_leaf_threshold) - -PlantSimEngine.inputs_(m::ToyCustomInternodeEmergence) = (TT_cu=0.0,water_stock=0.0, carbon_stock=0.0) -PlantSimEngine.outputs_(m::ToyCustomInternodeEmergence) = (TT_cu_emergence=0.0, carbon_organ_creation_consumed=0.0) - -function PlantSimEngine.run!(m::ToyCustomInternodeEmergence, models, status, meteo, constants=nothing, sim_object=nothing) - - leaves_surface_area = m.leaf_surface_area * get_n_leaves(status.node) - status.carbon_organ_creation_consumed = 0.0 - - if leaves_surface_area > m.leaves_max_surface_area - return nothing - end - - # if water levels are low, prioritise roots - if status.water_stock < m.water_leaf_threshold - return nothing - end - - # if not enough carbon, no organ creation - if status.carbon_stock < m.carbon_internode_creation_cost - return nothing - end - - if length(MultiScaleTreeGraph.children(status.node)) == 2 && - status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - - status_new_internode.TT_cu_emergence = m.TT_emergence - status.TT_cu - status.carbon_organ_creation_consumed = m.carbon_internode_creation_cost - end - - return nothing -end -``` - -## Updating the mapping - -The resource storage and internode emergence models now need a couple of extra water-related mapped variables. -The :Root organ is added to the mapping with its own models. New parameters need to be initialized. - -```@example usepkg -mapping = ModelMapping( -:Scene => ToyDegreeDaysCumulModel(), -:Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured=>[:Leaf], - :water_absorbed=>[:Root], - :carbon_root_creation_consumed=>[:Root], - :carbon_organ_creation_consumed=>[:Internode] - - ], - ), - Status(water_stock = 0.0, carbon_stock = 0.0) - ), -:Internode => ( - MultiScaleModel( - model=ToyCustomInternodeEmergence(),#TT_emergence=20.0), - mapped_variables=[:TT_cu => :Scene, - PreviousTimeStep(:water_stock)=>:Plant, - PreviousTimeStep(:carbon_stock)=>:Plant], - ), - Status(carbon_organ_creation_consumed=0.0), - ), -:Root => ( MultiScaleModel( - model=ToyRootGrowthModel(10.0, 50.0, 10), - mapped_variables=[PreviousTimeStep(:carbon_stock)=>:Plant, - PreviousTimeStep(:water_stock)=>:Plant], - ), - ToyWaterAbsorptionModel(), - Status(carbon_root_creation_consumed=0.0, root_water_assimilation=1.0), - ), -:Leaf => ( ToyLeafCarbonCaptureModel(),), -) -``` - -## Running the simulation - -Running this new simulation is almost the same as before. The weather data is unchanged, but a new :Root node was added to the MTG. - -```@example usepkg -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) - plant = MultiScaleTreeGraph.Node(mtg, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - - internode1 = MultiScaleTreeGraph.Node(plant, MultiScaleTreeGraph.NodeMTG("/", :Internode, 1, 2)) - MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - - internode2 = MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("<", :Internode, 1, 2)) - MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - - plant_root_start = MultiScaleTreeGraph.Node( - plant, - MultiScaleTreeGraph.NodeMTG("+", :Root, 1, 3), - ) - -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -outs = run!(mtg, mapping, meteo_day) -mtg -``` - -And that's it ! - -...Or is it ? - -If you inspect the code and output data closely, you may notice some distinctive problems with the way the simulation runs... Some things aren't quite right. If you wish to know more, onwards to the next chapter: [Fixing bugs in the plant simulation](@ref) \ No newline at end of file diff --git a/docs/src/multiscale/multiscale_example_3.md b/docs/src/multiscale/multiscale_example_3.md deleted file mode 100644 index 582ec984c..000000000 --- a/docs/src/multiscale/multiscale_example_3.md +++ /dev/null @@ -1,503 +0,0 @@ -# Fixing bugs in the plant simulation - -```@setup usepkg -using PlantSimEngine -using PlantSimEngine.Examples -using PlantMeteo, Dates -using MultiScaleTreeGraph -function get_root_end_node(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return MultiScaleTreeGraph.traverse(root, x->x, symbol=:Root, filter_fun = MultiScaleTreeGraph.isleaf) -end - -function get_roots_count(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return length(MultiScaleTreeGraph.traverse(root, x->x, symbol=:Root)) -end - -function get_n_leaves(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - nleaves = length(MultiScaleTreeGraph.traverse(root, x->1, symbol=:Leaf)) - return nleaves -end - -PlantSimEngine.@process "organ_emergence" verbose = false - -struct ToyCustomInternodeEmergence{T} <: AbstractOrgan_EmergenceModel - TT_emergence::T - carbon_internode_creation_cost::T - leaf_surface_area::T - leaves_max_surface_area::T - water_leaf_threshold::T -end - -ToyCustomInternodeEmergence(;TT_emergence=300.0, carbon_internode_creation_cost=200.0, leaf_surface_area=3.0,leaves_max_surface_area=100.0, -water_leaf_threshold=30.0) = ToyCustomInternodeEmergence(TT_emergence, carbon_internode_creation_cost, leaf_surface_area, leaves_max_surface_area, water_leaf_threshold) - -PlantSimEngine.inputs_(m::ToyCustomInternodeEmergence) = (TT_cu=0.0,water_stock=0.0, carbon_stock=0.0) -PlantSimEngine.outputs_(m::ToyCustomInternodeEmergence) = (TT_cu_emergence=0.0, carbon_organ_creation_consumed=0.0) - -function PlantSimEngine.run!(m::ToyCustomInternodeEmergence, models, status, meteo, constants=nothing, sim_object=nothing) - - leaves_surface_area = m.leaf_surface_area * get_n_leaves(status.node) - status.carbon_organ_creation_consumed = 0.0 - - if leaves_surface_area > m.leaves_max_surface_area - return nothing - end - - # if water levels are low, prioritise roots - if status.water_stock < m.water_leaf_threshold - return nothing - end - - # if not enough carbon, no organ creation - if status.carbon_stock < m.carbon_internode_creation_cost - return nothing - end - - if length(MultiScaleTreeGraph.children(status.node)) == 2 && - status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - - status_new_internode.TT_cu_emergence = m.TT_emergence - status.TT_cu - status.carbon_organ_creation_consumed = m.carbon_internode_creation_cost - end - - return nothing -end - -############################ -# Naive water absorption model -# Absorbs precipitation water depending on quantity of roots -############################ -PlantSimEngine.@process "water_absorption" verbose = false - -struct ToyWaterAbsorptionModel <: AbstractWater_AbsorptionModel -end - -PlantSimEngine.inputs_(::ToyWaterAbsorptionModel) = (root_water_assimilation=1.0,) -PlantSimEngine.outputs_(::ToyWaterAbsorptionModel) = (water_absorbed=0.0,) - -function PlantSimEngine.run!(m::ToyWaterAbsorptionModel, models, status, meteo, constants=nothing, extra=nothing) - #root_end = get_root_end_node(status.node) - #root_len = root_end[:Root_len] - status.water_absorbed = meteo.Precipitations * status.root_water_assimilation #* root_len -end - -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyWaterAbsorptionModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyWaterAbsorptionModel}) = PlantSimEngine.IsObjectIndependent() - - -########################## -### Root growth : when water stocks are low, expand root -########################## - -PlantSimEngine.@process "root_growth" verbose = false - -struct ToyRootGrowthModel{T} <: AbstractRoot_GrowthModel - water_threshold::T - carbon_root_creation_cost::T - root_max_len::Int -end - -PlantSimEngine.inputs_(::ToyRootGrowthModel) = (water_stock=0.0,carbon_stock=0.0,) -PlantSimEngine.outputs_(::ToyRootGrowthModel) = (carbon_root_creation_consumed=0.0,) - -function PlantSimEngine.run!(m::ToyRootGrowthModel, models, status, meteo, constants=nothing, extra=nothing) - if status.water_stock < m.water_threshold && status.carbon_stock > m.carbon_root_creation_cost - - root_end = get_root_end_node(status.node) - - if length(root_end) != 1 - throw(AssertionError("Couldn't find MTG leaf node with symbol \"Root\"")) - end - root_len = get_roots_count(root_end[1]) - if root_len < m.root_max_len - st = add_organ!(root_end[1], extra, "<", :Root, 2, index=1) - status.carbon_root_creation_consumed = m.carbon_root_creation_cost - end - else - status.carbon_root_creation_consumed = 0.0 - end -end - -########################## -### Model accumulating carbon and water resources -########################## - -PlantSimEngine.@process "resource_stock_computation" verbose = false - -struct ToyStockComputationModel <: AbstractResource_Stock_ComputationModel -end -#status.water_stock += meteo.precipitations * root_water_assimilation_ratio - -PlantSimEngine.inputs_(::ToyStockComputationModel) = -(water_absorbed=0.0,carbon_captured=0.0,carbon_organ_creation_consumed=0.0,carbon_root_creation_consumed=0.0) - -PlantSimEngine.outputs_(::ToyStockComputationModel) = (water_stock=-Inf,carbon_stock=-Inf) - -function PlantSimEngine.run!(m::ToyStockComputationModel, models, status, meteo, constants=nothing, extra=nothing) - status.water_stock += sum(status.water_absorbed) #- status.water_transpiration - status.carbon_stock += sum(status.carbon_captured) - sum(status.carbon_organ_creation_consumed) - sum(status.carbon_root_creation_consumed) - - if status.water_stock < 0.0 - status.water_stock = 0.0 - end -end - -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyStockComputationModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyStockComputationModel}) = PlantSimEngine.IsObjectIndependent() - -######################## -## Leaf model capturing some arbitrary carbon quantity -######################## - -PlantSimEngine.@process "leaf_carbon_capture" verbose = false - -struct ToyLeafCarbonCaptureModel<: AbstractLeaf_Carbon_CaptureModel end - -function PlantSimEngine.inputs_(::ToyLeafCarbonCaptureModel) - NamedTuple()#(TT_cu=-Inf) -end - -function PlantSimEngine.outputs_(::ToyLeafCarbonCaptureModel) - (carbon_captured=0.0,) -end - -function PlantSimEngine.run!(::ToyLeafCarbonCaptureModel, models, status, meteo, constants, extra) - # very crude approximation with LAI of 1 and constant PPFD - status.carbon_captured = 200.0 *(1.0 - exp(-0.2)) -end - -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyLeafCarbonCaptureModel}) = PlantSimEngine.IsObjectIndependent() -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLeafCarbonCaptureModel}) = PlantSimEngine.IsTimeStepIndependent() - -mapping = ModelMapping( -:Scene => ToyDegreeDaysCumulModel(), -:Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured=>[:Leaf], - :water_absorbed=>[:Root], - :carbon_root_creation_consumed=>[:Root], - :carbon_organ_creation_consumed=>[:Internode] - - ], - ), - Status(water_stock = 0.0, carbon_stock = 0.0) - ), -:Internode => ( - MultiScaleModel( - model=ToyCustomInternodeEmergence(),#TT_emergence=20.0), - mapped_variables=[:TT_cu => :Scene, - PreviousTimeStep(:water_stock)=>:Plant, - PreviousTimeStep(:carbon_stock)=>:Plant], - ), - Status(carbon_organ_creation_consumed=0.0), - ), -:Root => ( MultiScaleModel( - model=ToyRootGrowthModel(10.0, 50.0, 10), - mapped_variables=[PreviousTimeStep(:carbon_stock)=>:Plant, - PreviousTimeStep(:water_stock)=>:Plant], - ), - ToyWaterAbsorptionModel(), - Status(carbon_root_creation_consumed=0.0, root_water_assimilation=1.0), - ), -:Leaf => ( ToyLeafCarbonCaptureModel(),), -) - -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) - -plant = MultiScaleTreeGraph.Node(mtg, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -internode1 = MultiScaleTreeGraph.Node(plant, MultiScaleTreeGraph.NodeMTG("/", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -internode2 = MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("<", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -plant_root_start = MultiScaleTreeGraph.Node( - plant, - MultiScaleTreeGraph.NodeMTG("+", :Root, 1, 3), -) - -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -``` - -There are two major issues hinted at in last chapter's implementation, which we'll discuss and resolve here. - -You can find the full script for this simulation in the [ToyMultiScalePlantModel](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/ToyMultiScalePlantModel/ToyPlantSimulation3.jl) subfolder of the examples folder. - -```@contents -Pages = ["multiscale_example_3.md"] -Depth = 3 -``` - -## An organ creation problem - -There is one quirk you may have noticed when inspecting the data : when a root expands, the new root is immediately active, and some models may act on it immediately... including the root growth model. Meaning this new root may also sprout another root in the same timestep, and so on. - -You can notice this by looking at the simulation's state during the first two timesteps: - -```@example usepkg -outs = run!(mtg, mapping, first(meteo_day, 2)) - -root_nodes_per_timestep = [0, 0] -for i in 1:length(outs[:Root]) - if outs[:Root][i].timestep < 3 - root_nodes_per_timestep[outs[:Root][i].timestep] += 1 - end -end - -root_nodes_per_timestep -``` - -Our root grew to full length within one timestep. Oops. - -This is an implementation decision in PlantSimEngine. **By default, newly created organs are active**, and models can affect them **as soon as they are created**. - -In our case, internode growth depends on a threshold thermal time value, which accumulates over several timesteps, so even though new internodes are immediately active, they can't themselves grow new organs within the same timestep. But as we've just showcased, we have a root problem. - -This quirk is also handled in [XPalm.jl](https://github.com/PalmStudio/XPalm.jl), a package using PlantSimEngine: some organs make use of state machines, and are considered "immature" when they are created. Immature organs cannot grow new organs until some conditions are met for their state to change. There are also other conditions governing organ emergence, such as specific threshold values relating to Thermal Time (see [here](https://github.com/PalmStudio/XPalm.jl/blob/433e1c47c743e7a53e764672818a43ed8feb10c6/src/plant/phytomer/leaves/phyllochron.jl#L46) for an example). - -!!! note - This implementation decision for new organs to be immediately active may be subject to change in future versions of PlantSimEngine. Also note that the way the dependency graph is structured determines the order in which models run. Meaning that which models are run before or after organ creation might change with new additions and updates to your mapping. Some models might run "one timestep later", see [Simulation order instability when adding models](@ref) for more details. - -!!! note - MTG node output data has a couple of subtleties, see [Multi-scale output data structure](@ref) for more details - -### Delaying organ maturity - -How do we avoid this extreme instant growth ? We can, of course, add some thermal time constraint. We could arbitrarily tinker with water resources. - -We can otherwise add a simple state machine variable to our root and internodes in the MTG, indicating a newly added organ is immature and cannot grow on the same timestep. Since our root doesn't branch, we can simply keep track of a single state variable. See the [State machines](@ref) section for some examples. - -In fact, we could change the scale at which the check is made to extend the root, and have another model call this one directly. This enables running this model only for the end root when those occasional timesteps when root growth is possible, instead of at every timestep for every root node. - -## A resource distribution bug - -Another problem you may have noticed, is that the water and carbon stock are computed by aggregating photosynthesis over leaves and absorption over roots... But they aren't always properly decremented when consumed ! - -If the end root grows, it outputs a `carbon_root_creation_consumed` value, but under certain conditions, we might also create other roots and internodes even when there shouldn't be enough carbon left for them. - -Indeed, if both the root and leaf water thresholds are met, and there is enough carbon for a single root or internode but not for both, and the root model runs before the internode model, both will use the carbon_stock variable prior to organ emission. The internode emission model won't account for the root carbon consumption. - -This occurs because `carbon_stock` is only computed once, and won't update until the next timestep. - -### Fixing resource computation: a root growth decision model - -To avoid that problem in our specific case, we can couple the root growth model and the internode emission model, and pass the `carbon_root_creation_consumed` variable to the internode emission model so that it can use an updated carbon stock. Or we could have an intermediate model recompute the new stock to pass along to the internode emission model. - -There is a section in the [Tips and workarounds] page discussing this situation and other potential solutions: [Having a variable simultaneously as input and output of a model](@ref). - -We'll go for the first option and couple the root growth and internode emission model. - -### Internode emission adjustments - -The only change required for our internode emission model is to take into account `carbon_root_creation_consumed` as a new input, map that variable from the :Root scale in our mapping, and compute the adjusted carbon stock. Here's the relevant excerpt in the [`run!`](@ref) function. - -```julia - # take into account that the stock may already be depleted - carbon_stock_updated_after_roots = status.carbon_stock - status.carbon_root_creation_consumed - - # if not enough carbon, no organ creation - if carbon_stock_updated_after_roots < m.carbon_internode_creation_cost - return nothing - end -``` - -### A multi-scale hard dependency appears - -Our root growth decision model inherits some of the responsibility from last chapter's root growth model, so inputs, parameters and condition checks will be similar. We'll let the root growth model keep the length check and only focus on resources. - -Since the decision model is now directly responsible for calling the actual root growth model, we need to declare that it requires a root growth model as a hard dependency and cannot be run standalone. - -This hard dependency is in fact multiscale, since both models operate at different scales, :Plant and :Root. You can read more about multi-scale hard dependencies in the [Handling dependencies in a multiscale context](@ref) page. - -Compared to the single-scale equivalent, the multi-scale declaration additionally requires mapping the scale: - -```julia -PlantSimEngine.dep(::ToyRootGrowthDecisionModel) = (root_growth=AbstractRoot_GrowthModel=>[:Root],) -``` - -The `status` argument [`run!`](@ref) function of the root growth decision model only contains variables from the :Plant scale, or explicitely mapped to this scale, which isn't the case for the root growth's variables. To make use of the root growth model's variables, we need to recover the [`status`](@ref) at the :Root scale. It is accessible from the `extra` argument in [`run!`](@ref)'s signature. - -In multi-scale simulations, this `extra` argument implicitely contains an object storing the simulation state. It contains the statuses at various scales, and all the models indexed per scale and process name. - -Access to the :Root status within the root growth decision model [`run!`](@ref) function is done like so: - -```julia -status_Root= extra_args.statuses[:Root][1] -``` - -It is then possible to call the root growth model from the parent's [`run!`](@ref) function: - -```julia -PlantSimEngine.run!(extra.models[:Root].root_growth, models, status_Root, meteo, constants, extra) -``` - -Which will enable writing the rest of the [`run!`](@ref) function. - -### Root growth decision model implementation - -With that new coupling consideration properly handled, we can complete the full model implementation: - -```julia -PlantSimEngine.@process "root_growth_decision" verbose = false - -struct ToyRootGrowthDecisionModel{T} <: AbstractRoot_Growth_DecisionModel - water_threshold::T - carbon_root_creation_cost::T -end - -PlantSimEngine.inputs_(::ToyRootGrowthDecisionModel) = -(water_stock=0.0,carbon_stock=0.0) - -PlantSimEngine.outputs_(::ToyRootGrowthDecisionModel) = NamedTuple() - -PlantSimEngine.dep(::ToyRootGrowthDecisionModel) = (root_growth=AbstractRoot_GrowthModel=>[:Root],) - -# "status" is at the :Plant scale -function PlantSimEngine.run!(m::ToyRootGrowthDecisionModel, models, status, meteo, constants=nothing, extra=nothing) - - if status.water_stock < m.water_threshold && status.carbon_stock > m.carbon_root_creation_cost - # Obtain "status" at :Root scale - status_Root= extra_args.statuses[:Root][1] - # Call the hard dependency model directly with its status - PlantSimEngine.run!(extra.models[:Root].root_growth, models, status_Root, meteo, constants, extra) - end -end -``` - -The root growth model will output the `carbon_root_creation_consumed` computation, but it'll still be exposed to downstream models despite the root growth model being a 'hidden' model in the dependency graph due to its hard dependency nature. - -With this new coupling, we will only be creating at most a single new root per timestep, as the root growth decision will only be called once per timestep. - -### Root growth - -This iteration turns into a simplifed version of last chapter's. - -```julia -PlantSimEngine.@process "root_growth" verbose = false - -struct ToyRootGrowthModel <: AbstractRoot_GrowthModel - root_max_len::Int -end - -PlantSimEngine.inputs_(::ToyRootGrowthModel) = NamedTuple() -PlantSimEngine.outputs_(::ToyRootGrowthModel) = (carbon_root_creation_consumed=0.0,) - -function PlantSimEngine.run!(m::ToyRootGrowthModel, models, status, meteo, constants=nothing, extra=nothing) - status.carbon_root_creation_consumed = 0.0 - - root_end = get_root_end_node(status.node) - - if length(root_end) != 1 - throw(AssertionError("Couldn't find MTG leaf node with symbol \"Root\"")) - end - - root_len = get_roots_count(root_end[1]) - if root_len < m.root_max_len - st = add_organ!(root_end[1], extra, "<", :Root, 2, index=1) - status.carbon_root_creation_consumed = m.carbon_root_creation_cost - end -end -``` - -### Mapping adjustments - -The new mapping only has straightforward changes. Some models cease to be multi-scale, others require new variables to be mapped for them. `carbon_root_creation_consumed` ceases to be a vector mapping and is a scalar variable. - -```julia -mapping = ModelMapping( -:Scene => ToyDegreeDaysCumulModel(), -:Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured=>[:Leaf], - :water_absorbed=>[:Root], - :carbon_root_creation_consumed=>:Root, - :carbon_organ_creation_consumed=>[:Internode] - - ], - ), - MultiScaleModel( - model=ToyRootGrowthDecisionModel(10.0, 50.0), - ), - Status(water_stock = 0.0, carbon_stock = 0.0) - ), -:Internode => ( - MultiScaleModel( - model=ToyCustomInternodeEmergence(),#TT_emergence=20.0), - mapped_variables=[:TT_cu => :Scene, - :water_stock=>:Plant, - :carbon_stock=>:Plant, - :carbon_root_creation_consumed=>:Root], - ), - Status(carbon_organ_creation_consumed=0.0), - ), -:Root => (ToyRootGrowthModel(10), - ToyWaterAbsorptionModel(), - Status(carbon_root_creation_consumed=0.0, root_water_assimilation=1.0), - ), -:Leaf => ( ToyLeafCarbonCaptureModel(),), -) -``` - -We can now run our simulation as we did previously... or can we ? - -```julia -ERROR: Cyclic dependency detected for process resource_stock_computation: resource_stock_computation for organ Plant depends on root_growth from organ Root, which depends on the first one. This is not allowed, you may need to develop a new process that does the whole computation by itself. -``` - -Ah, it looks like our additional usage of the root carbon cost creates a cyclic dependency. - -### Breaking the dependency cycle - -Fortunately, the logic here is quite straightforward. We can't be computing our current timestep's resource stock with `carbon_root_creation_consumed`, and then updating it right after root creation again using a new value of `carbon_root_creation_consumed`. - -The solution is hopefully quite intuitive : when we compute resource stocks, we should be computing it using the previous timestep's values. Then root creation happens (or doesn't), and the computed `carbon_root_creation_consumed` corresponds to the current timestep value. We could also do the same for water to be consistent. - -### Updated mapping - -The relevant part of the mapping that needs to be updated is the following: - -```julia -mapping = ModelMapping( -... -:Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured=>[:Leaf], - :water_absorbed=>[:Root], - PreviousTimeStep(:carbon_root_creation_consumed)=>:Root, - PreviousTimeStep(:carbon_organ_creation_consumed)=>[:Internode], - ], - ), - ToyRootGrowthDecisionModel(10.0, 50.0), - Status(water_stock = 0.0, carbon_stock = 0.0) - ), -... -) -``` - -## Final words - -And you're now ready to run the simulation. - -The full script can be found [here](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/ToyMultiScalePlantModel/ToyPlantSimulation3.jl), in the ToyMultiScalePlantModel subfolder of the examples folder. - -We now have a plant with two different growth directions. Roots are added at the beginning, until water is considered abundant enough. - -Of course, there are still several design issues with this implementation. It is as utterly unrealistic as the previous one, and doesn't even consume water. Some condition checking is a little ad hoc and could be made more robust. More sanity checks could be added, and the model and variable names could definitely be made more clear. - -But once again, this example is only made to illustrate what is possible with this framework, and doesn't strive for ecophysiological consistency. And the approach can be made increasingly more complex by refining models and simulation parameters, and feeding in new information about your plant, and ramp up to realistic, production-ready and predictive simulations. diff --git a/docs/src/multiscale/multiscale_example_4.md b/docs/src/multiscale/multiscale_example_4.md deleted file mode 100644 index f5105e84b..000000000 --- a/docs/src/multiscale/multiscale_example_4.md +++ /dev/null @@ -1,226 +0,0 @@ -# Visualizing a plant using PlantGeom - -We've created our toy plant, part of the fun is to actually visualize it ! - -Let's see how to do so with the [PlantGeom](https://github.com/VEZY/PlantGeom.jl) companion package. - -We'll be reusing the mtg from part 3 of the plant tutorial: [Fixing bugs in the plant simulation](@ref), so you need to run that simulation first, or to include the script file into your current code (which is what we'll do here): - -```julia -using PlantSimEngine -using MultiScaleTreeGraph -using PlantSimEngine.Examples -using Pkg -Pkg.add("CSV") -using CSV -include("ToyPlantSimulation3.jl") -``` - -You'll need to add PlantGeom and a compatible visualization package to your environment. We'll use Plots: - -```julia -using Plots -using PlantGeom -``` - -That's enough to get a nicer display of the MTG than the console-based printing. You'll only need to type the following line: - -```julia -RecipesBase.plot(mtg) -``` - -This provides the following visualization: -![MTG Plots visualization](../www/mtg_plot_1.svg) - -And that's it ! - -We can see the root expansion in one direction, and the internodes with their leaves in the other. - -Of course, that's good and all, but going beyond that would be nice. - -PlantGeom is able to render geometry from what it finds in the MTG. If a node in the tree graph has a `:geometry` attribute with a mesh and a transformation, it can make use of that to build a plant. That mesh can be unique per node, or based on a reference mesh that is copied and transformed for every node. - -!!! note - This page simply aims to illustrate PlantGeom's features and doesn't aim for a particularly realistic or aesthetic look. A little randomness could go a long way to make the plant look a little more life-like, but would also be very ad-hoc and make the code less clear. - -Our MTG doesn't have any such attribute, so we'll need to iterate on our nodes, provide them with a mesh and calculate appropriate transformations. We'll use one reference mesh for each plant-related scale, Internode, Root and Leaf. - -We'll make use of some of the Meshes primitives and transformations, as well as some helper functions from the packages TransformsBase and Rotations. For leaves, we'll read a .ply file using the PlyIO package, which contains a very unrealistic leaf + petiole mesh. - -We'll also make our plant opposite decussate: leaves come in pairs, and pairs are rotated by 90 degrees along the stem. - -The function that'll provide the geometry to the node is: -```julia -PlantGeom.Geometry(; ref_mesh<:RefMesh, transformation=Identity(), dUp=1.0, dDwn=1.0, mesh::Union{SimpleMesh,Nothing}=nothing) -``` - -We only care about the first two parameters in our case, and we can use a simple cylinder for each node of our single Internode stem and single Root. - -```julia -using PlantGeom.Meshes - -# Internodes and roots will use a cylinder as a mesh - -cylinder() = Meshes.CylinderSurface(1.0) |> Meshes.discretize |> Meshes.simplexify - -refmesh_internode = PlantGeom.RefMesh(:Internode, cylinder()) -refmesh_root = PlantGeom.RefMesh(:Root, cylinder()) -``` - -A simple function to read the vertices and faces from the .ply file for our leaves: - -```julia -Pkg.add("PlyIO") -using PlyIO -function read_ply(fname) - ply = PlyIO.load_ply(fname) - x = ply["vertex"]["x"] - y = ply["vertex"]["y"] - z = ply["vertex"]["z"] - points = Meshes.Point.(x, y, z) - connec = [Meshes.connect(Tuple(c .+ 1)) for c in ply["face"]["vertex_indices"]] - Meshes.SimpleMesh(points, connec) -end - -leaf_ply = read_ply("examples/leaf_with_petiole.ply") -refmesh_leaf = PlantGeom.RefMesh(:Leaf, leaf_ply) -``` - -```julia -Pkg.add("TransformsBase") -Pkg.add("Rotations") -import TransformsBase: → -import Rotations: RotY, RotZ, RotX -``` - -!!! note - We'll use X, Y, Z as standard cartersian coordinate axes, with Z pointing upwards. - -We can then write the function that adds the geometry to our MTG. - -It traverses the MTG, starting from the base, and adds a transformation for each encountered node. - -The following just operates on internodes, for clarity: - -```julia -# Add the geometry to the MTG, with transformations -function add_geometry!(mtg, refmesh_internode) - - # incremental offset - internode_height = 0.0 - - # relative scale of the base mesh - internode_width = 0.5 - - # length of the base mesh - internode_length = 1.0 - - traverse!(mtg) do node - if symbol(node) == :Internode - # Set to scale, then translate by the total height - mesh_transformation = Meshes.Scale(internode_width, internode_width, internode_length) → Meshes.Translate(0.0, 0.0, internode_height) - node.geometry = PlantGeom.Geometry(ref_mesh=refmesh_internode, transformation=mesh_transformation) - - internode_height += node_length - end - end -end -``` - -We simply need to choose a given width for our stem, and increment the height to place our next internode at as we traverse it. - -Note that the default cylinder provided by Meshes.jl points upwards, which is why there is no need for rotation. Roots function likewise, but are simply translated down, and need to start below the origin. - -We can visualize this simple stem, using GLMakie as a rendering backend: - -```julia -add_geometry!(mtg, refmesh_internode) - -# Visualize the mesh -using GLMakie -viz(mtg) -``` - -![Toy Plant - stem only](../www/toy_plant_stem_only.png) - -On the other hand, the leaf mesh will need to be rotated, but it is aligned along the X axis, so there is no need for an initial reorientation (which would have been required if it was pointing upwards like the cylinders). The petiole starts at the origin, so on top of translating them to leaf height we also need to translate them away from the Z axis by the internode radius. The mesh also needs to be scaled, as it is only 0.1 unit lengths long compared to our 0.5-width internode. - -Let's also rotate our leaves so that they point upwards slightly. - -If you make use of other meshes, bear in mind the initial starting translation, orientation and scale. You may need to test and calibrate scales and transformations before you get it right. - -The full code that generates geometry for all the organs of our toy plant is the following: -```julia -# Add the geometry to the MTG, with transformations -function add_geometry!(mtg, refmesh_internode, refmesh_root, refmesh_leaf) - - # incremental offset - internode_height = 0.0 - root_depth = 0.0 - - # relative scale of the base mesh (base cylinder is of height 1 and radius 1) - internode_width = 0.5 - root_width = 0.2 - - # length of the base mesh - internode_length = 1.0 - root_length = 1.0 - - # ad hoc value to adjust the leaf mesh to the scene scale - leaf_mesh_scale = 25 - - leaf_scale_width = 0.4*leaf_mesh_scale - leaf_scale_height = 0.4*leaf_mesh_scale - - # Helpers to make the leaves opposite decussate - leaf_rotation = MathConstants.pi / 2.0 - i = 0 - - traverse!(mtg) do node - if symbol(node) == :Internode - # Set to scale, then translate by the total height - mesh_transformation = Meshes.Scale(internode_width, internode_width, internode_length) → Meshes.Translate(0.0, 0.0, internode_height) - node.geometry = PlantGeom.Geometry(ref_mesh=refmesh_internode, transformation=mesh_transformation) - - internode_height += internode_length - - # Leaves are placed relatively to the parent internode, halfway along it - for chnode in children(node) - if symbol(chnode) == :Leaf - mesh_transformation = Meshes.Scale(leaf_scale_width, leaf_scale_width, leaf_scale_height) → Meshes.Rotate(RotX(-MathConstants.pi / 6.0)) → Meshes.Translate(0.0, -internode_width, internode_height - internode_length / 2.0) → Meshes.Rotate(RotZ(leaf_rotation)) - chnode.geometry = PlantGeom.Geometry(ref_mesh=refmesh_leaf, transformation=mesh_transformation) - # Set the second leaf in a pair opposite to the first one => add a 180° rotation - leaf_rotation += MathConstants.pi - end - end - - # Opposite decussate => 90° rotation between pairs - i += 1 - if i % 2 == 0 - leaf_rotation = MathConstants.pi / 2.0 - else - leaf_rotation = MathConstants.pi - end - - elseif symbol(node) == :Root - mesh_transformation = Meshes.Scale(root_width, root_width, root_length) → Meshes.Translate(0.0, 0.0, root_depth) → Meshes.Rotate(RotZ(MathConstants.pi)) - node.geometry = PlantGeom.Geometry(ref_mesh=refmesh_root, transformation=mesh_transformation) - root_depth -= root_length - end - end -end -``` - -And now, let's visualize our fully-grown, fully-featured plant: - -```julia -# Visualize the mesh -using GLMakie -viz(mtg) -``` - -Which gives us the following image scene: - -![Toy Plant with root and leaves](../www/toy_plant.png) - -Feel free to try and make this plant prettier, more colourful, or more physically realistic, using more realistic models on the PlantSimEngine side, or better geometry on the Plantgeom end. \ No newline at end of file diff --git a/docs/src/multiscale/single_to_multiscale.md b/docs/src/multiscale/single_to_multiscale.md deleted file mode 100644 index 7e8af7caf..000000000 --- a/docs/src/multiscale/single_to_multiscale.md +++ /dev/null @@ -1,233 +0,0 @@ -# Converting a single-scale simulation to multi-scale - -```@meta -CurrentModule = PlantSimEngine -``` - -```@setup usepkg -using PlantMeteo, Dates -using PlantSimEngine -using PlantSimEngine.Examples -using MultiScaleTreeGraph -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) -models_singlescale = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2); - status=(TT_cu=cumsum(meteo_day.TT),), -) -``` - -A single-scale simulation can be turned into a 'pseudo-multi-scale' simulation by providing a simple multi-scale tree graph, and declaring a mapping linking all models to a unique scale level. - -This page showcases how to do the conversion, and then adds a model at a new scale to make the simulation genuinely multi-scale. - -The full script for the example can be found in the examples folder, [here](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/ToySingleToMultiScale.jl) - -```@contents -Pages = ["single_to_multiscale.md"] -Depth = 3 -``` - -# From single to multi-scale mapping - -For example, let's return to the [`ModelMapping`](@ref) coupling a light interception model, a Leaf Area Index model, and a carbon biomass increment model that was discussed in the [Model switching](@ref) subsection: - -```@example usepkg -using PlantMeteo, Dates -using PlantSimEngine -using PlantSimEngine.Examples - -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -models_singlescale = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2); - status=(TT_cu=cumsum(meteo_day.TT),), -) - -outputs_singlescale = run!(models_singlescale, meteo_day) -outputs_singlescale[1:3,:] # show the first 3 rows of the output -``` - -Those models all operate on a simplified model of a single plant, without any organ-local information. We can therefore consider them to be working at the 'whole plant' scale. Their variables also operate at that `:Plant` scale, so there is no need to map any variable to other scales. - -We can therefore convert this into the following mapping: - -```@example usepkg -mapping = ModelMapping( -:Plant => ( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2), - Status(TT_cu=cumsum(meteo_day.TT),) - ), -) -``` - -Note the slight difference in syntax for the [`Status`](@ref). This is because each scale has its own variables, so we must provide the values to each scale independently. - -## Adding a new package for our plant graph - -None of these models operate on a multi-scale tree graph, either. There is no concept of organ creation or growth. We still need to provide a multi-scale tree graph to a multi-scale simulation, so we can -for now- declare a very simple MTG, with a single node: - -```@example usepkg -using MultiScaleTreeGraph - -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Plant, 0, 0),) -``` - -!!! note - You will need to add the `MultiScaleTreeGraph` package to your environment. See [Installing and running PlantSimEngine](@ref) if you are not yet comfortable with Julia or need a refresher. - -## Running the multi-scale simulation ? - -We now have **almost** everything we need to run the multiscale simulation. - -This first conversion step can be a starting point for a more elaborate multi-scale simulation. - -The signature of the [`run!`](@ref) function in multi-scale differs slightly from the single-scale version: - -```julia -out_multiscale = run!(mtg, mapping, meteo_day) -``` - -(Some of the optional arguments also change slightly) - -Passing in a vector through the [`Status`](@ref) field is still possible in multi-scale mode, but more involving than in single-scale mode. If you need to go this way, you can find a detailed example [here](@ref multiscale_vector), although we don't recommend it for beginners. In any case, it's simpler to write a model to provide the thermal time per timestep as a variable, instead of as a single vector in the [`Status`](@ref). - -Our 'pseudo-multiscale' first approach will therefore turn into a genuine multi-scale simulation. - -## Adding a second scale - -Let's have a model provide the Cumulated Thermal Time to our Leaf Area Index model, instead of initializing it through the [`Status`](@ref). - -Let's instead implement our own `ToyTT_cuModel`. - -### TT_cu model implementation - -This model doesn't require any outside data or input variables, it only operates on the weather data and outputs our desired TT_cu. The implementation doesn't require any advanced coupling and is very straightforward. - -```@example usepkg -PlantSimEngine.@process "tt_cu" verbose = false - -struct ToyTt_CuModel <: AbstractTt_CuModel -end - -function PlantSimEngine.run!(::ToyTt_CuModel, models, status, meteo, constants, extra=nothing) - status.TT_cu += - meteo.TT -end - -function PlantSimEngine.inputs_(::ToyTt_CuModel) - NamedTuple() # No input variables -end - -function PlantSimEngine.outputs_(::ToyTt_CuModel) - (TT_cu=0.0,) -end -``` - -!!! note - The only accessible variables in the [`run!`](@ref) function via the status are the ones that are local to the :Scene scale. This isn't explicit at first glance, but very important to keep in mind when developing models, or using them at different scales. If variables from other scales are required, then they need to be mapped via a [`MultiScaleModel`](@ref), or sometimes a more complex coupling is necessary. - -### Linking the new TT_cu model to a scale in the mapping - -We now have our model implementation. How does it fit into our mapping ? - -Our new model doesn't really relate to a specific organ of our plant. In fact, this model doesn't represent a physiological process of the plant, but rather an environmental process affecting its physiology. We could therefore have it operate at a different scale unrelated to the plant, which we'll call :Scene. This makes sense. - -Note that we now need to add a :Scene node to our Multi-scale Tree Graph, otherwise our model will not run, since no other model calls it and :Plant nodes will only call models at the :Plant scale. See [Empty status vectors in multi-scale simulations](@ref) for more details. - -```@example usepkg -mtg_multiscale = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 0, 0),) - plant = MultiScaleTreeGraph.Node(mtg_multiscale, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) -``` - -### Mapping between scales : the MultiScaleModel wrapper - -The cumulated thermal time (`:TT_cu`) which was previously provided to the LAI model as a simulation parameter now needs to be mapped from the :Scene scale level. - -This is done by wrapping our ToyLAIModel in a dedicated structure called a [`MultiScaleModel`](@ref). A [`MultiScaleModel`](@ref) requires two keyword arguments : `model`, indicating the model for which some variables are mapped, and `mapped_variables`, indicating which scale link to which variables, and potentially renaming them. - -There can be different kinds of variable mapping with slightly different syntax, but in our case, only a single scalar value of the TT_cu is passed from the :Scene to the :Plant scale. - -This gives us the following declaration with the [`MultiScaleModel`](@ref) wrapper for our LAI model: - -```@example usepkg -MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ) -``` -and the new mapping with two scales: - -```@example usepkg -mapping_multiscale = ModelMapping( - :Scene => ToyTt_CuModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.5), - ToyRUEGrowthModel(0.2), - ), -) -``` - -### Running the multi-scale simulation - -We can then run the multiscale simulation, with our two-node MTG : - -```@example usepkg -outputs_multiscale = run!(mtg_multiscale, mapping_multiscale, meteo_day) -``` - -### Comparing outputs between single- and multi-scale - -The outputs structures are slightly different : multi-scale outputs are indexed by scale, and a variable has a value for every node of the scale it operates at (for instance, there would be a "leaf_surface" value for every leaf in a plant), stored in an array. - -In our simple example, we only have one MTG scene node and one plant node, so the arrays for each variable in the multi-scale output only contain one value. - -We can access the output variables at the :Scene scale by indexing our outputs: - -```@example usepkg -outputs_multiscale[:Scene] -``` -We have a `Vector{NamedTuple}`structure. Our single-scale output is a `Vector{T}`: -```@example usepkg -outputs_singlescale.TT_cu -``` - - Let's extract the multi-scale `:TT_cu`: -```@example usepkg -computed_TT_cu_multiscale = [outputs_multiscale[:Scene][i].TT_cu for i in 1:length(outputs_multiscale[:Scene])] -``` - -We can now compare them value-by-value and do a piecewise approximate equality test : -```@example usepkg -for i in 1:length(computed_TT_cu_multiscale) - if !(computed_TT_cu_multiscale[i] ≈ outputs_singlescale.TT_cu[i]) - println(i) - end -end -``` -or equivalently, with broadcasting, we can write : -```@example usepkg -is_approx_equal = length(unique(computed_TT_cu_multiscale .≈ outputs_singlescale.TT_cu)) == 1 -``` - -!!! note - You may be wondering why we check for approximate equality rather than strict equality. The reason for that is due to floating-point accumulation errors, which are discussed in more detail in [Floating-point considerations](@ref). - -## ToyDegreeDaysCumulModel - -There is a model able to provide Thermal Time based on weather temperature data, [`ToyDegreeDaysCumulModel`](@ref), which can also be found in the examples folder. - -We didn't make use of it here for learning purposes. It also computes a thermal time based on default parameters that don't correspond to the thermal time in the example weather data, so results differ from the thermal time already present in the weather data without tinkering with the parameters. diff --git a/docs/src/planned_features.md b/docs/src/planned_features.md index ba02656e2..af2e89cc4 100644 --- a/docs/src/planned_features.md +++ b/docs/src/planned_features.md @@ -1,51 +1,53 @@ # Roadmap -This page summarizes work that is still in progress or intentionally left for -future releases. It is not a guarantee of delivery order. +PlantSimEngine now has one composite-model/object runtime for single-object, multiscale, +multi-plant, soil, microclimate, and multirate simulations. -## Current focus areas +Current priorities are: -### Multi-rate MTG simulations +- migrate downstream model packages to `CompositeModel`, `CompositeModelTemplate`, + `ObjectInstance`, and `ModelSpec`; +- strengthen type-stability and allocation tests for million-object workloads; +- add broader lifecycle tests for object creation, removal, movement, and + environment-index refresh; +- improve diagnostics for ambiguous selectors, writer conflicts, and temporal + policies; +- validate mutable voxel, layer, and octree microclimate backends; +- expand downstream release gates and performance benchmarks; +- evaluate parallel execution for independent compiled application batches. -Model-level varying timesteps are available experimentally for MTG simulations -through mapping-declared multi-rate execution and `ModelSpec` transforms such as -`TimeStepModel`, `InputBindings`, `OutputRouting`, and `ScopeModel`. +## Environment and microclimate work -Known gaps in the current implementation: +### Trial environment sampling -- no sub-step execution below the meteorological base-step duration; -- no dedicated event scheduler for irregular or non-fixed calendar execution; -- no threaded or distributed multi-rate MTG execution path yet. +Coupled microclimate solvers can iterate on local environmental state before +accepting a timestep. A canopy energy-balance model, for example, may need to: -### Multi-plant and multi-species simulations +1. propose a trial canopy air temperature and humidity; +2. run leaf models against that trial air state; +3. update the trial air state from leaf sensible and latent heat fluxes; +4. repeat until convergence; +5. commit only the accepted canopy or voxel air state to the mutable environment + backend. -PlantSimEngine can already express multi-scale simulations, but practical support -for scenes containing several plants or several species with overlapping model -sets is still limited. Future work in this area is expected to focus on more -flexible mapping and parameter declaration. +Pass non-committing trial state through `run_call!`: -## API and ergonomics +```julia +run_call!(context, :leaf_energy; environment=trial_environment, publish=false) +``` -- a more consistent mapping API and clearer multiscale dependency declaration; -- improved user-facing errors and diagnostics; -- better dependency graph visualization and traversal helpers; -- broader examples for fitting, type conversion, and error propagation; -- clearer weather-data validation when a simulation requires meteorological inputs. +Then commit the accepted state through the model-facing environment API: -## Testing and release engineering +```julia +commit_environment!(context, accepted_environment) +run_call!(context, :leaf_energy; publish=true) +``` -- broader downstream coverage and better release gating; -- additional checks for memory usage and type stability; -- state-machine or invariant-style validation for runtime outputs; -- graph fuzzing for multiscale corner cases. +The transient state is interpreted by each target backend through its opaque +compiled handle, so one call can sample different cells for different leaves. +`commit_environment!` commits only the accepted state to a mutable backend. +Future work is to validate full voxel, layer, and octree implementations on +this same model-side API. -## Lower-priority ideas - -- API support for iterative construction and validation of `ModelMapping`; -- optional code-generation or build steps for validated mappings; -- improved parallel execution strategies; -- reintroducing multi-object parallelism in single-scale runs if the execution - model can stay predictable and testable. - -The full list of open issues is available on +The full issue list is available on [GitHub](https://github.com/VirtualPlantLab/PlantSimEngine.jl/issues). diff --git a/docs/src/prerequisites/installing_plantsimengine.md b/docs/src/prerequisites/installing_plantsimengine.md index d992f7a20..67c135dbf 100644 --- a/docs/src/prerequisites/installing_plantsimengine.md +++ b/docs/src/prerequisites/installing_plantsimengine.md @@ -1,78 +1,49 @@ -# Installing and running PlantSimEngine +# Installing PlantSimEngine -```@contents -Pages = ["installing_plantsimengine.md"] -Depth = 3 -``` - -This page is meant to help along people newer to Julia. If you are quite accustomed to Julia, installing PlantSimEngine should be par for the course, and you can [move on to the next section](#step_by_step), or read about PlantSimEngine's [Key Concepts](@ref). - -## Installing Julia - -The direct download link can be found [here](https://julialang.org/downloads/), and some additional pointers [in the official manual](https://docs.julialang.org/en/v1/manual/installation/). - -## Installing VSCode - -You can get by using a REPL, but if writing a larger piece of software you may prefer using an IDE. PlantSimEngine is developed using VSCode, which you can install by following instruction [on this page](https://code.visualstudio.com/docs/setup/setup-overview). A documentation section specific to using Julia in VSCode can be found [here](https://code.visualstudio.com/docs/languages/julia). - -## Installing PlantSimEngine and its dependencies - -### Julia environments - -Julia package management is done via the Pkg.jl package. You can find more in-depth sections detailing its usage, and working with Julia environments [in its documentation](https://pkgdocs.julialang.org/v1/) - -If you find this page insufficient to get started, [this tutorial](https://jkrumbiegel.com/pages/2022-08-26-pkg-introduction/) explains in detail the subtleties of Julia environments. - -### Running an environment - -Once your environment is set up, you can launch a command prompt and type `julia`. This will launch Julia, and you should see `julia>` in the command prompt. - -You can always type `?` from there to enter help mode, and type the name of a function or language feature you wish to know more about. - -You can find out which directory you are in by typing `pwd()` in a Julia session. - -Handling environments and dependencies is done in Julia through a specific Package called Pkg, which comes with the base install. You can either call Pkg features the same way you would for another package, or enter Pkg mode by typing `]`, which will change the display from `julia>` to something like `(@v1.11)` pkg>, indicating your current environment (in this case, the default julia environment, which we don't recommend bloating). +Install Julia from the +[official download page](https://julialang.org/downloads/), create a project +environment, and add PlantSimEngine: -Once in Pkg mode, you can choose to create an environment by typing `activate path/to/environment`. - -You can then add packages that have been added to Julia's online global registry by typing `add packagename` and you can remove them by typing `remove packagename`. Typing `status` or `st` will indicate what your current environment is comprised of. To update packages in need of updating (a `^` symbol will display next to their name), type `update`… or `up`. - -If you are editing/developing a package or using one locally, typing `develop path/to/package source/` (or `dev path/to/package/source`) will cause your environment to use that version instead of the registered one. - -Typing `instantiate` will download all the packages declared in the manifest file (if it exists) of an environment. - -For instance, PlantSimEngine has a test folder used in development. If you wanted to run tests, you would type `]` then `activate ../path/to/PlantSimEngine/test` then `instantiate` -and then you would be ready to run some scripts. - -So if you wish to use PlantSimEngine, you can enter Pkg mode (`]`), choose an environment folder, then activate that environment with `activate ../path/to/your_environment`, add PlantSimEngine to it with `add PlantSimEngine` then download the package and its dependencies with `instantiate`. - -### Companion packages - -You'll also, for most of our examples, need `PlantMeteo`. For several multi-scale simulations, you'll need `MultiScaleTreeGraph`. - -Some of the weather data examples make use of the `CSV` package, some output data is manipulated as a DataFrame, which is part of the `DataFrames` package. - -### Using the example models +```julia +using Pkg +Pkg.activate("my_simulation") +Pkg.add("PlantSimEngine") +``` -Example models are exported as a distinct submodule of PlantSimEngine, meaning they aren't part of the main API. You can use them by typing: +Most simulations also use PlantMeteo: ```julia -using PlantSimEngine.Examples +Pkg.add("PlantMeteo") ``` -## Running a test simulation - -Assuming you've setup you're environement, correctly added `PlantMeteo` and `PlantSimEngine` to that environment, and downloaded everything with `instantiate`, you'll be able to run a test example in your REPL by typing line-by-line: +## First Simulation -```@example mypkg +```@example install using PlantSimEngine, PlantMeteo, Dates using PlantSimEngine.Examples -meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0) -leaf = ModelMapping(Beer(0.5), status = (LAI = 2.0,)) -out_sim = run!(leaf, meteo) + +meteo = Atmosphere( + T=20.0, + Wind=1.0, + Rh=0.65, + Ri_PAR_f=500.0, + duration=Hour(1), +) + +model = CompositeModel( + Beer(0.5); + status=(LAI=2.0,), + id=:leaf, + scale=:Leaf, + environment=meteo, +) + +simulation = run!(model) +final_state(simulation, One(scale=:Leaf)).aPPFD ``` -## Environments in VSCode +Example models are provided by the `PlantSimEngine.Examples` submodule. They +are useful for learning and tests but are not part of the core modeling API. -There is detailed documentation explaining how to make use of Julia with VSCode with one section indicating how to handle environments in VSCode: [https://www.julia-vscode.org/docs/stable/userguide/env/](https://www.julia-vscode.org/docs/stable/userguide/env/) - \ No newline at end of file +For local package development, use `Pkg.develop(path="...")`. Run the package +tests with `Pkg.test("PlantSimEngine")`. diff --git a/docs/src/prerequisites/julia_basics.md b/docs/src/prerequisites/julia_basics.md index bb22f92ee..707ad6122 100644 --- a/docs/src/prerequisites/julia_basics.md +++ b/docs/src/prerequisites/julia_basics.md @@ -15,7 +15,7 @@ It is not meant as a full-fledged from-scratch Julia tutorial. If you are comple ## Installing packages and setting up and environment For PlantSimEngine, you can check our documentation page on the topic: -[Installing and running PlantSimEngine](@ref) +[Installing PlantSimEngine](installing_plantsimengine.md). ## Cheatsheets @@ -23,8 +23,6 @@ You can also find a few cheatsheets [here](https://palmstudio.github.io/Biophysi ## Troubleshooting -There is a documentation page showcasing some of the common errors than can occur when using PlantSimEngine, which may be worth checking if you are encountering issues: [Troubleshooting error messages](@ref). - For more Julia learning-related difficulties, you will find quick responses on the Discourse forum: [https://discourse.julialang.org](https://discourse.julialang.org). ### Noteworthy differences with other languages: @@ -52,4 +50,4 @@ Also of importance: Many of these are also briefly presented in [this Julia Data Science](https://juliadatascience.io/julia_basics) guide, which also happens to focus on the DataFrames.jl package. -Understanding more about methods, parametric types and the typing system is usually worthwhile, when working with Julia packages. \ No newline at end of file +Understanding more about methods, parametric types and the typing system is usually worthwhile, when working with Julia packages. diff --git a/docs/src/prerequisites/key_concepts.md b/docs/src/prerequisites/key_concepts.md index 93bef82e6..2f254e75c 100644 --- a/docs/src/prerequisites/key_concepts.md +++ b/docs/src/prerequisites/key_concepts.md @@ -1,185 +1,108 @@ # Key Concepts -You'll find a brief description of some of the main concepts and terminology related to and used in PlantSimEngine. +## Processes And Models -```@contents -Pages = ["key_concepts.md"] -Depth = 4 -``` - -## Crop models - -## FSPM - -## PlantSimEngine terminology - -This page provides a general description of the concepts and terminology used in PlantSimEngine. For a more implementation-guided description of the design and some of the terms presented here, see the [Detailed walkthrough of a simple simulation](@ref detailed-walkthrough-of-a-simple-simulation) - -!!! Note - Some terminology has different meanings in different contexts. This is particularly true of the terms organ, scale and symbol, which have a different meaning for [Multi-scale Tree Graphs](@ref) than the rest of PlantSimEngine (see [Scale/symbol terminology ambiguity](@ref) further down). Make sure to double-check those subsections, and relevant examples if you encounter issues relating to these terms. - -### Processes - -A process in this package defines a biological or physical phenomena. Think of any process happening in a system, such as light interception, photosynthesis, water, carbon and energy fluxes, growth, yield or even electricity produced by solar panels. - -See [Implementing a new process](@ref) for a brief explanation on how to declare a new process. - -### Models - -A model is a particular implementation for the simulation of a process. - -There may be different models that can be used for the same process; for instance, there are multiple hypotheses and ways of modeling photosynthesis, with different granularity and accuracy. A simple photosynthesis model might apply a simple formula and apply it to the total leaf surface, a more complex one might calculate interception and light extinction. - -!!! note - The companion package PlantBiophysics.jl provides the [`Beer`](https://vezy.github.io/PlantBiophysics.jl/stable/functions/#PlantBiophysics.Beer) structure for the implementation of the Beer-Lambert law of light extinction. The process of `light_interception` and the `Beer` model are provided as an example script in this package too at [`examples/Beer.jl`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/master/examples/Beer.jl). - -Models can also be used for ad hoc computations that aren't directly tied to a specific literature-defined physiological process. In PlantSimEngine, everything is a model. There are many instances where a custom model might be practical to aggregate some computations or handle other information. To illustrate, XPalm, the Oil Palm model, has a few models that handle the state of different organs, and a model to handle leaf pruning, which you can find [here](https://github.com/PalmStudio/XPalm.jl/blob/main/src/plant/phytomer/leaves/leaf_pruning.jl). - -To prepare a simulation, you declare a ModelMapping with whatever models you wish to make use of and initialize necessary parameters: see the [step by step](@ref detailed-walkthrough-of-a-simple-simulation) section to learn how to use them in practice. - -For multi-scale simulations, models need to be tied to a particular scale when used. See the [Multiscale modeling](@ref) section below, or the [Multi-scale considerations](@ref) page for a more detailed description of multi-scale peculiarities. - -### Variables, inputs, outputs, and model coupling - -A model used in a simulation requires some input data and parameters, and will compute some other data which may be used by other models. Depending on what models are combined in a simulation, some variables may be inputs of some models, outputs of other models, only be part of intermediary computations, or be a user input to the whole simulation. - -Here's a conceptual model coupling; each "node" is equivalent to a distinct PlantSimEngine model, "compute()" is equivalent to the model's "run!" function: - -![Model coupling example](../www/GUID-12E2DDAD-7B20-4FE2-AA36-7FAC950382A6-low.png) -(Source: [Autodesk](https://help.autodesk.com/view/MAYAUL/2016/ENU/?guid=__files_GUID_A9070270_9B5D_4511_8012_BC948149884D_htm")) - -### Dependency graphs - -Coupling models together in this fashion creates what is known as a [Directed Acyclic Graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph) or DAG, a type of [dependency graph](https://en.wikipedia.org/wiki/Dependency_graph). The order in which models are run is determined by the ordering of these models in that graph. - -![Example DAG](../www/dags_acyclic_vs_cyclic-d1a669bf1b8b6bfa8ac3041788e81171.png) -A simple Directed Acyclic Graph, note the required absence of cycles. Source: [Astronomer](https://www.astronomer.io/docs/learn/dags/) (Note: "Not Acyclic" is simply "Cyclic"). - -PlantSimEngine creates this Directed Acyclic Graph automatically by plugging the right variables in the right models. Users therefore only need to declare models, they do not need to write the code to connect them as PlantSimEngine does that work for them, as long as the model coupling has no cyclic dependency. - -### ["Hard" and "Soft" dependencies](@id hard_dependency_def) - -Linking models by setting output variables from one model as input of another model handles many typical couplings (with more situations occurring with multi-scale models and variables), but what if two models are interdependent? What if they need to iterate on some computation and pass variables back and forth? - -You can find a typical example in a companion package: [PlantBioPhysics.jl](https://github.com/VEZY/PlantBiophysics.jl). An energy balance model, the [Monteith model](https://github.com/VEZY/PlantBiophysics.jl/blob/master/src/processes/energy/Monteith.jl), needs to [iteratively run a photosynthesis model](https://github.com/VEZY/PlantBiophysics.jl/blob/c1a75f294109d52dc619f764ce51c6ca1ea897e8/src/processes/energy/Monteith.jl#L154) in its [`run!`](@ref) function. - -See the illustration below of the way these models are interdependent: +A process identifies a biological or physical phenomenon, such as +photosynthesis, growth, water balance, or energy balance. A model is one +implementation of a process. -![Example of a coupling with cycles](../www/ecophysio_coupling_diagram.png) +Models subtype `AbstractModel` and declare: -Example of a coupling with a cycle. Source: PlantBioPhysics.jl +- `inputs_`: values read from object status, each declared as `Required(T)` or + `Default(value)`; +- `outputs_`: values written to object status; +- `environment_inputs_`: values sampled from the environment; +- `environment_outputs_`: environment variables a controller may commit; +- `commit_environment!`: accepted meteorological state committed to a mutable + environment by controller models; +- `dep`: processes called manually by the model, when required. -Model couplings that cause simulation to flow both ways break the 'acyclic' assumption of the dependency graph. - -PlantSimEngine handles this internally by not having those "heavily-coupled" models -called **hard dependencies** from now on- be part of the main dependency graph. Instead, modelers should call these models manually from within a model. This way, they are made to be children nodes of the parent/ancestor model, which handles them internally, so they aren't tied to other nodes of the dependency graph. The resulting higher-level graph therefore only links models without any two-way interdependencies, and remains a directed graph, enabling a cohesive simulation order. The simpler couplings in that top-level graph are called "soft dependencies". - -![Hard dependency coupling visualization in PlantSimEngine](../www/PBP_dependency_graph.png) -The previous coupling, handled by PlantSimEngine - -How PlantSimEngine links these models under the hood. The red models ("hard dependencies") are not exposed in the final dependency graph, which only contains the blue "soft dependencies", and has no cycles. - -This approach does have implications when developing interdependent models: hard dependencies need to be made explicit, and the ancestor needs to call the hard dependency model's [`run!`](@ref) function explicitely in its own [`run!`](@ref) function. Hard dependency models therefore must have only one parent model. - -This reliance on another process makes these models slightly more complex to develop and validate, but keep the versatility of the implementation, as any model implementing the hard-dependency process can be passed by the user. - -Note that hard dependencies can also have their own hard dependencies, and some complex couplings can happen. - -### Weather data - -To run a simulation, we usually need the climatic/meteorological conditions measured close to the object or component. - -Users are strongly encouraged to use [`PlantMeteo.jl`](https://github.com/PalmStudio/PlantMeteo.jl), the companion package that helps manage such data, with default pre-computations and structures for efficient computations. We will make constant use of it throughout the documentation, and recommend working with it. - -The most basic data structure from this package is a type called [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere), which defines steady-state atmospheric conditions, *i.e.* the conditions are considered at equilibrium. Another structure is available to define different consecutive time-steps: [`TimeStepTable`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.TimeStepTable). - -The mandatory variables to provide for an [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere) are: `T` (air temperature in °C), `Rh` (relative humidity, 0-1) and `Wind` (the wind speed, m s⁻¹). - -In the example below, we also pass in the -optional- incoming photosynthetically active radiation flux (`Ri_PAR_f`, W m⁻²). We can declare such conditions like so: - -```@example usepkg -using PlantMeteo -meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0) -``` - -More details are available from the [package documentation](https://vezy.github.io/PlantMeteo.jl/stable). If you do not wish to make use of this package, you can alternately provide your own data, as long as it respects the [Tables.jl interface](https://tables.juliadata.org/stable/#Implementing-the-Interface-(i.e.-becoming-a-Tables.jl-source)) (*e.g.* use a `DataFrame`). - -If you wish to make use of more fine-grained weather data, it will likely require more advanced model creation and MTG manipulation, and more involved work on the modeling side. - -### Organ/Scale - -Plants have different organs with distinct physiological properties and processes. When doing more fine-grained simulations of plant growth, many models will be tied to a particular organ of a plant. Models handling flowering state or root water absorption are such examples. Others, such as carbon allocation and demand, might be reused in slightly different ways for multiple organs of the plant. - -PlantSimEngine documentation tends to use the terms "organ" and "scale" mostly interchangeably. "Scale" is a bit more general and accurate, since some models might not operate at a specific organ level, but (for example) at the scene level, so a "Scene" scale might be present in the MTG, and in the user-provided data. - -When working with multi-scale data, the scale will often need to be specified to map variables, or to indicate at what scale level models work out. You will see some code resembling this : +The numerical kernel is implemented with: ```julia -:Root => (RootGrowthModel(), OrganAgeModel()), -:Leaf => (LightInterceptionModel(), OrganAgeModel()), -:Plant => (TotalBiomassModel(),), +PlantSimEngine.run!(model, status, environment, constants, context) ``` -This example excerpt links from specific models to a specific scale. Note that one model is reused at two different scales, and note that `:Plant` isn't an actual organ, hence the preferred usage of the term "scale". - -### Multiscale modeling - -Multi-scale modeling is the process of simulating a system at multiple levels of detail simultaneously. Some models might run at the organ scale while others run at the plot scale. Each model can access variables at its scale and other scales if needed, allowing for a more comprehensive system representation. It can also help identify emergent properties that are not apparent at a single level of detail. - -For example, a model of photosynthesis at the leaf scale can be combined with a model of carbon allocation at the plant scale to simulate the growth and development of the plant. Another example is a combination of models to simulate the energy balance of a forest. To simulate it, you need a model for each organ type of the plant, another for the soil, and finally, one at the plot scale, integrating all others. - -When running multi-scale simulations which contain models operating at different organ levels for the plant, extra information needs to be provided by the user to run models. Since some models are reused at different organ levels, it is necessary to indicate which organ level a model operates at. - -This is why multi-scale simulations make use of a 'mapping' in the `ModelMapping`, as well as links between models/variables in different scales, *e.g.* if an input variable comes from another scale, it is required to indicate which scale it is mapped from. - -You can read more about some practical differences as a user between single- and multi-scale simulations here: [Multi-scale considerations](@ref). - -### Multi-scale Tree Graphs +`Required(T)` describes an input that must be supplied by object state or +another application. `Default(value)` is a true model fallback that +PlantSimEngine can initialize automatically. Output literals are initial +output-state values. -![Grassy plant and equivalent MTG](../www/Grassy_plant_MTG_vertical.svg) +## Composite Models And Objects -A Grassy plant and its equivalent MTG +A `CompositeModel` contains objects and model applications. An `Object` can represent a +model, plant, soil volume, axis, internode, leaf, sensor, or any other simulated +entity. PlantSimEngine does not impose one plant architecture. -Multi-scale Tree Graphs (MTG) are a data structure used to represent plants. A more detailed introduction to the format and its attributes can be found [in the MultiScaleTreeGraph.jl package documentation](https://vezy.github.io/MultiScaleTreeGraph.jl/stable/the_mtg/mtg_concept/). +Objects can carry: -Multi-scale simulations can operate on MTG objects; new nodes are added corresponding to new organs created during the plant's growth. +- a stable identifier; +- scale, kind, species, and name metadata; +- parent-child relationships; +- geometry and position; +- mutable `Status`; +- object-local model applications. -You can see a basic display of an MTG by simply typing its name in the REPL: +`CompositeModelTemplate` packages reusable applications for a species or object type. +`ObjectInstance` mounts the template in a model. Several instances can share +models and parameters while declaring targeted overrides for exceptional +objects. -![example display of an MTG in PlantSimEngine](../www/MTG_output.png) +## Model Applications -!!! note - Another companion package, [PlantGeom.jl](https://github.com/VEZY/PlantGeom.jl), can also create MTG objects from .opf files (corresponding to the [Open Plant Format](https://amap-dev.cirad.fr/projects/xplo/wiki/The_opf_format_(*opf)), an alternate means of describing plants computationally). +`ModelSpec` configures one use of a model: -#### Scale/symbol terminology ambiguity +- `ModelSpec(...; on=...)` selects target objects; +- `ModelSpec(...; inputs=...)` selects producers for value dependencies; +- `ModelSpec(...; calls=...)` binds manually controlled model calls; +- `ModelSpec(...; every=...)` selects the execution cadence; +- `Environment(...)` configures environment sampling; +- `Updates(...; after=:application_id)` orders intentional additional writers; +- `ModelSpec(...; output_routing=...)` controls output publication. -Multi-scale tree graphs have different terminology (see [Organ/Scale](@ref)): +This keeps model implementations generic. Models do not need to know which +model, object, timestep, or coupling scenario will use them. -- the MTG node **symbol** represents "something" like a `:Plant`, `:Root`, `:Scene` or `:Leaf`. It corresponds to a PlantSimEngine *scale* and has nothing to do with the Julia programming language's definition of symbol (*e.g.* `:var`) -- the MTG node **scale**, is an integer passed to the Node constructor, and describes the level of description of the tree graph object. They don't always have a one-to-one correspondence to the symbol (or PlantSimEngine's scale), but are similar. +## Soft And Manual Dependencies -![Three scale levels on an MTG, which differ from typical PlantSimEngine concept of scale](../www/Grassy_plant_scales.svg) +Ordinary dependencies are inferred by matching model inputs with outputs and +are compiled into an acyclic execution order. `ModelSpec(...; inputs=...)` is used when the +source is cross-object, renamed, temporal, or otherwise ambiguous. -You can find a brief description of the MTG concepts [here](https://vezy.github.io/MultiScaleTreeGraph.jl/stable/the_mtg/mtg_concept/#Node-MTG-and-attributes). +Some algorithms need direct call-stack control. For example, a model energy +balance may repeatedly call leaf energy-balance models until canopy +microclimate converges. Such dependencies are bound with `ModelSpec(...; calls=...)`; the +parent invokes them with `run_call!`. -Other words are unfortunately reused in various contexts with different meanings: tree/leaf/root have a different meaning when talking about computer science data structure (*e.g.*, graphs, dependency graphs and trees). +## Status And References -!!! note - In the majority of cases, you can assume the tree-related terminology refers to the biological terms, and that "organ" refer to plant organs, and "single-scale", "multi-scale" and "scale" to PlantSimEngine's concept of scales described in [Organ/Scale](@ref). MTG objects are mostly manipulated on a per-node basis (the graph node, not the botanical node), unless a model makes use of functions relating to MTG traversal, in which case you may expect computer science terminology. +`Status` stores variables in references. Same-rate coupling normally shares +those references instead of copying values. A many-object input uses a +reference vector, so aggregation models read current source values directly. -#### TLDR +Temporal coupling uses published streams when producer and consumer clocks +differ. Policies include `HoldLast`, `Interpolate`, `Integrate`, `Aggregate`, +and `PreviousTimeStep`. -In summary: +## Environment -- In PlantSimEngine a scale is a level of description defined by a name (`String`). In MTG, a scale is an integer describing the level of description of the node, and a symbol is a name for that node. So symbol in the MTG == scale in PlantSimEngine; -- The word "node" is always used to refer to the Multiscale Tree Graph node, not the botanical node. +The active environment backend may be: -### State machines +- one constant atmosphere shared by all objects; +- a time-indexed weather table; +- a mutable layer, voxel, grid, or octree microclimate. -A state machine is a computational concept used to model mechanisms and devices, which may be of interest for your simulations. +Object-to-environment support is compiled and cached. Geometry changes mark the +binding dirty so it can be refreshed without recomputing spatial lookup at +every timestep. -![State machine image](../www/Turnstile_state_machine_colored.svg.png) -A simple state machine. See the [wikipedia page](https://en.wikipedia.org/wiki/Finite-state_machine) for more examples. +## Multiscale Plant Structure -State machines can be useful to model organ state: some organs in [XPalm.jl](https://github.com/PalmStudio/XPalm.jl), a package modelling the oil palm using PlantSimEngine, have a `state` variable behaving like a state machine, indicating whether an organ is mature, pruned, flowering, etc. +PlantSimEngine treats scale and object hierarchy as scenario data. A plant may +use leaves directly under a plant, or axes, segments, internodes, roots, and +other intermediate levels. Selectors express relationships such as one source, +many descendants, the current plant, an ancestor, or all matching objects in +the model. -You can find an example model (amongst other such models) affecting the `state` variable of some organs depending on their age and thermal time in the XPalm oil palm FSPM [here](https://github.com/PalmStudio/XPalm.jl/blob/main/src/plant/phytomer/phytomer/state.jl). +MultiScaleTreeGraph objects can be imported with `objects_from_mtg`, but the +runtime operates on the same composite-model/object representation afterward. diff --git a/docs/src/step_by_step/advanced_coupling.md b/docs/src/step_by_step/advanced_coupling.md index 07b81c8bb..907953a44 100644 --- a/docs/src/step_by_step/advanced_coupling.md +++ b/docs/src/step_by_step/advanced_coupling.md @@ -1,64 +1,167 @@ # Coupling more complex models -```@setup usepkg -using PlantSimEngine, PlantMeteo, Dates -# Import the example models defined in the `Examples` sub-module: +```@setup scene_advanced_coupling +using PlantSimEngine, PlantMeteo, Dates, DataFrames using PlantSimEngine.Examples -m = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - Process4Model(), - Process5Model(), - Process6Model(), - Process7Model(), +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, ) ``` -When two or more models have a two-way interdependency (rather than variables flowing out only one-way from one model into the next), we describe it as a [hard dependency](@ref hard_dependency_def). +Most model coupling is a value dependency: one model writes an output, another +model reads it as an input. Some models need tighter control. For example, an +energy-balance model may call photosynthesis and stomatal-conductance models +several times while it iterates leaf temperature. -This kind of interdependency requires a little more work from the user/modeler for PlantSimEngine to be able to automatically create the dependency graph. +That second case is a manual call dependency. In the composite-model/object API it is +declared with `ModelSpec(...; calls=...)`. -## Declaring hard dependencies +## Soft inputs and manual calls -A model that explicitly and directly calls another process in its [`run!`](@ref) function is part of a hard dependency, or a hard-coupled model. +Use `ModelSpec(...; inputs=...)` or inferred same-object bindings when a model only needs a +value. Use `ModelSpec(...; calls=...)` when the parent model must directly run another model +inside its own `run!` method. -Let's go through the example processes and models from a script provided by the package here [examples/dummy.jl](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples/dummy.jl) +The example process models in `examples/dummy.jl` contain both patterns: -In this script, we declare seven processes and seven models, one for each process. The processes are simply called "process1", "process2"..., and the model implementations are called `Process1Model`, `Process2Model`... +- `Process4Model` computes `var1` and `var2`; +- `Process1Model` consumes `var1` and `var2` and computes `var3`; +- `Process2Model` manually calls process 1, then computes `var4` and `var5`; +- `Process3Model` manually calls process 2, then computes `var6`; +- `Process5Model`, `Process6Model`, and `Process7Model` use regular soft + value dependencies. -When run, `Process2Model` calls another process's [`run!`](@ref) function explicitely, which requires defining that process as a hard-dependency of `Process2Model` : +## Declaring manual calls in the scenario -```julia -function PlantSimEngine.run!(::Process2Model, models, status, meteo, constants, extra) - # computing var3 using process1: - run!(models.process1, models, status, meteo, constants) - # computing var4 and var5: - status.var4 = status.var3 * 2.0 - status.var5 = status.var4 + 1.0 * meteo.T + 2.0 * meteo.Wind + 3.0 * meteo.Rh -end +`ModelSpec(...; calls=...)` is scenario-level wiring. The model kernel remains generic; the +scenario decides which concrete application is called. + +Use `application=...` in scenario-level `ModelSpec(...; calls=...)` and `ModelSpec(...; inputs=...)` when you +know which mounted model application should provide the value or be called. Use +process identities in model-level contracts such as `dep(model)`, where the +model author only declares that a compatible process is required and cannot know +the names chosen by future scenarios. + +This split avoids ambiguity when several applications implement the same +process. For example, two soil-water applications can share the same process but +represent different layers, parameter sets, objects, or time steps. A scenario +selector should name the application that has the intended role. + +```@example scene_advanced_coupling +complex_scene = CompositeModel( + Object(:scene; scale=:Scene, kind=:scene, status=Status(var0=2.0)); + applications=( + ModelSpec(Process4Model(); name=:prepare_inputs, on=One(scale=:Scene), every=Day(1)), + + ModelSpec(Process1Model(2.0); name=:process1, on=One(scale=:Scene), every=Day(1)), + + ModelSpec(Process2Model(); name=:process2, on=One(scale=:Scene), calls=(:process1 => One(scale=:Scene, application=:process1)), every=Day(1)), + + ModelSpec(Process3Model(); name=:process3, on=One(scale=:Scene), calls=(:process2 => One(scale=:Scene, application=:process2)), every=Day(1)), + + ModelSpec(Process5Model(); name=:process5, on=One(scale=:Scene), every=Day(1)), + + ModelSpec(Process7Model(); name=:process7, on=One(scale=:Scene), every=Day(1)), + + ModelSpec(Process6Model(); name=:process6, on=One(scale=:Scene), every=Day(1)), + ), + environment=meteo_day, +) + +select( + DataFrame(Diagnostics.explain_calls(complex_scene)), + :application_id, + :call, + :callee_application_ids, + :callee_object_ids, + :publication_policy, +) ``` -`Process2Model` is coupled to another process (`process1`), and calls its model's `run` function. The [`run!`](@ref) function is called with the same arguments as the [`run!`](@ref) function of the model that calls it, except that we pass the process we want to simulate as the first argument. +Applications selected by `ModelSpec(...; calls=...)` are not scheduled as independent root +applications under their caller. They run only when the parent calls them. +This gives the parent full call-stack control. -!!! note - We don't enforce any type of model to simulate `process1`. This is the reason why we can switch so easily between model implementations for any process, by just changing the model in the [`ModelMapping`](@ref). +## Running the coupled model -A hard-dependency must always be declared to PlantSimEngine. This is done by adding a method to the `dep` function when implementing the model. For example, the hard-dependency to `process1` into `Process2Model` is declared as follows: +The regular soft dependencies are still inferred from `inputs_` and +`outputs_`. The scheduler combines those soft edges with the call ownership +rules: + +```@example scene_advanced_coupling +select( + DataFrame(Diagnostics.explain_schedule(complex_scene)), + :application_id, + :manual_call_only, + :execution_index, + :clock, +) +``` + +Run one timestep: + +```@example scene_advanced_coupling +complex_sim = run!(complex_scene; steps=1) +complex_status = final_state(complex_sim) +( + var3=complex_status.var3, + var5=complex_status.var5, + var6=complex_status.var6, + var8=complex_status.var8, +) +``` + +## Writing new hard-coupled models + +For new composite-model/object models, execute all targets directly when they +share meteorology and publication policy: ```julia -PlantSimEngine.dep(::Process2Model) = (process1=AbstractProcess1Model,) +targets = run_call!(context, :leaf_energy; publish=true) ``` -This way PlantSimEngine knows that `Process2Model` needs a model for the simulation of the `process1` process. To avoid imposing a specific model to be coupled with `Process2Model`, the dependency only requires a model that is a subtype of the abstract parent type `AbstractProcess1Model`. This avoids constraining to the specific `Process1Model` implementation, meaning an alternate model computing the same variables for the same process is still interchangeable with `Process1Model`. +The result is always vector-like. Retrieve targets without executing them when +an algorithm needs selective execution or an already sampled environment for +each target: -While not encouraged, if you have a valid reason to force the coupling with a particular model, you can force the dependency to require that model specifically. For example, if we want to use only `Process1Model` for the simulation of `process1`, we would declare the dependency as follows: +```julia +targets = call_targets(context, :leaf_energy) +for (target, leaf_environment) in zip(targets, environments_by_leaf) + run_call!( + target; + sampled_environment=leaf_environment, + publish=false, + ) +end +``` + +For a provider-aware trial state shared by the call, keep the execute-all form. +Each target still samples through its own compiled handle: ```julia -PlantSimEngine.dep(::Process2Model) = (process1=Process1Model,) +function PlantSimEngine.run!(model::SceneEnergyBalance, status, environment, + constants, context) + trial = trial_environment(model, status) + run_call!(context, :leaf_energy; environment=trial, publish=false) + + accepted = accepted_environment(model, status) + commit_environment!(context, accepted) + run_call!(context, :leaf_energy; publish=true) + + return nothing +end ``` -## Examples in the wild +`run_call!` defaults to `publish=false`, which is useful for trial iterations. +Pass non-committing trial state with the `environment` keyword. Use +`commit_environment!` and `publish=true` for the accepted state so temporal +streams and mutable environment state are published once. + +The MAESPA-style example uses the same mechanism: a model energy-balance model +calls all selected leaf energy-balance models and the shared soil model while +it solves canopy microclimate. -You can find a typical example in a companion package: [PlantBioPhysics.jl](https://github.com/VEZY/PlantBiophysics.jl). An energy balance model, the [Monteith model](https://github.com/VEZY/PlantBiophysics.jl/blob/master/src/processes/energy/Monteith.jl), needs to [iteratively run a photosynthesis model](https://github.com/VEZY/PlantBiophysics.jl/blob/c1a75f294109d52dc619f764ce51c6ca1ea897e8/src/processes/energy/Monteith.jl#L154) in its [`run!`](@ref) function. \ No newline at end of file +Scenario wiring uses `ModelSpec(...; calls=...)`. Model authors should keep kernels generic +and only require manual calls when the model really needs call-stack control. diff --git a/docs/src/step_by_step/detailed_first_example.md b/docs/src/step_by_step/detailed_first_example.md index 068341b5e..5a762b2dd 100644 --- a/docs/src/step_by_step/detailed_first_example.md +++ b/docs/src/step_by_step/detailed_first_example.md @@ -1,17 +1,21 @@ -# [Detailed walkthrough of a simple simulation](@id detailed-walkthrough-of-a-simple-simulation) +# [Detailed Walkthrough Of A Simple Simulation](@id detailed-walkthrough-of-a-simple-simulation) -This page walks you through the ins and outs of a basic simulation, mostly aimed at people who have less experience programming, to showcase the various concepts presented earlier and requirements for a simulation in context. +This page walks through a small composite-model/object simulation. It is written for +readers who are still getting comfortable with Julia and PlantSimEngine. -A working trimmed-down script can be found further down in the [Example simulation](@ref), and other subsections in this page will detail setup and helper functions, and querying outputs. +If you only want examples to copy and modify, see [Quick examples](quick_and_dirty_examples.md). For +multi-object and multi-plant simulations, the same API scales up: add objects, +select them with `ModelSpec(...; on=...)`, connect values with `ModelSpec(...; inputs=...)`, and use +`ModelSpec(...; calls=...)` when a parent model must manually run child models. -If you simply wish to copy-paste examples and tinker with them, you can find a few examples on the [Quick examples](@ref) page. - -```@setup usepkg -using PlantSimEngine, PlantMeteo, Dates +```@setup detailed_scene +using PlantSimEngine, PlantMeteo, Dates, DataFrames using PlantSimEngine.Examples -meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0) -leaf = ModelMapping(Beer(0.5), status = (LAI = 2.0,)) -out_sim = run!(leaf, meteo) + +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, +) ``` ```@contents @@ -19,226 +23,203 @@ Pages = ["detailed_first_example.md"] Depth = 3 ``` -## Setting up your environment - -For every script in this documentation, you will always need a working Julia environment with PlantSimengine added to it, and usually several other companion packages. Details for getting to that point are provided on the [Installing and running PlantSimEngine](@ref) page. - -## Definitions - -### Processes - -A process in this package defines a biological or physical phenomena. Think of any process happening in a system, such as light interception, photosynthesis, water, carbon and energy fluxes, growth, yield or even electricity produced by solar panels. - -A process is "declared", meaning we define a process, and then implement models for its simulation. In this example, we will make use of a process that was already defined, and for which there already is a model implementation. - -### Models (ModelMapping) - -A process is simulated using a particular implementation, or **a model**. Each model is implemented using a structure that lists the parameters of the model. For example, PlantBiophysics provides the [`Beer`](https://vezy.github.io/PlantBiophysics.jl/stable/functions/#PlantBiophysics.Beer) structure for the implementation of the Beer-Lambert law of light extinction. The process of `light_interception` and the `Beer` model are provided as an example -script in this package too at [`examples/Beer.jl`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/master/examples/Beer.jl). - -Models can use several types of entries: - -- Parameters -- Meteorological information -- Variables -- Constants -- Extras - -**Parameters** are constant values that are used by the model to compute its outputs, and are exclusive to that model. - -**Meteorological information** contains values that are provided by the user and are used as inputs to the model. It is defined for one time-step, and `PlantSimEngine.jl` takes care of applying the model to each time-steps given by the user. - -**Variables** are either used or computed by the model and can optionally be initialized before the simulation. They can be part of multiple models, computed by one and then used as an input by another. They can also be a global simulation output, or be provided at the start of a simulation by the user. - -**Constants** are constant values, usually common between models, *e.g.* the universal gas constant. - -And **extras** are just extra values that can be used by a model, or serves as a placeholder for internal data. - -Users declare a set of models used for simulation, as well as the necessary parameters for each model, and whatever variables need to be initialized. This is done using a [`ModelMapping`](@ref) structure. - -For example let's instantiate a [`ModelMapping`](@ref) with a single model : the Beer-Lambert model of light extinction, used to simulate the light interception process. The model is implemented with the [`Beer`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/master/examples/Beer.jl) structure and only has one parameter: the extinction coefficient (`k`). - -Importing the package: - -```@example usepkg -using PlantSimEngine -``` - -Import the examples defined in the [`Examples`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/main/examples) sub-module (`light_interception` and `Beer`): - -```julia -using PlantSimEngine.Examples -``` +## Setting Up Your Environment -And then declare a [`ModelMapping`](@ref) with the `Beer` model: +Every script needs a Julia environment with PlantSimEngine installed. Most +examples also use companion packages such as PlantMeteo for weather data and +DataFrames for tabular outputs. Installation details are in +[Installing PlantSimEngine](../prerequisites/installing_plantsimengine.md). -```@example usepkg -m = ModelMapping(Beer(0.5)) -``` +## The Simulation Pieces -What happened here? We provided an instance of the `Beer` model to a [`ModelMapping`](@ref) to simulate the light interception process. +### Processes And Models -## Parameters +A process is something you want to simulate, such as light interception, +photosynthesis, water flux, growth, yield, or energy balance. -A parameter is a value constant for a simulation that is internal to a model and used for its computations. For example, the Beer-Lambert model uses the extinction coefficient (`k`) to compute the light extinction. The `Beer` structure in the Beer-Lambert model implementation, only has one field: `k`. We can see that using `fieldnames` on the model structure: +A model is one implementation of a process. In this page we use the example +`Beer` model, which implements a Beer-Lambert light-interception equation. +Its only parameter is the extinction coefficient `k`. -```@example usepkg +```@example detailed_scene fieldnames(Beer) ``` -## Variables (inputs, outputs) +The model implementation declares the status variables it reads and writes: -Variables are either inputs or outputs (*i.e.* computed) of models. Variables and their values are stored in the [`ModelMapping`](@ref) structure, and are initialized automatically or manually. - -For example, the `Beer` model needs the leaf area index (`LAI`, m² m⁻²) to run. - -We can see which variables are passed in as inputs using [`inputs`](@ref): - -```@example usepkg +```@example detailed_scene inputs(Beer(0.5)) ``` -and which are computed outputs of the model using [`outputs`](@ref): - -```@example usepkg +```@example detailed_scene outputs(Beer(0.5)) ``` -The [`ModelMapping`](@ref) structure will keep track of every variable's current state when running the simulation, storing them in a field called `status`. We can inspect that field with the [`status`](@ref) function and see that in our example it has two variables: `LAI` and `PPFD`. The first is an input, the second an output (*i.e.* it is computed by the model). +These declarations are the modeler's contract. The composite-model/object layer decides +where the model runs and where those values come from. -```@example usepkg -m = ModelMapping(Beer(0.5)) -keys(status(m)) -``` - -To know which variables should be initialized, we can use [`to_initialize`](@ref): +### CompositeModel Objects -```@example usepkg -m = ModelMapping(Beer(0.5)) -to_initialize(m) -``` +A `CompositeModel` contains simulated `Object`s. An object can represent a model, plant, +axis, leaf, soil layer, sensor, voxel, or any other simulated entity. -Their values are uninitialized though (hence the warnings): +For a first example, we use one object representing the whole model. The `Beer` +model reads `LAI`, so we initialize that variable on the object status. -```@example usepkg -(m[:LAI], m[:aPPFD]) +```@example detailed_scene +model = CompositeModel( + Beer(0.5); + status=(LAI=2.0,), + environment=meteo_day, + timestep=Day(1), +); +nothing ``` -Uninitialized variables are initialized to the value given in the [`inputs`](@ref) or [`outputs`](@ref) methods in the model's implementation code, which is usually equal to `typemin()`, *e.g.* `-Inf` for `Float64`. +The concise constructor creates one ordinary model object and one application +for each supplied model. `status` initializes that object, `timestep` applies a +common daily cadence, and `environment` supplies weather values such as +radiation. Use explicit `ModelSpec` and selectors when applications need +different policies or targets. -!!! tip - Prefer using [`to_initialize`](@ref) rather than [`inputs`](@ref) to check which variables should be initialized. [`inputs`](@ref) returns every variable that is needed by the model to run, but in multi-model simulations, some of them may already be computed by other models and not require initialization. [`to_initialize`](@ref) returns **only** the variables that are needed by the model to run and that are not initialized in the [`ModelMapping`](@ref). +## Inspecting The Compiled CompositeModel -We can initialize the required variables by providing their starting values to the status when declaring the `ModelMapping`: +Before runtime, PlantSimEngine resolves selectors and builds a compiled model. +This avoids resolving object selections inside the timestep loop. -```@example usepkg -m = ModelMapping(Beer(0.5), status = (LAI = 2.0,)) +```@example detailed_scene +select( + DataFrame(Diagnostics.explain_applications(model)), + :application_id, + :process, + :target_ids, +) ``` -Or after instantiation using [`init_status!`](@ref): +`Beer` has no model-to-model value input in this first model because `LAI` was +initialized directly on the object status: -```@example usepkg -m = ModelMapping(Beer(0.5)) - -init_status!(m, LAI = 2.0) +```@example detailed_scene +Diagnostics.explain_bindings(model) ``` -We can check if a component is correctly initialized using [`is_initialized`](@ref): +The schedule tells us when each application runs: -```@example usepkg -is_initialized(m) +```@example detailed_scene +select( + DataFrame(Diagnostics.explain_schedule(model)), + :application_id, + :dt_seconds, + :root_scheduled, + :manual_call_only, +) ``` -Some variables are inputs of models, but outputs of other models. When we couple models, [`to_initialize`](@ref) only requests the variables that are not computed by other models. - -## Climate forcing - -To make a simulation, we usually need the climatic/meteorological conditions measured close to the object or component. +## Running The Simulation -Users are strongly encouraged to use [`PlantMeteo.jl`](https://github.com/PalmStudio/PlantMeteo.jl), the companion package that helps manage such data, with default pre-computations and structures for efficient computations. The most basic data structure from this package is a type called [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere), which defines steady-state atmospheric conditions, *i.e.* the conditions are considered at equilibrium. Another structure is available to define different consecutive time-steps: [`TimeStepTable`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.TimeStepTable). +Run the model with [`run!`](@ref): -The mandatory variables to provide for an [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere) are: `T` (air temperature in °C), `Rh` (relative humidity, 0-1) and `Wind` (the wind speed, m s⁻¹). In our example, we also need the incoming photosynthetically active radiation flux (`Ri_PAR_f`, W m⁻²). We can declare such conditions like so: - -```@example usepkg -using PlantMeteo -meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0) +```@example detailed_scene +sim = run!(model; steps=3, outputs=:all) +nothing ``` -This `meteo` variable will therefore provide a single weather timeframe that can be used in a simulation. - -More details are available from the [package documentation](https://vezy.github.io/PlantMeteo.jl/stable). - -## Simulation +Final state is available independently of retained output history: -### Simulation of processes - -To run a simulation, you can call the [`run!`](@ref) method on the [`ModelMapping`](@ref). If some meteorological data is required for models to be simulated over several timesteps, that can be passed in as an optional argument as well. - -Your call to the function would then look like this: - -```julia -run!(model_list, meteo) +```@example detailed_scene +scene_status = final_state(sim) +(LAI=scene_status.LAI, aPPFD=scene_status.aPPFD) ``` -The first argument is the model mapping (see [`ModelMapping`](@ref)), and the second defines the micro-climatic conditions. +The returned `Simulation` stores retained output streams: -The [`ModelMapping`](@ref) should already be initialized for the given process before calling the function. Refer to the earlier subsection [Variables (inputs, outputs)](@ref) for more details. - -### Example simulation - -For example we can simulate the `light_interception` of a leaf like so: +```@example detailed_scene +first(collect_outputs(sim; sink=nothing), 3) +``` -```@example usepkg -using PlantSimEngine, PlantMeteo, Dates +For a table, use the default `DataFrame` sink: -# Import the examples defined in the `Examples` sub-module -using PlantSimEngine.Examples +```@example detailed_scene +first(collect_outputs(sim), 3) +``` -meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0) +## Adding A Model Coupling -leaf = ModelMapping(Beer(0.5), status = (LAI = 2.0,)) +Now let a daily LAI model compute `LAI` before the light-interception model +runs. `ToyLAIModel` reads cumulative thermal time `TT_cu` and writes `LAI`. +Because `Beer` reads `LAI`, the compiler can infer the same-object binding. -outputs_example = run!(leaf, meteo) +```@example detailed_scene +coupled_scene = CompositeModel( + ToyDegreeDaysCumulModel(), + ToyLAIModel(), + Beer(0.5); + status=(TT_cu=0.0,), + environment=meteo_day, + timestep=Day(1), +) -outputs_example[:aPPFD] +select( + DataFrame(Diagnostics.explain_bindings(coupled_scene)), + :application_id, + :input, + :source_application_ids, + :carrier_kind, + :copy_semantics, +) ``` -### Outputs +The `LAI` binding uses a live reference carrier, so the light-interception +model sees the value written by the LAI model without copying it. -The [`status`](@ref) field of a [`ModelMapping`](@ref) is used to initialize the variables before simulation and then to keep track of their values during and after the simulation. We can extract outputs of the very last timestep of a simulation using the [`status`](@ref) function. +Run the coupled model: -The actual full output data is returned by the [`run!`](@ref) function. Data is usually stored in a [`TimeStepTable`](@ref) structure from `PlantMeteo.jl`, which is a fast DataFrame-like structure with each time step being a [`Status`](@ref). It can be also be any `Tables.jl` structure, such as a regular `DataFrame`. The weather is also usually stored in a [`TimeStepTable`](@ref) but with each time step being an `Atmosphere`. +```@example detailed_scene +coupled_sim = run!(coupled_scene; steps=5, outputs=:all) +first(collect_outputs(coupled_sim), 8) +``` -In our example, the simulation was only provided one weather timestep, so the outputs returned by [`run!`](@ref) and the ModelMapping's [`status`](@ref) field are identical. -Let's look at the outputs structure of our previous simulated leaf: +The final object status contains the latest values from the coupled models: -```@setup usepkg -outputs_example +```@example detailed_scene +coupled_status = final_state(coupled_sim) +(TT_cu=coupled_status.TT_cu, LAI=coupled_status.LAI, aPPFD=coupled_status.aPPFD) ``` -We can extract the value of one variable by indexing into it, *e.g.* for the intercepted light: +## What Needs Initialization? -```@example usepkg -outputs_example[:aPPFD] -``` +Model `inputs_(...)` explicitly distinguishes `Required(T)` from +`Default(value)`. A required input needs user state or a producer binding; a +defaulted input needs neither. In a coupled model, an upstream application can +satisfy a required input. -Or similarly using the dot syntax: +Use the compiler explanations to distinguish the two cases: -```@example usepkg -outputs_example.aPPFD -``` +- `:supplied` means the object `Status` already provides the value; +- `:producer_bound` means another application supplies it; +- `:defaulted` means `Default(value)` initialized it; +- `:required` means it still has no source and compilation will fail. -You can then print the outputs, convert them to another format, or visualize them, using other Julia packages. You can read more on how to do that in the [Visualizing outputs and data](@ref) page. +For example, if we remove `TT_cu` from the model status, compilation fails +because no model in this model computes it before `ToyLAIModel` reads it: -Another convenient way to get the results is to transform the outputs into a `DataFrame`. Which is very easy because the [`TimeStepTable`](@ref) implements the Tables.jl interface: +```@example detailed_scene +bad_scene = CompositeModel( + ToyLAIModel(); + environment=meteo_day, +) -```@example usepkg -using DataFrames -convert_outputs(outputs_example, DataFrame) +try + Diagnostics.explain_bindings(bad_scene) +catch err + first(sprint(showerror, err), 300) +end ``` -## Model coupling - -A model can work either independently or in conjunction with other models. For example a stomatal conductance model is often associated with a photosynthesis model, *i.e.* it is called from the photosynthesis model. +## Next Steps -`PlantSimEngine.jl` is designed to make model coupling painless for modelers and users. Please see [Standard model coupling](@ref) and [Coupling more complex models](@ref) for more details, or [Handling dependencies in a multiscale context](@ref) for multi-scale specific coupling considerations. +- [Standard model coupling](@ref) shows more coupling patterns. +- [CompositeModel/Object Quickstart](../composite_model/quickstart.md) is the shortest + copy-pasteable path for the new API. +- [Model execution](../model_execution.md) explains scheduling, temporal inputs, hard calls, + output retention, and lifecycle refreshes. diff --git a/docs/src/step_by_step/graph_visualization_editor.md b/docs/src/step_by_step/graph_visualization_editor.md deleted file mode 100644 index c343919ff..000000000 --- a/docs/src/step_by_step/graph_visualization_editor.md +++ /dev/null @@ -1,236 +0,0 @@ -# Graph visualization and editing - -`PlantSimEngine` can display the dependency graph created from a [`ModelMapping`](@ref). Use it when you want to check which model computes which variable, inspect missing initial values, explain a model pipeline in documentation, or interactively build and revise a mapping. - -There are two entry points: - -- [`write_graph_view`](@ref) writes a standalone HTML viewer. This is available from `PlantSimEngine` itself and does not start a server. -- [`edit_graph`](@ref) starts a local browser editor. This is loaded by a Julia package extension when `HTTP.jl` is available and loaded in the session. - -## Static graph viewer - -The static viewer is the right tool for documentation, reports, or any read-only inspection. It contains the graph, search, the inspector, scale filters, relationship filters, and overview/detail modes, but it does not modify the [`ModelMapping`](@ref). - -```@setup graph_viewer -using PlantSimEngine -using PlantSimEngine.Examples -``` - -Here is a small pedagogical mapping with three models: - -```@example graph_viewer -mapping = ModelMapping( - ToyDegreeDaysCumulModel(), - ToyLAIModel(), - Beer(0.5), -) -nothing # hide -``` - -The thermal time model computes `TT_cu`, the LAI model consumes `TT_cu` and computes `LAI`, and the Beer model consumes `LAI` and computes `aPPFD`. The generated viewer below is the same HTML file you would get by calling [`write_graph_view`](@ref): - -```@raw html - -``` - -To write the viewer yourself: - -```julia -using PlantSimEngine -using PlantSimEngine.Examples - -mapping = ModelMapping( - ToyDegreeDaysCumulModel(), - ToyLAIModel(), - Beer(0.5), -) - -write_graph_view("dependency_graph.html", mapping) -``` - -The returned file path is absolute, so you can print it, open it in a browser, or embed it in another documentation site. - -## Interactive editor - -The interactive editor uses the same graph JSON as the static viewer, but it keeps a WebSocket connection open to Julia. Julia remains the source of truth: the browser sends edit commands, Julia applies them to the [`ModelMapping`](@ref), recompiles graph diagnostics, and sends the updated graph back to the browser. - -The editor is implemented as a package extension. Static graph files do not need `HTTP`, but the live editor does. In a project that only depends on `PlantSimEngine`, install `HTTP` first: - -```julia -using Pkg -Pkg.add("HTTP") -``` - -Then load `HTTP` before calling [`edit_graph`](@ref): - -```julia -using PlantSimEngine -using PlantSimEngine.Examples -using HTTP - -mapping = ModelMapping( - ToyLAIModel(), - Beer(0.5); - status=(TT_cu=1.0,), -) - -session = edit_graph(mapping) -session.url -session -``` - -To start from a blank graph and build a mapping from scratch, omit the mapping: - -```julia -session = edit_graph() -``` - -By default, `edit_graph` opens `session.url` in the system default browser. Pass `open_browser=false` to keep the session headless, for example in scripts or tests: - -```julia -session = edit_graph(mapping; open_browser=false) -``` - -The URL contains a session token and the server listens on `127.0.0.1` by default. Treat that URL as a local capability: anyone who can reach it can edit the live mapping. If you intentionally bind to another host, pass `allow_remote=true` only on a trusted network. Raw `julia` parameter values are disabled by default for remote sessions; pass `allow_julia_eval=true` only if you explicitly accept that risk. - -To stop the HTTP/WebSocket session, run: - -```julia -close(session) -``` - -Use [`current_mapping`](@ref) to recover the latest mapping from the session: - -```julia -edited_mapping = current_mapping(session) -close(session) -``` - -!!! note - If `HTTP` is not loaded, `edit_graph(mapping)` throws an error explaining that the interactive editor requires `using HTTP`. Static graph visualization through [`write_graph_view`](@ref), `graph_view`, and [`graph_view_json`](@ref) remains available without loading `HTTP`. - -## What you can edit - -The editor supports the same mapping operations as the Julia graph-edit API: - -- add a model by choosing a scale, a model type, parameter values, and a rate; -- update an existing model's parameter values, scale, or rate from the inspector; -- remove a model from the inspector or from the selected model node; -- add new scales while configuring a model; -- set a mapped input variable from the inspector; -- draw a connection from an output port to an input port to create a mapping; -- map a scalar source value or a vector of values from one or several source scales; -- mark or unmark a variable as [`PreviousTimeStep`](@ref); -- use undo and redo inside the live session. - -The `+` buttons beside variables are suggestions from the current model library: - -- on an input, `+` lists models that can compute that variable as an output; -- on an output, `+` lists models that can consume that variable as an input. - -Clicking a suggested model opens the add-model panel with that model preselected, so you can set its scale, parameters, and rate before adding it. - -## Cycles - -The simulation dependency graph must be acyclic when it runs. The viewer can still compile a non-throwing graph view for cyclic or incomplete mappings, so the editor can show the problem instead of failing immediately. - -When a cycle is detected: - -- cycle edges are drawn in red; -- the cycle call-to-action asks you to choose a break point in the graph; -- clicking the scissors button on a highlighted input wraps that input in [`PreviousTimeStep`](@ref). - -This means the consumer model uses the variable value from the previous timestep, so that current-step dependency is removed and the graph can run again. - -## Mapping code and saving - -The web editor also exposes a dedicated "Mapping code" panel. It shows the current [`ModelMapping`](@ref) as Julia code, and can write that code to a `.jl` file so it can be copied/pasted or reused in scripts. The generated file is intentionally plain Julia: it imports the packages needed by the selected models and defines a top-level `mapping` variable: - -```julia -using PlantSimEngine -using PlantSimEngine.Examples - -mapping = ModelMapping( - # ... -) -``` - -After writing a file once, every successful edit, undo, redo, or recent-file load automatically rewrites that same file. The session also keeps a recovery autosave in the temporary directory. The top-left "Open" button can reopen a mapping script from a file path or from the recent mapping list. Use git or another version-control system for mapping scripts that matter for a simulation workflow. - -The `Status(...)` entries in generated code are rebuilt from the current mapping. Variables computed by models are omitted, even if they were present in the original status, and only variables still required for initialization are kept. - -Because the generated script only defines `mapping`, users can include it directly from a simulation script: - -```julia -include("mapping.generated.jl") -run!(mapping, meteo) -``` - -## Models from external packages - -The editor does not use a separate model registry. It discovers models from the Julia session by traversing the loaded subtype tree under [`AbstractModel`](@ref). - -This means packages become available when you load them: - -```julia -using PlantSimEngine -using PlantSimEngine.Examples -using PlantBiophysics -using HTTP - -session = edit_graph() -``` - -After `using PlantBiophysics`, the editor can list the process and model types that `PlantBiophysics` loaded into the session, provided those models follow the normal PlantSimEngine contract: - -- process abstract types are subtypes of [`AbstractModel`](@ref); -- concrete model structs are subtypes of those process types; -- models define `inputs_` and `outputs_`; -- model parameters are stored in struct fields, with an optional zero-argument constructor for default values. - -Constructor fields become parameter rows in the add-model and edit-model panels. For parametric models, fields that share the same type parameter also share the same type dropdown. The available parameter type choices are `float`, `integer`, `boolean`, `symbol`, `string`, `nothing`, and `julia`. Julia validates the final constructor call; if construction fails, the diagnostic is returned to the editor. - -You can inspect the currently visible library from Julia: - -```@example graph_viewer -available_models(:light_interception) -``` - -If a package is not loaded with `using PackageName`, its model types are not present in the Julia session and the editor cannot list them. - -## Embedding a graph in package documentation - -For package documentation built with Documenter, generate the HTML file before `makedocs` and place it somewhere under `docs/src`, for example `docs/src/www/model_graph.html`: - -```julia -# docs/make.jl -using Documenter -using PlantSimEngine -using YourPackage - -mapping = YourPackage.default_mapping() -write_graph_view(joinpath(@__DIR__, "src", "www", "model_graph.html"), mapping) - -makedocs(; - # ... -) -``` - -Then embed it from a markdown page: - -```html - -``` - -Use the right relative path for the page where the iframe lives and remember that Documenter deploys pretty URLs by default. A page in `docs/src/multiscale/page.md` usually needs `../../www/model_graph.html`; a page at the root of `docs/src/` usually needs `www/model_graph.html`. - -!!! tip - This is the same pattern used to show large package mappings, such as the XPalm dependency graph, directly inside package documentation. The viewer is static, so it works on GitHub Pages without a Julia server. diff --git a/docs/src/step_by_step/implement_a_model.md b/docs/src/step_by_step/implement_a_model.md index afaf888f3..a3f3b6613 100644 --- a/docs/src/step_by_step/implement_a_model.md +++ b/docs/src/step_by_step/implement_a_model.md @@ -30,37 +30,31 @@ Declare the `inputs_` and `outputs_` methods for that model (note the '_', these ```@example usepkg function PlantSimEngine.inputs_(::Beer) - (LAI=-Inf,) + (LAI=Required(Float64),) end function PlantSimEngine.outputs_(::Beer) - (aPPFD=-Inf,) + (aPPFD=0.0,) end ``` Write the [`run!`](@ref) function that operates on a single timestep : ```@example usepkg -function run!(::Beer, models, status, meteo, constants, extras) - status.PPFD = - meteo.Ri_PAR_f * - exp(-models.light_interception.k * status.LAI) * +function PlantSimEngine.run!(model::Beer, status, environment, constants, context) + status.aPPFD = + environment.Ri_PAR_f * + exp(-model.k * status.LAI) * constants.J_to_umol + return nothing end ``` -Determine if parallelization is possible, and which traits to declare : - -```@example usepkg -PlantSimEngine.ObjectDependencyTrait(::Type{<:Beer}) = PlantSimEngine.IsObjectIndependent() -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Beer}) = PlantSimEngine.IsTimeStepIndependent() -``` - And that is all you need to get going, for this example with a single parameter and no interdependencies. The [`@process`](@ref) macro does some boilerplate work described [here](@ref under_the_hood) -Some extra utility functions can also be interesting to implement to make users' lives simpler. See the [Model implementation additional notes](@ref) page for details. +Some context utility functions can also be interesting to implement to make users' lives simpler. See the [Model implementation additional notes](@ref) page for details. If your custom model needs to handle more complex couplings than the simple input/output described in this example, check out the [Coupling more complex models](@ref) page. ## Detailed version @@ -147,87 +141,101 @@ Parameterized types are practical because they let the user choose the type of t ### Inputs and outputs -When implementing a new model, it is necessary to declare what variables will be required, whether provided as an input to our model or computed for every timestep as an output. Input variables will either be initialized by the user in a `Status` object, or provided by another model. Output variables may be global simulation outputs and/or used by other models. +When implementing a new model, it is necessary to declare what variables it +reads and what variables it computes. Every input declaration must say whether +the input is required or has a genuine model default. A required input is +initialized by the user in a `Status` object or bound from another model. A +defaulted input needs neither. Output variables may be retained as simulation +outputs and/or used by other models. In our case, the `Beer` model, computing light interception, has one input variable and one output variable: - Inputs: `:LAI`, the leaf area index (m² m⁻²) - Outputs: `:aPPFD`, the photosynthetic photon flux density (μmol m⁻² s⁻¹) -We declare these inputs/outputs by adding a method for the [`inputs`](@ref) and [`outputs`](@ref) functions. These functions take the type of the model as argument, and return a `NamedTuple` with the names of the variables as keys, and their default values as values: +We declare these inputs/outputs by adding methods for the underscore extension +functions. `inputs_` returns a `NamedTuple` whose values are `Required(T)` or +`Default(value)` declarations. `outputs_` returns a `NamedTuple` whose values +are the initial output state: ```@example usepkg function PlantSimEngine.inputs_(::Beer) - (LAI=-Inf,) + (LAI=Required(Float64),) end function PlantSimEngine.outputs_(::Beer) - (aPPFD=-Inf,) + (aPPFD=0.0,) end ``` -These functions are internal, and end with an "\_". Users instead use [`inputs`](@ref) and [`outputs`](@ref) to query model variables. +`LAI` has no scientifically meaningful fallback, so it is required. If the +model instead had an optional efficiency of `0.8`, it would declare +`efficiency=Default(0.8)`. Do not use sentinel values such as `-Inf` to mean +"required": they are ordinary values and hide the model contract. + +`Required(Float64)` is an expected type, not an initialization value. A model +that supports a broader or parameterized type can declare that type instead. +PlantSimEngine does not convert status values to `Float64`. + +These extension functions end with an "\_". Simulation users instead use +[`inputs`](@ref), [`outputs`](@ref), [`init_variables`](@ref), and +[`Diagnostics.explain_initialization`](@ref) to inspect the contract. ### The run! method -When running a simulation with [`run!`](@ref), each model is run in turn at every timestep, following whatever order was deduced from the `ModelMapping` definition and Status. Each model also has its [`run!`](@ref) method for that purpose that update the simulation's current state, with a slightly different signature. The function takes six arguments: +When running a simulation with [`run!`](@ref), each model is run at its +scheduled timestep, following the dependency order compiled from model +applications, inputs, and manual calls. Each model has its own [`run!`](@ref) +method for updating the current state. The function takes five arguments: ```julia -function run!(::Beer, models, status, meteo, constants, extras) +function PlantSimEngine.run!(model::Beer, status, environment, constants, context) ``` -- the model's type -- models: a [`ModelMapping`](@ref) object, which contains all the models of the simulation +- model: the current model instance, used for dispatch and parameter access. - status: a [`Status`](@ref) object, which contains the current values (*i.e.* state) of the variables for **one** time-step (e.g. the value of the plant LAI at time t) -- meteo: (usually) an `Atmosphere` object, or a row of the meteorological data, which contains the current values of the meteorological variables for **one** time-step (*e.g.* the value of the PAR at time t) +- environment: the sampled model-facing environment for the current target and + timestep. - constants: a `Constants` object, or a `NamedTuple`, which contains the values of the constants for the simulation (*e.g.* the value of the Stefan-Boltzmann constant, unit-conversion constants...) -- extras: any other object you want to pass to your model, mostly for advanced usage, not detailed here +- context: PlantSimEngine's runtime context for hard calls and lifecycle + operations. -A typical [`run!`](@ref) function can therefore make use of simulation constants, input/output variables accessible through the [`Status`](@ref object, or weather data. +A typical [`run!`](@ref) function can therefore use simulation constants, +input/output variables accessible through the [`Status`](@ref) object, or +weather data. -Here is the [`run!`](@ref) implementation of the light interception for a [`ModelMapping`](@ref) component models. Note that the input and output variable are accessed through the [`status`](@ref) argument : +Here is the [`run!`](@ref) implementation of the light interception model. +Note that the input and output variables are accessed through the +`status` argument: ```@example usepkg -function run!(::Beer, models, status, meteo, constants, extras) - status.PPFD = - meteo.Ri_PAR_f * - exp(-models.light_interception.k * status.LAI) * +function PlantSimEngine.run!(model::Beer, status, environment, constants, context) + status.aPPFD = + environment.Ri_PAR_f * + exp(-model.k * status.LAI) * constants.J_to_umol + return nothing end ``` ### Additional notes -To use this model, users will have to make sure that the variables for that model are defined in the [`Status`](@ref) object, the meteorology, and the `Constants` object. +To use this model, simulation users must supply or bind every `Required` status +input. Inputs declared with `Default` are initialized automatically. Required +environment variables and constants must also be available through their +respective contracts. !!! Note [`Status`](@ref) objects contain the current state of the simulation. It is not, by default, possible to make use of earlier variable states, unless a custom model is written for that purpose. -Model parameters are available from the [`ModelMapping`](@ref) that is passed via the `models` argument. Index by the process name, then the parameter name. For example, the `k` parameter of the `Beer` model is found in `models.light_interception.k`. +Model parameters are read directly from the current model instance. For +example, the `k` parameter of the `Beer` model is `model.k`. !!! warning - You need to import all the functions you want to extend, so Julia knows your intention of adding a method to the function from PlantSimEngine, and not defining your own function. To do so, you have to prefix the said functions by the package name, or import them before *e.g.*: `import PlantSimEngine: inputs_, outputs_`. The troubleshooting subsection [Implementing a model: forgetting to import or prefix functions](@ref) showcases output errors that can occur when you forget to prefix. - -### Parallelization traits - -`PlantSimEngine` defines traits to get additional information about the models. At the moment, there are two traits implemented that help the package to know if a model can be run in parallel over space (*i.e.* objects) and/or time (*i.e.* time-steps). - -By default, all models are assumed to be **not** parallelizable over objects and time-steps, because it is the safest default. If your model is parallelizable, you should add the trait to the model. - -For example, if we want to add the trait for parallelization over objects to our `Beer` model, we would do: - -```@example usepkg -PlantSimEngine.ObjectDependencyTrait(::Type{<:Beer}) = PlantSimEngine.IsObjectIndependent() -``` - -And if we want to add the trait for parallelization over time-steps to our `Beer` model, we would do: - -```@example usepkg -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Beer}) = PlantSimEngine.IsTimeStepIndependent() -``` - -!!! note - A model is parallelizable over objects if it does not call another model directly inside its code. Similarly, a model is parallelizable over time-steps if it does not get values from other time-steps directly inside its code. In practice, most of the models are parallelizable one way or another, but it is safer to assume they are not. + Prefix functions you extend with `PlantSimEngine.`, or import them first, + for example `import PlantSimEngine: inputs_, outputs_`. Otherwise Julia + defines an unrelated function in your module instead of adding a method to + PlantSimEngine's function. OK that's it! We now a full new model implementation for the light interception process! Other models might be more complex in terms of what computations they do, or how they couple with other models, but the approach remains the same. @@ -245,4 +253,14 @@ PlantSimEngine.dep(::Fvcb) = (stomatal_conductance=AbstractStomatal_ConductanceM Here we say to PlantSimEngine that the `Fvcb` model needs a model of type `AbstractStomatal_ConductanceModel` in the stomatal conductance process. +This is intentionally process-based because `dep(model)` is a model-author +contract. The model author cannot know which application name a future scenario +will choose for stomatal conductance. In a concrete scenario, users should wire +the selected producer or callee with `application=...` in `ModelSpec(...; inputs=...)` or +`ModelSpec(...; calls=...)` when that application is known: + +```julia +ModelSpec(ParentModel(); name=:parent, calls=(:stomata => One(scale=:Leaf, application=:stomatal_conductance))) +``` + You can read more about hard dependencies in [Coupling more complex models](@ref). diff --git a/docs/src/step_by_step/model_switching.md b/docs/src/step_by_step/model_switching.md index c63a31c8f..10a65fb9f 100644 --- a/docs/src/step_by_step/model_switching.md +++ b/docs/src/step_by_step/model_switching.md @@ -1,102 +1,98 @@ # Model switching -```@setup usepkg -using PlantSimEngine, PlantMeteo, Dates -# Import the examples defined in the `Examples` sub-module +```@setup scene_model_switching +using PlantSimEngine, PlantMeteo, Dates, DataFrames using PlantSimEngine.Examples -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -models = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2), - status=(TT_cu=cumsum(meteo_day.TT),), +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, ) -run!(models, meteo_day) -models2 = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyAssimGrowthModel(), - status=(TT_cu=cumsum(meteo_day.TT),), -) -run!(models2, meteo_day) ``` -One of the main objective of PlantSimEngine is allowing users to switch between model implementations for a given process **without making any change to the PlantSimEngine codebase**. +One main objective of PlantSimEngine is to let users switch between model +implementations for a process without changing the engine or the other model +kernels. -The package was designed around this idea to make easy changes easy and efficient. Switch models in the [`ModelMapping`](@ref), and call the [`run!`](@ref) function again. No other changes are required if no new variables are introduced. +In the composite-model/object API, the switch happens at the model-application layer: +replace the model inside a `ModelSpec`, keep the same `ModelSpec(...; on=...)` +selector, and keep the same input contract when the replacement model needs the +same variables. -## A first simulation as a starting point +## A first simulation -With a working environment, let's create a [`ModelMapping`](@ref) with several models from the example scripts in the [`examples`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/master/examples/) folder: +This model computes degree-days, LAI, absorbed PAR, and growth on one model +object: -Importing the models from the scripts: +```@example scene_model_switching +function plant_model_with_growth(growth_model; growth_name=:growth) + CompositeModel( + Object(:scene; scale=:Scene, kind=:scene); + applications=( + ModelSpec(ToyDegreeDaysCumulModel(); name=:degree_days, on=One(scale=:Scene), every=Day(1)), -```julia -using PlantSimEngine -# Import the examples defined in the `Examples` sub-module: -using PlantSimEngine.Examples -``` + ModelSpec(ToyLAIModel(); name=:lai, on=One(scale=:Scene), every=Day(1)), -Coupling the models in a [`ModelMapping`](@ref): + ModelSpec(Beer(0.5); name=:light_interception, on=One(scale=:Scene), every=Day(1)), -```@example usepkg -models = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2), - status=(TT_cu=cumsum(meteo_day.TT),), -) + ModelSpec(growth_model; name=growth_name, on=One(scale=:Scene), every=Day(1)), + ), + environment=meteo_day, + ) +end -nothing # hide +rue_scene = plant_model_with_growth(ToyRUEGrowthModel(0.2)) +rue_sim = run!(rue_scene; steps=10) +rue_status = final_state(rue_sim) +(growth_model=:ToyRUEGrowthModel, biomass=rue_status.biomass) ``` -We can the simulation by calling the [`run!`](@ref) function with meteorology data. Here we use an example data set: - -```@example usepkg -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) -nothing # hide -``` - -We can now run the simulation: - -```@example usepkg -output_initial = run!(models, meteo_day) -output_initial[1:3,:] # show the first 3 rows of the output +The compiler infers the same-object bindings from the model declarations. The +growth model reads `aPPFD`, which is produced by the light interception model: + +```@example scene_model_switching +select( + DataFrame(Diagnostics.explain_bindings(rue_scene)), + :application_id, + :input, + :source_application_ids, + :origin, + :carrier_kind, +) ``` -## Switching one model in the simulation - -Now what if we want to switch the model that computes growth ? We can do this by simply replacing the model in the [`ModelMapping`](@ref), and PlantSimEngine will automatically update the dependency graph, and adapt the simulation to the new model. - -Let's switch ToyRUEGrowthModel with ToyAssimGrowthModel: - -```@example usepkg -models2 = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyAssimGrowthModel(), # This was `ToyRUEGrowthModel(0.2)` before - status=(TT_cu=cumsum(meteo_day.TT),), +## Switching the growth model + +`ToyAssimGrowthModel` implements the same `:growth` process, reads the same +`aPPFD` input, and computes additional outputs such as carbon assimilation and +respiration. The rest of the model does not need to change: + +```@example scene_model_switching +assim_scene = plant_model_with_growth(ToyAssimGrowthModel()) +assim_sim = run!(assim_scene; steps=10) +assim_status = final_state(assim_sim) +( + growth_model=:ToyAssimGrowthModel, + carbon_assimilation=assim_status.carbon_assimilation, + Rm=assim_status.Rm, + biomass=assim_status.biomass, ) - -nothing # hide ``` -ToyAssimGrowthModel is a little bit more complex than `ToyRUEGrowthModel`](@ref), as it also computes the maintenance and growth respiration of the plant, so it has more parameters (we use the default values here). - -We can run a new simulation and see that the simulation's results are different from the previous simulation: +The dependency graph and execution plan are rebuilt from the new application +set: -```@example usepkg -output_updated = run!(models2, meteo_day) -output_updated[1:3,:] # show the first 3 rows of the output +```@example scene_model_switching +select( + DataFrame(Diagnostics.explain_execution_plan(assim_sim)), + :application_id, + :object_ids, + :batch_size, + :inner_loop_dispatch, +) ``` -And that's it! We can switch between models without changing the code, and without having to recompute the dependency graph manually. This is a very powerful feature of PlantSimEngine!💪 - -!!! note - This was a very standard but straightforward example. Sometimes other models will require to add other models to the [`ModelMapping`](@ref). For example ToyAssimGrowthModel could have required a maintenance respiration model. In this case `PlantSimEngine` will indicate what kind of model is required for the simulation. - -!!! note - In our example we replaced what we call a [soft-dependency coupling](@ref hard_dependency_def), but the same principle applies to [hard-dependencies](@ref hard_dependency_def). Hard and Soft dependencies are concepts related to model coupling, and are discussed in more detail in [Standard model coupling](@ref) and [Coupling more complex models](@ref). - +This is the same principle used in larger composite models: switch one process +implementation by replacing one `ModelSpec` or by using an +`ObjectInstance(...; overrides=...)` when the change applies to one plant +instance or one organ. diff --git a/docs/src/step_by_step/parallelization.md b/docs/src/step_by_step/parallelization.md deleted file mode 100644 index 6c590059b..000000000 --- a/docs/src/step_by_step/parallelization.md +++ /dev/null @@ -1,39 +0,0 @@ -## Parallel execution - -!!! note - This page is likely to change and become outdated. In any case, parallel execution only currently applies to single-scale simulations (multi-scale simulations' changing MTGs and extra complexity don't allow for straightforward parallelisation) - -### FLoops - -`PlantSimEngine.jl` uses the [`Floops`](https://juliafolds.github.io/FLoops.jl/stable/) package to run the simulation in sequential, parallel (multi-threaded) or distributed (multi-process) computations over objects, time-steps and independent processes. - -That means that you can provide any compatible executor to the `executor` argument of [`run!`](@ref). By default, [`run!`](@ref) uses the [`ThreadedEx`](https://juliafolds.github.io/FLoops.jl/stable/reference/api/#executor) executor, which is a multi-threaded executor. You can also use the [`SequentialEx`](https://juliafolds.github.io/Transducers.jl/dev/reference/manual/#Transducers.SequentialEx)for sequential execution (non-parallel), or [`DistributedEx`](https://juliafolds.github.io/Transducers.jl/dev/reference/manual/#Transducers.DistributedEx) for distributed computations. - -### Parallel traits - -`PlantSimEngine.jl` uses [Holy traits](https://invenia.github.io/blog/2019/11/06/julialang-features-part-2/) to define if a model can be run in parallel. -See also [Model traits](../model_traits.md) for a full inventory of model-level traits. - -!!! note - A model is executable in parallel over time-steps if it does not uses or set values from other time-steps, and over objects if it does not uses or set values from other objects. - -You can define a model as executable in parallel by defining the traits for time-steps and objects. For example, the ToyLAIModel model from the [examples folder](https://github.com/VirtualPlantLab/PlantSimEngine.jl/tree/main/examples) can be run in parallel over time-steps and objects, so it defines the following traits: - -```julia -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLAIModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyLAIModel}) = PlantSimEngine.IsObjectIndependent() -``` - -By default all models are considered not executable in parallel, because it is the safest option to avoid bugs that are difficult to catch, so you only need to define these traits if it is executable in parallel for them. - -!!! tip - A model that is defined executable in parallel will not necessarily will. First, the user has to pass a parallel `executor` to [`run!`](@ref) (*e.g.* `ThreadedEx`). Second, if the model is coupled with another model that is not executable in parallel, `PlantSimEngine` will run all models in sequential. - -### Further executors - -You can also take a look at [FoldsThreads.jl](https://github.com/JuliaFolds/FoldsThreads.jl) for extra thread-based executors, [FoldsDagger.jl](https://github.com/JuliaFolds/FoldsDagger.jl) for -Transducers.jl-compatible parallel fold implemented using the Dagger.jl framework, and soon [FoldsCUDA.jl](https://github.com/JuliaFolds/FoldsCUDA.jl) for GPU computations -(see [this issue](https://github.com/VirtualPlantLab/PlantSimEngine.jl/issues/22)) and [FoldsKernelAbstractions.jl](https://github.com/JuliaFolds/FoldsKernelAbstractions.jl). You can also take a look at -[ParallelMagics.jl](https://github.com/JuliaFolds/ParallelMagics.jl) to check if automatic parallelization is possible. - -Finally, you can take a look into [Transducers.jl's documentation](https://github.com/JuliaFolds/Transducers.jl) for more information, for example if you don't know what is an executor, you can look into [this explanation](https://juliafolds.github.io/Transducers.jl/stable/explanation/glossary/#glossary-executor). diff --git a/docs/src/step_by_step/quick_and_dirty_examples.md b/docs/src/step_by_step/quick_and_dirty_examples.md index e871e8518..be48327f0 100644 --- a/docs/src/step_by_step/quick_and_dirty_examples.md +++ b/docs/src/step_by_step/quick_and_dirty_examples.md @@ -1,95 +1,121 @@ -# Quick examples +# Quick Examples -This page is meant for people who have set up their environment and just want to copy-paste an example or two, see what the REPL returns and start tinkering. +This page is for copy-paste experimentation with the native composite-model/object API. +If you want a slower explanation of the same ideas, see +[Detailed Walkthrough Of A Simple Simulation](@ref detailed-walkthrough-of-a-simple-simulation). -If you are less comfortable with Julia, or need to set up an environment first, see this page : [Getting started with Julia](@ref). -If you wish for a more detailed rundown of the examples, you can instead have a look at the [step by step](#step_by_step) section, which will go into more detail. +The examples use one model object, but the same pattern scales to plants, +organs, soil objects, and microclimate grids by adding more `Object`s and +selecting them with `ModelSpec(...; on=...)` and `ModelSpec(...; inputs=...)`. -These examples are all for single-scale simulations. For multi-scale modelling tutorials and examples, refer to [this section][#multiscale] +```@setup quick_model_examples +using PlantSimEngine, PlantMeteo, Dates, DataFrames +using PlantSimEngine.Examples -You can find the implementation for all the example models, as well as other toy models [in the examples folder](https://github.com/VirtualPlantLab/PlantSimEngine.jl/tree/main/examples). +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, +) +``` ```@contents Pages = ["quick_and_dirty_examples.md"] Depth = 2 ``` -## Environment - -These examples assume you have a working Julia environment with PlantSimengine added to it, as well as the other packages used in these examples. Details for getting to that point are provided on the [Installing and running PlantSimEngine](@ref) page. - +## One Light Interception Model -## Example with a single light interception model and a single weather timestep +```@example quick_model_examples +model = CompositeModel( + Beer(0.5); + status=(LAI=2.0,), + environment=meteo_day, +) -```@example usepkg -using PlantSimEngine, PlantMeteo, Dates -using PlantSimEngine.Examples -meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0) -leaf = ModelMapping(Beer(0.5), status = (LAI = 2.0,)) -out = run!(leaf, meteo) +sim = run!(model; steps=3, outputs=:all) +first(collect_outputs(sim), 3) ``` -## Coupling the light interception model with a Leaf Area Index model +## LAI And Light Interception -The weather data in this example contains data over 365 days, meaning the simulation will have as many timesteps. - -```@example usepkg -using PlantSimEngine -using PlantMeteo, Dates -using PlantSimEngine.Examples +Here, `ToyDegreeDaysCumulModel` computes cumulative thermal time, `ToyLAIModel` +computes `LAI`, and `Beer` consumes `LAI`. The compiler infers the same-object +value bindings from model inputs and outputs. -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -models = ModelMapping( +```@example quick_model_examples +lai_scene = CompositeModel( + ToyDegreeDaysCumulModel(), ToyLAIModel(), - Beer(0.5), - status=(TT_cu=cumsum(meteo_day.TT),), + Beer(0.5); + environment=meteo_day, ) -outputs_coupled = run!(models, meteo_day) -outputs_coupled[1:3,:] # show the first 3 rows of the output +lai_sim = run!(lai_scene; steps=5, outputs=:all) +first(collect_outputs(lai_sim), 8) ``` -## Coupling the light interception and Leaf Area Index models with a biomass increment model +Inspect the inferred coupling: +```@example quick_model_examples +select( + DataFrame(Diagnostics.explain_bindings(lai_scene)), + :application_id, + :input, + :source_application_ids, + :carrier_kind, +) +``` -```@example usepkg -using PlantSimEngine -using PlantMeteo, Dates -using PlantSimEngine.Examples +## Add Biomass Growth -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) +`ToyRUEGrowthModel` consumes absorbed light and accumulates biomass. No extra +input binding is needed because `Beer` is the unique producer of `aPPFD` on the +same object. -models = ModelMapping( +```@example quick_model_examples +growth_scene = CompositeModel( + ToyDegreeDaysCumulModel(), ToyLAIModel(), Beer(0.5), - ToyRUEGrowthModel(0.2), - status=(TT_cu=cumsum(meteo_day.TT),), + ToyRUEGrowthModel(0.2); + environment=meteo_day, ) -outputs_coupled = run!(models, meteo_day) -outputs_coupled[1:3,:] # show the first 3 rows of the output +growth_sim = run!(growth_scene; steps=5) +growth_status = final_state(growth_sim) +(LAI=growth_status.LAI, aPPFD=growth_status.aPPFD, biomass=growth_status.biomass) ``` -## Example using PlantBioPhysics +## Keep Only One Requested Output -A companion package, PlantBioPhysics, uses PlantSimEngine, and contains other models used in ecophysiological simulations. +For larger simulations, request only the streams you want to keep: -You can have a look at its documentation [here](https://vezy.github.io/PlantBiophysics.jl/stable/) +```@example quick_model_examples +request = OutputRequest( + :Scene, + :biomass; + name=:biomass_daily, + application=:growth, + policy=HoldLast(), + clock=Day(1), +) -Several example simulations are provided there. Here's one taken from [this page](https://vezy.github.io/PlantBiophysics.jl/stable/simulation/first_simulation/) : +requested_sim = run!( + growth_scene; + steps=5, + outputs=request, +) -```julia -using PlantBiophysics, PlantSimEngine +first(collect_outputs(requested_sim, :biomass_daily), 5) +``` -meteo = Atmosphere(T = 22.0, Wind = 0.8333, P = 101.325, Rh = 0.4490995) +## PlantBiophysics -leaf = ModelMapping( - Monteith(), - Fvcb(), - Medlyn(0.03, 12.0), - status = (Ra_SW_f = 13.747, sky_fraction = 1.0, aPPFD = 1500.0, d = 0.03) - ) +The same composite-model/object API can host models from companion packages such as +PlantBiophysics. A typical PlantBiophysics energy-balance setup uses +`ModelSpec(...; calls=...)` so an iterative parent model can manually run photosynthesis and +stomatal-conductance models, then call `run_call!(target; publish=true)` once +for the accepted solution. -out = run!(leaf,meteo) -``` \ No newline at end of file +See [MAESPA-style model example handoff](../dev/maespa_model_handoff.md) for +the current multi-plant energy-balance acceptance example. diff --git a/docs/src/step_by_step/simple_model_coupling.md b/docs/src/step_by_step/simple_model_coupling.md index 179b36d6f..56882d6b2 100644 --- a/docs/src/step_by_step/simple_model_coupling.md +++ b/docs/src/step_by_step/simple_model_coupling.md @@ -1,127 +1,97 @@ # Standard model coupling -```@setup usepkg +```@setup scene_coupling using PlantSimEngine using PlantSimEngine.Examples -using PlantMeteo, Dates +using PlantMeteo, Dates, DataFrames -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) -models = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2), - status=(TT_cu=cumsum(meteo_day.TT),), +meteo_day = read_weather( + joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"); + duration=Dates.Day, ) -nothing ``` -## Setting up your environment - -Again, make sure you have a working Julia environment with PlantSimengine added to it, and the other recommended companion packages. Details for getting to that point are provided on the [Installing and running PlantSimEngine](@ref) page. +This page shows the standard coupling case: one model computes a variable that +another model reads. In the composite-model/object API, the user describes model +applications on objects, and the compiler wires the value dependencies. -## ModelMapping - -The [`ModelMapping`](@ref) is a container that holds a list of models, their parameter values, and the status of the variables associated to them. - -If one looks at prior examples, the ModelMappings so far have only contained a single model, whose input variables are initialised in the ModelMapping [`status`](@ref) keyword argument. - -Example models are all taken from the example scripts in the [`examples`](https://github.com/VirtualPlantLab/PlantSimEngine.jl/blob/master/examples/) folder. +## Setting up your environment -Here's a first [`ModelMapping`](@ref) declaration with a light interception model, requiring input Leaf Area Index (LAI): +Make sure you have a working Julia environment with PlantSimEngine and the +recommended companion packages. Details are provided on the +[Installing PlantSimEngine](../prerequisites/installing_plantsimengine.md) +page. -```julia -modellist_coupling_part_1 = ModelMapping(Beer(0.5), status = (LAI = 2.0,)) -``` +## One object and one model -Here's a second one with a Leaf Area Index model, with some example Cumulated Thermal Time as input. (This TT_cu is usually computed from weather data): +A model contains objects. A model application says where a model runs. Here a +light interception model runs on the model object, uses the environment's +daily cadence, and reads `LAI` from that object's status: -```julia -modellist_coupling_part_2 = ModelMapping( - ToyLAIModel(), - status=(TT_cu=1.0:2000.0,), # Pass the cumulated degree-days as input to the model +```@example scene_coupling +light_scene = CompositeModel( + Beer(0.5); + status=(LAI=2.0,), + environment=meteo_day, ) -``` - -## Combining models -Suppose we want our ToyLAIModel to compute the `LAI` for the light interception model. - -We can couple the two models by having them be part of a single [`ModelMapping`](@ref). The `LAI` variable will then be a coupled output computed by the ToyLAIModel, then used as input by `Beer`. It will no longer need to be declared as part of the [`status` . - -This is an instance of what we call a ["soft dependency" coupling](@ref hard_dependency_def): a model depends on another model's outputs for its inputs. +light_sim = run!(light_scene; steps=3, outputs=:all) +first(collect_outputs(light_sim; sink=DataFrame), 3) +``` -Here's a first attempt : +## Coupling two models -```@example usepkg -using PlantSimEngine -# Import the examples defined in the `Examples` sub-module: -using PlantSimEngine.Examples +Suppose we want `ToyLAIModel` to compute `LAI` for `Beer`. Both models can run +on the same object. `ToyLAIModel` produces `LAI`, and `Beer` declares `LAI` as +an input, so the model compiler infers the binding: -# A ModelMapping with two coupled models -models = ModelMapping( +```@example scene_coupling +coupled_scene = CompositeModel( + ToyDegreeDaysCumulModel(), ToyLAIModel(), - Beer(0.5), - status=(TT_cu=1.0:2000.0,), + Beer(0.5); + environment=meteo_day, ) -struct UnexpectedSuccess <: Exception end #hack to enable checking an error without failing docbuild #hide -# see https://github.com/JuliaDocs/Documenter.jl/issues/1420 #hide -try #hide -run!(models) -throw(UnexpectedSuccess()) #hide -catch err; err isa UnexpectedSuccess ? rethrow(err) : showerror(stderr, err); end #hide -``` - -Oops, we get an error related to the weather data, with the detailed output being: -```julia -ERROR: type NamedTuple has no field Ri_PAR_f -Stacktrace: - [1] getindex(mnt::Atmosphere{(), Tuple{}}, i::Symbol) - @ PlantMeteo ~/Path/to/PlantMeteo/src/structs/atmosphere.jl:147 - [2] getcolumn(row::PlantMeteo.TimeStepRow{Atmosphere{(), Tuple{}}}, nm::Symbol) - @ PlantMeteo ~/Path/to/PlantMeteo/src/structs/TimeStepTable.jl:205 - ... +select( + DataFrame(Diagnostics.explain_bindings(coupled_scene)), + :application_id, + :input, + :source_application_ids, + :origin, + :carrier_kind, + :copy_semantics, +) ``` -The `Beer` model requires a specific meteorological parameter. Let's fix that by importing the example weather data : - -```@example usepkg -using PlantSimEngine - -# PlantMeteo and CSV packages are now used -using PlantMeteo, Dates +The `:inferred_same_object` rows are soft dependencies: the consumer input is +provided by another model output. Same-rate local links use live references, so +the timestep loop does not copy values between models. -# Import the examples defined in the `Examples` sub-module: -using PlantSimEngine.Examples - -# Import example weather data -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -# A ModelMapping with two coupled models -models = ModelMapping( - ToyLAIModel(), - Beer(0.5), - status=(TT_cu=cumsum(meteo_day.TT),), # We can now compute a genuine cumulative thermal time from the weather data -) +Run the coupled model: -# Add the weather data to the run! call -outputs_coupled = run!(models, meteo_day) -outputs_coupled[1:3,:] +```@example scene_coupling +coupled_sim = run!(coupled_scene; steps=5) +coupled_status = final_state(coupled_sim) +(TT_cu=coupled_status.TT_cu, LAI=coupled_status.LAI, aPPFD=coupled_status.aPPFD) ``` -And there you have it. The light interception model made its computations using the Leaf Area Index computed by ToyLAIModel. +## Adding another model -## Further coupling +Additional models are just additional applications. `ToyRUEGrowthModel` +consumes `aPPFD`, which is produced by `Beer`, so the compiler infers another +same-object binding: -Of course, one can keep adding models. Here's an example `ModelMapping` with another model, `ToyRUEGrowthModel`, which computes the carbon biomass increment caused by photosynthesis. - -```julia -models = ModelMapping( +```@example scene_coupling +growth_scene = CompositeModel( + ToyDegreeDaysCumulModel(), ToyLAIModel(), Beer(0.5), - ToyRUEGrowthModel(0.2), - status=(TT_cu=cumsum(meteo_day.TT),), + ToyRUEGrowthModel(0.2); + environment=meteo_day, ) -nothing # hide -``` \ No newline at end of file +growth_sim = run!(growth_scene; steps=5) +growth_status = final_state(growth_sim) +(LAI=growth_status.LAI, aPPFD=growth_status.aPPFD, biomass=growth_status.biomass) +``` diff --git a/docs/src/troubleshooting/common_errors.md b/docs/src/troubleshooting/common_errors.md new file mode 100644 index 000000000..a8df3b70d --- /dev/null +++ b/docs/src/troubleshooting/common_errors.md @@ -0,0 +1,13 @@ +# Common Errors + +A missing-input error means a `Required(T)` input has neither supplied state +nor a producer binding; start with `Diagnostics.explain_initialization`. A +plain-input-declaration error means `inputs_` must replace each literal with +`Required(T)` or `Default(value)`. A cardinality error lists selector matches; +correct the scope or choose the intended `OptionalOne`/`Many` multiplicity. An +ambiguity requires an explicit application/object selector. + +Duplicate-writer errors require either distinct output routing or an explicit +`Updates` order. Cadence errors require fixed `Dates` periods compatible with +the environment base step. Extend package functions as +`PlantSimEngine.run!(...)`, including the package qualification. diff --git a/docs/src/troubleshooting/dependency_cycles.md b/docs/src/troubleshooting/dependency_cycles.md new file mode 100644 index 000000000..312321816 --- /dev/null +++ b/docs/src/troubleshooting/dependency_cycles.md @@ -0,0 +1,29 @@ +# Diagnosing Dependency Cycles + +A same-step value cycle is rejected because no valid execution order exists. +Read the reported application, object, and variable edges. If the science uses +yesterday's value, put `PreviousTimeStep(:variable)` on that input. If the +science requires convergence in the current step, make one parent application +own child trials with `calls`. Otherwise reformulate the coupled equations. + +Application declaration order is not a cycle-resolution mechanism. + +For example, if application `:leaf` reads same-step `water` from `:root` while +`:root` reads same-step `carbon` from `:leaf`, compilation fails before either +kernel runs. If root water scientifically affects tomorrow's leaf carbon, +change only that edge: + +```julia +ModelSpec( + LeafModel(); + inputs=( + PreviousTimeStep(:water) => + One(scale=:Root, application=:root, var=:water), + ), +) +``` + +The receiving object's initial `water` value is used until the first accepted +historical sample exists. If both values must converge within the same step, +do not add a lag: make a parent model own `calls` to the two trial models, +iterate with `publish=false`, and publish each accepted state once. diff --git a/docs/src/troubleshooting/runtime_contracts.md b/docs/src/troubleshooting/runtime_contracts.md new file mode 100644 index 000000000..7e5fda2bd --- /dev/null +++ b/docs/src/troubleshooting/runtime_contracts.md @@ -0,0 +1,12 @@ +# Runtime Contracts And Diagnostics + +Use `Diagnostics.explain_initialization`, `Diagnostics.explain_bindings`, `Diagnostics.explain_calls`, +`Diagnostics.explain_schedule`, `Diagnostics.explain_environment_bindings`, and +`Diagnostics.explain_output_retention` as the supported inspection surface. Do not inspect +compiled internal fields. + +Targets, carriers, calls, writer checks, and schedules refresh after the +application that made a structural change. New objects join applications still +remaining in that timestep; they do not retroactively run earlier applications. +Movement and geometry changes invalidate affected spatial environment bindings. +Accepted streams are append-only. diff --git a/docs/src/troubleshooting_and_testing/implicit_contracts.md b/docs/src/troubleshooting_and_testing/implicit_contracts.md deleted file mode 100644 index b65b4a9da..000000000 --- a/docs/src/troubleshooting_and_testing/implicit_contracts.md +++ /dev/null @@ -1,96 +0,0 @@ -This page summarizes some of the assumptions, coupling constraints and inner workings of PlantSimEngine which may be particular relevant when implementing new models. - -If you are unsure of an implementation subtlety, check this page out to see whether it answers your question. - -```@contents -Pages = ["implicit_contracts.md"] -Depth = 2 -``` - -## Weather data provides the simulation timestep, but models can veer away from it - -The weather data timesteps, whether hourly or daily, provide the pace at which most other models run. - -In XPalm, weather data for most models is provided daily, meaning biomass calculations are also provided daily. - -Many models are considered to be steady-state over that timeframe, but not all : the leaf pruning model pertubes the plant in a non-steady state fashion, for example. Models that require computations over several iterations to stabilise (often part of hard dependencies) might also have a timestep unrelated to the weather data. - -!!! Note - Implicitely, this means any vector variables given as input to the simulation must be consistent with the number of weather timesteps. Providing one weather value but a larger vector variable is an exception : the weather data is replicated over each timestep. (This may be subject to change in the future when support for different timesteps in a single simulation is implemented) - -## Why does my model skip half-hour rows? - -If your meteo has 30-minute rows but a model appears to run hourly, check timestep resolution order: - -1. If model has explicit `TimeStepModel(...)`, it is used. -2. Else if model `timespec(model)` is non-default, it is used. -3. Else model uses meteo `duration`. - -Then compatibility rules apply: - -1. `timestep_hint.required` is enforced for meteo-derived clocks. -2. `timestep_hint.preferred` is informational only. -3. Meteo aggregation/integration happens only for models with coarser effective clocks. - -Common cause: -- model has explicit hourly `TimeStepModel(...)`, so 30-minute rows are intentionally aggregated to hourly runs. - -Quick diagnostics: -- Run `explain_model_specs(mapping_or_sim)` to see, per process, whether runtime clock comes from explicit `ModelSpec`, model `timespec`, or meteo base step. -- Ensure meteo `duration` is present and valid on every row (mandatory when meteo is provided). - -## Weather data must be interpolated prior to simulation - -If your weather data isn't adjusted to conform to a regular timestep, you will need to adjust it to fit that constraint. PlantSimEngine does no interpolation prior to simulation and expects regular weather timesteps. - -## No cyclic dependencies in the simplified dependency graph - -The model dependency graph used for running the simulation is comprised of soft and hard dependency nodes, and the final version only links soft dependency nodes together, and is expected to contain no cycles. - -Any user model coupling which causes a cyclic dependency to occur will require some extra tinkering to run : either design models differently, create a hard dependency with some of the problematic models, or break the cycle by having a variable take the previous timestep's value as input. - -See [Dependency graphs](@ref) and the following subsections for more discussion related to dependency graph constraints. - -Note : Only the previous timestep is accessible in PlantSimEngine without any kind of dedicated model. How to create a model to store more past timesteps of a specific variable is described in the [Tips and workarounds](@ref) page: [Making use of past states in multi-scale simulations](@ref) - -## Hard dependencies need to be declared in the model definition - -Hard dependencies are handled internally by their owning soft dependency model, ie the hard dep's run! function is directly called by the soft dependency's run!. - -The current way in which PlantSimEngine creates its dependency graph requires users to declare what process is required in the hard dependency and which scale it pulls the model and its variables from. - -## Parallelisation opportunities must be part of the model definition - -Traits that indicate that a model is independent or objects need to be part of the model definition. Modelers need to keep this in mind when implementing new models. - -This is currently mostly a concern for single-scale simulations, as multi-scale simulations are not currently parallelised ; a more involved scheduler would need to be implemented when MTGs are modified by models, and to handle more interesting parallelisation opportunities at specific scales. - -There may be new parallelisation features for multi-plant simulations further down the road. - -## Hard dependencies can only have one parent in the dependency graph - -The final dependency graph is comprised only of soft dependency nodes, and is guaranteed to contain no cycles. Hard dependencies are handled internally by their soft dependency ancestor. To avoid any ambiguity in terms of processing order, only one soft dependency node can 'own' a hard dependency And similarly, nested hard dependencies only have a single soft dependency ancestor. - -This is not solely an implementation detail of PlantSimEngine's internal mechanisms ; if your simulation requires complex coupling, you might need to carefully consider how to manage your hard dependencies, or insert an extra intermediate model to simplify things. - -## A model can only be used once per scale - -Similarly, to avoid depedency graph ambiguity (and for simulation cohesion), PlantSimEngine currently assumes a model describing a process only occurs once per scale. - -Model renaming and duplicating works around this assumption. It may change once multi-plant/multi-species features are implemented. - -## No two variables with the same name at the same scale - -This rule avoids potential ambiguity which could then cause both problems in terms of model ordering during the simulation, as well as incorrectly coupling models with the wrong variable. - -A workaround for some of the situations where this occurs is described here : [Having a variable simultaneously as input and output of a model](@ref) - -## Simulation order instability when adding models - -An important aspect to bear in mind is that PlantSimEngine automatically determines an order in which models are run from the dependency graph it generates by coupling models together. - -This order of simulation depends on the way the models link together. If you replace a model by a new set of models, or pass in new variables that create new links between models, you may change the simulation order. - -When iterating and slowly making a simulation more physiologically realistic and complex, it is therefore fully possible that the order in which two models are run is flipped by a user change. - -This design choice implementation -a concession made for ease of use and flexibility when developing a simulation- means that until your set of models is fully stabilized and you know which variables are `PreviousTimestep` and what order models run in, as you expand and change the set you might see differences of execution of one timestep for some models. It isn't a conceptual problem as most models are steady-state, and simulation order is stable for a given set of models, but it does mean PlantSimEngine will be less conveient for some types of simulation. diff --git a/docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md b/docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md deleted file mode 100644 index 602045e04..000000000 --- a/docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md +++ /dev/null @@ -1,515 +0,0 @@ -# Troubleshooting error messages - -PlantSimEngine attempts to be as comfortable and easy to use as possible for the user, and many kinds of user error will be caught and explanations provided to resolve them, but there are still blind spots, as well as syntax errors that will often generate a Julia error (which can be less intuitive to decrypt) rather than a PlantSimEngine error. - -To help people newer to Julia with troubleshooting, here are a few common 'easy-to-make' mistakes with the current API that might not be obvious to interpret, and pointers on how to fix them. - -They are listed by 'nature of error', rather than by error message, so you may need to search the page to find your specific error. - -If you need more help to decode Julia errors, you can find help on the [Julia Discourse forums](https://discourse.julialang.org). -If you need some advice on the FSPM side, the research community has [its own discourse forum](https://fspm.discourse.group). - -If the issue seems PlantSimEngine-related, or you have questions regarding modeling or have suggestions, you can also [file an issue](https://github.com/VirtualPlantLab/PlantSimEngine.jl/issues) on Github. - -```@contents -Pages = ["plantsimengine_and_julia_troubleshooting.md"] -Depth = 3 -``` - -## Tips and workflow - -Some errors are very specific as to their cause, and the PlantSimEngine errors tend to be explicit about which parameter / variable / organ is causing the error, helping narrow down its origin. - -Some generic-looking errors usually do contain some extra information to help focus the debugging hunt. For instance, a dispatch failure on run! caused by some issue with args/kwargs may highlight explicitely indicate which arguments are currently causing conflict. In VSCode, such arguments are highlighted in red (the first and last arguments in the example below): - -```julia -a = 1 -run!(a, simple_mtg, mapping, meteo_day, a) - -ERROR: MethodError: no method matching run!(::Int64, ::Node{NodeMTG, Dict{…}}, ::Dict{String, Tuple{…}}, ::DataFrame, ::Int64) -The function [`run!`](@ref) exists, but no method is defined for this combination of argument types. - -Closest candidates are: - run!(::ToyPlantLeafSurfaceModel, ::Any, ::Any, ::Any, ::Any, ::Any) - @ PlantSimEngine /PlantSimEngine/examples/ToyLeafSurfaceModel.jl:75 - ... -``` - -If you wish to search for a specific error in the current page, copy the part of the description that is not specific to your script, and Ctrl+F it here. In the above example, the generic part would be : -```julia -ERROR: MethodError: no method matching -``` - -## Common Julia errors - -### NamedTuples with a single value require a comma : - -This one is easy to miss. - -Empty NamedTuple objects are initialised with x = NamedTuple(). Ones with more than one variable can be initialised like this : -```julia -a = (var1 = 0, var2 = 0) -``` -or like this : -```julia -a = (var1 = 0, var2 = 0,) -``` -The second comma being optional. - -However, if there is only a single variable, notation has to be : -```julia -a = (var1 = 0,) -``` -The comma is compulsory. If it is forgotten : -```julia -a = (var1 = 0) -``` -the line will be interpreted as setting the variable a to the value var1 is set to, hence a will be an Int64 of value 0. - -This is a liability when writing custom models as some functions work with NamedTuples : -```julia -function PlantSimEngine.inputs_(::HardDepSameScaleAvalModel) - (e2 = -Inf,) -end -``` - -The error returned will likely be a Julia error along the lines of : -```julia -[ERROR: MethodError: no method matching merge(::Float64, ::@NamedTuple{g::Float64}) - -Closest candidates are: -merge(::NamedTuple{()}, ::NamedTuple) -@ Base namedtuple.jl:337 -merge(::NamedTuple{an}, ::NamedTuple{bn}) where {an, bn} -@ Base namedtuple.jl:324 -merge(::NamedTuple, ::NamedTuple, NamedTuple...) -@ Base namedtuple.jl:343 - -Stacktrace: -[1] variables_multiscale(node::PlantSimEngine.HardDependencyNode{…}, organ::String, vars_mapping::Dict{…}, st::@NamedTuple{}) -... -``` -It is sometimes properly detected and explained on PlantSimEngine's side (when passing in tracked_outputs, for instance), but may also occur when declaring statuses. - -### Incorrectly declaring empty inputs or outputs - -The syntax for an empty NamedTuple is `NamedTuple()`. If instead one types `()` or `(,)`an error returned respectively by PlantSimEngine or Julia will be returned. - -## PlantSimEngine user errors - -Most of the following errors occur exclusively in multi-scale simulations, which has a slightly more complex API, but some are common to both single- and multi-scale simulations. - -### ModelMapping: providing a type name instead of a constructed instance - -```julia -m = ModelMapping(day=MyToyModel, week=MyToyModel2) -``` -This line is incorrect and will return -```julia -MethodError: no method matching inputs_(::Type{MyToyDayModel}) -``` - -The correct syntax is (assuming the corresponding constructor exists) : -```julia -m = ModelMapping(day=MyToyModel(), week=MyToyModel2()) -``` - -### Implementing a model: forgetting to import or prefix functions - -When implementing a model, you need to make sure that your implementation is correctly recognised as extending `PlantSimEngine` methods and types, and not writing new independent ones. - -In the following working toy model implementation, note that the `inputs_`, `outputs_` and [`run!`](@ref) function are all prefixed with the module name. If there were hard dependencies to manage, the [`dep`](@ref) function would also be identically prefixed. - -```julia -using PlantSimEngine -@process "toy" verbose = false - -struct ToyToyModel{T} <: AbstractToyModel - internal_constant::T -end - -function PlantSimEngine.inputs_(::ToyToyModel) - (a = -Inf, b = -Inf, c = -Inf) -end - -function PlantSimEngine.outputs_(::ToyToyModel) - (d = -Inf, e = -Inf) -end - - -function PlantSimEngine.run!(m::ToyToyModel, models, status, meteo, constants=nothing, extra_args=nothing) - status.d = m.internal_constant * status.a - status.e += m.internal_constant -end - -meteo = Weather([ - Atmosphere(T=20.0, Wind=1.0, Rh=0.65, Ri_PAR_f=200.0), - Atmosphere(T=20.0, Wind=1.0, Rh=0.65, Ri_PAR_f=200.0), - Atmosphere(T=18.0, Wind=1.0, Rh=0.65, Ri_PAR_f=100.0), -]) - -model = ModelMapping( - ToyToyModel(1), - status = ( a = 1, b = 0, c = 0), -) -to_initialize(model) -sim = PlantSimEngine.run!(model, meteo) -``` - -If you declare these functions without importing them first, or prefixing them with the module name, they will be considered to be part of your current environment, and won't be extending PlantSimEngine methods, which means PlantSimEngine will not be able to properly make use of your functions, and simulations are likely to error, or run incorrectly. - -Forgetting to prefix the [`run!`](@ref) function definition gives the following error : -```julia -ERROR: MethodError: no method matching run!(::ModelMapping{...}, ::TimeStepTable{Atmosphere{…}}) -The function [`run!`](@ref) exists, but no method is defined for this combination of argument types. - -Closest candidates are: - run!(::ToyToyModel, ::Any, ::Any, ::Any, ::Any, ::Any) - @ Main ~/path/to/file.jl:20 -``` - -Forgetting to prefix the `inputs_`or `outputs_` functions for your model might not always generate an error, depending on whether the variables declared in this function are present in your mapping's corresponding Status. - -In cases where they do throw an error, you may get the following kind of output: -```julia -ERROR: type NamedTuple has no field d -Stacktrace: - [1] setproperty!(mnt::Status{(:a, :b, :c), Tuple{…}}, s::Symbol, x::Int64) - @ PlantSimEngine ~/path/to/package/PlantSimEngine/src/component_models/Status.jl:100 - [2] run!(m::ToyToyModel{…}, models::@NamedTuple{…}, status::Status{…}, meteo::PlantMeteo.TimeStepRow{…}, constants::Constants{…}, extra_args::Nothing) - ... -``` - -!!! note - There may be more we can do on our end in the future to make the issue more obvious, but in the meantime it is safest to consistently prefix the methods you need to declare and call with `PlantSimEngine.`, or to explicitely import the functions you wish to extend, *e.g.*: `import PlantSimEngine: inputs_, outputs_`. - -### MultiScaleModel : forgetting a kwarg in the declaration - -A MultiScaleModel requires two kwargs, model and mapped_variables : - -```julia -models = MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[:TT_cu => :Scene,], - ) -``` - -Forgetting 'model=' : - -```julia -models = MultiScaleModel( - ToyLAIModel(), - mapped_variables=[:TT_cu => :Scene,], - ) -ERROR: MethodError: no method matching MultiScaleModel(::ToyLAIModel; mapped_variables::Vector{Pair{Symbol, String}}) -The type `MultiScaleModel` exists, but no method is defined for this combination of argument types when trying to construct it. - -Closest candidates are: - MultiScaleModel(::T, ::Any) where T<:AbstractModel got unsupported keyword argument "mapped_variables" - @ PlantSimEngine PlantSimEngine/src/mtg/MultiScaleModel.jl:188 - MultiScaleModel(; model, mapped_variables) - @ PlantSimEngine PlantSimEngine/src/mtg/MultiScaleModel.jl:191 -``` - -Forgetting 'mapped_variables=' : -```julia -models = MultiScaleModel( - model=ToyLAIModel(), - [:TT_cu => :Scene,], - ) - -ERROR: MethodError: no method matching MultiScaleModel(::Vector{Pair{Symbol, String}}; model::ToyLAIModel) -The type `MultiScaleModel` exists, but no method is defined for this combination of argument types when trying to construct it. - -Closest candidates are: - MultiScaleModel(; model, mapping) - @ PlantSimEngine PlantSimEngine/src/mtg/MultiScaleModel.jl:191 - MultiScaleModel(::T, ::Any) where T<:AbstractModel got unsupported keyword argument "model" -``` - -The message 'got unsupported keyword argument "model"' can be misleading, as in the error in this case is not that a kwarg is *unsupported*, but rather that a keyword argument is *missing*. - -### MultiScaleModel : variable not defined in Module - -A possible cause for this error is that a variable was declared instead of a symbol in a mapping for a multiscale model : - -```julia -mapping = ModelMapping(:Scale => -MultiScaleModel( - model = ToyModel(), - mapped_variables = [should_be_symbol => :Other_Scale] # should_be_symbol is a variable, likely not found in the current module -), -... -), -``` - -Here's the correct version : -```julia -mapping = ModelMapping(:Scale => -MultiScaleModel( - model = ToyModel(), - mapped_variables=[:should_be_symbol => :Other_Scale] # should_be_symbol is now a symbol -), -... -), -``` - -### Kwarg and arg parameter issues when calling run! - -There are, unfortunately, multiple ways of passing in arguments to the run! functions that will confuse dynamic dispatch. Some of it is due to imperfections in type declarations on PlantSimEngine's end and may be improved upon in the future. - -Here are a few examples when modifying the usual multiscale run! call in this working example: - -```julia -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) -mtg = Node(MultiScaleTreeGraph.NodeMTG("/", :Plant, 1, 1)) -var1 = 15.0 - -mapping = ModelMapping( - :Leaf => ( - Process1Model(1.0), - Process2Model(), - Process3Model(), - Status(var1=var1,) - ) -) - -outs = Dict( - :Leaf => (:var1,), # :non_existing_variable is not computed by any model -) - -run!(mtg, mapping, meteo_day, PlantMeteo.Constants(), tracked_outputs=outs) -``` - -The exact signature is this : -```julia -function run!( - object::MultiScaleTreeGraph.Node, - mapping::ModelMapping, - meteo=nothing, - constants=PlantMeteo.Constants(), - extra=nothing; - nsteps=nothing, - tracked_outputs=nothing, - check=true, - executor=ThreadedEx() -``` - -Arguments after the mtg and mapping all have a default value and are optional, and arguments after the ';' delimiter are kwargs and need to be named. - -If one forgets the mtg, a flaw in the way run! is defined will lead to this error : -```julia -run!(mapping, meteo_day, PlantMeteo.Constants(), tracked_outputs=outs) - -ERROR: MethodError: no method matching check_dimensions(::PlantSimEngine.TableAlike, ::Tuple{…}, ::DataFrame) -The function `check_dimensions` exists, but no method is defined for this combination of argument types. - -Closest candidates are: - check_dimensions(::Any, ::Any) - @ PlantSimEngine PlantSimEngine/src/checks/dimensions.jl:43 - ... -``` - -If one forgets the necessary 'tracked_outputs=' in the definition, outs will be interpreted as the 'extra' arg instead of a kwarg. 'extra' usually defaults to nothing, and is reserved in multiscale mode, leading to the following error : - -```julia -run!(mtg, mapping, meteo_day, PlantMeteo.Constants(), outs) - -ERROR: Extra parameters are not allowed for the simulation of an MTG (already used for statuses). -Stacktrace: - [1] error(s::String) - @ Base ./error.jl:35 - [2] run!(::PlantSimEngine.TreeAlike, object::PlantSimEngine.GraphSimulation{…}, meteo::DataFrames.DataFrameRows{…}, constants::Constants{…}, extra::Dict{…}; tracked_outputs::Nothing, check::Bool, executor::ThreadedEx{…}) -``` - -In case of a more generic error that returns a -For example, if one does the opposite and adds a non-existent kwarg, the generic dispatch failure has some more specific information : -`got unsupported keyword argument "constants"` - -```julia -run!(mtg, mapping, meteo_day, constants=PlantMeteo.Constants(), tracked_outputs=outs) - -ERROR: MethodError: no method matching run!(::Node{…}, ::Dict{…}, ::DataFrame, ::Dict{…}, ::Nothing; constants::Constants{…}) -This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented. - -Closest candidates are: - run!(::Node, ::Dict{String}, ::Any, ::Any, ::Any; nsteps, tracked_outputs, check, executor) got unsupported keyword argument "constants" -``` - -### Hard dependency process not present in the mapping - -Another weakness in the current error checking leads to an unclear Julia error if a model A is present in a mapping and has a hard dependency on a model B, but B is absent from the mapping. - -In the following example, A corresponds to Process3Model, which requires a model B implementing 'Process2Model' and referred to as 'process2'. -Looking at the source code for Process3Model, the hard dependency is declared here : -```julia -PlantSimEngine.dep(::Process3Model) = (process2=Process2Model,) -``` - -However, the model provided in the examples, Process2Model is absent from the mapping : - -```julia -simple_mtg = Node(MultiScaleTreeGraph.NodeMTG("/", :Plant, 1, 1)) -mapping = ModelMapping( - :Leaf => ( - Process3Model(), - Status(var5=15.0,) - ) -) -outs = Dict( - :Leaf => (:var5,), -) -run!(simple_mtg, mapping, meteo_day, tracked_outputs=outs) - -ERROR: type NamedTuple has no field process2 -Stacktrace: - [1] getproperty(x::@NamedTuple{process3::Process3Model}, f::Symbol) - @ Base ./Base.jl:49 - [2] run!(::Process3Model, models::@NamedTuple{…}, status::Status{…}, meteo::DataFrameRow{…}, constants::Constants{…}, extra::PlantSimEngine.GraphSimulation{…}) - ... -``` - -The fix is to add Process2Model() -or another model for the same process- to the mapping. - -### Status API ambiguity - -One current problem with PlantSimEngine's API is that declaring a simulation's Status or Statuses differs between single- and multi-scale. - -Returning to the example in [Implementing a model: forgetting to import or prefix functions](@ref), the single-scale mapping status was declared like this: - -```julia -model = ModelMapping( - ToyToyModel(1), - status = ( a = 1, b = 0, c = 0), -) -``` -If instead you replace `status = ...`with the multi-scale declaration: `Status(...)`, you will get the following error: - -```julia -ERROR: MethodError: no method matching process(::Status{(:a, :b, :c), Tuple{Base.RefValue{Int64}, Base.RefValue{Int64}, Base.RefValue{Int64}}}) -The function `process` exists, but no method is defined for this combination of argument types. - -Closest candidates are: - process(::Pair{Symbol, A}) where A<:AbstractModel - @ PlantSimEngine ~/path/to/pkg/PlantSimEngine/src/Abstract_model_structs.jl:16 - process(::A) where A<:AbstractModel - @ PlantSimEngine ~/path/to/pkg/PlantSimEngine/src/Abstract_model_structs.jl:13 - -Stacktrace: - [1] (::PlantSimEngine.var"#5#6")(i::Status{(:a, :b, :c), Tuple{Base.RefValue{…}, Base.RefValue{…}, Base.RefValue{…}}}) - @ PlantSimEngine ./none:0 - [2] iterate -``` - -If you do the opposite in a multi-scale simulation by replacing the necessary `Status(...)` with `status = ...`, you may get an `ERROR: syntax: invalid named tuple element` error. Here's some output when tinkering with the Toy Plant tutorial's mapping: - -```julia -ERROR: syntax: invalid named tuple element "MultiScaleModel(...)" around /path/to/Pkg/PlantSimEngine/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation3.jl:196 -Stacktrace: - [1] top-level scope - @ ~/path/to/pkg/PlantSimEngine/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation3.jl:196 -``` -or -```julia -ERROR: syntax: invalid named tuple element "ToyRootGrowthModel(50, 10)" around /path/to/Pkg/PlantSimEngine/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation3.jl:196 -Stacktrace: - [1] top-level scope - @ ~/path/to/Pkg/PlantSimEngine/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation3.jl:196 -``` - -## Forgetting to declare a scale in the mapping but having variables point to it - -If there is a need to collect variables at two different scales, and one scale is completely absent from the mapping, the error currently occurs on the Julia side : - -```julia -# No models at the E3 scale in the mapping ! - -:E2 => ( - MultiScaleModel( - model = HardDepSameScaleEchelle2Model(), - mapped_variables=[:c => :E1 => :c, :e3 => :E3 => :e3, :f3 => :E3 => :f3,], - ), - ), - -Exception has occurred: KeyError -* -KeyError: key :E3 not found -Stacktrace: -[1] hard_dependencies(mapping::Dict{String, Tuple{Any, Any}}; verbose::Bool) -@ PlantSimEngine ......./src/dependencies/hard_dependencies.jl:175 -... -``` - -### Parenthesis placement when declaring a mapping - -An unintuitive error encountered in the past when defining a mapping : - -```julia -ERROR: ArgumentError: AbstractDict(kv): kv needs to be an iterator of 2-tuples or pairs -``` - -may occur when forgetting the parenthesis after '=>' in a mapping declaration, and combining it with another parenthesis error. - -```julia -mapping = ModelMapping( "Scale" => (ToyAssimGrowthModel(0.0, 0.0, 0.0), ToyCAllocationModel(), Status( TT_cu=Vector(cumsum(meteo_day.TT))), ), ) -``` - -Other errors such as: - -```julia -ERROR: MethodError: no method matching Dict(::Pair{String, ToyAssimGrowthModel{Float64}}, ::ToyCAllocationModel, ::Status{(:TT_cu,), Tuple{Base.RefValue{…}}}) -The type `Dict` exists, but no method is defined for this combination of argument types when trying to construct it. - -Closest candidates are: - Dict(::Pair{K, V}...) where {K, V} -``` - -often indicate a likely syntax error somewhere in the mapping definition. - -### Empty status vectors in multi-scale simulations - -This situation won't trigger an error. Unexpectedly empty vectors can be returned as outputs if you happen to forget to a node at the corresponding scale in the MTG, and no organ creation occurs for that node. - -Here's an example taken from the [Converting a single-scale simulation to multi-scale](@ref) page. It was modified by removing the :Plant node in the dummy MTG passed into the [`run!`](@ref)function. Without that :Plant node, only :Scene-scale models can run initially, and since no nodes are created, :Plant-scale models will never be run. - -```julia -PlantSimEngine.@process "tt_cu" verbose = false - -struct ToyTt_CuModel <: AbstractTt_CuModel end - -function PlantSimEngine.run!(::ToyTt_CuModel, models, status, meteo, constants, extra=nothing) - status.TT_cu += - meteo.TT -end - -function PlantSimEngine.inputs_(::ToyTt_CuModel) - NamedTuple() # No input variables -end - -function PlantSimEngine.outputs_(::ToyTt_CuModel) - (TT_cu=-Inf,) -end - -mapping_multiscale = ModelMapping( - :Scene => ToyTt_CuModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.5), - ToyRUEGrowthModel(0.2), - ), -) - -mtg_multiscale = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Plant, 0, 0),) -#plant = MultiScaleTreeGraph.Node(mtg_multiscale, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -out_multiscale = run!(mtg_multiscale, mapping_multiscale, meteo_day) - -out_multiscale[:Plant][:LAI] -``` - -In the above code, uncommenting the second line will add a :Plant node to the MTG, and the simulation will then behave as intuitively expected. diff --git a/docs/src/troubleshooting_and_testing/tips_and_workarounds.md b/docs/src/troubleshooting_and_testing/tips_and_workarounds.md deleted file mode 100644 index 27f19a067..000000000 --- a/docs/src/troubleshooting_and_testing/tips_and_workarounds.md +++ /dev/null @@ -1,112 +0,0 @@ -# Tips and workarounds - -## PlantSimEngine is actively being developed - -PlantSimEngine, despite the somewhat abstract codebase and generic simulation ambitions, is quite grounded in reality. There IS a desire to accomodate for a wide range of possible simulations, without constraining the user too much, but most features are developed on an as-needed basis, and grow out of necessity, partly from the requirements of an increasingly complex and refined implementation of an oil palm model, [XPalm](https://github.com/PalmStudio/XPalm.jl). - -Since the oil palm model is actively being developed, and some features aren't ready in PlantSimEngine, or require a lot of rewriting that we're not certain would be worth it (especially if it ends up constraining the codebase or what the user can do), some workarounds and shortcuts are occasionally used to circumvent a limitation. - -There are also a couple of features that are quick hacks or that are meant for quick and dirty prototyping, not for production. - -We'll list a few of them here, and will likely add some entry in the future listing some built-in limitations or implicit expectations of the package. - -```@contents -Pages = ["tips_and_workarounds.md"] -Depth = 2 -``` - -## Making use of past states in multi-scale simulations - -It is possible to make use of the value of a variable in the past simulation timestep via the [`PreviousTimeStep`](@ref) mechanism in the mapping API (In fact, as mentioned elsewhere, it is the default way to break undesirable cyclic dependencies that can come up when coupling models, see : [Avoiding cyclic dependencies](@ref)). - -However, it is not possible to go beyond that through the mapping API. Something like `PreviousTimeStep(PreviousTimeStep(PreviousTimeStep(:carbon_biomass)))` is not supported. Don't do that. - -One way to access prior variable states is simply to write an ad hoc model that stores a few values into an array or however many variables you might need, which you can then update every timestep and feed into other models that might need it. - -## Having a variable simultaneously as input and output of a model - -One current limitation of `PlantSimEngine` that can be occasionally awkward is that using the same variable name as input and output in a single model is unsupported. - -(On a related note : it is not possible to have two variables with the same name *in the same scale*. They are considered as the same variable.) - -The reason being that it is usually impossible to automatically determine how the coupling is supposed to work out, when other dependencies latch onto such a model. The user would have to explicitely declare some order of simulation between several models, and some amount of programmer work would also be necessary to implement that extra API feature into `PlantSimEngine`. - -We haven't found an approach that was fully satisfactory from both a code simplicity and an API convenience POV. Especially when prototyping and adding in new models, as that might require redeclaring the simulation order for those specific variables. - -There are two workarounds : - -- One possibly awkward approach is to rename one of the variables. It is not ideal, of course, as it means you might not be able to use a predefined model 'out of the box', but it does not have any of the tradeoffs and constraints mentioned above. - -- In many other situations one can work with what PlantSimEngine already provides. - -For example, one model in [XPalm.jl](https://github.com/PalmStudio/XPalm.jl/blob/main/src/plant/phytomer/leaves/leaf_pruning.jl) handles leaf pruning, affecting biomass. A straightforward implementation would be to have a `leaf_biomass` variable as both input and output. The workaround is to instead output a variable `leaf_biomass_pruning_loss` and to have that as input in the next timestep to compute the new leaf biomass. - -[Part 3](../multiscale/multiscale_example_3.md) of the Toy Plant tutorial does something similar for its carbon stock. The `carbon_stock` variable indicates how much carbon is available for root and internode growth, but instead of updating it and passing it along after the root growth decision model decided whether or not roots should be added, that model computes a `carbon_stock_updated_after_roots` which is then used by the internode growth model. - -This change in design avoids model order ambiguity and also improves readability, and makes sense in terms of PlantSimEngine's philosophy. - -## [Multiscale : passing in a vector in a mapping status at a specific scale](@id multiscale_vector) - -!!! note - This section is a little more advanced and not recommended for beginners - -You may have noticed that sometimes a vector (1-dimensional array) variable is passed into the [`status`](@ref) component of a [`ModelMapping`](@ref) in documentation examples (An example here with cumulative thermal time : [Model switching](@ref)). - -This is practical for simple simulations, or when quickly prototyping, to avoid having to write a model specifically for it. Whatever models make use of that variable are provided with one element corresponding to the current timestep every iteration. - -In multi-scale simulations, this feature is also supported, though not part of the main API. The way outputs and statuses work is a little different, so that little convenience feature is not as straightforward. - -It remains a convenience path for prototyping, and it is still not tested for -more complex interactions, so it may interact badly with variables that are -mapped to different scales or in unusual dependency couplings. - -The way to use this is as follows: - -Call the function `replace_mapping_status_vectors_with_generated_models(mapping_with_vectors_in_status, timestep_model_organ_level, nsteps)`on your mapping. - -It will parse your mapping, generate custom models to store and feed the vector values each timestep, and return the new mapping you can then use for your simulation. It also slips in a couple of internal models that provide the timestep index to these models (so note that symbols `:current_timestep` and `:next_timestep` will be declared for that mapping). You can decide which scale/organ level you want those models to be in via the `timestep_model_organ_level`parameter. `nsteps` is used as a sanity check, and expects you to provide the amount of simulation timesteps. - -!!! warning - Only subtypes of AbstractVector present in statuses will be affected. In some cases, meteo values might need a small conversion. For instance : - ``` - meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - status(TT_cu=cumsum(meteo_day.TT),)``` - - cumsum(meteo_day.TT) actually returns a CSV.SentinelArray.ChainedVectors{T, Vector{T}}, which is not a subtype of AbstractVector. - Replacing it with Vector(cumsum(meteo_day.TT)) will provide an adequate type. - -Here's an example usage, fixing the first attempt at [Converting a single-scale simulation to multi-scale](@ref): - -```julia -using PlantSimEngine -using PlantSimEngine.Examples -using PlantMeteo, Dates -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -# Direct translation of the single-scale simulation -mapping_pseudo_multiscale = ModelMapping( -:Plant => ( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2), - Status(TT_cu=cumsum(meteo_day.TT),) - ), -) - -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Plant, 1, 0),) - -# will generate an error as vectors can't be directly passed into a Status in multi-scale simulations -#out_pseudo_multiscale_error = run!(mtg, mapping_pseudo_multiscale, meteo_day) - -mapping_pseudo_multiscale_adjusted = PlantSimEngine.replace_mapping_status_vectors_with_generated_models(mapping_pseudo_multiscale, :Plant, PlantSimEngine.get_nsteps(meteo_day)) - -out_pseudo_multiscale_successful = run!(mtg, mapping_pseudo_multiscale_adjusted, meteo_day) - -``` - - -This feature is likely to break in simulations that make use of planned future features (such as mixing models with different timesteps), without guarantee of a fix on a short notice. Again, bear in mind it is mostly a convenient shortcut for prototyping, when doing multi-scale simulations. - -## Cyclic dependencies in single-scale simulations - -Cyclic dependencies can happen in single-scale simulations, but the PreviousTimestep feature currently isn't available. Hard dependencies are one way to deal with them, creating a multi-scale simulation with a single effective scale is also an option. diff --git a/docs/src/tutorials/growing_plant/part1_growth.md b/docs/src/tutorials/growing_plant/part1_growth.md new file mode 100644 index 000000000..37bdc6418 --- /dev/null +++ b/docs/src/tutorials/growing_plant/part1_growth.md @@ -0,0 +1,33 @@ +# Growing A Plant CompositeModel + +Begin with a plant object and leaf objects whose carbon production is gathered +by a plant application through `Many(scale=:Leaf, within=Subtree())`. A growth +model calls `register_object!` after its carbon or thermal threshold is met. + +Structural changes refresh compiled targets after the application that made +the change. A new leaf may run applications that remain later in the same +timestep, but it never retroactively runs applications that already completed. +When callers mutate structure between `step!` calls, refresh occurs before the +next step. + +Build the initial registry explicitly so ownership remains visible: + +```julia +model = CompositeModel( + Object(:plant; scale=:Plant, status=Status(carbon=0.0)), + Object(:leaf_1; scale=:Leaf, parent=:plant, status=Status(area=1.0)); + applications=(leaf_application, plant_balance, growth_application), + environment=weather, +) +``` + +The plant balance gathers leaf production with +`Many(scale=:Leaf, within=Subtree())`. The growth kernel obtains the live model +with `runtime_model(context)`, checks its carbon and thermal thresholds, creates +a fully initialized `Object`, and calls `register_object!`. It should deduct +the construction cost exactly once before registration. + +After each step, assert both biology and structure: remaining plant carbon, +the number of leaf objects, each new leaf's parent, and accepted historical +outputs. `Diagnostics.explain_applications` should show that the new leaf is absent +during its creation step and present after the between-step refresh. diff --git a/docs/src/tutorials/growing_plant/part2_roots_water.md b/docs/src/tutorials/growing_plant/part2_roots_water.md new file mode 100644 index 000000000..9ab2f3a90 --- /dev/null +++ b/docs/src/tutorials/growing_plant/part2_roots_water.md @@ -0,0 +1,37 @@ +# Adding Roots And Water + +Add root objects and gather absorption through a plant-local `Many` selector. +Keep shared carbon and water stocks on the plant, while leaf and root state +remains object-local. Environment precipitation is an environment input; root +creation is an explicit `register_object!` operation with initialized status. + +When several plants share one soil object, select it explicitly with a +model-wide `One` selector rather than relying on traversal order. + +Keep stocks at the scale that owns conservation. A root model may publish an +absorption rate per root, while the plant model integrates all root rates and +updates one plant water stock. A soil model owns soil water; plants read it +through an explicit model-wide selector. This avoids copying one stock into +every organ and makes duplicate writers visible. + +```julia +ModelSpec( + PlantWaterModel(); + inputs=( + :root_uptake => Many( + scale=:Root, within=Subtree(), application=:root_absorption, + var=:uptake, policy=Integrate(), window=Day(1), + ), + :soil_water => One( + scale=:Soil, within=SceneScope(), application=:soil_water, + var=:water, + ), + ), +) +``` + +Precipitation, temperature, and radiation remain environment variables, not +ordinary object outputs. Use `Environment(sources=...)` when provider column +names differ from model-facing names. When growth creates a root, initialize +all required root status values before `register_object!`; verify the next +timestep's carrier with `Diagnostics.input_value` or `Diagnostics.explain_bindings`. diff --git a/docs/src/tutorials/growing_plant/part3_debugging.md b/docs/src/tutorials/growing_plant/part3_debugging.md new file mode 100644 index 000000000..1c4c6bbf7 --- /dev/null +++ b/docs/src/tutorials/growing_plant/part3_debugging.md @@ -0,0 +1,32 @@ +# Debugging Growth And Resource Ordering + +If an organ appears to spend resources before it exists, inspect activation +timing and the compiled schedule. If two models intentionally update one stock, +declare `Updates(:stock; after=:producer)`. If a parent must test several child +states before accepting one, use `calls` and publish only the accepted call. + +For cycles, choose a scientific meaning: lag one edge with +`PreviousTimeStep`, put convergence under a parent-owned hard call, or +reformulate the equations. Do not resolve a cycle by incidental application +ordering. + +Use this debugging order: + +1. `Diagnostics.explain_initialization(model)` for missing state or environment values. +2. `Diagnostics.explain_bindings(model)` for source scope and multiplicity. +3. `Diagnostics.explain_writers(model)` for competing canonical outputs. +4. `Diagnostics.explain_calls(model)` for call-only targets and target cardinality. +5. `Diagnostics.explain_schedule(model)` for cadence and root ordering. +6. `Diagnostics.explain_outputs(simulation)` after execution for publication history. + +A trial call must not mutate accepted output history or scatter mutable +environment outputs. Nested trials inherit the outer publication decision. +Convergence and failure policy belongs to the parent model: it decides the +iteration limit, tolerance, fallback, and whether any state is accepted. + +Structural mutation is also transactional at the timestep boundary. A new +organ is registered immediately in the model registry but does not recursively +run during the kernel that created it. Before the next timestep, compilation +refreshes targets, carriers, calls, writer validation, schedules, and requested +outputs. Geometry-only movement refreshes only affected spatial bindings where +possible. diff --git a/docs/src/working_with_data/fitting.md b/docs/src/working_with_data/fitting.md index 0232acb21..1473f1625 100644 --- a/docs/src/working_with_data/fitting.md +++ b/docs/src/working_with_data/fitting.md @@ -1,76 +1,57 @@ -# Parameter fitting +# Parameter Fitting -```@setup usepkg -using PlantSimEngine, PlantMeteo, Dates, Statistics, DataFrames -using PlantSimEngine.Examples - -meteo = Atmosphere(T=20.0, Wind=1.0, P=101.3, Rh=0.65, Ri_PAR_f=300.0) -m = ModelMapping(Beer(0.6), status=(LAI=2.0,)) -run!(m, meteo) - -df = DataFrame(aPPFD=m[:aPPFD][1], LAI=m.status.LAI[1], Ri_PAR_f=meteo.Ri_PAR_f[1]) -``` - -## The fit method - -Models are often calibrated using data, but the calibration process is not always the same depending on the model, and the data available to the user. - -`PlantSimEngine` defines a generic [`fit`](@ref) function that allows modelers provide a fitting algorithm for their model, and for users to use this method to calibrate the model using data. - -The function does nothing in this package, it is only defined to provide a common interface for all the models. It is up to the modeler to implement the method for their model. - -The method is implemented as a function with the following design pattern: the call to the function should take the model type as the first argument (T::Type{<:AbstractModel}), the data as the second argument (as a `Table.jl` compatible type, such as `DataFrame`), and any more information as keyword arguments, *e.g.* constants or parameters initializations with default values when necessary. - -## Example with Beer - -The example script (see `src/examples/Beer.jl`) that implements the `Beer` model provides an example of how to implement the `fit` method for a model: +`PlantSimEngine.Evaluation.fit` is the shared interface for model-specific +calibration. +Model packages implement a method whose first argument is the model type and +whose second argument is Tables.jl-compatible observations. ```julia -function PlantSimEngine.fit(::Type{Beer}, df; J_to_umol=PlantMeteo.Constants().J_to_umol) - k = Statistics.mean(log.(df.Ri_PAR_f ./ (df.PPFD ./ J_to_umol)) ./ df.LAI) +function PlantSimEngine.Evaluation.fit( + ::Type{Beer}, + data; + J_to_umol=PlantMeteo.Constants().J_to_umol, +) + k = Statistics.mean( + log.(data.Ri_PAR_f ./ (data.aPPFD ./ J_to_umol)) ./ data.LAI, + ) return (k=k,) end ``` -The function takes a `Beer` type as the first argument, the data as a `Tables.jl` -compatible type, such as a `DataFrame` as the second argument, and the `J_to_umol` constant as a keyword argument, which is used to convert between μ mol m⁻² s⁻¹ and J m⁻² s⁻¹. - -`df` should contain the columns `PPFD` (μ mol m⁻² s⁻¹), `LAI` (m² m⁻²) and `Ri_PAR_f` (W m⁻²). The function then computes `k` based on these values, and returns it as a `NamedTuple` of the form `(parameter_name=parameter_value,)`. - -Here's an example of how to use the `fit` method: +The result should be a `NamedTuple` of fitted parameters. -Importing the script first: - -```julia -using PlantSimEngine, PlantMeteo, Dates, DataFrames, Statistics -# Import the examples defined in the `Examples` sub-module: +```@example fitting +using PlantSimEngine, PlantMeteo, Dates, DataFrames using PlantSimEngine.Examples -``` - -Defining the meteo data: - -```@example usepkg -meteo = Atmosphere(T=20.0, Wind=1.0, P=101.3, Rh=0.65, Ri_PAR_f=300.0) -``` - -Computing the `PPFD` values from the `Ri_PAR_f` values using the `Beer` model (with `k=0.6`): - -```@example usepkg -m = ModelMapping(Beer(0.6), status=(LAI=2.0,)) -run!(m, meteo) -``` - -Now we can define the "data" to fit the model using the simulated `PPFD` values: - -```@example usepkg -df = DataFrame(aPPFD=m[:aPPFD][1], LAI=m.status.LAI[1], Ri_PAR_f=meteo.Ri_PAR_f[1]) -``` - -And finally we can fit the model using the `fit` method: -```@example usepkg -fit(Beer, df) +meteo = Atmosphere( + T=20.0, + Wind=1.0, + P=101.3, + Rh=0.65, + Ri_PAR_f=300.0, + duration=Hour(1), +) + +model = CompositeModel( + Beer(0.6); + status=(LAI=2.0,), + id=:leaf, + scale=:Leaf, + environment=meteo, +) + +simulation = run!(model) +leaf = final_state(simulation, One(scale=:Leaf)) +data = DataFrame( + aPPFD=[leaf.aPPFD], + LAI=[leaf.LAI], + Ri_PAR_f=[meteo.Ri_PAR_f[1]], +) + +PlantSimEngine.Evaluation.fit(Beer, data) ``` -!!! note - This is a dummy example to show that the fitting method works. A real application would fit the parameter values on the data directly. \ No newline at end of file +This example recovers the parameter used to generate the synthetic +observation. Real calibration methods can use any optimizer or uncertainty +framework and may return additional diagnostics. diff --git a/docs/src/working_with_data/floating_point_accumulation_error.md b/docs/src/working_with_data/floating_point_accumulation_error.md deleted file mode 100644 index 6153fdc62..000000000 --- a/docs/src/working_with_data/floating_point_accumulation_error.md +++ /dev/null @@ -1,161 +0,0 @@ -# Floating-point considerations - -```@setup usepkg -using PlantSimEngine -using PlantSimEngine.Examples -using PlantMeteo, Dates, MultiScaleTreeGraph -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -models = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2); - status=(TT_cu=cumsum(meteo_day.TT),), -) - -out_singlescale = run!(models, meteo_day) -``` -## Investigating a discrepancy - -In the [Converting a single-scale simulation to multi-scale](@ref) page, a single-scale simulation was converted to an equivalent multiscale simulation, and outputs were compared. One detail that was glossed over, but important to bear in mind as a PlantSimEngine user is related to floating-point approximations. - -### Single-scale simulation - -```@example usepkg -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -models_singlescale = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2); - status=(TT_cu=cumsum(meteo_day.TT),), -) - -outputs_singlescale = run!(models_singlescale, meteo_day) -outputs_singlescale[1:3,:] # show the first 3 rows of the output -``` - -### Multi-scale equivalent - -```@example usepkg -PlantSimEngine.@process "tt_cu" verbose = false - -struct ToyTt_CuModel <: AbstractTt_CuModel end - -function PlantSimEngine.run!(::ToyTt_CuModel, models, status, meteo, constants, extra=nothing) - status.TT_cu += - meteo.TT -end - -function PlantSimEngine.inputs_(::ToyTt_CuModel) - NamedTuple() # No input variables -end - -function PlantSimEngine.outputs_(::ToyTt_CuModel) - (TT_cu=0.0,) -end - -mapping_multiscale = ModelMapping( - :Scene => ToyTt_CuModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.5), - ToyRUEGrowthModel(0.2), - ), -) - -mtg_multiscale = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Plant, 0, 0),) - plant = MultiScaleTreeGraph.Node(mtg_multiscale, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -outputs_multiscale = run!(mtg_multiscale, mapping_multiscale, meteo_day) -``` - -### Output comparison - -```@setup usepkg -mapping_multiscale = ModelMapping( - :Scene => ToyTt_CuModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.5), - ToyRUEGrowthModel(0.2), - ), -) - -mtg_multiscale = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 0, 0),) - plant = MultiScaleTreeGraph.Node(mtg_multiscale, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -outputs_multiscale = run!(mtg_multiscale, mapping_multiscale, meteo_day) -``` - -```@example usepkg - -computed_TT_cu_multiscale = [outputs_multiscale[:Scene][i].TT_cu for i in 1:length(outputs_multiscale[:Scene])] -is_approx_equal = length(unique(computed_TT_cu_multiscale .≈ outputs_singlescale.TT_cu)) == 1 -``` - -Why was the comparison only approximate ? Why `≈` instead of `==`? - -Let's try it out. What if write instead: - -```@example usepkg -computed_TT_cu_multiscale = [outputs_multiscale[:Scene][i].TT_cu for i in 1:length(outputs_multiscale[:Scene])] -is_perfectly_equal = length(unique(computed_TT_cu_multiscale .== outputs_singlescale.TT_cu)) == 1 -``` - -Why is this false? Let's look at the data. - -Looking more closely at the output, we can notice that values are identical up to timestep #105 : - -```@example usepkg -(computed_TT_cu_multiscale .== outputs_singlescale.TT_cu)[104] -``` - -```@example usepkg -(computed_TT_cu_multiscale .== outputs_singlescale.TT_cu)[105] -``` - -We have the values 132.33333333333331 (multi-scale) and 132.33333333333334 (single-scale). The final output values are : 2193.8166666666643 (multi-scale) and 2193.816666666666 (single-scale). - -The divergence isn't huge, but in other situations or over more timesteps it could start becoming a problem. - -## Floating-point summation - -The reason values aren't identical, is due to the fact that many numbers do not have an exact floating point representation. A classical example is the fact that [0.1 + 0.2 != 0.3](https://blog.reverberate.org/2016/02/06/floating-point-demystified-part2.html) : - -```@example usepkg -println(0.1 + 0.2 - 0.3) -``` - -When summing many numbers, depnding on the order in which they are summed, floating-point approximation errors may aggregate more or less quickly. - -The default summation per-timestep in our example `Toy_Tt_CuModel` was a naive summation. The `cumsum` function used in the single-scale simulation to directly compute the TT_cu uses a pairwise summation method that provides approximation error on fewer digits compared to naive summation. Errors aggregate more slowly. - -In our simple example, using Float64 values, the difference wasn't significant enough to matter, but if you are writing a simulation over many timesteps or aggregating a value over many nodes, you may need to alter models to avoid numerical errors blowing up due to floating-point accuracy. - -Depending on what value is being computed and the mathematical operations used, changes may range from applying a simple scale to a range of values, to significant refactoring. - - -## Other links related to floating-point numerical concerns - -Note that many of the examples in these blogposts discuss Float32 accuracy. Float64 values have several extra precision bits to work. - -A series of blog posts on floating-point accuracy: [https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/) -Floating-Point Visually Explained : [https://fabiensanglard.net/floating_point_visually_explained/](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/) -Examples of floating point problems: [https://jvns.ca/blog/2023/01/13/examples-of-floating-point-problems/](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/) - -Relating specifically to floating-point sums: - -Pairwise summation: [https://en.wikipedia.org/wiki/Pairwise_summation](https://en.wikipedia.org/wiki/Pairwise_summation) -Kahan summation: [https://en.wikipedia.org/wiki/Kahan_summation_algorithm](https://en.wikipedia.org/wiki/Kahan_summation_algorithm) -Taming Floating-Point Sums: [https://orlp.net/blog/taming-float-sums/](https://orlp.net/blog/taming-float-sums/) diff --git a/docs/src/working_with_data/inputs.md b/docs/src/working_with_data/inputs.md deleted file mode 100644 index 3c94c985b..000000000 --- a/docs/src/working_with_data/inputs.md +++ /dev/null @@ -1,94 +0,0 @@ -# Input types - -[`run!`](@ref) usually takes two inputs: a [`ModelMapping`](@ref) and data for the meteorology. The data for the meteorology is usually provided for one time step using an `Atmosphere`, or for several time-steps using a `TimeStepTable{Atmosphere}`. The [`ModelMapping`](@ref) can also be provided as a singleton, or as a vector or dictionary of. - -[`run!`](@ref) knows how to handle these data formats via the [`PlantSimEngine.DataFormat`](@ref) trait (see [this blog post](https://www.juliabloggers.com/the-emergent-features-of-julialang-part-ii-traits/) to learn more about traits). For example, we tell PlantSimEngine that a `TimeStepTable` should be handled like a table by implementing the following trait: - -```julia -DataFormat(::Type{<:PlantMeteo.TimeStepTable}) = TableAlike() -``` - -If you need to use a different data format for the meteorology, you can implement a new trait for it. For example, if you have a table-alike data format, you can implement the trait like this: - -```julia -DataFormat(::Type{<:MyTableFormat}) = TableAlike() -``` - -There are two other traits available: `SingletonAlike` for a data format representing one time-step only, and `TreeAlike` for trees, which is used for MultiScaleTreeGraphs nodes (not generic at this time). - -## Promoting status variable types - -Use the `type_promotion` keyword on [`ModelMapping`](@ref) when the default input and output values declared by models should be converted to another type: - -```julia -models = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2); - status=(TT_cu=cumsum(meteo_day.TT),), - type_promotion=Dict(Real => Float32), -) -``` - -For single-scale mappings, `type_promotion` is applied while the backing status is constructed. It follows the same semantics as the deprecated [`ModelList`](@ref): model-provided default values are converted, while values explicitly passed in `status` keep the type chosen by the user. If those values should also be `Float32`, pass them as `Float32` values directly. - -For multiscale mappings, the per-node statuses do not exist when [`ModelMapping`](@ref) is constructed. The promotion map is stored on the mapping and applied when the MTG simulation is initialized: - -```julia -mapping = ModelMapping( - :Scene => ToyTt_CuModel(), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => :Scene, - ], - ), - Beer(0.5), - ToyRUEGrowthModel(0.2), - ); - type_promotion=Dict(Float64 => Float32, Vector{Float64} => Vector{Float32}), -) - -outputs = run!(mtg, mapping, meteo_day) -``` - -The same promotion can also be passed at MTG run time: - -```julia -outputs = run!( - mtg, - mapping, - meteo_day; - type_promotion=Dict(Float64 => Float32, Vector{Float64} => Vector{Float32}), -) -``` - -In multiscale runs, type promotion is used by `GraphSimulation` during status template creation, `RefVector` creation, output preallocation, and initialization from MTG node attributes. - - -## Special considerations for new input types - -If you want to use a custom data format for the inputs, you need to make sure some methods are implemented for your data format depending on your use-cases. - -For example if you use models that need to get data from a different time step (*e.g.* a model that needs to get the previous day's temperature), you need to make sure that the data from the other time-steps can be accessed from the current time-step. - -To do so, you need to implement the following methods for your structure that defines your rows: - -- `Base.parent`: return the parent table of the row, *e.g.* the full DataFrame -- `PlantMeteo.rownumber`: return the row number of the row in the parent table, *e.g.* the row number in the DataFrame -- (Optionnally) `PlantMeteo.row_from_parent(row, i)`: return row `i` from the parent table, *e.g.* the row `i` from the DataFrame. This is only needed if you want high performance, the default implementation calls `Tables.rows(parent(row))[i]`. - -!!! compat - `PlantMeteo.rownumber` is temporary. It soon will be replaced by `DataAPI.rownumber` instead, which will be also used by *e.g.* DataFrames.jl. See [this Pull Request](https://github.com/JuliaData/DataAPI.jl/issues/60). - -## Working with weather data - -Here's a quick example showcasing how to export the example weather data to your own file : - -```julia -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) -PlantMeteo.write_weather("examples/meteo_day.csv", meteo_day, duration = Dates.Day) -``` - -If you wish to filter weather data, reshape it, adjust it, write it, you'll find some more examples in PlantMeteo's [API reference](https://palmstudio.github.io/PlantMeteo.jl/stable/API/). diff --git a/docs/src/working_with_data/reducing_dof.md b/docs/src/working_with_data/reducing_dof.md deleted file mode 100644 index 1a4b925de..000000000 --- a/docs/src/working_with_data/reducing_dof.md +++ /dev/null @@ -1,121 +0,0 @@ -# Reducing the DoF - -```@setup usepkg -using PlantSimEngine, PlantMeteo, Dates -# Import the examples defined in the `Examples` sub-module: -using PlantSimEngine.Examples - -meteo = Atmosphere(T = 20.0, Wind = 1.0, P = 101.3, Rh = 0.65) -struct ForceProcess1Model <: AbstractProcess1Model end -PlantSimEngine.inputs_(::ForceProcess1Model) = (var3=-Inf,) -PlantSimEngine.outputs_(::ForceProcess1Model) = (var3=-Inf,) -function PlantSimEngine.run!(::ForceProcess1Model, models, status, meteo, constants=nothing, extra=nothing) - return nothing -end -``` - -## Introduction - -### Why reduce the degrees of freedom - -Reducing the degrees of freedom in a model, by forcing certain variables to measurements, can be useful for several reasons: - -1. It can prevent overfitting by constraining the model and making it less complex. -2. It can help to better calibrate the other components of the model by reducing the co-variability of the variables (see [Parameter degeneracy](@ref)). -3. It can lead to more interpretable models by identifying the most important variables and relationships. -4. It can improve the computational efficiency of the model by reducing the number of variables that need to be estimated. -5. It can also help to ensure that the model is consistent with known physical or observational constraints and improve the credibility of the model and its predictions. -6. It is important to note that over-constraining a model can also lead to poor fits and false conclusions, so it is essential to carefully consider which variables to constrain and to what measurements. - -## Parameter degeneracy - -The concept of "degeneracy" or "parameter degeneracy" in a model occurs when two or more variables in a model are highly correlated, and small changes in one variable can be compensated by small changes in another variable, so that the overall predictions of the model remain unchanged. Degeneracy can make it difficult to estimate the true values of the variables and to determine the unique solutions of the model. It also makes the model sensitive to the initial conditions (*e.g.* the parameters) and the optimization algorithm used. - -Degeneracy is related to the concept of "co-variability" or "collinearity", which refers to the degree of linear relationship between two or more variables. In a degenerate model, two or more variables are highly co-variate, meaning that they are highly correlated and can produce similar predictions. By fixing one variable to a measured value, the model will have less flexibility to adjust the other variables, which can help to reduce the co-variability and improve the robustness of the model. - -This is an important topic in plant/crop modelling, as the models are very often degenerate. It is most often referred to as "multicollinearity" in the field. In the context of model calibration, it is also known as "parameter degeneracy" or "parameter collinearity". In the context of model reduction, it is also known as "redundancy" or "redundant variables". - -## Reducing the DoF in PlantSimEngine - -### Soft-coupled models - -PlantSimEngine provides a simple way to reduce the degrees of freedom in a model by constraining the values of some variables to measurements. - -Let's define a model list as usual with the seven processes from `examples/dummy.jl`: - -```@example usepkg -using PlantSimEngine, PlantMeteo, Dates -# Import the examples defined in the `Examples` sub-module: -using PlantSimEngine.Examples - -meteo = Atmosphere(T = 20.0, Wind = 1.0, P = 101.3, Rh = 0.65) -m = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - Process4Model(), - Process5Model(), - Process6Model(), - Process7Model(), - status=(var0 = 0.5,) -) - -run!(m, meteo) - -status(m) -``` - -Let's say that `m` is our complete model, and that we want to reduce the degrees of freedom by constraining the value of `var9` to a measurement, which was previously computed by `Process7Model`, a soft-dependency model. It is very easy to do this in PlantSimEngine: just remove the model from the model list and give the value of the measurement in the status: - -```@example usepkg -m2 = ModelMapping( - Process1Model(2.0), - Process2Model(), - Process3Model(), - Process4Model(), - Process5Model(), - Process6Model(), - status=(var0 = 0.5, var9 = 10.0), -) - -out = run!(m2, meteo) -``` - -And that's it ! The models that depend on `var9` will now use the measured value of `var9` instead of the one computed by `Process7Model`. - -### Hard-coupled models - -It is a bit more complicated to reduce the degrees of freedom in a model that is hard-coupled to another model, because it calls the [`run!`](@ref) method of the other model. - -In this case, we need to replace the old model with a new model that forces the value of the variable to the measurement. This is done by giving the measurements as inputs of the new model, and returning nothing so the value is unchanged. - -Starting from the model list with the seven processes from above, but this time let's say that we want to reduce the degrees of freedom by constraining the value of `var3` to a measurement, which was previously computed by `Process1Model`, a hard-dependency model. It is very easy to do this in PlantSimEngine: just replace the model by a new model that forces the value of `var3` to the measurement: - -```@example usepkg -struct ForceProcess1Model <: AbstractProcess1Model end -PlantSimEngine.inputs_(::ForceProcess1Model) = (var3=-Inf,) -PlantSimEngine.outputs_(::ForceProcess1Model) = (var3=-Inf,) -function PlantSimEngine.run!(::ForceProcess1Model, models, status, meteo, constants=nothing, extra=nothing) - return nothing -end -``` - -Now we can create a new model list with the new model for `process7`: - -```@example usepkg -m3 = ModelMapping( - ForceProcess1Model(), - Process2Model(), - Process3Model(), - Process4Model(), - Process5Model(), - Process6Model(), - Process7Model(), - status = (var0=0.5,var3 = 10.0) -) - -out = run!(m3, meteo) -``` - -!!! note - We could also eventually provide the measured variable using the meteo data, but it is not recommended. The meteo data is meant to be used for the meteo variables only, and not for the model variables. It is better to use the status for that. diff --git a/docs/src/working_with_data/visualising_outputs.md b/docs/src/working_with_data/visualising_outputs.md deleted file mode 100644 index e7d833e2a..000000000 --- a/docs/src/working_with_data/visualising_outputs.md +++ /dev/null @@ -1,98 +0,0 @@ -```@setup usepkg -# ] add PlantSimEngine, PlantMeteo -using PlantSimEngine, PlantMeteo, Dates - -# Include the model definition from the examples folder: -using PlantSimEngine.Examples - -# Import the example meteorological data: -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -# Define the list of models for coupling: -model = ModelMapping( - ToyLAIModel(), - Beer(0.6), - status=(TT_cu=cumsum(meteo_day[:, :TT]),), # Pass the cumulated degree-days as input to `ToyLAIModel`, this could also be done using another model -) - -# Run the simulation: -sim_out = run!(model, meteo_day) - -``` - -# Visualizing outputs and data - -## Output structure - -PlantSimEngine's run! functions return for each timestep the state of the variables that were requested using the `tracked_outputs` kwarg (or the state of every variable if this kwarg was left unspecified). Multi-scale simulations also indicate which organ and MTG node these state variables are related to. - -Here's an example indicating how to plot output data using CairoMakie, a package used for plotting. - -```@example usepkg -# ] add PlantSimEngine, PlantMeteo -using PlantSimEngine, PlantMeteo, Dates - -# Include the model definition from the examples folder: -using PlantSimEngine.Examples - -# Import the example meteorological data: -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Dates.Day) - -# Define the list of models for coupling: -models = ModelMapping( - ToyLAIModel(), - Beer(0.6), - status=(TT_cu=cumsum(meteo_day[:, :TT]),), # Pass the cumulated degree-days as input to `ToyLAIModel`, this could also be done using another model -) - -# Run the simulation: -sim_outputs = run!(models, meteo_day) -sim_outputs[1:3,:] # show the first 3 rows of the output -``` - -The output data is displayed as a by default as a `TimeStepTable`. It is also possible to filter which variables are kept via the optional `tracked_outputs` keyword argument. - -## Plotting outputs - -Using CairoMakie, one can plot out selected variables : - -!!! note - You will need to add CairoMakie to your environment through Pkg mode first. - -```@example usepkg -# Plot the results: -using CairoMakie - -fig = Figure(resolution=(800, 600)) -ax = Axis(fig[1, 1], ylabel="LAI (m² m⁻²)") -lines!(ax, sim_outputs[:TT_cu], sim_outputs[:LAI], color=:mediumseagreen) - -ax2 = Axis(fig[2, 1], xlabel="Cumulated growing degree days since sowing (°C)", ylabel="aPPFD (mol m⁻² d⁻¹)") -lines!(ax2, sim_outputs[:TT_cu], sim_outputs[:aPPFD], color=:firebrick1) - -fig -``` - -## TimeStepTables and DataFrames - -```@setup usepkg -sim_out = run!(model, meteo_day) -``` - -The output data is usually stored in a `TimeStepTable` structure defined in `PlantMeteo.jl`, which is a fast DataFrame-like structure with each time step being a [`Status`](@ref). It can be also be any `Tables.jl` structure, such as a regular `DataFrame`. Weather data is also usually stored in a `TimeStepTable` but with each time step being an `Atmosphere`. - -Another simple way to get the results is to transform the outputs into a `DataFrame`. Which is very easy because the `TimeStepTable` implements the Tables.jl interface: - -```@example usepkg -using DataFrames -sim_outputs_df = PlantSimEngine.convert_outputs(sim_outputs, DataFrame) -sim_outputs_df[[1, 2, 3, 363, 364, 365], :] -``` - -It is also possible to create DataFrames from specific variables: - -```julia -df = DataFrame(aPPFD=sim_outputs[:aPPFD][1], LAI=sim_outputs.LAI[1], Ri_PAR_f=meteo.Ri_PAR_f[1]) -``` - -Which can also be useful for [Parameter fitting ](@ref). \ No newline at end of file diff --git a/docs/test/runtests.jl b/docs/test/runtests.jl new file mode 100644 index 000000000..73b4f265c --- /dev/null +++ b/docs/test/runtests.jl @@ -0,0 +1,42 @@ +using Test + +@testset "Progressive journey structure" begin + journey_root = joinpath(@__DIR__, "..", "src", "journeys") + user_pages = sort([ + joinpath(journey_root, "users", file) + for file in readdir(joinpath(journey_root, "users")) + if endswith(file, ".md") + ]) + modeler_pages = sort([ + joinpath(journey_root, "modelers", file) + for file in readdir(joinpath(journey_root, "modelers")) + if endswith(file, ".md") + ]) + + for page in user_pages + source = read(page, String) + @test occursin("New concept", source) + @test occursin("## Page recap", source) + @test occursin("**You added:**", source) + @test occursin("**PlantSimEngine infer", source) + @test occursin("**You keep explicit:**", source) + @test occursin("**New API names:**", source) + @test !occursin("```julia", source) + end + + for page in modeler_pages + source = read(page, String) + @test occursin("**New concept:**", source) + @test occursin("## Model-author recap", source) + @test occursin("**You implemented:**", source) + @test occursin("**PlantSimEngine inferred:**", source) + @test occursin("**The scenario author keeps explicit:**", source) + @test occursin("**New API names:**", source) + @test occursin("tested", lowercase(source)) + end +end + +@testset "PlantSimEngine documentation" begin + ENV["PLANTSIMENGINE_DOCS_BUILD_ONLY"] = "true" + @test include(joinpath(@__DIR__, "..", "make.jl")) === nothing +end diff --git a/examples/Beer.jl b/examples/Beer.jl index c7069c536..bc6279359 100644 --- a/examples/Beer.jl +++ b/examples/Beer.jl @@ -12,7 +12,7 @@ PlantSimEngine.@process "light_interception" verbose = false Beer-Lambert law for light interception. Required inputs: `LAI` in m² m⁻². -Required meteorology data: `Ri_PAR_f`, the incident flux of atmospheric radiation in the +Required environment input: `Ri_PAR_f`, the incident flux of atmospheric radiation in the PAR, in W m[soil]⁻² (== J m[soil]⁻² s⁻¹). Output: aPPFD, the absorbed Photosynthetic Photon Flux Density in μmol[PAR] m[leaf]⁻² s⁻¹. @@ -21,12 +21,9 @@ struct Beer{T} <: AbstractLight_InterceptionModel k::T end -# Beer is parallelizable over time-steps and objects, so we can declare it as such using the trait: -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Beer}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Beer}) = PlantSimEngine.IsObjectIndependent() """ - run!(::Beer, object, meteo, constants=Constants(), extra=nothing) + run!(model::Beer, status, environment, constants, context) Computes the photosynthetic photon flux density (`aPPFD`, µmol m⁻² s⁻¹) absorbed by an object using the incoming PAR radiation flux (`Ri_PAR_f`, W m⁻²) and the Beer-Lambert law @@ -34,41 +31,50 @@ of light extinction. # Arguments -- `::Beer`: a Beer model, from the model list (*i.e.* m.light_interception) -- `models`: A `ModelMapping` struct holding the parameters for the model with -initialisations for `LAI` (m² m⁻²): the leaf area index. -- `status`: the status of the model, usually the model list status (*i.e.* m.status) -- `meteo`: meteorology structure, see [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere) -- `constants = PlantMeteo.Constants()`: physical constants. See `PlantMeteo.Constants` for more details -- `extra = nothing`: extra arguments, not used here. +- `model`: the current Beer model instance. +- `status`: the application-local view of the target [`Object`](@ref) status. +- `environment`: sampled environment, such as an [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere) row. +- `constants`: physical constants supplied by the [`CompositeModel`](@ref) run. +- `context`: runtime context; this kernel does not use it. # Examples ```julia -m = ModelMapping(Beer(0.5), status=(LAI=2.0,)) - -meteo = Atmosphere(T=20.0, Wind=1.0, P=101.3, Rh=0.65, Ri_PAR_q=300.0) - -run!(m, meteo) - -m[:aPPFD] +model = CompositeModel( + Beer(0.5); + status=(LAI=2.0,), + id=:leaf, + scale=:Leaf, + environment=Atmosphere( + T=20.0, + Wind=1.0, + P=101.3, + Rh=0.65, + Ri_PAR_f=300.0, + duration=Hour(1), + ), +) +run!(model) +only(model_objects(model; scale=:Leaf)).status.aPPFD ``` """ -function PlantSimEngine.run!(::Beer, models, status, meteo, constants, extra=nothing) +function PlantSimEngine.run!(model::Beer, status, environment, constants, context) status.aPPFD = - meteo.Ri_PAR_f * - (1.0 - exp(-models.light_interception.k * status.LAI)) * + environment.Ri_PAR_f * + (1.0 - exp(-model.k * status.LAI)) * constants.J_to_umol end function PlantSimEngine.inputs_(::Beer) - (LAI=-Inf,) + (LAI=Required(Real),) end -function PlantSimEngine.outputs_(::Beer) - (aPPFD=-Inf,) +function PlantSimEngine.outputs_(model::Beer) + (aPPFD=oftype(float(model.k), -Inf),) end +PlantSimEngine.environment_inputs_(::Beer) = (Ri_PAR_f=0.0,) + """ fit(::Type{Beer}, df; J_to_umol=PlantMeteo.Constants().J_to_umol) @@ -92,17 +98,27 @@ using PlantSimEngine using PlantSimEngine.Examples ``` -Create a model list with a Beer model, and fit it to the data: +Create a `CompositeModel` with one leaf object, then fit `Beer` to the data: ```julia -m = ModelMapping(Beer(0.6), status=(LAI=2.0,)) -meteo = Atmosphere(T=20.0, Wind=1.0, P=101.3, Rh=0.65, Ri_PAR_f=300.0) -run!(m, meteo) -df = DataFrame(aPPFD=m[:aPPFD][1], LAI=m.status.LAI[1], Ri_PAR_f=meteo.Ri_PAR_f[1]) -fit(Beer, df) +model = CompositeModel( + Beer(0.6); + status=(LAI=2.0,), + id=:leaf, + scale=:Leaf, + environment=environment, +) +simulation = run!(model) +leaf = final_state(simulation, One(scale=:Leaf)) +df = DataFrame(aPPFD=leaf.aPPFD, LAI=leaf.LAI, Ri_PAR_f=environment.Ri_PAR_f[1]) +Evaluation.fit(Beer, df) ``` """ -function PlantSimEngine.fit(::Type{Beer}, df; J_to_umol=PlantMeteo.Constants().J_to_umol) +function PlantSimEngine.Evaluation.fit( + ::Type{Beer}, + df; + J_to_umol=PlantMeteo.Constants().J_to_umol, +) k = Statistics.mean(-log.(1 .- df.aPPFD ./ (J_to_umol .* df.Ri_PAR_f)) ./ df.LAI) return (k=k,) -end \ No newline at end of file +end diff --git a/examples/ToyAdvancedControl.jl b/examples/ToyAdvancedControl.jl new file mode 100644 index 000000000..22c5da86e --- /dev/null +++ b/examples/ToyAdvancedControl.jl @@ -0,0 +1,121 @@ +PlantSimEngine.@process "toy_selective_call_controller" verbose = false +PlantSimEngine.@process "toy_stock_writer" verbose = false + +""" + ToySelectiveCallControllerModel( + trial_temperatures, + accepted_temperature; + selected_object, + ) + +Resolve several hard-call targets, run `selected_object` for several +unpublished trials, then publish one accepted result. +""" +struct ToySelectiveCallControllerModel{T} <: + AbstractToy_Selective_Call_ControllerModel + trial_temperatures::NTuple{2,T} + accepted_temperature::T + selected_object::Symbol +end + +function ToySelectiveCallControllerModel( + trial_temperatures::Tuple, + accepted_temperature, + ; + selected_object, +) + length(trial_temperatures) == 2 || error( + "ToySelectiveCallControllerModel needs exactly two trial temperatures.", + ) + values = promote( + float(trial_temperatures[1]), + float(trial_temperatures[2]), + float(accepted_temperature), + ) + T = typeof(values[1]) + return ToySelectiveCallControllerModel{T}( + (values[1], values[2]), + values[3], + Symbol(selected_object), + ) +end + +PlantSimEngine.inputs_(::ToySelectiveCallControllerModel) = NamedTuple() +PlantSimEngine.dep(::ToySelectiveCallControllerModel) = ( + readers=Call(Many( + scale=:Leaf, + process=:toy_environment_reader, + within=Subtree(), + )), +) +function PlantSimEngine.outputs_(model::ToySelectiveCallControllerModel) + initial = zero(model.accepted_temperature) + return ( + target_count=0, + trial_temperature_seen=initial, + accepted_temperature_seen=initial, + ) +end + +function PlantSimEngine.run!( + model::ToySelectiveCallControllerModel, + status, + environment, + constants, + context, +) + targets = call_targets(context, :readers) + status.target_count = length(targets) + selected = only(call_targets( + context, + :readers; + objects=(ObjectId(model.selected_object),), + )) + + for temperature in model.trial_temperatures + run_call!( + selected; + sampled_environment=(T=temperature,), + publish=false, + ) + end + status.trial_temperature_seen = selected.status.temperature_seen + + run_call!( + selected; + sampled_environment=(T=model.accepted_temperature,), + publish=true, + ) + status.accepted_temperature_seen = selected.status.temperature_seen + return nothing +end + +""" + ToyStockWriterModel(value) + +Write one configured stock value. Several named applications of this model can +demonstrate canonical writer ordering and stream-only output routing. +""" +struct ToyStockWriterModel{T} <: AbstractToy_Stock_WriterModel + value::T +end + +function ToyStockWriterModel(value::Real) + parameter = float(value) + return ToyStockWriterModel{typeof(parameter)}(parameter) +end + +PlantSimEngine.inputs_(::ToyStockWriterModel) = NamedTuple() +PlantSimEngine.outputs_(model::ToyStockWriterModel) = + (stock=zero(model.value),) + +function PlantSimEngine.run!( + model::ToyStockWriterModel, + status, + environment, + constants, + context, +) + status.stock = model.value + return nothing +end diff --git a/examples/ToyAssimGrowthModel.jl b/examples/ToyAssimGrowthModel.jl index cda5f167f..7c52ea6ca 100644 --- a/examples/ToyAssimGrowthModel.jl +++ b/examples/ToyAssimGrowthModel.jl @@ -41,31 +41,37 @@ end # Define inputs: function PlantSimEngine.inputs_(::ToyAssimGrowthModel) - (aPPFD=-Inf,) + (aPPFD=Required(Real),) end # Define outputs: -function PlantSimEngine.outputs_(::ToyAssimGrowthModel) - (carbon_assimilation=-Inf, Rm=-Inf, Rg=-Inf, biomass_increment=-Inf, biomass=0.0) +function PlantSimEngine.outputs_(model::ToyAssimGrowthModel) + initial = oftype(model.LUE, -Inf) + return ( + carbon_assimilation=initial, + Rm=initial, + Rg=initial, + biomass_increment=initial, + biomass=zero(model.LUE), + ) end # Tells Julia what is the type of elements: Base.eltype(x::ToyAssimGrowthModel{T}) where {T} = T # Implement the growth model: -function PlantSimEngine.run!(::ToyAssimGrowthModel, models, status, meteo, constants, extra) +function PlantSimEngine.run!(model::ToyAssimGrowthModel, status, environment, constants, context) # The assimilation is simply the absorbed photosynthetic photon flux density (aPPFD) times the light use efficiency (LUE): - status.carbon_assimilation = status.aPPFD * models.growth.LUE + status.carbon_assimilation = status.aPPFD * model.LUE # The maintenance respiration is simply a factor of the assimilation: - status.Rm = status.carbon_assimilation * models.growth.Rm_factor - # Note that we use models.growth.Rm_factor to access the parameter of the model + status.Rm = status.carbon_assimilation * model.Rm_factor # Net primary productivity of the plant (NPP) is the assimilation minus the maintenance respiration: NPP = status.carbon_assimilation - status.Rm # The NPP is used with a cost (growth respiration Rg): - status.Rg = 1 - (NPP / models.growth.Rg_cost) + status.Rg = 1 - (NPP / model.Rg_cost) # The biomass increment is the NPP minus the growth respiration: status.biomass_increment = NPP - status.Rg @@ -73,6 +79,3 @@ function PlantSimEngine.run!(::ToyAssimGrowthModel, models, status, meteo, const # The biomass is the biomass from the previous time-step plus the biomass increment: status.biomass += status.biomass_increment end - -# And optionally, we can tell PlantSimEngine that we can safely parallelize our model over space (objects): -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyAssimGrowthModel}) = PlantSimEngine.IsObjectIndependent() \ No newline at end of file diff --git a/examples/ToyAssimModel.jl b/examples/ToyAssimModel.jl index 7ad0f2ed8..84eee12db 100644 --- a/examples/ToyAssimModel.jl +++ b/examples/ToyAssimModel.jl @@ -39,24 +39,19 @@ end # Define inputs: function PlantSimEngine.inputs_(::ToyAssimModel) - (aPPFD=-Inf, soil_water_content=-Inf) + (aPPFD=Required(Real), soil_water_content=Required(Real)) end # Define outputs: -function PlantSimEngine.outputs_(::ToyAssimModel) - (carbon_assimilation=-Inf,) +function PlantSimEngine.outputs_(model::ToyAssimModel) + (carbon_assimilation=oftype(float(model.LUE), -Inf),) end # Tells Julia what is the type of elements: Base.eltype(::ToyAssimModel{T}) where {T} = T # Implement the model: -function PlantSimEngine.run!(::ToyAssimModel, models, status, meteo, constants, extra) +function PlantSimEngine.run!(model::ToyAssimModel, status, environment, constants, context) # The assimilation is simply the absorbed photosynthetic photon flux density (aPPFD) times the light use efficiency (LUE): - status.carbon_assimilation = status.aPPFD * models.carbon_assimilation.LUE * status.soil_water_content + status.carbon_assimilation = status.aPPFD * model.LUE * status.soil_water_content end - -# And optionally, we can tell PlantSimEngine that we can safely parallelize our model over space (objects): -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyAssimModel}) = PlantSimEngine.IsObjectIndependent() -# And also over time (time-steps): -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyAssimModel}) = PlantSimEngine.IsTimeStepIndependent() \ No newline at end of file diff --git a/examples/ToyCAllocationModel.jl b/examples/ToyCAllocationModel.jl index db6666152..a14c4b754 100644 --- a/examples/ToyCAllocationModel.jl +++ b/examples/ToyCAllocationModel.jl @@ -31,7 +31,11 @@ struct ToyCAllocationModel <: AbstractCarbon_AllocationModel end # Define inputs: function PlantSimEngine.inputs_(::ToyCAllocationModel) - (carbon_assimilation=[-Inf], Rm=-Inf, carbon_demand=[-Inf],) + ( + carbon_assimilation=Required(AbstractVector{<:Real}), + Rm=Required(Real), + carbon_demand=Required(AbstractVector{<:Real}), + ) end # Define outputs: @@ -39,7 +43,7 @@ function PlantSimEngine.outputs_(::ToyCAllocationModel) (carbon_offer=-Inf, carbon_allocation=[-Inf],) end -function PlantSimEngine.run!(::ToyCAllocationModel, models, status, meteo, constants, extra_args) +function PlantSimEngine.run!(::ToyCAllocationModel, status, environment, constants, context) carbon_demand_tot = sum(status.carbon_demand) #Note: this model is multiscale, so status.carbon_demand, status.carbon_allocation, and status.carbon_assimilation are vectors. @@ -68,5 +72,5 @@ function PlantSimEngine.run!(::ToyCAllocationModel, models, status, meteo, const end end -# Can be parallelized over time-steps, but not objects (we have vectors of values coming from other objects as input): -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyCAllocationModel}) = PlantSimEngine.IsTimeStepIndependent() +# This model reads values from several objects, so object-level independence +# must not be assumed by a future executor. diff --git a/examples/ToyCBiomassModel.jl b/examples/ToyCBiomassModel.jl index d2dd19d8d..ce2b36c9a 100644 --- a/examples/ToyCBiomassModel.jl +++ b/examples/ToyCBiomassModel.jl @@ -28,19 +28,21 @@ end # Define inputs: function PlantSimEngine.inputs_(::ToyCBiomassModel) - (carbon_allocation=-Inf,) + (carbon_allocation=Required(Real),) end # Define outputs: -function PlantSimEngine.outputs_(::ToyCBiomassModel) - (carbon_biomass_increment=-Inf, carbon_biomass=0.0, growth_respiration=-Inf,) +function PlantSimEngine.outputs_(model::ToyCBiomassModel) + initial = oftype(float(model.construction_cost), -Inf) + return ( + carbon_biomass_increment=initial, + carbon_biomass=zero(float(model.construction_cost)), + growth_respiration=initial, + ) end -function PlantSimEngine.run!(m::ToyCBiomassModel, models, status, meteo, constants, extra_args) +function PlantSimEngine.run!(m::ToyCBiomassModel, status, environment, constants, context) status.carbon_biomass_increment = status.carbon_allocation / m.construction_cost status.carbon_biomass += status.carbon_biomass_increment status.growth_respiration = status.carbon_allocation - status.carbon_biomass_increment end - -# Can be parallelized over organs (but not time-steps, as it is incrementally updating the biomass in the status): -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyCBiomassModel}) = PlantSimEngine.IsObjectIndependent() \ No newline at end of file diff --git a/examples/ToyCDemandModel.jl b/examples/ToyCDemandModel.jl index b376aa83c..1548840c5 100644 --- a/examples/ToyCDemandModel.jl +++ b/examples/ToyCDemandModel.jl @@ -31,29 +31,28 @@ end # Instantiate the `struct` with keyword arguments and default values: function ToyCDemandModel(; optimal_biomass, development_duration) - ToyCDemandModel(optimal_biomass, development_duration) + parameters = promote(float(optimal_biomass), float(development_duration)) + return ToyCDemandModel(parameters...) end # Define inputs: function PlantSimEngine.inputs_(::ToyCDemandModel) - (TT=-Inf,) + (TT=Required(Real),) end # Define outputs: -function PlantSimEngine.outputs_(::ToyCDemandModel) - (carbon_demand=-Inf,) +function PlantSimEngine.outputs_(model::ToyCDemandModel) + (carbon_demand=oftype(model.optimal_biomass, -Inf),) end # Tells Julia what is the type of elements: Base.eltype(::ToyCDemandModel{T}) where {T} = T # Implement the growth model: -function PlantSimEngine.run!(::ToyCDemandModel, models, status, meteo, constants, extra) +function PlantSimEngine.run!(model::ToyCDemandModel, status, environment, constants, context) # The carbon demand is simply the biomass under optimal conditions divided by the duration of the development: - status.carbon_demand = status.TT * models.carbon_demand.optimal_biomass / models.carbon_demand.development_duration + status.carbon_demand = + status.TT * + model.optimal_biomass / + model.development_duration end - -# And optionally, we can tell PlantSimEngine that we can safely parallelize our model over space (objects): -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyCDemandModel}) = PlantSimEngine.IsObjectIndependent() -# And also over time (time-steps): -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyCDemandModel}) = PlantSimEngine.IsTimeStepIndependent() \ No newline at end of file diff --git a/examples/ToyDegreeDays.jl b/examples/ToyDegreeDays.jl index 72d77b70c..95d59565a 100644 --- a/examples/ToyDegreeDays.jl +++ b/examples/ToyDegreeDays.jl @@ -11,26 +11,28 @@ Computes the thermal time in degree days and cumulated degree-days based on the the initial cumulated degree days, the base temperature below which there is no growth, and the maximum temperature for growh. """ -struct ToyDegreeDaysCumulModel <: AbstractDegreedaysModel - init_TT::Float64 - T_base::Float64 - T_max::Float64 +struct ToyDegreeDaysCumulModel{T<:Real} <: AbstractDegreedaysModel + init_TT::T + T_base::T + T_max::T end # Defining default values: -ToyDegreeDaysCumulModel(; init_TT=0.0, T_base=10.0, T_max=43.0) = ToyDegreeDaysCumulModel(init_TT, T_base, T_max) +function ToyDegreeDaysCumulModel(; init_TT=0.0, T_base=10.0, T_max=43.0) + parameters = promote(float(init_TT), float(T_base), float(T_max)) + return ToyDegreeDaysCumulModel(parameters...) +end # Defining the inputs and outputs of the model: PlantSimEngine.inputs_(::ToyDegreeDaysCumulModel) = NamedTuple() -PlantSimEngine.outputs_(m::ToyDegreeDaysCumulModel) = (TT=-Inf, TT_cu=0.0,) +PlantSimEngine.outputs_(m::ToyDegreeDaysCumulModel) = ( + TT=oftype(m.init_TT, -Inf), + TT_cu=m.init_TT, +) +PlantSimEngine.environment_inputs_(m::ToyDegreeDaysCumulModel) = (T=zero(m.T_base),) # Implementing the actual algorithm by adding a method to the run! function for our model: -function PlantSimEngine.run!(m::ToyDegreeDaysCumulModel, models, status, meteo, constants=nothing, extra=nothing) - status.TT = max(0.0, min(meteo.T, m.T_max) - m.T_base) +function PlantSimEngine.run!(m::ToyDegreeDaysCumulModel, status, environment, constants, context) + status.TT = max(zero(m.T_base), min(environment.T, m.T_max) - m.T_base) status.TT_cu += status.TT end - -# The computation of ToyDegreeDaysCumulModel dependents on previous values, but it is independent of other objects. -# The default trait is that models are dependent of other time-steps and object. So we need to change the default trait -# for objects: -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyDegreeDaysCumulModel}) = PlantSimEngine.IsObjectIndependent() \ No newline at end of file diff --git a/examples/ToyInternodeEmergence.jl b/examples/ToyInternodeEmergence.jl deleted file mode 100644 index b43cfd58d..000000000 --- a/examples/ToyInternodeEmergence.jl +++ /dev/null @@ -1,36 +0,0 @@ - -# Declaring the process of LAI dynamic: -PlantSimEngine.@process "organ_emergence" verbose = false - -# Declaring the model of LAI dynamic with its parameter values: - -""" - ToyInternodeEmergence(;init_TT=0.0, TT_emergence = 300) - -Computes the organ emergence based on cumulated thermal time since last event. -""" -struct ToyInternodeEmergence <: AbstractOrgan_EmergenceModel - TT_emergence::Float64 -end - -# Defining default values: -ToyInternodeEmergence(; TT_emergence=300.0) = ToyInternodeEmergence(TT_emergence) - -# Defining the inputs and outputs of the model: -PlantSimEngine.inputs_(m::ToyInternodeEmergence) = (TT_cu=-Inf,) -PlantSimEngine.outputs_(m::ToyInternodeEmergence) = (TT_cu_emergence=0.0,) - -# Implementing the actual algorithm by adding a method to the run! function for our model: -function PlantSimEngine.run!(m::ToyInternodeEmergence, models, status, meteo, constants=nothing, sim_object=nothing) - - if length(MultiScaleTreeGraph.children(status.node)) == 1 && status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - # NB: the node can produce one leaf, and one internode only, so we check that it did not produce - # any internode yet. - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - - status_new_internode.TT_cu_emergence = status.TT_cu - end - - return nothing -end \ No newline at end of file diff --git a/examples/ToyLAIModel.jl b/examples/ToyLAIModel.jl index 081c8824f..0c7bcd821 100644 --- a/examples/ToyLAIModel.jl +++ b/examples/ToyLAIModel.jl @@ -26,51 +26,56 @@ Computes the Leaf Area Index (LAI) based on a sigmoid function of thermal time. - `LAI`: the Leaf Area Index, usually in m² m⁻² """ -struct ToyLAIModel <: AbstractLai_DynamicModel - max_lai::Float64 - dd_incslope::Int - inc_slope::Float64 - dd_decslope::Int - dec_slope::Float64 +struct ToyLAIModel{T<:Real} <: AbstractLai_DynamicModel + max_lai::T + dd_incslope::T + inc_slope::T + dd_decslope::T + dec_slope::T end # Defining a method with keyword arguments and default values: -ToyLAIModel(; max_lai=8.0, dd_incslope=800, inc_slope=110, dd_decslope=1500, dec_slope=20) = ToyLAIModel(max_lai, dd_incslope, inc_slope, dd_decslope, dec_slope) +function ToyLAIModel(; max_lai=8.0, dd_incslope=800, inc_slope=110, dd_decslope=1500, dec_slope=20) + parameters = promote( + float(max_lai), + float(dd_incslope), + float(inc_slope), + float(dd_decslope), + float(dec_slope), + ) + return ToyLAIModel(parameters...) +end # Defining the inputs and outputs of the model: -PlantSimEngine.inputs_(::ToyLAIModel) = (TT_cu=-Inf,) -PlantSimEngine.outputs_(::ToyLAIModel) = (LAI=-Inf,) +PlantSimEngine.inputs_(::ToyLAIModel) = (TT_cu=Required(Real),) +PlantSimEngine.outputs_(model::ToyLAIModel) = (LAI=oftype(model.max_lai, -Inf),) # Implementing the actual algorithm by adding a method to the run! function for our model: -function PlantSimEngine.run!(::ToyLAIModel, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(model::ToyLAIModel, status, environment, constants, context) status.LAI = - models.LAI_Dynamic.max_lai * - (1.0 / - (1.0 + exp((models.LAI_Dynamic.dd_incslope - status.TT_cu) / models.LAI_Dynamic.inc_slope)) - - 1.0 / (1.0 + exp((models.LAI_Dynamic.dd_decslope - status.TT_cu) / models.LAI_Dynamic.dec_slope)) + model.max_lai * + (one(model.max_lai) / + (one(model.max_lai) + exp((model.dd_incslope - status.TT_cu) / model.inc_slope)) - + one(model.max_lai) / (one(model.max_lai) + exp((model.dd_decslope - status.TT_cu) / model.dec_slope)) ) - if status.LAI < 0.0 - status.LAI = 0.0 + if status.LAI < zero(model.max_lai) + status.LAI = zero(model.max_lai) end end -# The computation of ToyLAIModel is independant of previous values and other objects. We can add this information as -# traits to the model to tell PlantSimEngine that it is safe to run the models in parallel: -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLAIModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyLAIModel}) = PlantSimEngine.IsObjectIndependent() - - +# ToyLAIModel is independent of previous values and other objects. The current +# public runtime remains sequential and owns execution policy. -# A second model at scene scale: +# A second model at model scale: """ ToyLAIfromLeafAreaModel() -Computes the Leaf Area Index (LAI) of the scene based on the plants leaf area. +Computes the Leaf Area Index (LAI) of the model based on the plants leaf area. # Arguments -- `scene_area`: the area of the scene, usually in m² +- `scene_area`: the area of the model, usually in m² # Inputs @@ -78,7 +83,7 @@ Computes the Leaf Area Index (LAI) of the scene based on the plants leaf area. # Outputs -- `LAI`: the Leaf Area Index of the scene, usually in m² m⁻² +- `LAI`: the Leaf Area Index of the model, usually in m² m⁻² - `total_surface`: the total surface of the plants, usually in m² """ struct ToyLAIfromLeafAreaModel{T} <: AbstractLai_DynamicModel @@ -86,14 +91,19 @@ struct ToyLAIfromLeafAreaModel{T} <: AbstractLai_DynamicModel end # Defining the inputs and outputs of the model: -PlantSimEngine.inputs_(::ToyLAIfromLeafAreaModel) = (plant_surfaces=[-Inf],) -PlantSimEngine.outputs_(::ToyLAIfromLeafAreaModel) = (LAI=-Inf, total_surface=-Inf) +PlantSimEngine.inputs_(::ToyLAIfromLeafAreaModel) = ( + plant_surfaces=Required(AbstractVector{<:Real}), +) +PlantSimEngine.outputs_(m::ToyLAIfromLeafAreaModel) = ( + LAI=oftype(float(m.scene_area), -Inf), + total_surface=oftype(float(m.scene_area), -Inf), +) # Implementing the actual algorithm by adding a method to the run! function for our model: -function PlantSimEngine.run!(m::ToyLAIfromLeafAreaModel, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(m::ToyLAIfromLeafAreaModel, status, environment, constants, context) status.total_surface = sum(status.plant_surfaces) status.LAI = status.total_surface / m.scene_area end -# The computation of ToyLAIfromLeafAreaModel is independant of previous values so we can compute it in parallel over time-steps: -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLAIfromLeafAreaModel}) = PlantSimEngine.IsTimeStepIndependent() +# ToyLAIfromLeafAreaModel is independent of previous values, but execution +# policy remains owned by the runtime. diff --git a/examples/ToyLeafSurfaceModel.jl b/examples/ToyLeafSurfaceModel.jl index b120745c4..cf8e6a716 100644 --- a/examples/ToyLeafSurfaceModel.jl +++ b/examples/ToyLeafSurfaceModel.jl @@ -27,21 +27,19 @@ end # Define inputs: function PlantSimEngine.inputs_(::ToyLeafSurfaceModel) - (carbon_biomass=-Inf,) + (carbon_biomass=Required(Real),) end # Define outputs: -function PlantSimEngine.outputs_(::ToyLeafSurfaceModel) - (surface=-Inf,) +function PlantSimEngine.outputs_(model::ToyLeafSurfaceModel) + (surface=oftype(float(model.SLA), -Inf),) end -function PlantSimEngine.run!(m::ToyLeafSurfaceModel, models, status, meteo, constants, extra_args) +function PlantSimEngine.run!(m::ToyLeafSurfaceModel, status, environment, constants, context) status.surface = status.carbon_biomass * m.SLA end # Can be parallelized over organs and time-steps: -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyLeafSurfaceModel}) = PlantSimEngine.IsObjectIndependent() -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLeafSurfaceModel}) = PlantSimEngine.IsTimeStepDependent() @@ -64,7 +62,7 @@ struct ToyPlantLeafSurfaceModel <: AbstractLeaf_SurfaceModel end # Define inputs: function PlantSimEngine.inputs_(::ToyPlantLeafSurfaceModel) - (leaf_surfaces=[-Inf],) + (leaf_surfaces=Required(AbstractVector{<:Real}),) end # Define outputs: @@ -72,9 +70,6 @@ function PlantSimEngine.outputs_(::ToyPlantLeafSurfaceModel) (surface=-Inf,) end -function PlantSimEngine.run!(m::ToyPlantLeafSurfaceModel, models, status, meteo, constants, extra_args) +function PlantSimEngine.run!(m::ToyPlantLeafSurfaceModel, status, environment, constants, context) status.surface = sum(status.leaf_surfaces) end - -# Can be parallelized over time-steps: -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyPlantLeafSurfaceModel}) = PlantSimEngine.IsTimeStepDependent() \ No newline at end of file diff --git a/examples/ToyLightPartitioningModel.jl b/examples/ToyLightPartitioningModel.jl index 3f43c009f..77db042fa 100644 --- a/examples/ToyLightPartitioningModel.jl +++ b/examples/ToyLightPartitioningModel.jl @@ -11,7 +11,7 @@ Computes the light partitioning based on relative surface. # Inputs -- `aPPFD`: the absorbed photosynthetic photon flux density at the larger scale (*e.g.* scene), in mol[PAR] m⁻² time-step⁻¹ +- `aPPFD`: the absorbed photosynthetic photon flux density at the larger scale (*e.g.* model), in mol[PAR] m⁻² time-step⁻¹ # Outputs @@ -24,13 +24,15 @@ Computes the light partitioning based on relative surface. struct ToyLightPartitioningModel <: AbstractLight_PartitioningModel end # Define inputs: -PlantSimEngine.inputs_(::ToyLightPartitioningModel) = (aPPFD_larger_scale=-Inf, total_surface=-Inf, surface=-Inf,) +PlantSimEngine.inputs_(::ToyLightPartitioningModel) = ( + aPPFD_larger_scale=Required(Real), + total_surface=Required(Real), + surface=Required(Real), +) # Define outputs: PlantSimEngine.outputs_(::ToyLightPartitioningModel) = (aPPFD=-Inf,) -function PlantSimEngine.run!(::ToyLightPartitioningModel, models, status, meteo, constants, extra) +function PlantSimEngine.run!(::ToyLightPartitioningModel, status, environment, constants, context) status.aPPFD = status.aPPFD_larger_scale * status.surface / status.total_surface end - -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLightPartitioningModel}) = PlantSimEngine.IsTimeStepIndependent() \ No newline at end of file diff --git a/examples/ToyMaintenanceRespirationModel.jl b/examples/ToyMaintenanceRespirationModel.jl index 492e039e3..32c50806c 100644 --- a/examples/ToyMaintenanceRespirationModel.jl +++ b/examples/ToyMaintenanceRespirationModel.jl @@ -30,13 +30,41 @@ struct ToyMaintenanceRespirationModel{T} <: AbstractMaintenance_RespirationModel nitrogen_content::T end -PlantSimEngine.inputs_(::ToyMaintenanceRespirationModel) = (carbon_biomass=0.0,) -PlantSimEngine.outputs_(::ToyMaintenanceRespirationModel) = (Rm=-Inf,) +function ToyMaintenanceRespirationModel(Q10, Rm_base, T_ref, P_alive, nitrogen_content) + parameters = promote( + float(Q10), + float(Rm_base), + float(T_ref), + float(P_alive), + float(nitrogen_content), + ) + return ToyMaintenanceRespirationModel{typeof(first(parameters))}(parameters...) +end -function PlantSimEngine.run!(m::ToyMaintenanceRespirationModel, models, status, meteo, constants, extra=nothing) +PlantSimEngine.inputs_(::ToyMaintenanceRespirationModel) = ( + carbon_biomass=Required(Real), +) +PlantSimEngine.outputs_(model::ToyMaintenanceRespirationModel) = ( + Rm=oftype(model.Rm_base, -Inf), +) +PlantSimEngine.environment_inputs_( + model::ToyMaintenanceRespirationModel, +) = (T=zero(model.T_ref),) + +function PlantSimEngine.run!( + model::ToyMaintenanceRespirationModel, + status, + environment, + constants, + context, +) status.Rm = - status.carbon_biomass * m.P_alive * m.nitrogen_content * m.Rm_base * - m.Q10^((meteo.T - m.T_ref) / 10.0) + status.carbon_biomass * + model.P_alive * + model.nitrogen_content * + model.Rm_base * + model.Q10^((environment.T - model.T_ref) / 10) + return nothing end """ @@ -44,7 +72,7 @@ end Total plant maintenance respiration based on the sum of `Rm_organs`, the maintenance respiration of the organs. -# Intputs +# Inputs - `Rm_organs`: a vector of maintenance respiration from all organs in the plant in gC time-step⁻¹ @@ -54,9 +82,18 @@ Total plant maintenance respiration based on the sum of `Rm_organs`, the mainten """ struct ToyPlantRmModel <: AbstractMaintenance_RespirationModel end -PlantSimEngine.inputs_(::ToyPlantRmModel) = (Rm_organs=[-Inf],) +PlantSimEngine.inputs_(::ToyPlantRmModel) = ( + Rm_organs=Required(AbstractVector{<:Real}), +) PlantSimEngine.outputs_(::ToyPlantRmModel) = (Rm=-Inf,) -function PlantSimEngine.run!(::ToyPlantRmModel, models, status, meteo, constants, extra=nothing) +function PlantSimEngine.run!( + ::ToyPlantRmModel, + status, + environment, + constants, + context, +) status.Rm = sum(status.Rm_organs) -end \ No newline at end of file + return nothing +end diff --git a/examples/ToyModelDeveloper.jl b/examples/ToyModelDeveloper.jl new file mode 100644 index 000000000..ca32f9886 --- /dev/null +++ b/examples/ToyModelDeveloper.jl @@ -0,0 +1,82 @@ +PlantSimEngine.@process "toy_development" verbose = false +PlantSimEngine.@process "toy_daily_development" verbose = false + +""" + ToyDevelopmentModel(efficiency) + +Compute one growth increment from required thermal time and an optional stress +factor. + +# Inputs + +- `TT`: required thermal time for the current step. +- `stress`: dimensionless stress factor, defaulting to `1.0`. + +# Outputs + +- `growth`: growth increment for the current step. +""" +struct ToyDevelopmentModel{T} <: AbstractToy_DevelopmentModel + efficiency::T +end + +function ToyDevelopmentModel(efficiency::Real) + parameter = float(efficiency) + return ToyDevelopmentModel{typeof(parameter)}(parameter) +end + +PlantSimEngine.inputs_(::ToyDevelopmentModel) = ( + TT=Required(Real), + stress=Default(1.0), +) +PlantSimEngine.outputs_(model::ToyDevelopmentModel) = ( + growth=zero(model.efficiency), +) + +function PlantSimEngine.run!( + model::ToyDevelopmentModel, + status, + environment, + constants, + context, +) + status.growth = model.efficiency * status.TT * status.stress + return nothing +end + +""" + ToyDailyDevelopmentModel(increment) + +Accumulate one configured growth increment every 24 simulation steps. The model +declares this default cadence and hold-last output semantics. +""" +struct ToyDailyDevelopmentModel{T} <: + AbstractToy_Daily_DevelopmentModel + increment::T +end + +function ToyDailyDevelopmentModel(increment::Real) + parameter = float(increment) + return ToyDailyDevelopmentModel{typeof(parameter)}(parameter) +end + +PlantSimEngine.inputs_(::ToyDailyDevelopmentModel) = NamedTuple() +PlantSimEngine.outputs_(model::ToyDailyDevelopmentModel) = ( + daily_growth=zero(model.increment), +) +PlantSimEngine.timespec(::Type{<:ToyDailyDevelopmentModel}) = + ClockSpec(24.0, 1.0) +PlantSimEngine.output_policy(::Type{<:ToyDailyDevelopmentModel}) = ( + daily_growth=HoldLast(), +) + +function PlantSimEngine.run!( + model::ToyDailyDevelopmentModel, + status, + environment, + constants, + context, +) + status.daily_growth += model.increment + return nothing +end diff --git a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation1.jl b/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation1.jl deleted file mode 100644 index 120ad9f95..000000000 --- a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation1.jl +++ /dev/null @@ -1,140 +0,0 @@ - -########################################### -# Toy plant model -# Physiologically meaningless but illustrates organ creation -########################################### - -function get_n_leaves(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - nleaves = length(MultiScaleTreeGraph.traverse(root, x -> 1, symbol=:Leaf)) - return nleaves -end - -PlantSimEngine.@process "organ_emergence" verbose = false - -struct ToyCustomInternodeEmergence{T} <: AbstractOrgan_EmergenceModel - TT_emergence::T - carbon_internode_creation_cost::T - leaf_surface_area::T - leaves_max_surface_area::T -end - -ToyCustomInternodeEmergence(; TT_emergence=300.0, carbon_internode_creation_cost=200.0, leaf_surface_area=3.0, leaves_max_surface_area=100.0) = ToyCustomInternodeEmergence(TT_emergence, carbon_internode_creation_cost, leaf_surface_area, leaves_max_surface_area) - -PlantSimEngine.inputs_(m::ToyCustomInternodeEmergence) = (TT_cu=0.0, carbon_stock=0.0) -PlantSimEngine.outputs_(m::ToyCustomInternodeEmergence) = (TT_cu_emergence=0.0, carbon_organ_creation_consumed=0.0) - -function PlantSimEngine.run!(m::ToyCustomInternodeEmergence, models, status, meteo, constants=nothing, sim_object=nothing) - - leaves_surface_area = m.leaf_surface_area * get_n_leaves(status.node) - status.carbon_organ_creation_consumed = 0.0 - - if leaves_surface_area > m.leaves_max_surface_area - return nothing - end - - # if not enough carbon, no organ creation - if status.carbon_stock < m.carbon_internode_creation_cost - return nothing - end - - if length(MultiScaleTreeGraph.children(status.node)) == 2 && - status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - - status_new_internode.TT_cu_emergence = m.TT_emergence - status.TT_cu - status.carbon_organ_creation_consumed = m.carbon_internode_creation_cost - end - - return nothing -end - -########################## -### Model accumulating carbon resources -########################## - -PlantSimEngine.@process "resource_stock_computation" verbose = false - -struct ToyStockComputationModel <: AbstractResource_Stock_ComputationModel -end - -PlantSimEngine.inputs_(::ToyStockComputationModel) = - (carbon_captured=0.0, carbon_organ_creation_consumed=0.0) - -PlantSimEngine.outputs_(::ToyStockComputationModel) = (carbon_stock=-Inf,) - -function PlantSimEngine.run!(m::ToyStockComputationModel, models, status, meteo, constants=nothing, extra=nothing) - status.carbon_stock += sum(status.carbon_captured) - sum(status.carbon_organ_creation_consumed) -end - -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyStockComputationModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyStockComputationModel}) = PlantSimEngine.IsObjectIndependent() - -######################## -## Leaf model capturing some arbitrary carbon quantity -######################## - -PlantSimEngine.@process "leaf_carbon_capture" verbose = false - -struct ToyLeafCarbonCaptureModel <: AbstractLeaf_Carbon_CaptureModel end - -function PlantSimEngine.inputs_(::ToyLeafCarbonCaptureModel) - NamedTuple()#(TT_cu=-Inf) -end - -function PlantSimEngine.outputs_(::ToyLeafCarbonCaptureModel) - (carbon_captured=0.0,) -end - -function PlantSimEngine.run!(::ToyLeafCarbonCaptureModel, models, status, meteo, constants, extra) - # very crude approximation with LAI of 1 and constant aPPFD - status.carbon_captured = 200.0 * (1.0 - exp(-0.2)) -end - -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyLeafCarbonCaptureModel}) = PlantSimEngine.IsObjectIndependent() -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLeafCarbonCaptureModel}) = PlantSimEngine.IsTimeStepIndependent() - -mapping = ModelMapping( - :Scene => ToyDegreeDaysCumulModel(), - :Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured => [:Leaf], - :carbon_organ_creation_consumed => [:Internode] - ], - ), - Status(carbon_stock=0.0) - ), - :Internode => ( - MultiScaleModel( - model=ToyCustomInternodeEmergence(),#TT_emergence=20.0), - mapped_variables=[:TT_cu => (:Scene => :TT_cu), - PreviousTimeStep(:carbon_stock) => (:Plant => :carbon_stock)], - ), - Status(carbon_organ_creation_consumed=0.0), - ), - :Leaf => (ToyLeafCarbonCaptureModel(),), -) - -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) -#MultiScaleTreeGraph.Node(mtg, MultiScaleTreeGraph.NodeMTG("/", :Soil, 1, 1)) -plant = MultiScaleTreeGraph.Node(mtg, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -internode1 = MultiScaleTreeGraph.Node(plant, MultiScaleTreeGraph.NodeMTG("/", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -internode2 = MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("<", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - - -meteo_day = CSV.read(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), DataFrame, header=18) - -outs = run!(mtg, mapping, meteo_day) -mtg - -length(MultiScaleTreeGraph.traverse(mtg, x -> x, symbol=:Leaf)) diff --git a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation2.jl b/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation2.jl deleted file mode 100644 index 15b3ec356..000000000 --- a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation2.jl +++ /dev/null @@ -1,235 +0,0 @@ -########################################### -# Toy plant model -# Physiologically and physically completely meaningless -# (no dimension for units, arbitrary values, stores water and carbon in abstract stocks, -# arbitrary max leaf count and root length, constant and non-coupled photosynthesis and water absorption, ...) -# But it should illustrate the basics of simulating a growing multiscale plant with PlantSimEngine's model approach -########################################### - -function get_root_end_node(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return MultiScaleTreeGraph.traverse(root, x -> x, symbol=:Root, filter_fun=MultiScaleTreeGraph.isleaf) -end - -function get_roots_count(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return length(MultiScaleTreeGraph.traverse(root, x -> x, symbol=:Root)) -end - -function get_n_leaves(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - nleaves = length(MultiScaleTreeGraph.traverse(root, x -> 1, symbol=:Leaf)) - return nleaves -end - -PlantSimEngine.@process "organ_emergence" verbose = false - -struct ToyCustomInternodeEmergence{T} <: AbstractOrgan_EmergenceModel - TT_emergence::T - carbon_internode_creation_cost::T - leaf_surface_area::T - leaves_max_surface_area::T - water_leaf_threshold::T -end - -ToyCustomInternodeEmergence(; TT_emergence=300.0, carbon_internode_creation_cost=200.0, leaf_surface_area=3.0, leaves_max_surface_area=100.0, - water_leaf_threshold=30.0) = ToyCustomInternodeEmergence(TT_emergence, carbon_internode_creation_cost, leaf_surface_area, leaves_max_surface_area, water_leaf_threshold) - -PlantSimEngine.inputs_(m::ToyCustomInternodeEmergence) = (TT_cu=0.0, water_stock=0.0, carbon_stock=0.0) -PlantSimEngine.outputs_(m::ToyCustomInternodeEmergence) = (TT_cu_emergence=0.0, carbon_organ_creation_consumed=0.0) - -function PlantSimEngine.run!(m::ToyCustomInternodeEmergence, models, status, meteo, constants=nothing, sim_object=nothing) - - leaves_surface_area = m.leaf_surface_area * get_n_leaves(status.node) - status.carbon_organ_creation_consumed = 0.0 - - if leaves_surface_area > m.leaves_max_surface_area - return nothing - end - - # if water levels are low, prioritise roots - if status.water_stock < m.water_leaf_threshold - return nothing - end - - # if not enough carbon, no organ creation - if status.carbon_stock < m.carbon_internode_creation_cost - return nothing - end - - if length(MultiScaleTreeGraph.children(status.node)) == 2 && - status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - - status_new_internode.TT_cu_emergence = m.TT_emergence - status.TT_cu - status.carbon_organ_creation_consumed = m.carbon_internode_creation_cost - end - - return nothing -end - -############################ -# Naive water absorption model -# Absorbs precipitation water depending on quantity of roots -############################ -PlantSimEngine.@process "water_absorption" verbose = false - -struct ToyWaterAbsorptionModel <: AbstractWater_AbsorptionModel -end - -PlantSimEngine.inputs_(::ToyWaterAbsorptionModel) = (root_water_assimilation=1.0,) -PlantSimEngine.outputs_(::ToyWaterAbsorptionModel) = (water_absorbed=0.0,) - -function PlantSimEngine.run!(m::ToyWaterAbsorptionModel, models, status, meteo, constants=nothing, extra=nothing) - #root_end = get_root_end_node(status.node) - #root_len = root_end[:Root_len] - status.water_absorbed = meteo.Precipitations * status.root_water_assimilation #* root_len -end - -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyWaterAbsorptionModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyWaterAbsorptionModel}) = PlantSimEngine.IsObjectIndependent() - - -########################## -### Root growth : when water stocks are low, expand root -########################## - -PlantSimEngine.@process "root_growth" verbose = false - -struct ToyRootGrowthModel{T} <: AbstractRoot_GrowthModel - water_threshold::T - carbon_root_creation_cost::T - root_max_len::Int -end - -PlantSimEngine.inputs_(::ToyRootGrowthModel) = (water_stock=0.0, carbon_stock=0.0,) -PlantSimEngine.outputs_(::ToyRootGrowthModel) = (carbon_root_creation_consumed=0.0,) - -function PlantSimEngine.run!(m::ToyRootGrowthModel, models, status, meteo, constants=nothing, extra=nothing) - if status.water_stock < m.water_threshold && status.carbon_stock > m.carbon_root_creation_cost - - root_end = get_root_end_node(status.node) - - if length(root_end) != 1 - throw(AssertionError("Couldn't find MTG leaf node with symbol \"Root\"")) - end - root_len = get_roots_count(root_end[1]) - if root_len < m.root_max_len - st = add_organ!(root_end[1], extra, "<", :Root, 2, index=1) - status.carbon_root_creation_consumed = m.carbon_root_creation_cost - end - else - status.carbon_root_creation_consumed = 0.0 - end -end - -########################## -### Model accumulating carbon and water resources -########################## - -PlantSimEngine.@process "resource_stock_computation" verbose = false - -struct ToyStockComputationModel <: AbstractResource_Stock_ComputationModel -end -#status.water_stock += meteo.precipitations * root_water_assimilation_ratio - -PlantSimEngine.inputs_(::ToyStockComputationModel) = - (water_absorbed=0.0, carbon_captured=0.0, carbon_organ_creation_consumed=0.0, carbon_root_creation_consumed=0.0) - -PlantSimEngine.outputs_(::ToyStockComputationModel) = (water_stock=-Inf, carbon_stock=-Inf) - -function PlantSimEngine.run!(m::ToyStockComputationModel, models, status, meteo, constants=nothing, extra=nothing) - status.water_stock += sum(status.water_absorbed) #- status.water_transpiration - status.carbon_stock += sum(status.carbon_captured) - sum(status.carbon_organ_creation_consumed) - sum(status.carbon_root_creation_consumed) - - if status.water_stock < 0.0 - status.water_stock = 0.0 - end -end - -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyStockComputationModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyStockComputationModel}) = PlantSimEngine.IsObjectIndependent() - -######################## -## Leaf model capturing some arbitrary carbon quantity -######################## - -PlantSimEngine.@process "leaf_carbon_capture" verbose = false - -struct ToyLeafCarbonCaptureModel <: AbstractLeaf_Carbon_CaptureModel end - -function PlantSimEngine.inputs_(::ToyLeafCarbonCaptureModel) - NamedTuple()#(TT_cu=-Inf) -end - -function PlantSimEngine.outputs_(::ToyLeafCarbonCaptureModel) - (carbon_captured=0.0,) -end - -function PlantSimEngine.run!(::ToyLeafCarbonCaptureModel, models, status, meteo, constants, extra) - # very crude approximation with LAI of 1 and constant aPPFD - status.carbon_captured = 200.0 * (1.0 - exp(-0.2)) -end - -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyLeafCarbonCaptureModel}) = PlantSimEngine.IsObjectIndependent() -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyLeafCarbonCaptureModel}) = PlantSimEngine.IsTimeStepIndependent() - -mapping = ModelMapping( - :Scene => ToyDegreeDaysCumulModel(), - :Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured => [:Leaf], - :water_absorbed => [:Root], - :carbon_root_creation_consumed => [:Root], - :carbon_organ_creation_consumed => [:Internode]], - ), - Status(water_stock=0.0, carbon_stock=0.0) - ), - :Internode => ( - MultiScaleModel( - model=ToyCustomInternodeEmergence(),#TT_emergence=20.0), - mapped_variables=[:TT_cu => (:Scene => :TT_cu), - PreviousTimeStep(:water_stock) => (:Plant => :water_stock), - PreviousTimeStep(:carbon_stock) => (:Plant => :carbon_stock)], - ), - Status(carbon_organ_creation_consumed=0.0), - ), - :Root => (MultiScaleModel( - model=ToyRootGrowthModel(10.0, 50.0, 10), - mapped_variables=[PreviousTimeStep(:carbon_stock) => (:Plant => :carbon_stock), - PreviousTimeStep(:water_stock) => (:Plant => :water_stock)], - ), - ToyWaterAbsorptionModel(), - Status(carbon_root_creation_consumed=0.0, root_water_assimilation=1.0), - ), - :Leaf => (ToyLeafCarbonCaptureModel(),), -) - -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) - -plant = MultiScaleTreeGraph.Node(mtg, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -internode1 = MultiScaleTreeGraph.Node(plant, MultiScaleTreeGraph.NodeMTG("/", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -internode2 = MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("<", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -plant_root_start = MultiScaleTreeGraph.Node( - plant, - MultiScaleTreeGraph.NodeMTG("+", :Root, 1, 3), -) - -meteo_day = CSV.read(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), DataFrame, header=18) - -outs = run!(mtg, mapping, meteo_day) -mtg - - -length(MultiScaleTreeGraph.traverse(mtg, x -> x, symbol=:Leaf)) diff --git a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation3.jl b/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation3.jl deleted file mode 100644 index bdd4071b5..000000000 --- a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation3.jl +++ /dev/null @@ -1,251 +0,0 @@ -########################################### -# Toy plant model with an updated decision model for organ growth -# Physiologically and physically completely meaningless -# (no dimension for units, arbitrary values, stores water and carbon in abstract stocks, -# arbitrary max leaf count and root length, constant and non-coupled photosynthesis and water absorption, ...) -# But it should illustrate the basics of simulating a growing multiscale plant with PlantSimEngine's model approach -########################################### - -function get_root_end_node(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return MultiScaleTreeGraph.traverse(root, x -> x, symbol=:Root, filter_fun=MultiScaleTreeGraph.isleaf) -end - -function get_roots_count(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - return length(MultiScaleTreeGraph.traverse(root, x -> x, symbol=:Root)) -end - -function get_n_leaves(node::MultiScaleTreeGraph.Node) - root = MultiScaleTreeGraph.get_root(node) - nleaves = length(MultiScaleTreeGraph.traverse(root, x -> 1, symbol=:Leaf)) - return nleaves -end - -PlantSimEngine.@process "organ_emergence" verbose = false - -struct ToyCustomInternodeEmergence{T} <: AbstractOrgan_EmergenceModel - TT_emergence::T - carbon_internode_creation_cost::T - leaf_surface_area::T - leaves_max_surface_area::T - water_leaf_threshold::T -end - -ToyCustomInternodeEmergence(; TT_emergence=300.0, carbon_internode_creation_cost=200.0, leaf_surface_area=3.0, leaves_max_surface_area=100.0, - water_leaf_threshold=30.0) = ToyCustomInternodeEmergence(TT_emergence, carbon_internode_creation_cost, leaf_surface_area, leaves_max_surface_area, water_leaf_threshold) - -PlantSimEngine.inputs_(m::ToyCustomInternodeEmergence) = (TT_cu=0.0, water_stock=0.0, carbon_stock=0.0, carbon_root_creation_consumed=0.0) -PlantSimEngine.outputs_(m::ToyCustomInternodeEmergence) = (TT_cu_emergence=0.0, carbon_organ_creation_consumed=0.0) - -function PlantSimEngine.run!(m::ToyCustomInternodeEmergence, models, status, meteo, constants=nothing, sim_object=nothing) - - leaves_surface_area = m.leaf_surface_area * get_n_leaves(status.node) - status.carbon_organ_creation_consumed = 0.0 - - if leaves_surface_area > m.leaves_max_surface_area - return nothing - end - - # if water levels are low, prioritise roots - if status.water_stock < m.water_leaf_threshold - return nothing - end - - # take into account that the stock may already be depleted - carbon_stock_updated_after_roots = status.carbon_stock - status.carbon_root_creation_consumed - - # if not enough carbon, no organ creation - if carbon_stock_updated_after_roots < m.carbon_internode_creation_cost - return nothing - end - - if length(MultiScaleTreeGraph.children(status.node)) == 2 && - status.TT_cu - status.TT_cu_emergence >= m.TT_emergence - status_new_internode = add_organ!(status.node, sim_object, "<", :Internode, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - add_organ!(status_new_internode.node, sim_object, "+", :Leaf, 2, index=1) - - status_new_internode.TT_cu_emergence = m.TT_emergence - status.TT_cu - status.carbon_organ_creation_consumed = m.carbon_internode_creation_cost - end - - return nothing -end - -############################ -# Naive water absorption model -# Absorbs precipitation water depending on quantity of roots -############################ -PlantSimEngine.@process "water_absorption" verbose = false - -struct ToyWaterAbsorptionModel <: AbstractWater_AbsorptionModel -end - -PlantSimEngine.inputs_(::ToyWaterAbsorptionModel) = (root_water_assimilation=1.0,) -PlantSimEngine.outputs_(::ToyWaterAbsorptionModel) = (water_absorbed=0.0,) - -function PlantSimEngine.run!(m::ToyWaterAbsorptionModel, models, status, meteo, constants=nothing, extra=nothing) - #root_end = get_root_end_node(status.node) - #root_len = root_end[:Root_len] - status.water_absorbed = meteo.Precipitations * status.root_water_assimilation #* root_len -end - -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToyWaterAbsorptionModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyWaterAbsorptionModel}) = PlantSimEngine.IsObjectIndependent() - - -########################## -### Root growth : when water stocks are low, expand root -########################## - -PlantSimEngine.@process "root_growth" verbose = false - -struct ToyRootGrowthModel{T} <: AbstractRoot_GrowthModel - carbon_root_creation_cost::T - root_max_len::Int -end - -PlantSimEngine.inputs_(::ToyRootGrowthModel) = NamedTuple() -PlantSimEngine.outputs_(::ToyRootGrowthModel) = (carbon_root_creation_consumed=0.0,) - -function PlantSimEngine.run!(m::ToyRootGrowthModel, models, status, meteo, constants=nothing, extra=nothing) - status.carbon_root_creation_consumed = 0.0 - - root_end = get_root_end_node(status.node) - - if length(root_end) != 1 - throw(AssertionError("Couldn't find MTG leaf node with symbol \"Root\"")) - end - - root_len = get_roots_count(root_end[1]) - if root_len < m.root_max_len - st = add_organ!(root_end[1], extra, "<", :Root, 2, index=1) - status.carbon_root_creation_consumed = m.carbon_root_creation_cost - end -end - -########################## -### Decision model controlling the root growth model -########################## -PlantSimEngine.@process "root_growth_decision" verbose = false - -struct ToyRootGrowthDecisionModel{T} <: AbstractRoot_Growth_DecisionModel - water_threshold::T - carbon_root_creation_cost::T -end - -PlantSimEngine.inputs_(::ToyRootGrowthDecisionModel) = - (water_stock=0.0, carbon_stock=0.0) - -PlantSimEngine.outputs_(::ToyRootGrowthDecisionModel) = NamedTuple() - -PlantSimEngine.dep(::ToyRootGrowthDecisionModel) = (root_growth=AbstractRoot_GrowthModel => [:Root],) - -function PlantSimEngine.run!(m::ToyRootGrowthDecisionModel, models, status, meteo, constants=nothing, extra=nothing) - - if status.water_stock < m.water_threshold && status.carbon_stock > m.carbon_root_creation_cost - status_Root = extra.statuses[:Root][1] - PlantSimEngine.run!(extra.models[:Root].root_growth, models, status_Root, meteo, constants, extra) - end -end - - -########################## -### Model accumulating carbon and water resources -########################## - -PlantSimEngine.@process "resource_stock_computation" verbose = false - -struct ToyStockComputationModel <: AbstractResource_Stock_ComputationModel -end - -PlantSimEngine.inputs_(::ToyStockComputationModel) = - (water_absorbed=0.0, carbon_captured=0.0, carbon_organ_creation_consumed=0.0, carbon_root_creation_consumed=0.0) - -PlantSimEngine.outputs_(::ToyStockComputationModel) = (water_stock=-Inf, carbon_stock=-Inf) - -function PlantSimEngine.run!(m::ToyStockComputationModel, models, status, meteo, constants=nothing, extra=nothing) - status.water_stock += sum(status.water_absorbed) - status.carbon_stock += sum(status.carbon_captured) - sum(status.carbon_organ_creation_consumed) - sum(status.carbon_root_creation_consumed) -end - - -######################## -## Leaf model capturing some arbitrary carbon quantity -######################## - -PlantSimEngine.@process "leaf_carbon_capture" verbose = false - -struct ToyLeafCarbonCaptureModel <: AbstractLeaf_Carbon_CaptureModel end - -function PlantSimEngine.inputs_(::ToyLeafCarbonCaptureModel) - NamedTuple() -end - -function PlantSimEngine.outputs_(::ToyLeafCarbonCaptureModel) - (carbon_captured=0.0,) -end - -function PlantSimEngine.run!(::ToyLeafCarbonCaptureModel, models, status, meteo, constants, extra) - # very crude approximation with LAI of 1 and constant aPPFD - status.carbon_captured = 200.0 * (1.0 - exp(-0.2)) -end - - -mapping = ModelMapping( - :Scene => ToyDegreeDaysCumulModel(), - :Plant => ( - MultiScaleModel( - model=ToyStockComputationModel(), - mapped_variables=[ - :carbon_captured => [:Leaf], - :water_absorbed => [:Root], - PreviousTimeStep(:carbon_root_creation_consumed) => (:Root => :carbon_root_creation_consumed), - PreviousTimeStep(:carbon_organ_creation_consumed) => [:Internode], - ], - ), - ToyRootGrowthDecisionModel(10.0, 50.0), - Status(water_stock=0.0, carbon_stock=0.0) - ), - :Internode => ( - MultiScaleModel( - model=ToyCustomInternodeEmergence(),#TT_emergence=20.0), - mapped_variables=[:TT_cu => (:Scene => :TT_cu), - :water_stock => (:Plant => :water_stock), - :carbon_stock => (:Plant => :carbon_stock), - :carbon_root_creation_consumed => (:Root => :carbon_root_creation_consumed)], - ), - Status(carbon_organ_creation_consumed=0.0), - ), - :Root => (ToyRootGrowthModel(50.0, 10), - ToyWaterAbsorptionModel(), - Status(carbon_root_creation_consumed=0.0, root_water_assimilation=1.0), - ), - :Leaf => (ToyLeafCarbonCaptureModel(),), -) - -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) - -plant = MultiScaleTreeGraph.Node(mtg, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) - -internode1 = MultiScaleTreeGraph.Node(plant, MultiScaleTreeGraph.NodeMTG("/", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -internode2 = MultiScaleTreeGraph.Node(internode1, MultiScaleTreeGraph.NodeMTG("<", :Internode, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) -MultiScaleTreeGraph.Node(internode2, MultiScaleTreeGraph.NodeMTG("+", :Leaf, 1, 2)) - -plant_root_start = MultiScaleTreeGraph.Node( - plant, - MultiScaleTreeGraph.NodeMTG("+", :Root, 1, 3), -) - -meteo_day = CSV.read(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), DataFrame, header=18) - -outs = run!(mtg, mapping, meteo_day) -mtg - - -length(MultiScaleTreeGraph.traverse(mtg, x -> x, symbol=:Leaf)) diff --git a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation4.jl b/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation4.jl deleted file mode 100644 index 1684ab44e..000000000 --- a/examples/ToyMultiScalePlantTutorial/ToyPlantSimulation4.jl +++ /dev/null @@ -1,148 +0,0 @@ -########################################### -# Toy plant model MTG visualisation using PlantGeom -########################################### -using PlantSimEngine - -using MultiScaleTreeGraph -using PlantSimEngine.Examples -using Pkg -Pkg.add("CSV") -using CSV -include("ToyPlantSimulation3.jl") - -using Plots -using PlantGeom -# reusing the mtg from part 3: -RecipesBase.plot(mtg) - -#= -using GLMakie -#using CairoMakie -using PlantGeom - -PlantGeom.diagram(mtg)=# - - -using PlantGeom.Meshes - -# Internodes and roots will use a cylinder as a mesh - -cylinder() = Meshes.CylinderSurface(1.0) |> Meshes.discretize |> Meshes.simplexify - -refmesh_internode = PlantGeom.RefMesh("Internode", cylinder()) -refmesh_root = PlantGeom.RefMesh("Root", cylinder()) - -# Leaves and petioles are a single mesh, read from a .ply file - -Pkg.add("PlyIO") -using PlyIO -function read_ply(fname) - ply = PlyIO.load_ply(fname) - x = ply["vertex"]["x"] - y = ply["vertex"]["y"] - z = ply["vertex"]["z"] - points = Meshes.Point.(x, y, z) - connec = [Meshes.connect(Tuple(c .+ 1)) for c in ply["face"]["vertex_indices"]] - Meshes.SimpleMesh(points, connec) -end - -leaf_ply = read_ply("examples/leaf_with_petiole.ply") -refmesh_leaf = PlantGeom.RefMesh("Leaf", leaf_ply) - -Pkg.add("TransformsBase") -Pkg.add("Rotations") -#using PlantGeom.TranformsBase -import TransformsBase: → -import Rotations: RotY, RotZ, RotX -# Add the geometry to the MTG, with transformations -function add_geometry!(mtg, refmesh_internode) - - # incremental offset - internode_height = 0.0 - - # relative scale of the base mesh - internode_width = 0.5 - - # length of the base mesh - internode_length = 1.0 - - traverse!(mtg) do node - if symbol(node) == :Internode - # Set to scale, then translate by the total height - mesh_transformation = Meshes.Scale(internode_width, internode_width, internode_length) → Meshes.Translate(0.0, 0.0, internode_height) - node.geometry = PlantGeom.Geometry(ref_mesh=refmesh_internode, transformation=mesh_transformation) - - internode_height += internode_length - end - end -end - -add_geometry!(mtg, refmesh_internode) - -# Visualize the mesh -using GLMakie -viz(mtg) - -function add_geometry!(mtg, refmesh_internode, refmesh_root, refmesh_leaf) - - # incremental offset - internode_height = 0.0 - root_depth = 0.0 - - # relative scale of the base mesh - internode_width = 0.5 - root_width = 0.2 - - # length of the base mesh - internode_length = 1.0 - root_length = 1.0 - - # ad hoc value to adjust the base mesh to the scene scale - leaf_mesh_scale = 25 - leaf_scale_width = 0.4*leaf_mesh_scale - leaf_scale_height = 0.4*leaf_mesh_scale - - # Helpers to make the leaves opposite decussate - leaf_rotation = MathConstants.pi / 2.0 - i = 0 - - traverse!(mtg) do node - if symbol(node) == :Internode - # Set to scale, then translate by the total height - mesh_transformation = Meshes.Scale(internode_width, internode_width, internode_length) → Meshes.Translate(0.0, 0.0, internode_height) - node.geometry = PlantGeom.Geometry(ref_mesh=refmesh_internode, transformation=mesh_transformation) - - internode_height += node_length - - # Leaves are placed relatively to the parent internode - for chnode in children(node) - if symbol(chnode) == :Leaf - # Leaves are placed halfway along the the parent internode - mesh_transformation = Meshes.Scale(leaf_scale_width, leaf_scale_width, leaf_scale_height) → Meshes.Rotate(RotX(-MathConstants.pi / 6.0)) → Meshes.Translate(0.0, -internode_width, internode_height - internode_length / 2.0) → Meshes.Rotate(RotZ(leaf_rotation)) - chnode.geometry = PlantGeom.Geometry(ref_mesh=refmesh_leaf, transformation=mesh_transformation) - # Set the second leaf in a pair opposite to the first one => add a 180° rotation - leaf_rotation += MathConstants.pi - end - end - - # Opposite decussate => 90° rotation between pairs - i += 1 - if i % 2 == 0 - leaf_rotation = MathConstants.pi / 2.0 - else - leaf_rotation = MathConstants.pi - end - - elseif symbol(node) == :Root - mesh_transformation = Meshes.Scale(root_width, root_width, root_length) → Meshes.Translate(0.0, 0.0, root_depth) → Meshes.Rotate(RotZ(MathConstants.pi)) - node.geometry = PlantGeom.Geometry(ref_mesh=refmesh_root, transformation=mesh_transformation) - root_depth -= root_length - end - end -end - -add_geometry!(mtg, refmesh_internode, refmesh_root, refmesh_leaf) - -# Visualize the mesh -using GLMakie -viz(mtg) \ No newline at end of file diff --git a/examples/ToyRUEGrowthModel.jl b/examples/ToyRUEGrowthModel.jl index c3db5cb6b..a74470b66 100644 --- a/examples/ToyRUEGrowthModel.jl +++ b/examples/ToyRUEGrowthModel.jl @@ -30,24 +30,21 @@ end # Define inputs: function PlantSimEngine.inputs_(::ToyRUEGrowthModel) - (aPPFD=-Inf,) + (aPPFD=Required(Real),) end # Define outputs: -function PlantSimEngine.outputs_(::ToyRUEGrowthModel) - (biomass=0.0, biomass_increment=-Inf) +function PlantSimEngine.outputs_(model::ToyRUEGrowthModel) + (biomass=zero(model.efficiency), biomass_increment=oftype(float(model.efficiency), -Inf)) end # Tells Julia what is the type of elements: Base.eltype(x::ToyRUEGrowthModel{T}) where {T} = T # Implement the growth model: -function PlantSimEngine.run!(::ToyRUEGrowthModel, models, status, meteo, constants, extra) - status.biomass_increment = status.aPPFD * models.growth.efficiency +function PlantSimEngine.run!(model::ToyRUEGrowthModel, status, environment, constants, context) + status.biomass_increment = status.aPPFD * model.efficiency status.biomass += status.biomass_increment end -# And optionally, we can tell PlantSimEngine that we can safely parallelize our model over space (objects): -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToyRUEGrowthModel}) = PlantSimEngine.IsObjectIndependent() - -# Note that this model cannot be parallelized over time because we use the biomass from the previous time-step. \ No newline at end of file +# The model uses biomass from the previous timestep, so time steps are stateful. diff --git a/examples/ToySingleToMultiScale.jl b/examples/ToySingleToMultiScale.jl deleted file mode 100644 index af43b48a9..000000000 --- a/examples/ToySingleToMultiScale.jl +++ /dev/null @@ -1,119 +0,0 @@ -############################## -### Example single- to multi-scale conversion -############################## - -# Environment setup -using CSV -using DataFrames -using PlantSimEngine -using PlantMeteo -using PlantSimEngine.Examples -using MultiScaleTreeGraph - -# Weather data for all simulations -meteo_day = CSV.read(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), DataFrame, header=18) - -############################## -### Single-scale simulation -############################## - -models_singlescale = ModelMapping( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2), - status=(TT_cu=cumsum(meteo_day.TT),), -) - -outputs_singlescale = run!(models_singlescale, meteo_day) - -############################## -#### Direct translation of the single-scale simulation -############################## -mapping_pseudo_multiscale = ModelMapping( - :Plant => ( - ToyLAIModel(), - Beer(0.5), - ToyRUEGrowthModel(0.2), - Status(TT_cu=cumsum(meteo_day.TT),) - ), -) - -mtg = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Plant, 1, 0),) - -# will generate an error as vectors can't be directly passed into a Status in multi-scale simulations -out_pseudo_multiscale = run!(mtg, mapping_pseudo_multiscale, meteo_day) - -############################## -#### Ad Hoc Cumulated Thermal Time Model -############################## - -PlantSimEngine.@process "tt_cu" verbose = false - -struct ToyTt_CuModel <: AbstractTt_CuModel -end - -function PlantSimEngine.run!(::ToyTt_CuModel, models, status, meteo, constants, extra=nothing) - status.TT_cu += meteo.TT -end - -function PlantSimEngine.inputs_(::ToyTt_CuModel) - NamedTuple() -end - -function PlantSimEngine.outputs_(::ToyTt_CuModel) - (TT_cu=-Inf,) -end - -############################## -#### Actual multiscale version of the single-scale simulation -############################## - -mapping_multiscale = ModelMapping( - :Scene => ( - ToyTt_CuModel(), - Status(TT_cu=0.0), - ), - :Plant => ( - MultiScaleModel( - model=ToyLAIModel(), - mapped_variables=[ - :TT_cu => (:Scene => :TT_cu), - ], - ), - Beer(0.5), - ToyRUEGrowthModel(0.2), - ), -) - -# We now need two nodes for our MTG -mtg_multiscale = MultiScaleTreeGraph.Node(MultiScaleTreeGraph.NodeMTG("/", :Scene, 1, 0)) -plant = MultiScaleTreeGraph.Node(mtg_multiscale, MultiScaleTreeGraph.NodeMTG("+", :Plant, 1, 1)) -outputs_multiscale = run!(mtg_multiscale, mapping_multiscale, meteo_day) - -############################## -#### Output comparison -############################## - -computed_TT_cu_multiscale = collect(Base.Iterators.flatten(outputs_multiscale[:Scene][:TT_cu])) - -is_approx_equal_1 = true - -for i in 1:length(computed_TT_cu_multiscale) - if !(computed_TT_cu_multiscale[i] ≈ outputs_singlescale.TT_cu[i]) - is_approx_equal_1 = false - break - end -end - -is_approx_equal_1 - -is_approx_equal_2 = length(unique(computed_TT_cu_multiscale .≈ outputs_singlescale.TT_cu)) == 1 - - -# Note : it is also possible to get the weather data length via PlantSimEngine.get_nsteps(meteo_day) -# instead of checking for array length - -is_perfectly_equal = length(unique(computed_TT_cu_multiscale .== outputs_singlescale.TT_cu)) == 1 - -(computed_TT_cu_multiscale.==outputs_singlescale.TT_cu)[104] -(computed_TT_cu_multiscale.==outputs_singlescale.TT_cu)[105] diff --git a/examples/ToySoilModel.jl b/examples/ToySoilModel.jl index 7d0c20b3a..b3b9b9845 100644 --- a/examples/ToySoilModel.jl +++ b/examples/ToySoilModel.jl @@ -16,23 +16,21 @@ the `values` range using `rand`. - `values`: a range of `soil_water_content` values to sample from. Can be a vector of values `[0.5,0.6]` or a range `0.1:0.1:1.0`. Default is `[0.5]`. """ -struct ToySoilWaterModel{T<:Union{AbstractRange{Float64},AbstractVector{Float64}}} <: AbstractSoil_WaterModel +struct ToySoilWaterModel{T<:Union{AbstractRange,AbstractVector}} <: AbstractSoil_WaterModel values::T end -# Defining a method with keyword arguments and default values: -ToySoilWaterModel(values=[0.5]) = ToySoilWaterModel(values) +# Defining a zero-argument default without shadowing the generated positional +# constructor. +ToySoilWaterModel() = ToySoilWaterModel([0.5]) # Defining the inputs and outputs of the model: PlantSimEngine.inputs_(::ToySoilWaterModel) = NamedTuple() -PlantSimEngine.outputs_(::ToySoilWaterModel) = (soil_water_content=-Inf,) +PlantSimEngine.outputs_(m::ToySoilWaterModel) = ( + soil_water_content=oftype(float(first(m.values)), -Inf), +) # Implementing the actual algorithm by adding a method to the run! function for our model: -function PlantSimEngine.run!(m::ToySoilWaterModel, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(m::ToySoilWaterModel, status, environment, constants, context) status.soil_water_content = rand(m.values) end - -# The computation of ToySoilWaterModel is independant of previous values and other objects. We can add this information as -# traits to the model to tell PlantSimEngine that it is safe to run the models in parallel: -PlantSimEngine.TimeStepDependencyTrait(::Type{<:ToySoilWaterModel}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:ToySoilWaterModel}) = PlantSimEngine.IsObjectIndependent() \ No newline at end of file diff --git a/examples/ToySpatialEnvironment.jl b/examples/ToySpatialEnvironment.jl new file mode 100644 index 000000000..9cb7a4b5e --- /dev/null +++ b/examples/ToySpatialEnvironment.jl @@ -0,0 +1,197 @@ +""" + ToySpatialEnvironment(cells; step_seconds=3600.0) + +A minimal spatial environment for examples and tests. + +`cells` maps cell ids to named tuples of environment variables. Objects select +a cell with geometry such as `(cell=:sun,)`. PlantSimEngine compiles that cell +id into a [`ToyEnvironmentHandle`](@ref), so sampling does not resolve geometry +inside the model kernel loop. An application configured with `sink=:cells` may +also commit an accepted named-tuple state to its bound cell. +""" +struct ToySpatialEnvironment{C,T} <: + PlantSimEngine.EnvironmentAPI.AbstractEnvironmentBackend + cells::C + step_seconds::T +end + +ToySpatialEnvironment(cells; step_seconds=3600.0) = + ToySpatialEnvironment(cells, float(step_seconds)) + +""" + ToyEnvironmentHandle + +Opaque compiled handle returned by [`ToySpatialEnvironment`](@ref). +""" +struct ToyEnvironmentHandle + cell::Symbol + sink::Union{Nothing,Symbol} +end + +PlantSimEngine.EnvironmentAPI.base_step_seconds(backend::ToySpatialEnvironment) = + backend.step_seconds +PlantSimEngine.EnvironmentAPI.get_nsteps(::ToySpatialEnvironment) = 1 + +function PlantSimEngine.EnvironmentAPI.environment_variables( + backend::ToySpatialEnvironment, +) + isempty(backend.cells) && return Set{Symbol}() + return Set(Symbol.(propertynames(first(values(backend.cells))))) +end + +function PlantSimEngine.EnvironmentAPI.bind_environment( + backend::ToySpatialEnvironment, + object::PlantSimEngine.Object, + context::PlantSimEngine.EnvironmentAPI.EnvironmentContext, + config, +) + object_geometry = PlantSimEngine.geometry(object) + object_geometry isa NamedTuple && haskey(object_geometry, :cell) || error( + "ToySpatialEnvironment needs `(cell=...,)` geometry for object " * + "`$(object.id.value)`.", + ) + cell = Symbol(object_geometry.cell) + haskey(backend.cells, cell) || error( + "ToySpatialEnvironment has no cell `$(cell)` for object " * + "`$(object.id.value)`.", + ) + sink = + isnothing(config) || !haskey(config, :sink) ? + nothing : Symbol(config.sink) + isnothing(sink) || sink == :cells || error( + "ToySpatialEnvironment only supports `sink=:cells`, got " * + "`$(sink)`.", + ) + return ToyEnvironmentHandle(cell, sink) +end + +function PlantSimEngine.EnvironmentAPI.sample( + backend::ToySpatialEnvironment, + handle::ToyEnvironmentHandle, + variable::Symbol, + time, +) + row = backend.cells[handle.cell] + hasproperty(row, variable) || error( + "ToySpatialEnvironment cell `$(handle.cell)` does not provide " * + "variable `$(variable)`.", + ) + return getproperty(row, variable) +end + +function PlantSimEngine.EnvironmentAPI.sample( + backend::ToySpatialEnvironment, + handle::ToyEnvironmentHandle, + state::NamedTuple, + variable::Symbol, + time, +) + hasproperty(state, variable) || error( + "ToySpatialEnvironment trial state does not provide variable " * + "`$(variable)`.", + ) + return getproperty(state, variable) +end + +function PlantSimEngine.EnvironmentAPI.commit_environment!( + backend::ToySpatialEnvironment, + handle::ToyEnvironmentHandle, + state::NamedTuple, + time, +) + handle.sink == :cells || error( + "ToySpatialEnvironment handle for cell `$(handle.cell)` has no " * + "commit sink.", + ) + backend.cells[handle.cell] = state + return nothing +end + +PlantSimEngine.@process "toy_environment_reader" verbose = false +PlantSimEngine.@process "toy_environment_controller" verbose = false + +""" + ToyEnvironmentReaderModel() + +Read temperature from the model-facing environment. +""" +struct ToyEnvironmentReaderModel <: AbstractToy_Environment_ReaderModel end + +PlantSimEngine.inputs_(::ToyEnvironmentReaderModel) = NamedTuple() +PlantSimEngine.outputs_(::ToyEnvironmentReaderModel) = (temperature_seen=0.0,) +PlantSimEngine.environment_inputs_(::ToyEnvironmentReaderModel) = (T=0.0,) + +function PlantSimEngine.run!( + ::ToyEnvironmentReaderModel, + status, + environment, + constants, + context, +) + status.temperature_seen = environment.T + return nothing +end + +""" + ToyEnvironmentControllerModel(trial_temperature, accepted_temperature) + +Demonstrate a typed trial environment followed by one accepted environment +commit and publication. +""" +struct ToyEnvironmentControllerModel{T} <: + AbstractToy_Environment_ControllerModel + trial_temperature::T + accepted_temperature::T +end + +function ToyEnvironmentControllerModel(trial_temperature, accepted_temperature) + parameters = promote( + float(trial_temperature), + float(accepted_temperature), + ) + return ToyEnvironmentControllerModel(parameters...) +end + +PlantSimEngine.inputs_(::ToyEnvironmentControllerModel) = NamedTuple() +PlantSimEngine.dep(::ToyEnvironmentControllerModel) = ( + reader=Call(One(process=:toy_environment_reader)), +) +function PlantSimEngine.outputs_(model::ToyEnvironmentControllerModel) + initial = zero(model.accepted_temperature) + return ( + trial_temperature_seen=initial, + accepted_temperature_seen=initial, + ) +end +PlantSimEngine.environment_outputs_(model::ToyEnvironmentControllerModel) = ( + T=zero(model.accepted_temperature), +) + +function PlantSimEngine.run!( + model::ToyEnvironmentControllerModel, + status, + environment, + constants, + context, +) + trial_environment = (T=model.trial_temperature,) + trial_target = only(run_call!( + context, + :reader; + environment=trial_environment, + publish=false, + )) + status.trial_temperature_seen = trial_target.status.temperature_seen + + accepted_environment = (T=model.accepted_temperature,) + commit_environment!(context, accepted_environment) + accepted_target = only(run_call!( + context, + :reader; + environment=accepted_environment, + publish=true, + )) + status.accepted_temperature_seen = + accepted_target.status.temperature_seen + return nothing +end diff --git a/examples/benchmark.jl b/examples/benchmark.jl deleted file mode 100644 index a372ad467..000000000 --- a/examples/benchmark.jl +++ /dev/null @@ -1,31 +0,0 @@ -#]add BenchmarkTools - -using BenchmarkTools -using PlantSimEngine, PlantMeteo, DataFrames, CSV, Dates, Statistics -# using PlantSimEngine.Examples - -meteo_day = read_weather(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), duration=Day) -models = ModelMapping( - ToyLAIModel(), - status=(TT_cu=cumsum(meteo_day.TT),), -) - -# Match the warning on the executor, the default is ThreadedEx() but ToyRUEGrowthModel can't be run in parallel: -time_run = @benchmark run!($models, $meteo_day) - -median_time_ns = median(time_run.times) / nrow(meteo_day) - -# If we provide a serial executor, it works without a warning: -time_run_seq = @benchmark run!($models, $meteo_day, executor=$(SequentialEx())) -median_time_seq_ns = median(time_run_seq.times) / nrow(meteo_day) - -# Coupled model: -models_coupled = ModelMapping( - ToyLAIModel(), - Beer(0.5), - status=(TT_cu=cumsum(meteo_day.TT),), -) - -# Match the warning on the executor, the default is ThreadedEx() but ToyRUEGrowthModel can't be run in parallel: -time_run_coupled = @benchmark run!($models_coupled, $meteo_day) -median_time_coupled_ns = median(time_run_coupled.times) / nrow(meteo_day) diff --git a/examples/dummy.jl b/examples/dummy.jl index f3a556f1d..eb84eac0d 100644 --- a/examples/dummy.jl +++ b/examples/dummy.jl @@ -13,13 +13,11 @@ A dummy model implementing a "process1" process for testing purposes. struct Process1Model <: AbstractProcess1Model a end -PlantSimEngine.inputs_(::Process1Model) = (var1=-Inf, var2=-Inf) +PlantSimEngine.inputs_(::Process1Model) = (var1=Required(Float64), var2=Required(Float64)) PlantSimEngine.outputs_(::Process1Model) = (var3=-Inf,) -function PlantSimEngine.run!(::Process1Model, models, status, meteo, constants=nothing, extra=nothing) - status.var3 = models.process1.a + status.var1 * status.var2 +function PlantSimEngine.run!(model::Process1Model, status, environment, constants, context) + status.var3 = model.a + status.var1 * status.var2 end -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Process1Model}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Process1Model}) = PlantSimEngine.IsObjectIndependent() # Defining a 2nd process called "process2", and a model @@ -32,18 +30,19 @@ PlantSimEngine.@process "process2" verbose = false A dummy model implementing a "process2" process for testing purposes. """ struct Process2Model <: AbstractProcess2Model end -PlantSimEngine.inputs_(::Process2Model) = (var1=-Inf, var3=-Inf) +PlantSimEngine.inputs_(::Process2Model) = (var1=Required(Float64), var3=Required(Float64)) PlantSimEngine.outputs_(::Process2Model) = (var4=-Inf, var5=-Inf) -PlantSimEngine.dep(::Process2Model) = (process1=AbstractProcess1Model,) -function PlantSimEngine.run!(::Process2Model, models, status, meteo, constants=nothing, extra=nothing) +PlantSimEngine.environment_inputs_(::Process2Model) = (T=0.0, Wind=0.0, Rh=0.0) +PlantSimEngine.dep(::Process2Model) = ( + process1=PlantSimEngine.Call(PlantSimEngine.One(process=:process1)), +) +function PlantSimEngine.run!(::Process2Model, status, environment, constants, context) # computing var3 using process1: - PlantSimEngine.run!(models.process1, models, status, meteo, constants) + PlantSimEngine.run_call!(context, :process1; publish=true) # computing var4 and var5: status.var4 = status.var3 * 2.0 - status.var5 = status.var4 + 1.0 * meteo.T + 2.0 * meteo.Wind + 3.0 * meteo.Rh + status.var5 = status.var4 + 1.0 * environment.T + 2.0 * environment.Wind + 3.0 * environment.Rh end -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Process2Model}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Process2Model}) = PlantSimEngine.IsObjectIndependent() # Defining a 3d process called "process3", and a model # that implements an algorithm, and that depends on the second one (and @@ -56,20 +55,20 @@ PlantSimEngine.@process "process3" verbose = false A dummy model implementing a "process3" process for testing purposes. """ struct Process3Model <: AbstractProcess3Model end -PlantSimEngine.inputs_(::Process3Model) = (var5=-Inf,) +PlantSimEngine.inputs_(::Process3Model) = (var5=Required(Float64),) PlantSimEngine.outputs_(::Process3Model) = (var4=-Inf, var6=-Inf,) # NB: var4 is computed by process2, so it is not in the inputs, it is also recomputed by this model, # so we need a hard dependency on process2: -PlantSimEngine.dep(::Process3Model) = (process2=Process2Model,) -function PlantSimEngine.run!(::Process3Model, models, status, meteo, constants=nothing, extra=nothing) - # computing var3 using process1: - PlantSimEngine.run!(models.process2, models, status, meteo, constants, extra) +PlantSimEngine.dep(::Process3Model) = ( + process2=PlantSimEngine.Call(PlantSimEngine.One(process=:process2)), +) +function PlantSimEngine.run!(::Process3Model, status, environment, constants, context) + # computing var3, var4 and var5 using process2 (which calls process1): + PlantSimEngine.run_call!(context, :process2; publish=true) # re-computing var4: status.var4 = status.var4 * 2.0 status.var6 = status.var5 + status.var4 end -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Process3Model}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Process3Model}) = PlantSimEngine.IsObjectIndependent() # Defining a 4th process called "process4", and a model # that implements an algorithm, and that computes the @@ -83,16 +82,14 @@ A dummy model implementing a "process4" process for testing purposes. It computes the inputs needed for the coupled processes 1-2-3. """ struct Process4Model <: AbstractProcess4Model end -PlantSimEngine.inputs_(::Process4Model) = (var0=-Inf,) +PlantSimEngine.inputs_(::Process4Model) = (var0=Required(Float64),) PlantSimEngine.outputs_(::Process4Model) = (var1=-Inf, var2=-Inf) -function PlantSimEngine.run!(::Process4Model, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(::Process4Model, status, environment, constants, context) # computing var3 using process1: # re-computing var4: status.var1 = status.var0 + 0.01 status.var2 = status.var1 + 0.02 end -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Process4Model}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Process4Model}) = PlantSimEngine.IsObjectIndependent() # Defining a 5th process called "process5", and a model # that implements an algorithm, and that computes other @@ -106,13 +103,11 @@ A dummy model implementing a "process5" process for testing purposes. It needs the outputs from the coupled processes 1-2-3. """ struct Process5Model <: AbstractProcess5Model end -PlantSimEngine.inputs_(::Process5Model) = (var5=-Inf, var6=-Inf) +PlantSimEngine.inputs_(::Process5Model) = (var5=Required(Float64), var6=Required(Float64)) PlantSimEngine.outputs_(::Process5Model) = (var7=-Inf,) -function PlantSimEngine.run!(::Process5Model, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(::Process5Model, status, environment, constants, context) status.var7 = status.var5 * status.var6 end -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Process5Model}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Process5Model}) = PlantSimEngine.IsObjectIndependent() # Defining a 6th process called "process6", and a model @@ -128,13 +123,11 @@ It needs the outputs from the coupled processes 1-2-3, but also from process 7 that is itself independant. """ struct Process6Model <: AbstractProcess6Model end -PlantSimEngine.inputs_(::Process6Model) = (var7=-Inf, var9=-Inf) +PlantSimEngine.inputs_(::Process6Model) = (var7=Required(Float64), var9=Required(Float64)) PlantSimEngine.outputs_(::Process6Model) = (var8=-Inf,) -function PlantSimEngine.run!(::Process6Model, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(::Process6Model, status, environment, constants, context) status.var8 = status.var7 + 1.0 end -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Process6Model}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Process6Model}) = PlantSimEngine.IsObjectIndependent() # Defining a 7th process called "process7", and a model # that depends on nothing but var0 so it is independant. @@ -150,10 +143,8 @@ It is independent (needs :var0 only as for Process4Model), but its outputs are used by Process6Model, so it is a soft-coupling. """ struct Process7Model <: AbstractProcess7Model end -PlantSimEngine.inputs_(::Process7Model) = (var0=-Inf, var3=-Inf) +PlantSimEngine.inputs_(::Process7Model) = (var0=Required(Float64), var3=Required(Float64)) PlantSimEngine.outputs_(::Process7Model) = (var9=-Inf,) -function PlantSimEngine.run!(::Process7Model, models, status, meteo, constants=nothing, extra=nothing) +function PlantSimEngine.run!(::Process7Model, status, environment, constants, context) status.var9 = status.var0 + 1.0 end -PlantSimEngine.TimeStepDependencyTrait(::Type{<:Process7Model}) = PlantSimEngine.IsTimeStepIndependent() -PlantSimEngine.ObjectDependencyTrait(::Type{<:Process7Model}) = PlantSimEngine.IsObjectIndependent() diff --git a/examples/maespa_model_example.jl b/examples/maespa_model_example.jl new file mode 100644 index 000000000..3ff437be8 --- /dev/null +++ b/examples/maespa_model_example.jl @@ -0,0 +1,789 @@ +using Dates +using PlantMeteo +using PlantSimEngine + +include(joinpath(@__DIR__, "plantbiophysics_subsample", "Tuzet.jl")) +include(joinpath(@__DIR__, "plantbiophysics_subsample", "FvCB.jl")) +include(joinpath(@__DIR__, "plantbiophysics_subsample", "Monteith.jl")) + +PlantSimEngine.@process "maespa_soil_water" verbose = false +PlantSimEngine.@process "scene_eb" verbose = false +PlantSimEngine.@process "leaf_state" verbose = false +PlantSimEngine.@process "maespa_lai_dynamic" verbose = false +PlantSimEngine.@process "alloc_a" verbose = false +PlantSimEngine.@process "alloc_b" verbose = false + +duration_seconds(environment) = Dates.value(Dates.Millisecond(environment.duration)) / 1000.0 +mutable struct MaespaSingleLayerEnvironment{F,C} <: + PlantSimEngine.EnvironmentAPI.AbstractEnvironmentBackend + forcing::F # MAESPA forcing data (Meteo data from above the canopy) + canopy::C # Within-canopy computed microclimate +end + +struct MaespaEnvironmentHandle + provider::Symbol + sink::Union{Nothing,Symbol} +end + +function MaespaSingleLayerEnvironment(forcing; canopy=_maespa_meteo_row(forcing, 1)) + canopy = Atmosphere( + T=canopy.T, + Rh=canopy.Rh, + Wind=canopy.Wind, + P=canopy.P, + Cₐ=canopy.Cₐ, + Ri_PAR_f=canopy.Ri_PAR_f, + Ri_SW_f=canopy.Ri_SW_f, + duration=canopy.duration, + ) + return MaespaSingleLayerEnvironment( + forcing, + canopy, + ) +end + +_maespa_meteo_row(environment, time) = + first(Iterators.drop(environment, clamp(Int(round(time)), 1, PlantSimEngine.get_nsteps(environment)) - 1)) + +PlantSimEngine.EnvironmentAPI.base_step_seconds( + backend::MaespaSingleLayerEnvironment, +) = PlantSimEngine.EnvironmentAPI.base_step_seconds( + PlantSimEngine.EnvironmentAPI.environment_backend(backend.forcing), +) +PlantSimEngine.EnvironmentAPI.get_nsteps( + backend::MaespaSingleLayerEnvironment, +) = PlantSimEngine.EnvironmentAPI.get_nsteps(backend.forcing) +PlantSimEngine.EnvironmentAPI.environment_variables( + ::MaespaSingleLayerEnvironment, +) = Set([ + :T, :Rh, :Wind, :P, :Cₐ, :Ri_PAR_f, :Ri_SW_f, :duration, :VPD, :ε, :γ, :Δ, :ρ, :λ, +]) + +function PlantSimEngine.EnvironmentAPI.bind_environment( + backend::MaespaSingleLayerEnvironment, + object::Object, + context::PlantSimEngine.EnvironmentAPI.EnvironmentContext, + config, +) + provider = isnothing(config) ? :canopy : Symbol(config.provider) + sink = isnothing(config) || !haskey(config, :sink) ? nothing : Symbol(config.sink) + provider in (:forcing, :canopy) || error( + "MAESPA single-layer environment provider must be `:forcing` or `:canopy`, got `$(provider)`." + ) + isnothing(sink) || sink == :canopy || error( + "MAESPA single-layer environment sink must be `:canopy`, got `$(sink)`." + ) + return MaespaEnvironmentHandle(provider, sink) +end + +function PlantSimEngine.EnvironmentAPI.sample( + backend::MaespaSingleLayerEnvironment, + handle::MaespaEnvironmentHandle, + variable::Symbol, + time, +) + environment = handle.provider == :forcing ? + _maespa_meteo_row(backend.forcing, time) : + backend.canopy + return getproperty(environment, variable) +end + +function PlantSimEngine.EnvironmentAPI.sample( + backend::MaespaSingleLayerEnvironment{F,C}, + handle::MaespaEnvironmentHandle, + state::C, + variable::Symbol, + time, +) where {F,C} + environment = handle.provider == :forcing ? + _maespa_meteo_row(backend.forcing, time) : + state + return getproperty(environment, variable) +end + +function PlantSimEngine.EnvironmentAPI.commit_environment!( + backend::MaespaSingleLayerEnvironment{F,C}, + handle::MaespaEnvironmentHandle, + state::C, + time, +) where {F,C} + handle.sink == :canopy || error( + "MAESPA environment handle for provider `$(handle.provider)` has no `:canopy` commit sink." + ) + backend.canopy = state + return nothing +end + +struct SoilWater{T} <: AbstractMaespa_Soil_WaterModel + theta_sat::T + psi_e::T + b::T + depth1::T + depth2::T +end + +PlantSimEngine.inputs_(::SoilWater) = (transpiration=Required(Float64), infiltration=Required(Float64)) +PlantSimEngine.outputs_(::SoilWater) = (theta1=0.32, theta2=0.34, psi_soil=-0.1) + +function PlantSimEngine.run!(m::SoilWater, status, environment, constants, context) + withdrawal = max(status.transpiration, 0.0) + recharge = max(status.infiltration, 0.0) + status.theta1 = clamp(status.theta1 + (recharge - 0.7 * withdrawal) / max(m.depth1 * 1000.0, 1.0), 0.04, m.theta_sat) + status.theta2 = clamp(status.theta2 - 0.3 * withdrawal / max(m.depth2 * 1000.0, 1.0), 0.04, m.theta_sat) + rel = clamp(status.theta1 / m.theta_sat, 0.05, 1.0) + status.psi_soil = m.psi_e * rel^(-m.b) + return nothing +end + +struct LeafState <: AbstractLeaf_StateModel end + +PlantSimEngine.inputs_(::LeafState) = NamedTuple() +PlantSimEngine.outputs_(::LeafState) = (leaf_area=0.0, leaf_carbon=0.0) + +PlantSimEngine.run!(::LeafState, status, environment, constants, context) = nothing + +""" + LAIModel(area) + +Compute model leaf area and leaf area index from all selected leaves. +""" +struct LAIModel{T} <: AbstractMaespa_Lai_DynamicModel + area::T + + function LAIModel(area::T) where {T} + area > 0 || throw(ArgumentError("`area` must be strictly positive.")) + new{T}(area) + end +end + +PlantSimEngine.inputs_(::LAIModel) = (leaf_areas=Required(Vector{Float64}),) +PlantSimEngine.outputs_(::LAIModel) = (lai=0.0, leaf_area=(-Inf)) + +function PlantSimEngine.run!(m::LAIModel, status, environment, constants, context) + status.leaf_area = sum(status.leaf_areas) + status.lai = status.leaf_area / m.area + return nothing +end + +struct SceneEB{I,T} <: AbstractScene_EbModel + maxiter::I + tol_t::T + tol_vpd::T + tree_height::T + zht::T + zpd::T + z0ht::T + ground_area::T + qc::T + gbcan_min::T + von_karman::T +end + +function SceneEB( + maxiter, + tol_t, + tol_vpd; + tree_height=2.0, + zht=4.0, + zpd=0.75 * tree_height, + z0ht=0.1 * tree_height, + ground_area=1.0, + qc=0.0, + gbcan_min=0.0123, + von_karman=0.41, +) + ground_area > 0.0 || throw(ArgumentError("`ground_area` must be strictly positive.")) + tree_height > 0.0 || throw(ArgumentError("`tree_height` must be strictly positive.")) + zht > 0.0 || throw(ArgumentError("`zht` must be strictly positive.")) + return SceneEB( + maxiter, + promote(tol_t, + tol_vpd, + tree_height, + zht, + zpd, + z0ht, + ground_area, + qc, + gbcan_min, + von_karman)... + ) +end + +PlantSimEngine.inputs_(::SceneEB) = ( + lai=Required(Float64), + leaf_area=Required(Float64), + leaf_areas=Required(Vector{Float64}), + leaf_carbon=Required(Vector{Float64}), + leaf_Ra_SW_f=Required(Vector{Float64}), + leaf_aPPFD=Required(Vector{Float64}), + Ψₗ=Required(Vector{Float64}), + leaf_rn=Required(Vector{Float64}), + leaf_lambda_e=Required(Vector{Float64}), + leaf_h=Required(Vector{Float64}), + leaf_a=Required(Vector{Float64}), + psi_soil=Required(Float64), +) +PlantSimEngine.environment_inputs_(::SceneEB) = ( + T=0.0, + Rh=0.0, + Wind=0.0, + P=0.0, + Cₐ=0.0, + Ri_PAR_f=0.0, + Ri_SW_f=0.0, + duration=Dates.Hour(1), + VPD=0.0, + λ=0.0, +) +PlantSimEngine.environment_outputs_(::SceneEB) = (T=0.0, Rh=0.0) +PlantSimEngine.outputs_(::SceneEB) = ( + canopy_rn=0.0, + canopy_lambda_e=0.0, + canopy_h=0.0, + canopy_tair=20.0, + canopy_vpd=1.0, + canopy_rh=0.7, + canopy_htot=0.0, + canopy_gcanop=0.0, + scene_transpiration=0.0, + scene_infiltration=0.0, + scene_assimilation=0.0, + iterations=0, +) + +struct SceneEBSolverResult + tair::Float64 + vpd::Float64 + rh::Float64 + psi_soil::Float64 + final_meteo + iterations::Int + htot::Float64 + gcanop::Float64 + lai::Float64 +end + +function _model_leaf_meteo(environment, tair_canopy, vpd_canopy) + return Atmosphere( + T=tair_canopy, + Rh=rh_from_vpd(vpd_canopy, e_sat(tair_canopy)), + Wind=environment.Wind, + P=environment.P, + Cₐ=environment.Cₐ, + Ri_PAR_f=environment.Ri_PAR_f, + Ri_SW_f=environment.Ri_SW_f, + duration=environment.duration, + ) +end + +function _check_leaf_vector_lengths(status, variables) + n = length(status.leaf_areas) + for variable in variables + length(getproperty(status, variable)) == n || + throw(DimensionMismatch("`$(variable)` must have the same length as `leaf_areas`.")) + end + return n +end + +function _aggregate_model_leaf_fluxes(status, ground_area, local_meteo) + n = _check_leaf_vector_lengths(status, (:leaf_rn, :leaf_lambda_e, :leaf_h, :leaf_a)) + total_rn = 0.0 + total_lambda_e = 0.0 + total_h = 0.0 + total_a = 0.0 + for i in 1:n + leaf_area = status.leaf_areas[i] + total_rn += status.leaf_rn[i] * leaf_area + total_lambda_e += status.leaf_lambda_e[i] * leaf_area + total_h += status.leaf_h[i] * leaf_area + total_a += status.leaf_a[i] * leaf_area + end + fluxes = ( + rn=total_rn / ground_area, + lambda_e=total_lambda_e / ground_area, + h=total_h / ground_area, + a=total_a / ground_area, + environment=local_meteo, + ) + status.canopy_rn = fluxes.rn + status.canopy_lambda_e = fluxes.lambda_e + status.canopy_h = fluxes.h + status.scene_assimilation = fluxes.a + return fluxes +end + +function _prepare_model_leaf_inputs!(status, environment, psi_soil) + # Prepare the leaf status for each leaf target, and run the energy balance for each leaf: + status.leaf_Ra_SW_f .= environment.Ri_SW_f + status.leaf_aPPFD .= environment.Ri_PAR_f + status.Ψₗ .= psi_soil + return nothing +end + +function _run_model_leaf_targets!(context, status, local_meteo, meteo_above, psi_soil, ground_area; publish=false) + _prepare_model_leaf_inputs!(status, meteo_above, psi_soil) + run_call!( + context, + :energy_balance; + environment=local_meteo, + publish=publish, + ) + fluxes = _aggregate_model_leaf_fluxes(status, ground_area, local_meteo) + return fluxes +end + +function _run_model_leaf_targets_from_environment!(context, status, local_meteo, meteo_above, psi_soil, ground_area; publish=false) + _prepare_model_leaf_inputs!(status, meteo_above, psi_soil) + run_call!(context, :energy_balance; publish=publish) + fluxes = _aggregate_model_leaf_fluxes(status, ground_area, local_meteo) + return fluxes +end + +function gbcanms(wind, zht, tree_height; gbcan_min=0.0123, von_karman=0.41) + zpd = 0.75 * tree_height + z0 = 0.1 * tree_height + zstar = max(zht, eps(Float64)) + wind2 = max(wind, 1.0e-6) + + if zstar <= tree_height + wind2 *= exp(0.13155 * (tree_height / zstar - 1.0)) + zstar = 2.0 * tree_height + end + + zstar = max(zstar, zpd + z0 + 1.0e-6) + windstar = wind2 * von_karman / log((zstar - zpd) / z0) + alpha1 = 1.5 + zw = zpd + alpha1 * (tree_height - zpd) + gbcanmsini = windstar * von_karman / log((zstar - zpd) / (zw - zpd)) + gbcanmsrou = windstar * von_karman / ((zw - tree_height) / (zw - zpd)) + canopy_air_ms = max(1.0 / (1.0 / gbcanmsini + 1.0 / gbcanmsrou), gbcan_min) + + alpha = 2.0 + z0ht2 = 0.01 + kh = alpha1 * von_karman * windstar * (tree_height - zpd) + soil_denominator = tree_height * exp(alpha) * + (exp(-alpha * z0ht2 / tree_height) - exp(-alpha * (zpd + z0) / tree_height)) + soil_canopy_ms = max(alpha * kh / soil_denominator, 0.0) + return (canopy_air_ms=canopy_air_ms, soil_canopy_ms=soil_canopy_ms) +end + +function canopy_air_update(m::SceneEB, fluxes, meteo_above, canopy_meteo, constants) + gbs = gbcanms( + meteo_above.Wind, + m.zht, + m.tree_height; + gbcan_min=m.gbcan_min, + von_karman=m.von_karman, + ) + gbcan_ms = gbs.canopy_air_ms + tair_above = meteo_above.T + vpd_above = max(0.01, meteo_above.VPD) + qn = fluxes.rn + qe = fluxes.lambda_e + rad_interc = get(fluxes, :rad_interc, 0.0) + rnettot = qn + rad_interc + etot = qe + htot = rnettot - etot - m.qc + heat_conductance = constants.Cₚ * canopy_meteo.ρ * gbcan_ms + + tair_new = tair_above + htot / heat_conductance + tair_new = clamp(tair_new, tair_above - 10.0, tair_above + 10.0) + + vpair_above = PlantMeteo.e_sat(tair_above) - vpd_above + vpair_canopy = vpair_above + etot * canopy_meteo.γ / heat_conductance + vpd_new = max(0.01, PlantMeteo.e_sat(tair_new) - vpair_canopy) + vpd_new = clamp(vpd_new, max(0.01, vpd_above - 1.5), vpd_above + 1.5) + environment = _model_leaf_meteo(meteo_above, tair_new, vpd_new) + return (environment=environment, tair=tair_new, vpd=vpd_new, rh=environment.Rh, htot=htot, gcanop=gbcan_ms) +end + +function _solve_model_energy_balance!( + m::SceneEB, + context, + status, + environment, + constants=PlantMeteo.Constants(), +) + tair_above = environment.T + vpd_above = max(0.01, environment.VPD) + tair_canopy = tair_above + vpd_canopy = vpd_above + psi_soil = status.psi_soil + final_meteo = environment + last_update = (tair=tair_canopy, vpd=vpd_canopy, rh=environment.Rh, htot=0.0, gcanop=0.0) + + for iter in 1:m.maxiter + # Run the energy balance of each leaf, and aggregate the fluxes at the canopy scale: + trial_meteo = _model_leaf_meteo(environment, tair_canopy, vpd_canopy) + fluxes = _run_model_leaf_targets!(context, status, trial_meteo, environment, psi_soil, m.ground_area) + # Update the canopy-scale environment based on the leaf fluxes, and check for convergence: + final_meteo = fluxes.environment + update = canopy_air_update(m, fluxes, environment, trial_meteo, constants) + status.canopy_tair = update.tair + status.canopy_vpd = update.vpd + status.canopy_rh = update.rh + status.canopy_htot = update.htot + status.canopy_gcanop = update.gcanop + last_update = update + if abs(update.tair - tair_canopy) < m.tol_t && abs(update.vpd - vpd_canopy) < m.tol_vpd + tair_canopy = update.tair + vpd_canopy = update.vpd + return SceneEBSolverResult( + tair_canopy, + vpd_canopy, + update.rh, + psi_soil, + update.environment, + iter, + update.htot, + update.gcanop, + status.lai, + ) + end + tair_canopy = 0.5 * (tair_canopy + update.tair) # take the average to help convergence + vpd_canopy = 0.5 * (vpd_canopy + update.vpd) + end + + error( + "SceneEB did not converge after $(m.maxiter) iterations ", + "(tol_t=$(m.tol_t), tol_vpd=$(m.tol_vpd), ", + "last_tair=$(last_update.tair), last_vpd=$(last_update.vpd))." + ) +end + +function _publish_model_leaf_solution!(context, status, solution::SceneEBSolverResult, environment, ground_area) + commit_environment!(context, solution.final_meteo) + fluxes = _run_model_leaf_targets_from_environment!( + context, + status, + solution.final_meteo, + environment, + solution.psi_soil, + ground_area; + publish=true, + ) + n = _check_leaf_vector_lengths(status, (:leaf_carbon, :leaf_a)) + for i in 1:n + status.leaf_carbon[i] += status.leaf_a[i] * status.leaf_areas[i] * duration_seconds(environment) * 12.0e-6 + end + return fluxes +end + +function PlantSimEngine.run!(m::SceneEB, status, environment, constants, context) + solution = _solve_model_energy_balance!(m, context, status, environment, constants) + fluxes = _publish_model_leaf_solution!(context, status, solution, environment, m.ground_area) + transpiration_mm = λE_to_E(fluxes.lambda_e, solution.final_meteo.λ) * duration_seconds(environment) * 18.0e-6 + + status.canopy_tair = solution.tair + status.canopy_vpd = solution.vpd + status.canopy_rh = solution.rh + status.canopy_htot = solution.htot + status.canopy_gcanop = solution.gcanop + status.scene_transpiration = transpiration_mm + status.scene_infiltration = 0.0 + status.scene_assimilation = fluxes.a + status.iterations = solution.iterations + run_call!(context, :soil; publish=true) + return nothing +end + +alloc_inputs() = (leaf_carbon=Required(Vector{Float64}),) +alloc_outputs() = (daily_growth=0.0, leaf_pool=0.0, wood_pool=0.0) + +function allocate!(status, leaf_fraction, wood_fraction) + carbon = sum(status.leaf_carbon) + status.daily_growth = carbon + status.leaf_pool += leaf_fraction * carbon + status.wood_pool += wood_fraction * carbon + return nothing +end + +struct AllocA <: AbstractAlloc_AModel + leaf_fraction::Float64 + wood_fraction::Float64 +end + +struct AllocB <: AbstractAlloc_BModel + leaf_fraction::Float64 + wood_fraction::Float64 +end + +PlantSimEngine.inputs_(::AllocA) = alloc_inputs() +PlantSimEngine.outputs_(::AllocA) = alloc_outputs() +PlantSimEngine.inputs_(::AllocB) = alloc_inputs() +PlantSimEngine.outputs_(::AllocB) = alloc_outputs() + +PlantSimEngine.run!(m::AllocA, status, environment, constants, context) = + allocate!(status, m.leaf_fraction, m.wood_fraction) +PlantSimEngine.run!(m::AllocB, status, environment, constants, context) = + allocate!(status, m.leaf_fraction, m.wood_fraction) + +function _maespa_leaf_status(; leaf_area, sky_fraction, d) + return Status( + Ra_SW_f=0.0, + sky_fraction=sky_fraction, + d=d, + aPPFD=0.0, + Ψₗ=-0.1, + leaf_area=leaf_area, + leaf_carbon=0.0, + Tₗ=20.0, + Rn=0.0, + Ra_LW_f=0.0, + H=0.0, + λE=0.0, + Cₛ=400.0, + Cᵢ=300.0, + A=0.0, + Gₛ=0.0, + Gbₕ=0.0, + Dₗ=0.0, + Gbc=0.0, + iter=0, + ) +end + +_maespa_plant_status() = Status(leaf_carbon=[0.0], daily_growth=0.0, leaf_pool=0.0, wood_pool=0.0) + +function _maespa_model_status() + return Status( + leaf_areas=[0.0], + leaf_carbon=[0.0], + leaf_Ra_SW_f=[0.0], + leaf_aPPFD=[0.0], + Ψₗ=[-0.1], + leaf_rn=[0.0], + leaf_lambda_e=[0.0], + leaf_h=[0.0], + leaf_a=[0.0], + canopy_rn=0.0, + canopy_lambda_e=0.0, + canopy_h=0.0, + leaf_area=0.0, + lai=0.0, + canopy_tair=20.0, + canopy_vpd=1.0, + canopy_rh=0.7, + canopy_htot=0.0, + canopy_gcanop=0.0, + scene_transpiration=0.0, + scene_infiltration=0.0, + scene_assimilation=0.0, + psi_soil=-0.1, + iterations=0, + ) +end + +function _maespa_soil_status() + return Status(theta1=0.33, theta2=0.36, psi_soil=-0.10, transpiration=0.0, infiltration=0.0) +end + +function _maespa_species_template(species; monteith, fvcb, tuzet, allocation) + return CompositeModelTemplate( + ( + ModelSpec(monteith; name=:energy_balance, on=Many(scale=:Leaf), calls=(:photosynthesis => One(scale=:Leaf, application=:photosynthesis)), environment=Environment(provider=:canopy), every=Dates.Hour(1)), + ModelSpec(fvcb; name=:photosynthesis, on=Many(scale=:Leaf), calls=(:stomatal_conductance => One(scale=:Leaf, application=:stomatal_conductance)), every=Dates.Hour(1)), + ModelSpec(tuzet; name=:stomatal_conductance, on=Many(scale=:Leaf), every=Dates.Hour(1)), + ModelSpec(LeafState(); name=:leaf_state, on=Many(scale=:Leaf), every=Dates.Hour(1)), + ModelSpec(allocation; name=:allocation, on=One(scale=:Plant), inputs=(:leaf_carbon => Many(scale=:Leaf, within=Subtree(), var=:leaf_carbon)), every=Dates.Day(1)), + ); + kind=:plant, + species=species, + ) +end + +function _maespa_plant_instance(name, template; nleaves, leaf_area, sky_fraction, d) + plant_id = Symbol(name) + axis_id = Symbol(name, "_axis") + leaves = ntuple(nleaves) do index + Object( + Symbol(name, "_leaf_", index); + scale=:Leaf, + parent=axis_id, + status=_maespa_leaf_status(; leaf_area=leaf_area, sky_fraction=sky_fraction, d=d), + ) + end + return ObjectInstance( + name, + template; + root=Object(plant_id; scale=:Plant, parent=:model, status=_maespa_plant_status()), + objects=( + Object(Symbol(name, "_axis"); scale=:Internode, parent=plant_id), + leaves..., + ), + ) +end + +function build_maespa_model(; scene_model=SceneEB(25, 0.03, 0.005), environment=maespa_meteo()) + environment = environment isa MaespaSingleLayerEnvironment ? environment : MaespaSingleLayerEnvironment(environment) + template_a = _maespa_species_template( + :A; + monteith=Monteith(; ε=0.955, maxiter=20, ΔT=0.02), + fvcb=Fvcb(; VcMaxRef=72.0, JMaxRef=135.0, RdRef=1.1), + tuzet=Tuzet(; g0=0.015, g1=4.8, Ψᵥ=-1.4, sf=3.2, Γ=42.0), + allocation=AllocA(0.35, 0.55), + ) + template_b = _maespa_species_template( + :B; + monteith=Monteith(; ε=0.955, maxiter=20, ΔT=0.02), + fvcb=Fvcb(; VcMaxRef=58.0, JMaxRef=110.0, RdRef=1.3), + tuzet=Tuzet(; g0=0.012, g1=3.5, Ψᵥ=-1.1, sf=3.8, Γ=42.0), + allocation=AllocB(0.55, 0.35), + ) + ground_area = scene_model.ground_area + return CompositeModel( + Object(:model; scale=:Scene, kind=:model, status=_maespa_model_status()), + Object(:soil; scale=:Soil, kind=:soil, parent=:model, status=_maespa_soil_status()), + _maespa_plant_instance( + :plant_A, + template_a; + nleaves=2, + leaf_area=0.018, + sky_fraction=1.0, + d=0.035, + ), + _maespa_plant_instance( + :plant_B, + template_b; + nleaves=3, + leaf_area=0.014, + sky_fraction=0.8, + d=0.028, + ); + applications=( + ModelSpec(LAIModel(ground_area); name=:lai_dynamic, on=One(scale=:Scene), inputs=(:leaf_areas => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + process=:leaf_state, + var=:leaf_area, + ),), every=Dates.Day(1)), + ModelSpec(scene_model; name=:scene_eb, on=One(scale=:Scene), inputs=(:leaf_areas => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + process=:leaf_state, + var=:leaf_area, + ), + :leaf_carbon => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + process=:leaf_state, + var=:leaf_carbon, + ), + :leaf_Ra_SW_f => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + var=:Ra_SW_f, + ), + :leaf_aPPFD => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + var=:aPPFD, + ), + :Ψₗ => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + var=:Ψₗ, + ), + :leaf_rn => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + policy=HoldLast(), + var=:Rn, + ), + :leaf_lambda_e => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + policy=HoldLast(), + var=:λE, + ), + :leaf_h => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + policy=HoldLast(), + var=:H, + ), + :leaf_a => Many( + kind=:plant, + scale=:Leaf, + within=SceneScope(), + policy=HoldLast(), + var=:A, + ), + :psi_soil => One( + kind=:soil, + scale=:Soil, + application=:soil_water, + var=:psi_soil, + ),), calls=(:energy_balance => Many(kind=:plant, scale=:Leaf, process=:energy_balance), + :soil => One(kind=:soil, scale=:Soil, application=:soil_water),), environment=Environment(provider=:forcing, sink=:canopy), every=Dates.Hour(1)), + ModelSpec(SoilWater(0.45, -0.03, 4.4, 0.25, 0.75); name=:soil_water, on=One(kind=:soil, scale=:Soil), inputs=(:transpiration => One( + scale=:Scene, + within=SceneScope(), + application=:scene_eb, + var=:scene_transpiration, + ), + :infiltration => One( + scale=:Scene, + within=SceneScope(), + application=:scene_eb, + var=:scene_infiltration, + ),), every=Dates.Hour(1)), + ), + environment=environment, + ) +end + +function maespa_meteo(; nhours=24) + return Weather([ + Atmosphere( + T=22.0 + 5.0 * sinpi((hour - 7) / 12), + Rh=clamp(0.72 - 0.22 * sinpi((hour - 7) / 12), 0.35, 0.90), + Wind=1.2 + 0.3 * sinpi(hour / 12), + Ri_PAR_f=max(0.0, 900.0 * sinpi((hour - 6) / 12)), + Ri_SW_f=max(0.0, 450.0 * sinpi((hour - 6) / 12)), + duration=Dates.Hour(1), + ) + for hour in 1:nhours + ]) +end + +function run_maespa_example(; nhours=24, check=true) + model = build_maespa_model(; environment=maespa_meteo(; nhours=nhours)) + compiled = Advanced.compile_composite_model(model) + check && Advanced.refresh_environment_bindings!(model, compiled) + simulation = run!( + model; + steps=nhours, + constants=PlantMeteo.Constants(), + outputs=:all, + ) + return ( + model=model, + compiled=simulation.compiled, + environment=simulation.environment_bindings, + simulation=simulation, + ) +end + +if abspath(PROGRAM_FILE) == @__FILE__ + result = run_maespa_example() + model = result.model + println("leaf_count = ", length(model_objects(model; scale=:Leaf))) + println( + "scene_transpiration = ", + only(model_objects(model; scale=:Scene)).status.scene_transpiration, + ) + println("psi_soil = ", only(model_objects(model; kind=:soil)).status.psi_soil) + println("plant_A = ", only(model_objects(model; name=:plant_A)).status.daily_growth) + println("plant_B = ", only(model_objects(model; name=:plant_B)).status.daily_growth) +end diff --git a/examples/plantbiophysics_subsample/FvCB.jl b/examples/plantbiophysics_subsample/FvCB.jl new file mode 100644 index 000000000..7efe0031a --- /dev/null +++ b/examples/plantbiophysics_subsample/FvCB.jl @@ -0,0 +1,196 @@ +# Generate all methods for the photosynthesis process: several environment time-steps, components, +# over an MTG, and the mutating /non-mutating versions +@process "photosynthesis" verbose = false + +# Default policy for assimilation rates when consumed at coarser clocks. +# An explicit `ModelSpec(...; inputs=...)` policy overrides this default. +PlantSimEngine.output_policy(::Type{<:AbstractPhotosynthesisModel}) = (A=PlantSimEngine.Integrate(PlantMeteo.DurationSumReducer()),) + + +""" +Farquhar–von Caemmerer–Berry (FvCB) model for C3 photosynthesis (Farquhar et al., 1980; +von Caemmerer and Farquhar, 1981) coupled with a conductance model. +""" +struct Fvcb{T} <: AbstractPhotosynthesisModel + Tᵣ::T + VcMaxRef::T + JMaxRef::T + RdRef::T + TPURef::T + Eₐᵣ::T + O₂::T + Eₐⱼ::T + Hdⱼ::T + Δₛⱼ::T + Eₐᵥ::T + Hdᵥ::T + Δₛᵥ::T + α::T + θ::T +end + +function Fvcb(; Tᵣ=25.0, VcMaxRef=200.0, JMaxRef=250.0, RdRef=0.6, TPURef=9999.0, Eₐᵣ=46390.0, + O₂=210.0, Eₐⱼ=29680.0, Hdⱼ=200000.0, Δₛⱼ=631.88, Eₐᵥ=58550.0, Hdᵥ=200000.0, + Δₛᵥ=629.26, α=0.425, θ=0.7) + + Fvcb(promote(Tᵣ, VcMaxRef, JMaxRef, RdRef, TPURef, Eₐᵣ, O₂, Eₐⱼ, Hdⱼ, Δₛⱼ, Eₐᵥ, Hdᵥ, Δₛᵥ, α, θ)...) +end + +function PlantSimEngine.inputs_(::Fvcb) + ( + aPPFD=Required(Float64), + Tₗ=Required(Float64), + Cₛ=Required(Float64), + ) +end + +function PlantSimEngine.outputs_(::Fvcb) + (A=-Inf, Gₛ=-Inf, Cᵢ=-Inf) +end + +Base.eltype(x::Fvcb) = typeof(x).parameters[1] + +PlantSimEngine.dep(::Fvcb) = ( + stomatal_conductance=PlantSimEngine.Call( + PlantSimEngine.One(scale=:Leaf, process=:stomatal_conductance), + ), +) +PlantSimEngine.timestep_hint(::Type{<:Fvcb}) = ( + required=(Dates.Minute(1), Dates.Hour(6)), + preferred=Dates.Hour(1) +) + +PlantSimEngine.output_policy(::Type{<:Fvcb}) = ( + A=PlantSimEngine.Integrate(PlantMeteo.DurationSumReducer()), # from μmol m-2 s-1 to μmol m-2 timerstep-1 + Cᵢ=PlantSimEngine.Integrate(PlantMeteo.MeanReducer()), + Gₛ=PlantSimEngine.Integrate(PlantMeteo.DurationSumReducer()), +) + +function arrhenius(kref, Eₐ, Tₖ, Tᵣₖ, R) + kref * exp(Eₐ * (Tₖ - Tᵣₖ) / (R * Tₖ * Tᵣₖ)) +end + +function arrhenius(kref, Eₐ, Tₖ, Tᵣₖ, Hd, Δₛ, R) + activation = arrhenius(kref, Eₐ, Tₖ, Tᵣₖ, R) + deactivation_ref = 1.0 + exp((Tᵣₖ * Δₛ - Hd) / (R * Tᵣₖ)) + deactivation = 1.0 + exp((Tₖ * Δₛ - Hd) / (R * Tₖ)) + return activation * deactivation_ref / deactivation +end + +function Γ_star(Tₖ, Tᵣₖ, R=PlantMeteo.Constants().R) + arrhenius(oftype(Tₖ, 42.75), oftype(Tₖ, 37830.0), Tₖ, Tᵣₖ, R) +end + +function get_km(Tₖ, Tᵣₖ, O₂, R=PlantMeteo.Constants().R) + KC = arrhenius(oftype(Tₖ, 404.9), oftype(Tₖ, 79430.0), Tₖ, Tᵣₖ, R) + KO = arrhenius(oftype(Tₖ, 278.4), oftype(Tₖ, 36380.0), Tₖ, Tᵣₖ, R) + return KC * (1.0 + O₂ / KO) +end + +function PlantSimEngine.run!(m::Fvcb, status, environment, constants, context) + + # Tranform Celsius temperatures in Kelvin: + Tₖ = status.Tₗ - constants.K₀ + Tᵣₖ = m.Tᵣ - constants.K₀ + + # Temperature dependence of the parameters: + Γˢ = Γ_star(Tₖ, Tᵣₖ, constants.R) # Gamma star (CO2 compensation point) in μmol mol-1 + Km = get_km(Tₖ, Tᵣₖ, m.O₂, constants.R) # effective Michaelis–Menten coefficient for CO2 + + # Maximum electron transport rate at the given leaf temperature (μmol m-2 s-1): + JMax = arrhenius(m.JMaxRef, m.Eₐⱼ, Tₖ, Tᵣₖ, m.Hdⱼ, m.Δₛⱼ, constants.R) + # Maximum rate of Rubisco activity at the given models temperature (μmol m-2 s-1): + VcMax = arrhenius(m.VcMaxRef, m.Eₐᵥ, Tₖ, Tᵣₖ, m.Hdᵥ, m.Δₛᵥ, constants.R) + # Rate of mitochondrial respiration at the given leaf temperature (μmol m-2 s-1): + Rd = arrhenius(m.RdRef, m.Eₐᵣ, Tₖ, Tᵣₖ, constants.R) + # Rd is also described as the CO2 release in the light by processes other than the PCO + # cycle, and termed "day" respiration, or "light respiration" (Harley et al., 1986). + + # Actual electron transport rate (considering intercepted PAR and leaf temperature): + J = get_J(status.aPPFD, JMax, m.α, m.θ) # in μmol m-2 s-1 + # RuBP regeneration + Vⱼ = J / 4 + + # Stomatal conductance (mol[CO₂] m-2 s-1), dispatched on type of first argument (gs_closure): + stomatal_model = + PlantSimEngine.call_model(context, :stomatal_conductance) + st_closure = + gs_closure(stomatal_model, status, environment, constants, context) + + Cᵢⱼ = get_Cᵢⱼ(Vⱼ, Γˢ, status.Cₛ, Rd, stomatal_model.g0, st_closure) + + # Electron-transport-limited rate of CO2 assimilation (RuBP regeneration-limited): + Wⱼ = Vⱼ * (Cᵢⱼ - Γˢ) / (Cᵢⱼ + 2.0 * Γˢ) # also called Aⱼ + # See Von Caemmerer, Susanna. 2000. Biochemical models of leaf photosynthesis. + # Csiro publishing, eq. 2.23. + # NB: here the equation is modified because we use Vⱼ instead of J, but it is the same. + + # If Rd is larger than Wⱼ, no assimilation: + if Wⱼ - Rd < 1.0e-6 + Cᵢⱼ = Γˢ + Wⱼ = Vⱼ * (Cᵢⱼ - Γˢ) / (Cᵢⱼ + 2.0 * Γˢ) + end + + Cᵢᵥ = get_Cᵢᵥ(VcMax, Γˢ, status.Cₛ, Rd, stomatal_model.g0, st_closure, Km) + + # Rubisco-carboxylation-limited rate of CO₂ assimilation (RuBP activity-limited): + if Cᵢᵥ <= 0.0 || Cᵢᵥ > status.Cₛ + Wᵥ = 0.0 + else + Wᵥ = VcMax * (Cᵢᵥ - Γˢ) / (Cᵢᵥ + Km) + end + + # Net assimilation (μmol m-2 s-1) + status.A = min(Wᵥ, Wⱼ, 3 * m.TPURef) - Rd + + # Stomatal conductance (mol[CO₂] m-2 s-1) + PlantSimEngine.run_call!( + context, + :stomatal_conductance; + sampled_environment=st_closure, + publish=false, + ) + + # Intercellular CO₂ concentration (Cᵢ, μmol mol) + status.Cᵢ = min(status.Cₛ, status.Cₛ - status.A / status.Gₛ) + nothing +end + +function get_J(aPPFD, JMax, α, θ) + (α * aPPFD + JMax - sqrt((α * aPPFD + JMax)^2 - 4 * α * θ * aPPFD * JMax)) / (2 * θ) +end + +function get_Cᵢⱼ(Vⱼ, Γˢ, Cₛ, Rd, g0, st_closure) + a = g0 + st_closure * (Vⱼ - Rd) + b = (1.0 - Cₛ * st_closure) * (Vⱼ - Rd) + g0 * (2.0 * Γˢ - Cₛ) - + st_closure * (Vⱼ * Γˢ + 2.0 * Γˢ * Rd) + c = -(1.0 - Cₛ * st_closure) * Γˢ * (Vⱼ + 2.0 * Rd) - + g0 * 2.0 * Γˢ * Cₛ + + return positive_root(a, b, c) +end + +function get_Cᵢᵥ(VcMAX, Γˢ, Cₛ, Rd, g0, st_closure, Km) + a = g0 + st_closure * (VcMAX - Rd) + b = (1.0 - Cₛ * st_closure) * (VcMAX - Rd) + g0 * (Km - Cₛ) - st_closure * (VcMAX * Γˢ + Km * Rd) + c = -(1.0 - Cₛ * st_closure) * (VcMAX * Γˢ + Km * Rd) - g0 * Km * Cₛ + + return positive_root(a, b, c) +end + +function max_root(a, b, c) + Δ = b^2.0 - 4.0 * a * c + x1 = (-b + sqrt(Δ)) / (2.0 * a) + x2 = (-b - sqrt(Δ)) / (2.0 * a) + return max(x1, x2) +end + +function positive_root(a, b, c) + Δ = b^2.0 - 4.0 * a * c + return Δ >= 0.0 ? (-b + sqrt(Δ)) / (2.0 * a) : 0.0 +end + +function negative_root(a, b, c) + Δ = b^2.0 - 4.0 * a * c + return Δ >= 0.0 ? (-b - sqrt(Δ)) / (2.0 * a) : 0.0 +end diff --git a/examples/plantbiophysics_subsample/Monteith.jl b/examples/plantbiophysics_subsample/Monteith.jl new file mode 100644 index 000000000..1b278df31 --- /dev/null +++ b/examples/plantbiophysics_subsample/Monteith.jl @@ -0,0 +1,731 @@ +#! Careful: this file is a copy/paste from the original model implementation in PlantBiophysics.jl (v0.16.2). It is only used for testing. +#! If you want to use this model, use the one from PlantBiophysics.jl instead, which is more up to date and maintained. + +@process "energy_balance" verbose = false +""" + black_body(T, K₀, σ) + black_body(T) + +Thermal infrared, *i.e.* longwave radiation emitted from a black body at temperature T. + +- `T`: temperature of the object in Celsius degree +- `K₀`: absolute zero (°C) +- `σ` (``W\\ m^{-2}\\ K^{-4}``) [Stefan-Boltzmann constant](https://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_law) + +# Note + +`K₀` and `σ` are taken from `PlantMeteo.Constants` if not provided. + +""" +function black_body(T, K₀, σ) + Tₖ = T - K₀ + σ * (Tₖ^4.0) +end + +function black_body(T) + constants = PlantMeteo.Constants() + black_body(T, constants.K₀, constants.σ) +end + + +""" +Thermal infrared, *i.e.* longwave radiation emitted from an object at temperature T. + +- `T`: temperature of the object in Celsius degree +- `ε` object [emissivity](https://en.wikipedia.org/wiki/Emissivity) (not to confuse with ε the +ratio of molecular weights from `PlantMeteo.Constants`). A typical value for a leaf is 0.955. +- `K₀`: absolute zero (°C) +- `σ` (``W\\ m^{-2}\\ K^{-4}``) [Stefan-Boltzmann constant](https://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_law) + +# Note + +`K₀` and `σ` are taken from `PlantMeteo.Constants` if not provided. + +# Examples + +```julia +# Thermal infrared radiation of water at 25 °C: +grey_body(25.0, 0.96) +``` +""" +function grey_body(T, ε, K₀, σ) + ε * black_body(T, K₀, σ) +end + +function grey_body(T, ε) + constants = PlantMeteo.Constants() + grey_body(T, ε, constants.K₀, constants.σ) +end + + +""" + net_longwave_radiation(T₁,T₂,ε₁,ε₂,F₁,K₀,σ) + net_longwave_radiation(T₁,T₂,ε₁,ε₂,F₁) + +Net longwave radiation fluxes (*i.e.* thermal radiation, W m-2) between an object and another. +The object of interest is at temperature T₁ and has an emissivity ε₁, and the object with +which it exchanges energy is at temperature T₂ and has an emissivity ε₂. + +If the result is positive, then the object of interest gain energy. + +# Arguments + +- `T₁` (Celsius degree): temperature of the target object (object 1) +- `T₂` (Celsius degree): temperature of the object with which there is potential exchange (object 2) +- `ε₁`: object 1 emissivity +- `ε₂`: object 2 emissivity +- `F₁`: view factor (0-1), *i.e.* visible fraction of object 2 from object 1 (see note) +- `K₀`: absolute zero (°C) +- `σ` (``W\\ m^{-2}\\ K^{-4}``) [Stefan-Boltzmann constant](https://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_law) + +# Note + +`F₁`, the view factor (also called shape factor) is a coefficient applied to the semi-hemisphere +field of view of object 1 that "sees" object 2. E.g. a leaf can be viewed as a plane. If one side +of the leaf sees only object 2 in its field of view (e.g. the sky), then `F₁ = 1`. +Then the net longwave radiation flux for this part of the leaf is multiplied by its actual +surface to get the exchange. Note that we apply reciprocity between the two objects for +the view factor (they have the same value), *i.e.*: A₁F₁₂ = A₂F₂₁. + +Then, if we take a leaf as object 1, and the sky as object 2, the visible fraction of +sky viewed by the leaf would be: + +- `0.5` if the leaf is on top of the canopy, *i.e.* the upper side of the leaf sees the sky, +the side bellow sees other leaves and the soil. +- between 0 and 0.5 if it is within the canopy and partly shaded by other objects. + +Note that `A₁` for a leaf is twice its common used leaf area, because `A₁` is the **total** +leaf area of the object that exchange energy. + +```julia +# Net thermal radiation fluxes between a leaf and the sky considering the leaf at the top of +# the canopy: +Tₗ = 25.0 ; Tₐ = 20.0 +ε₁ = 0.955 ; ε₂ = 1.0 +Ra_LW_f = net_longwave_radiation(Tₗ,Tₐ,ε₁,ε₂,1.0) +Ra_LW_f + +# Ra_LW_f is the net longwave radiation flux between the leaf and the atmosphere per surface area. +# To get the actual net longwave radiation flux we need to multiply by the surface of the +# leaf, e.g. for a leaf of 2cm²: +leaf_area = 2e-4 # in m² +Ra_LW_f * leaf_area + +# The leaf lose ~0.0055 W towards the atmosphere. +``` + +# References + +Cengel, Y, et Transfer Mass Heat. 2003. A practical approach. New York, NY, USA: McGraw-Hill. +""" +function net_longwave_radiation(T₁, T₂, ε₁, ε₂, F₁, K₀, σ) + (black_body(T₂, K₀, σ) - black_body(T₁, K₀, σ)) / (1.0 / ε₁ + 1.0 / ε₂ - 1.0) * F₁ +end + +function net_longwave_radiation(T₁, T₂, ε₁, ε₂, F₁) + constants = PlantMeteo.Constants() + net_longwave_radiation(T₁, T₂, ε₁, ε₂, F₁, constants.K₀, constants.σ) +end + +""" + gbₕ_free(Tₐ,Tₗ,d,Dₕ₀) + gbₕ_free(Tₐ,Tₗ,d) + +Leaf boundary layer conductance for heat under **free** convection (m s-1). + +# Arguments + +- `Tₐ` (°C): air temperature +- `Tₗ` (°C): leaf temperature +- `d` (m): characteristic dimension, *e.g.* leaf width (see eq. 10.9 from Monteith and Unsworth, 2013). +- `Dₕ₀ = 21.5e-6`: molecular diffusivity for heat at base temperature. Use value from +`PlantMeteo.Constants` if not provided. + +# Note + +`R` and `Dₕ₀` can be found using `PlantMeteo.Constants`. To transform in ``mol\\ m^{-2}\\ s^{-1}``, +use [`ms_to_mol`](@ref). + +# References + +Leuning, R., F. M. Kelliher, DGG de Pury, et E.-D. SCHULZE. 1995. « Leaf nitrogen, +photosynthesis, conductance and transpiration: scaling from leaves to canopies ». Plant, +Cell & Environment 18 (10): 1183‑1200. + +Monteith, John, et Mike Unsworth. 2013. Principles of environmental physics: plants, +animals, and the atmosphere. Academic Press. Paragraph 10.1.3, eq. 10.9. +""" +function gbₕ_free(Tₐ, Tₗ, d, Dₕ₀=PlantMeteo.Constants().Dₕ₀) + zeroT = zero(Tₐ) # make it type stable + + if abs(Tₗ - Tₐ) > zeroT + Gr = 1.58e8 * d^3.0 * abs(Tₗ - Tₐ) # Grashof number (Monteith and Unsworth, 2013) + # !Note: Leuning et al. (1995) use 1.6e8 (eq. E4). + # Leuning et al. (1995) eq. E3: + Gbₕ_free = 0.5 * get_Dₕ(Tₐ, Dₕ₀) * (Gr^0.25) / d + else + Gbₕ_free = zeroT + end + + return Gbₕ_free +end + + +""" + gbₕ_forced(Wind,d) + +Boundary layer conductance for heat under **forced** convection (m s-1). See eq. E1 from +Leuning et al. (1995) for more details. + +# Arguments + +- `Wind` (m s-1): wind speed +- `d` (m): characteristic dimension, *e.g.* leaf width (see eq. 10.9 from Monteith and Unsworth, 2013). + +# Notes + +`d` is the minimal dimension of the surface of an object in contact with the air. + +# References + +Leuning, R., F. M. Kelliher, DGG de Pury, et E.-D. SCHULZE. 1995. « Leaf nitrogen, +photosynthesis, conductance and transpiration: scaling from leaves to canopies ». Plant, +Cell & Environment 18 (10): 1183‑1200. +""" +function gbₕ_forced(Wind, d) + 0.003 * sqrt(Wind / d) +end + + +""" + get_Dₕ(T,Dₕ₀) + get_Dₕ(T) + +Dₕ -molecular diffusivity for heat at base temperature- from Dₕ₀ (corrected by temperature). +See Monteith and Unsworth (2013, eq. 3.10). + +# Arguments + +- `Tₐ` (°C): temperature +- `Dₕ₀`: molecular diffusivity for heat at base temperature. Use value from `PlantMeteo.Constants` +if not provided. + +# References + +Monteith, John, et Mike Unsworth. 2013. Principles of environmental physics: plants, +animals, and the atmosphere. Academic Press. Paragraph 10.1.3. +""" +function get_Dₕ(T, Dₕ₀=PlantMeteo.Constants().Dₕ₀) + Dₕ₀ * (1 + 0.007 * T) +end + +""" + ms_to_mol(G,T,P,R,K₀) + ms_to_mol(G,T,P) + +Conversion of a conductance `G` from ``m\\ s^{-1}`` to ``mol\\ m^{-2}\\ s^{-1}``. + +# Arguments + +- `G` (``m\\ s^{-1}``): conductance +- `T` (°C): air temperature +- `P` (kPa): air pressure +- `R` (``J\\ mol^{-1}\\ K^{-1}``): universal gas constant. +- `K₀` (°C): absolute zero + +# See also + +[`mol_to_ms`](@ref) for the inverse process. +""" +function ms_to_mol(G, T, P, R, K₀) + G * f_ms_to_mol(T, P, R, K₀) +end + +function ms_to_mol(G, T, P) + constants = PlantMeteo.Constants() + ms_to_mol(G, T, P, constants.R, constants.K₀) +end + +""" + ms_to_mol(G,T,P,R,K₀) + ms_to_mol(G,T,P) + +Conversion of a conductance `G` from ``mol\\ m^{-2}\\ s^{-1}`` to ``m\\ s^{-1}``. + +# Arguments + +- `G` (``m\\ s^{-1}``): conductance +- `T` (°C): air temperature +- `P` (kPa): air pressure +- `R` (``J\\ mol^{-1}\\ K^{-1}``): universal gas constant. +- `K₀` (°C): absolute zero + +# See also + +[`ms_to_mol`](@ref) for the inverse process. +""" +function mol_to_ms(G, T, P, R, K₀) + G / f_ms_to_mol(T, P, R, K₀) +end + +function mol_to_ms(G, T, P) + constants = PlantMeteo.Constants() + mol_to_ms(G, T, P, constants.R, constants.K₀) +end + +""" +Conversion factor between conductance in ``m\\ s^{-1}`` to ``mol\\ m^{-2}\\ s^{-1}``. + +# Arguments + +- `T` (°C): air temperature +- `P` (kPa): air pressure +- `R` (``J\\ mol^{-1}\\ K^{-1}``): universal gas constant. +- `K₀` (°C): absolute zero +""" +function f_ms_to_mol(T, P, R, K₀) + (P * 1000) / (R * (T - K₀)) +end + +""" + gbh_to_gbw(gbh, Gbₕ_to_Gbₕ₂ₒ = PlantMeteo.Constants().Gbₕ_to_Gbₕ₂ₒ) + gbw_to_gbh(gbh, Gbₕ_to_Gbₕ₂ₒ = PlantMeteo.Constants().Gbₕ_to_Gbₕ₂ₒ) + +Boundary layer conductance for water vapor from boundary layer conductance for heat. + +# Arguments + +- `gbh` (m s-1): boundary layer conductance for heat under mixed convection. +- `Gbₕ_to_Gbₕ₂ₒ`: conversion factor. + +# Note + +Gbₕ is the sum of free and forced convection. See [`gbₕ_free`](@ref) and [`gbₕ_forced`](@ref). +""" +function gbh_to_gbw(gbh, Gbₕ_to_Gbₕ₂ₒ=PlantMeteo.Constants().Gbₕ_to_Gbₕ₂ₒ) + gbh * Gbₕ_to_Gbₕ₂ₒ +end + +function gbw_to_gbh(gbh, Gbₕ_to_Gbₕ₂ₒ=PlantMeteo.Constants().Gbₕ_to_Gbₕ₂ₒ) + gbh / Gbₕ_to_Gbₕ₂ₒ +end + + +""" + gsc_to_gsw(Gₛ, Gsc_to_Gsw = PlantMeteo.Constants().Gsc_to_Gsw) + +Conversion of a stomatal conductance for CO₂ into stomatal conductance for H₂O. +""" +function gsc_to_gsw(Gₛ, Gsc_to_Gsw=PlantMeteo.Constants().Gsc_to_Gsw) + Gₛ * Gsc_to_Gsw +end + +""" + gsw_to_gsc(Gₛ, Gsc_to_Gsw = PlantMeteo.Constants().Gsc_to_Gsw) + +Conversion of a stomatal conductance for H₂O into stomatal conductance for CO₂. +""" +function gsw_to_gsc(Gₛ, Gsc_to_Gsw=PlantMeteo.Constants().Gsc_to_Gsw) + Gₛ / Gsc_to_Gsw +end + +""" +γ_star(γ, a_sh, a_s, rbv, Rsᵥ, Rbₕ) + +γ∗, the apparent value of psychrometer constant (kPa K−1). + +# Arguments + +- `γ` (kPa K−1): psychrometer constant +- `aₛₕ` (1,2): number of faces exchanging heat fluxes (see Schymanski et al., 2017) +- `aₛᵥ` (1,2): number of faces exchanging water fluxes (see Schymanski et al., 2017) +- `Rbᵥ` (s m-1): boundary layer resistance to water vapor +- `Rsᵥ` (s m-1): stomatal resistance to water vapor +- `Rbₕ` (s m-1): boundary layer resistance to heat + +# Note + +Using the corrigendum from Schymanski et al. (2017) in here so the definition of +[`latent_heat`](@ref) remains generic. + +Not to be confused with [`Γ_star`](@ref) the CO₂ compensation point. + +# References + +Monteith, John L., et Mike H. Unsworth. 2013. « Chapter 13 - Steady-State Heat Balance: (i) +Water Surfaces, Soil, and Vegetation ». In Principles of Environmental Physics (Fourth Edition), +edited by John L. Monteith et Mike H. Unsworth, 217‑47. Boston: Academic Press. + +Schymanski, Stanislaus J., et Dani Or. 2017. Leaf-Scale Experiments Reveal an Important +Omission in the Penman–Monteith Equation ». Hydrology and Earth System Sciences 21 (2): 685‑706. +https://doi.org/10.5194/hess-21-685-2017. +""" +function γ_star(γ, aₛₕ, aₛᵥ, Rbᵥ, Rsᵥ, Rbₕ) + γ * aₛₕ / aₛᵥ * (Rbᵥ + Rsᵥ) / Rbₕ # rv + Rsᵥ= Boundary + stomatal conductance to water vapour +end + +""" + λE_to_E(λE, λ, Mₕ₂ₒ=PlantMeteo.Constants().Mₕ₂ₒ) + E_to_λE(E, λ, Mₕ₂ₒ=PlantMeteo.Constants().Mₕ₂ₒ) + +Conversion from latent heat (W m-2) to evaporation (mol[H₂O] m-2 s-1) or the +opposite (`E_to_λE`). + +# Arguments + +- `λE`: latent heat flux (W m-2) +- `E`: water evaporation (mol[H₂O] m-2 s-1) +- `λ` (J kg-1): latent heat of vaporization +- `Mₕ₂ₒ = 18.0e-3` (kg mol-1): Molar mass for water. + +# Note + +`λ` can be computed using: + + λ = latent_heat_vaporization(T, constants.λ₀) + +It is also directly available from the [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere) structure, and by extention in [`Weather`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Weather). + +To convert E from mol[H₂O] m-2 s-1 to mm s-1 you can simply do: + + E_mms = E_mol / constants.Mₕ₂ₒ + +mm[H₂O] s-1 is equivalent to kg[H₂O] m-2 s-1, wich is equivalent to l[H₂O] m-2 s-1. + +""" +function λE_to_E(λE, λ, Mₕ₂ₒ=PlantMeteo.Constants().Mₕ₂ₒ) + λE / λ * Mₕ₂ₒ +end + +function E_to_λE(E, λ, Mₕ₂ₒ=PlantMeteo.Constants().Mₕ₂ₒ) + E / Mₕ₂ₒ * λ +end + +""" +Struct to hold parameter and values for the energy model close to the one in +Monteith and Unsworth (2013) + +# Arguments + +- `aₛₕ = 2`: number of faces of the object that exchange sensible heat fluxes +- `aₛᵥ = 1`: number of faces of the object that exchange latent heat fluxes (hypostomatous => 1) +- `ε = 0.955`: emissivity of the object +- `maxiter = 10`: maximal number of iterations allowed to close the energy balance +- `ΔT = 0.01` (°C): maximum difference in object temperature between two iterations to consider convergence + +# Examples + +```julia +energy_model = Monteith() # a leaf in an illuminated chamber +``` +""" +struct Monteith{T,S} <: AbstractEnergy_BalanceModel + aₛₕ::S + aₛᵥ::S + ε::T + maxiter::S + ΔT::T +end + +function Monteith(; aₛₕ=2, aₛᵥ=1, ε=0.955, maxiter=10, ΔT=0.01) + param_int = promote(aₛₕ, aₛᵥ, maxiter) + param_float = promote(ε, ΔT) + Monteith(param_int[1], param_int[2], param_float[1], param_int[3], param_float[2]) +end + +function PlantSimEngine.inputs_(::Monteith) + ( + Ra_SW_f=Required(Float64), + sky_fraction=Required(Float64), + d=Required(Float64), + ) +end + +function PlantSimEngine.environment_inputs_(::Monteith) + ( + T=0.0, + Rh=0.0, + Wind=0.0, + P=0.0, + Cₐ=0.0, + ε=0.0, + VPD=0.0, + γ=0.0, + Δ=0.0, + ρ=0.0, + ) +end + +function PlantSimEngine.outputs_(::Monteith) + ( + Tₗ=-Inf, Rn=-Inf, Ra_LW_f=-Inf, H=-Inf, λE=-Inf, Cₛ=-Inf, Cᵢ=-Inf, + A=-Inf, Gₛ=-Inf, Gbₕ=-Inf, Dₗ=-Inf, Gbc=-Inf, iter=typemin(Int) + ) +end + +Base.eltype(x::Monteith) = typeof(x).parameters[1] +# Multi-rate default for energy balance: keep relatively fine cadence. +PlantSimEngine.timestep_hint(::Type{<:Monteith}) = ( + required=(Dates.Minute(1), Dates.Hour(2)), + preferred=Dates.Hour(1) +) +PlantSimEngine.output_policy(::Type{<:Monteith}) = ( + A=PlantSimEngine.Integrate(PlantMeteo.DurationSumReducer()), + Tₗ=PlantSimEngine.Integrate(PlantMeteo.MeanReducer()), + Rn=PlantSimEngine.Integrate(PlantMeteo.RadiationEnergy()), # W m-2 to MJ m-2 timestep-1 + Ra_LW_f=PlantSimEngine.Integrate(PlantMeteo.RadiationEnergy()), + H=PlantSimEngine.Integrate(PlantMeteo.RadiationEnergy()), + λE=PlantSimEngine.Integrate(PlantMeteo.RadiationEnergy()), + Cₛ=PlantSimEngine.Integrate(PlantMeteo.MeanReducer()), + Cᵢ=PlantSimEngine.Integrate(PlantMeteo.MeanReducer()), + Gₛ=PlantSimEngine.Integrate(PlantMeteo.DurationSumReducer()), + Gbₕ=PlantSimEngine.Integrate(PlantMeteo.DurationSumReducer()), + Dₗ=PlantSimEngine.Integrate(PlantMeteo.MeanReducer()), + Gbc=PlantSimEngine.Integrate(PlantMeteo.DurationSumReducer()), + iter=PlantSimEngine.Integrate(PlantMeteo.MeanReducer()) +) + +PlantSimEngine.dep(::Monteith) = ( + photosynthesis=PlantSimEngine.Call( + PlantSimEngine.One(scale=:Leaf, process=:photosynthesis), + ), +) + +""" + run!(model::Monteith, status, environment, constants, context) + +Leaf energy balance according to Monteith and Unsworth (2013), and corrigendum from +Schymanski et al. (2017). The computation is close to the one from the MAESPA model (Duursma +et al., 2012, Vezy et al., 2018) here. The leaf temperature is computed iteratively to close +the energy balance using the mass flux (~ Rn - λE). + +# Arguments + +- `model`: the current Monteith model instance. +- `status`: the application-local view of the target `Object` state, with + initial values for: + - `Ra_SW_f` (W m-2): net shortwave radiation (PAR + NIR). Often computed from a light interception model + - `sky_fraction` (0-2): view factor between the object and the sky for both faces (see details). + - `d` (m): characteristic dimension, *e.g.* leaf width (see eq. 10.9 from Monteith and Unsworth, 2013). +- `environment`: sampled environment, see [`Atmosphere`](https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere). +- `constants`: physical constants supplied by the `CompositeModel` run. +- `context`: compiled runtime context used for the declared photosynthesis + hard call. + +# Details + +The sky_fraction in the variables is equal to 2 if all the leaf is viewing is sky (e.g. in a +controlled chamber), 1 if the leaf is *e.g.* up on the canopy where the upper side of the +leaf sees the sky, and the side bellow sees soil + other leaves that are all considered at +the same temperature than the leaf, or less than 1 if it is partly shaded. + +# Notes + +If you want the algorithm to print a message whenever it does not reach convergence, use the +debugging mode by executing this in the REPL: `ENV["JULIA_DEBUG"] = PlantBiophysics`. + +More information [here](https://docs.julialang.org/en/v1/stdlib/Logging/#Environment-variables). + +# References + +Duursma, R. A., et B. E. Medlyn. 2012. « MAESPA: a model to study interactions between water +limitation, environmental drivers and vegetation function at tree and stand levels, with an +example application to [CO2] × drought interactions ». Geoscientific Model Development 5 (4): +919‑40. https://doi.org/10.5194/gmd-5-919-2012. + +Monteith, John L., et Mike H. Unsworth. 2013. « Chapter 13 - Steady-State Heat Balance: (i) +Water Surfaces, Soil, and Vegetation ». In Principles of Environmental Physics (Fourth Edition), +edited by John L. Monteith et Mike H. Unsworth, 217‑47. Boston: Academic Press. + +Schymanski, Stanislaus J., et Dani Or. 2017. « Leaf-Scale Experiments Reveal an Important +Omission in the Penman–Monteith Equation ». Hydrology and Earth System Sciences 21 (2): 685‑706. +https://doi.org/10.5194/hess-21-685-2017. + +Vezy, Rémi, Mathias Christina, Olivier Roupsard, Yann Nouvellon, Remko Duursma, Belinda Medlyn, +Maxime Soma, et al. 2018. « Measuring and modelling energy partitioning in canopies of varying +complexity using MAESPA model ». Agricultural and Forest Meteorology 253‑254 (printemps): 203‑17. +https://doi.org/10.1016/j.agrformet.2018.02.005. +""" +function PlantSimEngine.run!(model::Monteith, status, environment, constants, context) + + # Initialisations + status.Tₗ = environment.T - 0.2 + Tₗ_new = zero(environment.T) + status.Cₛ = environment.Cₐ + status.Dₗ = PlantMeteo.e_sat(status.Tₗ) - PlantMeteo.e_sat(environment.T) * environment.Rh + γˢ = Rbₕ = Δ = zero(environment.T) + status.Rn = status.Ra_SW_f + iter = 0 + # ?NB: We use iter = 0 and not 1 to get the right number of iterations at the end + # of the for loop, because we use iter += 1 at the end (so it increments once again) + + # Iterative resolution of the energy balance + for i in 1:model.maxiter + + # Update A, Gₛ, Cᵢ through the declared photosynthesis call: + PlantSimEngine.run_call!( + context, + :photosynthesis; + sampled_environment=environment, + publish=false, + ) + + # Stomatal resistance to water vapor + Rsᵥ = 1.0 / (gsc_to_gsw(mol_to_ms(status.Gₛ, environment.T, environment.P, constants.R, constants.K₀), + constants.Gsc_to_Gsw)) + + # Re-computing the net radiation according to simulated leaf temperature: + status.Ra_LW_f = net_longwave_radiation(status.Tₗ, environment.T, model.ε, environment.ε, + status.sky_fraction, constants.K₀, constants.σ) + #= ? NB: we use the sky fraction here (0-2) instead of the view factor (0-1) because: + - we consider both sides of the leaf at the same time (1 -> leaf sees sky on one face) + - we consider all objects in the model have the same temperature as the leaf + of interest except the atmosphere. So the leaf exchange thermal energy_balance only with + the atmosphere. =# + # status.Ra_LW_f = (grey_body(environment.T,1.0) - grey_body(status.Tₗ, 1.0))*status.sky_fraction + + status.Rn = status.Ra_SW_f + status.Ra_LW_f + + # Leaf boundary conductance for heat (m s-1), one sided: + status.Gbₕ = gbₕ_free(environment.T, status.Tₗ, status.d, constants.Dₕ₀) + + gbₕ_forced(environment.Wind, status.d) + # NB, in MAESPA we use Rni so we add the radiation conductance also (not here) + + # Leaf boundary resistance for heat (s m-1): + Rbₕ = 1 / status.Gbₕ + + # Leaf boundary resistance for water vapor (s m-1): + Rbᵥ = 1 / gbh_to_gbw(status.Gbₕ) + + # Leaf boundary conductance for CO₂ (mol[CO₂] m-2 s-1): + status.Gbc = ms_to_mol(status.Gbₕ, environment.T, environment.P, constants.R, constants.K₀) / + constants.Gbc_to_Gbₕ + + # Update Cₛ using boundary layer conductance to CO₂ and assimilation: + status.Cₛ = min(environment.Cₐ, environment.Cₐ - status.A / (status.Gbc * model.aₛᵥ)) + + # Apparent value of psychrometer constant (kPa K−1) + γˢ = γ_star(environment.γ, model.aₛₕ, model.aₛᵥ, Rbᵥ, Rsᵥ, Rbₕ) + + status.λE = latent_heat(status.Rn, environment.VPD, γˢ, Rbₕ, environment.Δ, environment.ρ, + model.aₛₕ, constants.Cₚ) + + # If potential evaporation is needed, here is how to compute it: + # γˢₑ = γ_star(environment.γ, energy_balance.aₛₕ, 1, Rbᵥ, 1.0e-9, Rbₕ) # Rsᵥ is inf. low + # Ev = latent_heat(status.Rn, environment.VPD, γˢₑ, Rbₕ, environment.Δ, environment.ρ, energy_balance.aₛₕ, constants.Cₚ) + + Tₗ_new = environment.T + (status.Rn - status.λE) / + (environment.ρ * constants.Cₚ * (model.aₛₕ / Rbₕ)) + + if abs(Tₗ_new - status.Tₗ) <= model.ΔT + break + end + + status.Tₗ = Tₗ_new + + # Vapour pressure difference between the surface and the saturation vapour pressure: + status.Dₗ = PlantMeteo.e_sat(status.Tₗ) - PlantMeteo.e_sat(environment.T) * environment.Rh + + iter += 1 + end + + status.H = sensible_heat(status.Rn, environment.VPD, γˢ, Rbₕ, environment.Δ, environment.ρ, + model.aₛₕ, constants.Cₚ) + + status.iter = iter + + @debug begin + if iter == model.maxiter + "`run!` algorithm did not converge. Please check the value." + end + end + + # Transpiration (mol[H₂O] m-2 s-1): + # ET = status.λE / environment.λ * constants.Mₕ₂ₒ + # ET / constants.Mₕ₂ₒ to get mm s-1 <=> kg m-2 s-1 <=> l m-2 s-1 + + nothing +end + +""" + latent_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ, Cₚ) + latent_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ) + +λE -the latent heat flux (W m-2)- using the Monteith and Unsworth (2013) definition corrected by +Schymanski et al. (2017), eq.22. + +- `Rn` (W m-2): net radiation. Carefull: not the isothermal net radiation +- `VPD` (kPa): air vapor pressure deficit +- `γˢ` (kPa K−1): apparent value of psychrometer constant (see `PlantMeteo.γ_star`) +- `Rbₕ` (s m-1): resistance for heat transfer by convection, i.e. resistance to sensible heat +- `Δ` (KPa K-1): rate of change of saturation vapor pressure with temperature (see `PlantMeteo.e_sat_slope`) +- `ρ` (kg m-3): air density of moist air. +- `aₛₕ` (1,2): number of sides that exchange energy for heat (2 for leaves) +- `Cₚ` (J K-1 kg-1): specific heat of air for constant pressure + +# References + +Monteith, J. and Unsworth, M., 2013. Principles of environmental physics: plants, animals, and the atmosphere. Academic Press. See eq. 13.33. + +Schymanski et al. (2017), Leaf-scale experiments reveal an important omission in the Penman–Monteith equation, +Hydrology and Earth System Sciences. DOI: https://doi.org/10.5194/hess-21-685-2017. See equ. 22. + +# Examples + +```julia +Tₐ = 20.0 ; P = 100.0 ; +ρ = air_density(Tₐ, P) # in kg m-3 +Δ = e_sat_slope(Tₐ) + +latent_heat(300.0, 2.0, 0.1461683, 50.0, Δ, ρ, 2.0) +``` +""" +function latent_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ, Cₚ) + (Δ * Rn + ρ * Cₚ * VPD * (aₛₕ / Rbₕ)) / (Δ + γˢ) +end + +function latent_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ) + latent_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ, PlantMeteo.Constants().Cₚ) +end + + +""" + sensible_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ, Cₚ) + sensible_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ) + +H -the sensible heat flux (W m-2)- using the Monteith and Unsworth (2013) definition corrected by +Schymanski et al. (2017), eq.22. + +- `Rn` (W m-2): net radiation. Carefull: not the isothermal net radiation +- `VPD` (kPa): air vapor pressure deficit +- `γˢ` (kPa K−1): apparent value of psychrometer constant (see `PlantMeteo.γ_star`) +- `Rbₕ` (s m-1): resistance for heat transfer by convection, i.e. resistance to sensible heat +- `Δ` (KPa K-1): rate of change of saturation vapor pressure with temperature (see `PlantMeteo.e_sat_slope`) +- `ρ` (kg m-3): air density of moist air. +- `aₛₕ` (1,2): number of sides that exchange energy for heat (2 for leaves) +- `Cₚ` (J K-1 kg-1): specific heat of air for constant pressure + +# References + +Monteith, J. and Unsworth, M., 2013. Principles of environmental physics: plants, animals, and the atmosphere. Academic Press. See eq. 13.33. + +Schymanski et al. (2017), Leaf-scale experiments reveal an important omission in the Penman–Monteith equation, +Hydrology and Earth System Sciences. DOI: https://doi.org/10.5194/hess-21-685-2017. See equ. 22. + +# Examples + +```julia +Tₐ = 20.0 ; P = 100.0 ; +ρ = air_density(Tₐ, P) # in kg m-3 +Δ = PlantMeteo.e_sat_slope(Tₐ) + +sensible_heat(300.0, 2.0, 0.1461683, 50.0, Δ, ρ, 2.0) +``` +""" +function sensible_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ, Cₚ) + (γˢ * Rn - ρ * Cₚ * VPD * (aₛₕ / Rbₕ)) / (Δ + γˢ) +end + +function sensible_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ) + sensible_heat(Rn, VPD, γˢ, Rbₕ, Δ, ρ, aₛₕ, PlantMeteo.Constants().Cₚ) +end diff --git a/examples/plantbiophysics_subsample/Tuzet.jl b/examples/plantbiophysics_subsample/Tuzet.jl new file mode 100644 index 000000000..ff6920d3d --- /dev/null +++ b/examples/plantbiophysics_subsample/Tuzet.jl @@ -0,0 +1,107 @@ +#! Careful: this file is more or less a copy/paste from the original model implementation in PlantBiophysics.jl (v0.16.2). It is only used for testing. +#! If you want to use this model, use the one from PlantBiophysics.jl instead, which is more up to date and maintained. + +# Generate all methods for the stomatal conductance process: several environment time-steps, components, +# over an MTG, and the mutating /non-mutating versions +@process "stomatal_conductance" verbose = false + +# Default policy for stomatal conductance when consumed at coarser clocks. +# Conductance is typically summarized over a window rather than accumulated. +PlantSimEngine.output_policy(::Type{<:AbstractStomatal_ConductanceModel}) = (Gₛ=PlantSimEngine.Aggregate(PlantMeteo.DurationSumReducer()),) + +# Gs accepts either an ordinary sampled environment or a closure value passed +# explicitly by the parent photosynthesis call. +function PlantSimEngine.run!(Gs::Gsm, status, environment, constants, context) where {Gsm<:AbstractStomatal_ConductanceModel} + closure = environment isa Number ? + environment : + gs_closure(Gs, status, environment, constants, context) + status.Gₛ = max( + Gs.gs_min, + Gs.g0 + closure * status.A, + ) +end + +""" +Tuzet et al. (2003) stomatal conductance model for CO₂. + +# Arguments + +- `g0`: intercept (μmol m⁻² s⁻¹). +- `g1`: slope. +- `Ψᵥ`: leaf water potential at which stomatal conductance is halved (MPa). +- `sf`: sensitivity factor for stomatal closure. +- `Γ`: CO₂ compensation point (mol mol⁻¹). +- `gs_min`: residual conductance (μmol m⁻² s⁻¹). + +# Variables + +- `Ψₗ`: leaf water potential (MPa). +- `Cₛ`: CO₂ concentration at the leaf surface (μmol mol⁻¹). +- `A`: CO₂ assimilation rate (μmol m⁻² s⁻¹). +- `Gₛ`: stomatal conductance (μmol m⁻² s⁻¹). + +# Note + +The CO₂ compensation point represents the concentration of CO₂ at which photosynthesis and respiration are balanced, +and it is typically a small positive value around 30–50 μmol mol⁻¹ under normal atmospheric conditions. + +This implementation uses Cₛ instead of Cᵢ. + +# References + +Tuzet, A., Perrier, A., & Leuning, R. (2003). A coupled model of stomatal conductance, photosynthesis and transpiration. Plant, Cell & Environment, 26(7), 1097-1116. +""" +struct Tuzet{T} <: AbstractStomatal_ConductanceModel + g0::T + g1::T + Ψᵥ::T + sf::T + Γ::T + gs_min::T +end + +Tuzet(g0, g1, Ψᵥ, sf, Γ, gs_min=oftype(g0, 0.001)) = Tuzet(promote(g0, g1, Ψᵥ, sf, Γ, gs_min)) +Tuzet(; g0, g1, Ψᵥ, sf, Γ, gs_min=0.001) = Tuzet(g0, g1, Ψᵥ, sf, Γ, gs_min) + +function PlantSimEngine.inputs_(::Tuzet) + (Ψₗ=Required(Float64), Cₛ=Required(Float64)) +end + +function PlantSimEngine.outputs_(::Tuzet) + (Gₛ=-Inf,) +end + +Base.eltype(::Tuzet{T}) where T = T + +""" + gs_closure(::Tuzet, status, environment, constants=nothing, context=nothing) + +Stomatal closure for CO₂ according to Tuzet et al. (2003). + +# Arguments + +- `::Tuzet`: an instance of the `Tuzet` model type. +- `status`: A status struct holding the variables for the models. +- `environment`: sampled environment. It is not used in this model. +- `constants`: A constants struct holding the constants for the models. Is not used in this model. +- `context`: The runtime context. It is not used in this model. + +# Details + +The stomatal conductance is calculated as: + + FPSIF = (1 + exp(sf * psiv)) / (1 + exp(sf * (psiv - Ψₗ))) + GSDIVA = g0 + (g1 / (Cₛ - Γ)) * FPSIF + +where `Γ` is the CO₂ compensation point. +""" +function gs_closure(m::Tuzet, status, environment, constants=nothing, context=nothing) + fpsif = (1 + exp(m.sf * m.Ψᵥ)) / + (1 + exp(m.sf * (m.Ψᵥ - status.Ψₗ))) + (m.g1 / (status.Cₛ - m.Γ)) * fpsif +end + +PlantSimEngine.timestep_hint(::Type{<:Tuzet}) = ( + required=(Dates.Minute(1), Dates.Hour(6)), + preferred=Dates.Hour(1) +) diff --git a/ext/PlantSimEngineGraphEditorExt.jl b/ext/PlantSimEngineGraphEditorExt.jl index a9c18ac95..7976690eb 100644 --- a/ext/PlantSimEngineGraphEditorExt.jl +++ b/ext/PlantSimEngineGraphEditorExt.jl @@ -2,908 +2,1319 @@ module PlantSimEngineGraphEditorExt import HTTP import JSON +import Dates import PlantSimEngine -import PlantSimEngine: edit_graph, current_mapping, apply_edit!, undo!, redo! -import Random - -mutable struct GraphEditorSession{M,G,S} <: PlantSimEngine.AbstractGraphEditorSession - mapping::M - mtg::G - history::Vector{M} - future::Vector{M} - server::S +import PlantSimEngine.GraphEditor: edit_graph, current_model, apply_edit!, undo!, redo! + +mutable struct GraphEditorSession <: PlantSimEngine.GraphEditor.AbstractModelGraphEditorSession + model::PlantSimEngine.CompositeModel + templates::Dict{Symbol,Any} + environments::Dict{Symbol,Any} + history::Vector{Any} + future::Vector{Any} + server::Any host::String port::Int token::String url::String - last_saved_path::Union{Nothing,String} - save_target_path::Union{Nothing,String} autosave_path::Union{Nothing,String} - last_autosaved_path::Union{Nothing,String} - recent_file_path::String - recent_mapping_paths::Vector{String} + save_path::Union{Nothing,String} allow_julia_eval::Bool + recent_paths::Vector{String} end -current_mapping(session::GraphEditorSession) = session.mapping +current_model(session::GraphEditorSession) = session.model + +function _normalize_named_catalog(catalog, label) + entries = if catalog isa NamedTuple + collect(pairs(catalog)) + elseif catalog isa AbstractDict + collect(pairs(catalog)) + else + error("$(label) catalog must be a NamedTuple or dictionary.") + end + normalized = Dict{Symbol,Any}() + for (name_, value) in entries + name_ isa Symbol || error("$(label) catalog names must be symbols, got `$(repr(name_))`.") + name = name_ + Base.isidentifier(String(name)) || error( + "$(label) catalog name `$(name)` must be a valid Julia identifier.", + ) + haskey(normalized, name) && error("$(label) catalog contains duplicate name `$(name)`.") + normalized[name] = value + end + return normalized +end + +function _normalize_template_catalog(catalog) + normalized = _normalize_named_catalog(catalog, "Template") + for (name, template) in normalized + template isa PlantSimEngine.CompositeModelTemplate || error( + "Template catalog entry `$(name)` must be a CompositeModelTemplate.", + ) + end + return normalized +end + +_normalize_environment_catalog(catalog) = _normalize_named_catalog(catalog, "Environment") + function Base.close(session::GraphEditorSession) - isopen(session.server) || return nothing - return close(session.server) + try + isopen(session.server) && close(session.server) + catch + close(session.server) + end + return nothing end function Base.show(io::IO, session::GraphEditorSession) - print(io, "GraphEditorSession(url=\"$(session.url)\", host=\"$(session.host)\", port=$(session.port))") + print(io, "GraphEditorSession(url=$(repr(session.url)), applications=$(length(session.model.applications)))") end function Base.show(io::IO, ::MIME"text/plain", session::GraphEditorSession) println(io, "PlantSimEngineGraphEditorExt.GraphEditorSession") println(io, " Open in browser: $(session.url)") - println(io, " Local state JSON: $(_state_url(session))") + println(io, " State JSON: $(_state_url(session))") + println(io, " Current model: GraphEditor.current_model(session)") println(io, " Quit session: close(session)") - println(io, " Current mapping: current_mapping(session)") - isnothing(session.save_target_path) || println(io, " Auto-saving edits to: $(session.save_target_path)") isnothing(session.autosave_path) || println(io, " Recovery autosave: $(session.autosave_path)") - println(io, " Save mapping code: use the \"Mapping code\" panel in the web editor") + isnothing(session.save_path) || println(io, " Saving changes to: $(session.save_path)") end -current_mapping_code(session::GraphEditorSession) = _model_mapping_to_julia(session.mapping) - """ - edit_graph([mapping]; mtg=nothing, host="127.0.0.1", port=8765, open_browser=true, autosave=true, allow_remote=false, allow_julia_eval=nothing) - -Start a local graph editor session. The returned session owns the current -`ModelMapping`; call `current_mapping(session)` to recover the edited mapping. -Call `edit_graph()` without a mapping to start from an empty scratch editor. - -Single-scale mappings are automatically normalized to multiscale form at the :Default scale. -By default, the session URL is opened with the system default browser. Pass -`open_browser=false` to disable this, for example in scripts or tests. -The URL includes a session token and the server is restricted to localhost -unless `allow_remote=true` is passed explicitly. -Raw `julia` parameter values are disabled by default for remote sessions; pass -`allow_julia_eval=true` only for trusted sessions. -When `autosave=true`, a recovery script is written to the temporary directory. -After saving through the web editor, every successful graph edit, undo, redo, -or recent-file load rewrites the saved Julia script. - -This method is provided by the `PlantSimEngineGraphEditorExt` package extension. -Load `HTTP` in the active session to make it available. + edit_graph([model]; templates=NamedTuple(), environments=NamedTuple(), + host="127.0.0.1", port=0, open_browser=true, + autosave=true, allow_remote=false, allow_julia_eval=nothing) + +Start a local Model graph editor. Julia owns the current Composite model and applies all +semantic edits received from the browser. Call `edit_graph()` to start from an +empty Composite model and `close(session)` to stop the server. `templates` is a +named catalog of `CompositeModelTemplate` presets. `environments` is a named +catalog of server-side environment values; these values are referenced by name +and are never serialized to the browser. """ function edit_graph( - mapping::PlantSimEngine.ModelMapping=_empty_editor_mapping(); - mtg=nothing, + model::PlantSimEngine.CompositeModel=PlantSimEngine.CompositeModel(); host::AbstractString="127.0.0.1", - port::Integer=8765, + port::Integer=0, open_browser::Bool=true, autosave::Bool=true, autosave_path::Union{Nothing,AbstractString}=nothing, - recent_file_path::Union{Nothing,AbstractString}=nothing, + save_path::Union{Nothing,AbstractString}=nothing, allow_remote::Bool=false, allow_julia_eval::Union{Nothing,Bool}=nothing, + recover_path::Union{Nothing,AbstractString}=nothing, + recent_paths=nothing, + templates=NamedTuple(), + environments=NamedTuple(), ) - if !_is_loopback_host(host) && !allow_remote - error("Graph editor sessions are limited to localhost by default. Pass `allow_remote=true` only for a trusted network environment.") - end - - # Normalize single-scale to multiscale form for uniform handling downstream - mapping = _normalize_to_multiscale(mapping) - + _is_loopback_host(host) || allow_remote || error( + "Graph editor sessions are limited to localhost by default. Pass `allow_remote=true` only for a trusted network.", + ) + effective_allow_julia_eval = isnothing(allow_julia_eval) ? !allow_remote : allow_julia_eval + template_catalog = _normalize_template_catalog(templates) + environment_catalog = _normalize_environment_catalog(environments) + catalog_values = ( + values(template_catalog)..., + values(environment_catalog)..., + ) + initial_model = isnothing(recover_path) ? PlantSimEngine._model_graph_deepcopy( + model, + catalog_values, + ) : _load_model_file( + _normalized_path(recover_path); + allow_julia_eval=effective_allow_julia_eval, + environments=environment_catalog, + ) session_ref = Ref{Any}() - handler = http -> _handle_http(session_ref[], http) + handler = stream -> _handle_http(session_ref[], stream) server = HTTP.listen!(handler, host, port; listenany=true, verbose=false) actual_port = HTTP.port(server) token = _session_token() - resolved_allow_julia_eval = isnothing(allow_julia_eval) ? !allow_remote : allow_julia_eval + autosave_file = autosave ? _normalized_path( + isnothing(autosave_path) ? _default_autosave_path() : autosave_path, + ) : nothing + remembered_paths = isnothing(recent_paths) ? _load_recent_paths() : String.(recent_paths) session = GraphEditorSession( - mapping, - mtg, - typeof(mapping)[], - typeof(mapping)[], + initial_model, + template_catalog, + environment_catalog, + Any[], + Any[], server, String(host), actual_port, token, "http://$(host):$(actual_port)/?token=$(token)", - nothing, - nothing, - autosave ? _normalized_output_path(isnothing(autosave_path) ? _default_autosave_path() : autosave_path) : nothing, - nothing, - _normalized_output_path(isnothing(recent_file_path) ? _default_recent_file_path() : recent_file_path), - _load_recent_mapping_paths(isnothing(recent_file_path) ? _default_recent_file_path() : recent_file_path), - resolved_allow_julia_eval, + autosave_file, + isnothing(save_path) ? nothing : _normalized_path(save_path), + effective_allow_julia_eval, + String[_normalized_path(path) for path in remembered_paths], ) session_ref[] = session - _persist_session_mapping!(session; write_save_target=false) + isnothing(session.save_path) || _remember_path!(session, session.save_path) + isnothing(recover_path) || _remember_path!(session, _normalized_path(recover_path)) + _persist_model!(session) open_browser && _open_in_default_browser(session.url) return session end -_session_token() = bytes2hex(rand(Random.RandomDevice(), UInt8, 16)) - -function _is_loopback_host(host::AbstractString) - value = lowercase(strip(String(host))) - return value in ("127.0.0.1", "localhost", "::1", "[::1]", "0:0:0:0:0:0:0:1") -end - -_base_url(session::GraphEditorSession) = "http://$(session.host):$(session.port)" -_state_url(session::GraphEditorSession) = "$(_base_url(session))/state?token=$(session.token)" -_websocket_url(session::GraphEditorSession) = "ws://$(session.host):$(session.port)/ws?token=$(session.token)" - -_empty_editor_mapping() = - PlantSimEngine._build_model_mapping(PlantSimEngine.MultiScale, Dict{Symbol,Tuple}(); validated=false) - -function _open_in_default_browser(url::AbstractString) - try - if Sys.isapple() - run(`open $url`) - elseif Sys.iswindows() - run(`cmd /c start "" $url`) - elseif !isnothing(Sys.which("xdg-open")) - run(`xdg-open $url`) - else - @warn "Could not open graph editor automatically because no supported default-browser command was found." url - return false - end - return true - catch err - @warn "Could not open graph editor automatically. Open the session URL manually." url exception = (err, catch_backtrace()) - return false +function apply_edit!(session::GraphEditorSession, edit::PlantSimEngine.GraphEditor.AbstractModelGraphEdit) + candidate = PlantSimEngine.GraphEditor.apply_model_graph_edit( + session.model, + edit; + preserve=(values(session.templates)..., values(session.environments)...), + ) + if edit isa Union{ + PlantSimEngine.GraphEditor.SetCompositeModelEnvironment, + PlantSimEngine.GraphEditor.SetModelApplicationEnvironment, + } + report = PlantSimEngine.GraphEditor.compile_model_report(candidate) + bindings = PlantSimEngine._compile_environment_bindings_for_applications( + candidate, + report.applications, + ) + PlantSimEngine._validate_model_environment_inputs!( + bindings, + Dict(application.id => application for application in report.applications), + ) end -end - -function apply_edit!(session::GraphEditorSession, edit::PlantSimEngine.AbstractGraphEdit) - updated_mapping = PlantSimEngine.apply_graph_edit(session.mapping, edit) - push!(session.history, session.mapping) + push!(session.history, session.model) empty!(session.future) - session.mapping = updated_mapping - return session.mapping + session.model = candidate + _persist_model!(session) + return session.model end function undo!(session::GraphEditorSession) - isempty(session.history) && return session.mapping - push!(session.future, session.mapping) - session.mapping = pop!(session.history) - return session.mapping + isempty(session.history) && return session.model + push!(session.future, session.model) + session.model = pop!(session.history) + _persist_model!(session) + return session.model end function redo!(session::GraphEditorSession) - isempty(session.future) && return session.mapping - push!(session.history, session.mapping) - session.mapping = pop!(session.future) - return session.mapping + isempty(session.future) && return session.model + push!(session.history, session.model) + session.model = pop!(session.future) + _persist_model!(session) + return session.model end -function _handle_http(session::GraphEditorSession, http::HTTP.Stream) - req = http.message - path = HTTP.URI(req.target).path +_session_token() = PlantSimEngine._graph_editor_session_token() - if HTTP.WebSockets.isupgrade(http.message) - _authorized_request(session, req) || return _write_http_response(http, 403, ["Content-Type" => "text/plain; charset=utf-8"], "Forbidden graph editor session token.") - _authorized_origin(session, req) || return _write_http_response(http, 403, ["Content-Type" => "text/plain; charset=utf-8"], "Forbidden graph editor websocket origin.") - return HTTP.WebSockets.upgrade(http) do ws - _handle_websocket(session, ws) - end - end +function _is_loopback_host(host) + return lowercase(strip(String(host))) in ( + "127.0.0.1", + "localhost", + "::1", + "[::1]", + "0:0:0:0:0:0:0:1", + ) +end - response = if path == "/" || path == "/index.html" || path == "/state" - _authorized_request(session, req) || return _write_http_response(http, 403, ["Content-Type" => "text/plain; charset=utf-8"], "Forbidden graph editor session token.") - if path == "/state" - (200, ["Content-Type" => "application/json"], _state_json(session)) - else - (200, ["Content-Type" => "text/html; charset=utf-8"], _editor_html(session)) +_base_url(session) = "http://$(session.host):$(session.port)" +_state_url(session) = "$(_base_url(session))/state?token=$(session.token)" +_websocket_url(session) = "ws://$(session.host):$(session.port)/ws?token=$(session.token)" + +function _handle_http(session::GraphEditorSession, stream::HTTP.Stream) + request = stream.message + path = HTTP.URI(request.target).path + + if HTTP.WebSockets.isupgrade(request) + _authorized_request(session, request) || return _write_response(stream, 403, "text/plain", "Forbidden session token.") + _authorized_origin(session, request) || return _write_response(stream, 403, "text/plain", "Forbidden websocket origin.") + return HTTP.WebSockets.upgrade(stream) do websocket + _handle_websocket(session, websocket) end - else - (404, ["Content-Type" => "text/plain; charset=utf-8"], "Not found") end - status, headers, body = response - return _write_http_response(http, status, headers, body) -end -function _write_http_response(http::HTTP.Stream, status::Integer, headers, body::AbstractString) - HTTP.setstatus(http, status) - for header in headers - HTTP.setheader(http, header) + if path == "/health" + return _write_response(stream, 200, "application/json", JSON.json(Dict("ok" => true))) end - HTTP.setheader(http, "Connection" => "close") - HTTP.setheader(http, "Content-Length" => string(sizeof(body))) - HTTP.startwrite(http) - write(http, body) - return nothing + _authorized_request(session, request) || return _write_response(stream, 403, "text/plain", "Forbidden session token.") + if path == "/" || path == "/index.html" + return _write_response(stream, 200, "text/html; charset=utf-8", _editor_html(session)) + elseif path == "/static" + view = PlantSimEngine.GraphEditor.model_graph_view( + session.model; + templates=session.templates, + environments=session.environments, + ) + return _write_response( + stream, + 200, + "text/html; charset=utf-8", + PlantSimEngine.GraphEditor.model_graph_view_html(view), + ) + elseif path == "/state" + return _write_response(stream, 200, "application/json", _state_json(session)) + end + return _write_response(stream, 404, "text/plain", "Not found") end -function _authorized_request(session::GraphEditorSession, req) - token = _request_token(req) - return !isnothing(token) && token == session.token +function _write_response(stream, status, content_type, body) + HTTP.setstatus(stream, status) + HTTP.setheader(stream, "Content-Type" => content_type) + HTTP.setheader(stream, "Connection" => "close") + HTTP.setheader(stream, "Content-Length" => string(sizeof(body))) + HTTP.startwrite(stream) + write(stream, body) + return nothing end -function _request_token(req) - header = HTTP.header(req, "X-PlantSimEngine-Graph-Token", "") - isempty(header) || return String(header) - return _query_param(String(req.target), "token") +function _authorized_request(session, request) + token = HTTP.header(request, "X-PlantSimEngine-Graph-Token", "") + isempty(token) && (token = something(_query_parameter(request.target, "token"), "")) + return token == session.token end -function _query_param(target::AbstractString, name::AbstractString) +function _query_parameter(target, requested_name) query = String(HTTP.URI(target).query) isempty(query) && return nothing - for part in split(query, '&') - pair = split(part, '='; limit=2) + for component in split(query, '&') + pair = split(component, '='; limit=2) length(pair) == 2 || continue - first(pair) == name && return last(pair) + first(pair) == requested_name && return last(pair) end return nothing end -function _authorized_origin(session::GraphEditorSession, req) - origin = HTTP.header(req, "Origin", "") - isempty(origin) && return true - return String(origin) == _base_url(session) -end - -""" - _normalize_to_multiscale(mapping::PlantSimEngine.ModelMapping{PlantSimEngine.SingleScale}) - -Convert a single-scale ModelMapping to multiscale form at the :Default scale. -This ensures all downstream logic only deals with MultiScale mappings. -""" -function _normalize_to_multiscale(mapping::PlantSimEngine.ModelMapping{PlantSimEngine.SingleScale}) - entry = mapping[:Default] # Returns tuple of (models..., status) - return PlantSimEngine.ModelMapping(:Default => entry; check=true, type_promotion=PlantSimEngine.type_promotion(mapping)) -end - -function _normalize_to_multiscale(mapping::PlantSimEngine.ModelMapping{PlantSimEngine.MultiScale}) - # Already multiscale, return as is - return mapping +function _authorized_origin(session, request) + origin = HTTP.header(request, "Origin", "") + return isempty(origin) || origin == _base_url(session) end -function _handle_websocket(session::GraphEditorSession, ws) - _websocket_send(ws, _state_json(session)) || return nothing +function _handle_websocket(session, websocket) + _send_websocket(websocket, _state_json(session)) || return nothing try - for message in ws - command = JSON.parse(String(message)) + for raw_message in websocket + command = JSON.parse(String(raw_message)) response = _handle_command!(session, command) - _websocket_send(ws, JSON.json(response)) || return nothing + _send_websocket(websocket, JSON.json(response)) || return nothing end catch err - _is_websocket_close_error(err) && return nothing - _websocket_send(ws, JSON.json(_error_payload(err))) + _is_close_error(err) || _send_websocket( + websocket, + JSON.json(Dict("ok" => false, "diagnostics" => [sprint(showerror, err)])), + ) end return nothing end -function _websocket_send(ws, payload::AbstractString) +function _send_websocket(websocket, payload) try - HTTP.WebSockets.send(ws, payload) + HTTP.WebSockets.send(websocket, payload) return true catch err - _is_websocket_close_error(err) && return false + _is_close_error(err) && return false rethrow() end end -function _is_websocket_close_error(err) - err isa EOFError && return true - err isa Base.IOError && return true - return false -end +_is_close_error(err) = err isa EOFError || err isa Base.IOError -function _handle_command!(session::GraphEditorSession, command) - action = get(command, "action", "") +function _handle_command!(session, command) + action = String(get(command, "action", "")) try - persist = false if action == "undo" undo!(session) - persist = true elseif action == "redo" redo!(session) - persist = true elseif action == "edit" - edit = _edit_from_command(session, command) - apply_edit!(session, edit) - persist = true - elseif action == "write_mapping_code" - raw_path = get(command, "path", "") - _write_mapping_code!(session, String(raw_path)) - elseif action == "open_mapping_code" - raw_path = get(command, "path", "") - _open_mapping_code!(session, String(raw_path)) - persist = true + apply_edit!(session, _edit_from_command(session, command)) + elseif action == "save_model_code" + session.save_path = _normalized_path(String(command["path"])) + _remember_path!(session, session.save_path) + _persist_model!(session) + elseif action == "open_model_code" + path = _normalized_path(String(command["path"])) + candidate = _load_model_file( + path; + allow_julia_eval=session.allow_julia_eval, + environments=session.environments, + ) + push!(session.history, session.model) + empty!(session.future) + session.model = candidate + session.save_path = path + _remember_path!(session, path) + _persist_model!(session) + elseif action == "preview_input_binding" + return _preview_input_binding_payload(session, command) + elseif action == "preview_application_targets" + return _preview_application_targets_payload(session, command) + elseif action == "preview_instance" + return _preview_instance_payload(session, command) + elseif action in ("open_add_application", "begin_add_application") + # This command only focuses/prefills frontend state. The Composite model is + # changed by a subsequent add_application edit. else - error("Unsupported graph editor command action `$action`.") + error("Unsupported graph editor command action `$(action)`.") end - diagnostics = persist ? _persist_session_mapping!(session) : String[] - return _state_payload(session; ok=isempty(diagnostics), diagnostics=diagnostics) + return _state_payload(session) catch err return _state_payload(session; ok=false, diagnostics=[sprint(showerror, err)]) end end -function _edit_from_command(session::GraphEditorSession, command) - kind = get(command, "kind", "") - kind == "mark_previous_timestep" && return PlantSimEngine.MarkPreviousTimeStep( - Symbol(command["scale"]), - Symbol(command["process"]), - Symbol(command["variable"]), - ) - kind == "unmark_previous_timestep" && return PlantSimEngine.UnmarkPreviousTimeStep( - Symbol(command["scale"]), - Symbol(command["process"]), - Symbol(command["variable"]), +function _preview_instance_payload(session, command) + candidate = PlantSimEngine.GraphEditor.apply_model_graph_edit( + session.model, + _add_instance_edit(session, command), ) - kind == "remove_model" && return PlantSimEngine.RemoveModel( - Symbol(command["scale"]), - Symbol(command["process"]), - ) - if kind == "update_model" - model_type = _resolve_model_type(command["modelType"]) - parameters = _parameters_from_command(session, get(command, "parameters", Dict())) - timestep = _timestep_from_command(get(command, "timestep", nothing); default_sentinel=true) - return PlantSimEngine.UpdateModel( - Symbol(command["scale"]), - Symbol(command["process"]), - Symbol(get(command, "targetScale", command["scale"])), - model_type, - parameters, - timestep, - ) - end - kind == "set_mapped_variable" && return PlantSimEngine.SetMappedVariable( - Symbol(command["scale"]), - Symbol(command["process"]), - Symbol(command["variable"]), - Symbol(command["sourceScale"]), - Symbol(command["sourceVariable"]), - Symbol(get(command, "mode", "single")), - Symbol.(get(command, "extraSourceScales", [])), + name = Symbol(command["name"]) + instance = only(item for item in candidate.instances if item.name == name) + report = PlantSimEngine.GraphEditor.compile_model_report(candidate) + application_ids = PlantSimEngine._instance_application_ids(candidate, instance) + payload = _state_payload(session) + payload["instancePreview"] = Dict{String,Any}( + "name" => string(name), + "objectIds" => [ + PlantSimEngine._model_graph_json_value(id.value) + for id in PlantSimEngine._instance_object_ids(candidate, instance) + ], + "applications" => [ + Dict( + "applicationId" => string(application.id), + "targetIds" => [ + PlantSimEngine._model_graph_json_value(id.value) + for id in application.target_ids + ], + ) + for application in report.applications if application.id in application_ids + ], + "diagnostics" => [diagnostic.message for diagnostic in report.diagnostics], ) - kind == "set_initialization" && return PlantSimEngine.SetStatusVariable( - Symbol(command["scale"]), - Symbol(command["variable"]), - _parse_parameter_value(session, get(command, "value", Dict("type" => "julia", "value" => "nothing"))), - ) - if kind in ("add_model", "replace_model") - model_type = _resolve_model_type(command["modelType"]) - parameters = _parameters_from_command(session, get(command, "parameters", Dict())) - timestep = _timestep_from_command(get(command, "timestep", nothing)) - if kind == "add_model" - return PlantSimEngine.AddModel(Symbol(command["scale"]), model_type, parameters, timestep) + return payload +end + +function _preview_application_targets_payload(session, command) + selector = _selector_from_payload(command["selector"]) + groups = Dict{String,Any}[] + target_ids = if haskey(command, "applicationRef") + application = _application_ref_from_command(command) + if application.scope == :template + _, selected = PlantSimEngine._model_edit_instance( + session.model, + something(application.instance), + ) + ids = PlantSimEngine.ObjectId[] + for instance in session.model.instances + instance.template === selected.template || continue + scoped = PlantSimEngine._selector_with_scope( + selector, + PlantSimEngine.Scope(instance.name), + ) + selected_ids = PlantSimEngine.resolve_object_ids(session.model, scoped) + append!(ids, selected_ids) + push!(groups, Dict( + "instance" => string(instance.name), + "objectIds" => [id.value for id in selected_ids], + )) + end + unique(ids) + else + PlantSimEngine.resolve_object_ids(session.model, selector) end - return PlantSimEngine.ReplaceModel(Symbol(command["scale"]), Symbol(command["process"]), model_type, parameters, timestep) + else + PlantSimEngine.resolve_object_ids(session.model, selector) end - error("Unsupported graph edit kind `$kind`.") + payload = _state_payload(session) + payload["targetPreview"] = Dict{String,Any}( + "objectIds" => [PlantSimEngine._model_graph_json_value(id.value) for id in target_ids], + "count" => length(target_ids), + "groups" => groups, + ) + return payload end -function _timestep_from_command(timestep; default_sentinel::Bool=false) - isnothing(timestep) && return nothing - timestep isa AbstractDict || error("Unsupported timestep payload `$(timestep)`.") - mode = String(get(timestep, "mode", "default")) - mode == "default" && return (default_sentinel ? :default : nothing) - mode == "clock" || error("Unsupported timestep mode `$mode`. Use `default` or `clock`.") - dt = _parse_real(get(timestep, "dt", "1.0")) - phase = _parse_real(get(timestep, "phase", "0.0")) - return PlantSimEngine.ClockSpec(dt, phase) +function _preview_input_binding_payload(session, command) + application = _application_ref_from_command(command) + application_ids = PlantSimEngine._model_edit_compiled_application_ids( + session.model, + application, + ) + input = Symbol(command["input"]) + candidate = PlantSimEngine.GraphEditor.apply_model_graph_edit( + session.model, + PlantSimEngine.GraphEditor.SetModelInputBinding( + application, + input, + _selector_for_application(session, application, command["selector"]), + ), + ) + report = PlantSimEngine.GraphEditor.compile_model_report(candidate) + bindings = [ + binding for binding in report.input_bindings + if binding.application_id in application_ids && binding.input == input + ] + payload = _state_payload(session) + payload["selectorPreview"] = Dict{String,Any}( + "applicationRef" => _application_ref_payload(application), + "input" => string(input), + "consumerObjectIds" => unique([ + PlantSimEngine._model_graph_json_value(binding.consumer_id.value) + for binding in bindings + ]), + "sourceObjectIds" => unique([ + PlantSimEngine._model_graph_json_value(source_id.value) + for binding in bindings for source_id in binding.source_ids + ]), + "sourceApplicationIds" => unique([ + string(source_id) for binding in bindings + for source_id in binding.source_application_ids + ]), + "bindingCount" => length(bindings), + "diagnostics" => [diagnostic.message for diagnostic in report.diagnostics], + ) + return payload end -_parse_real(value::Real) = Float64(value) -_parse_real(value) = parse(Float64, String(value)) +function _application_ref_payload(application) + return Dict{String,Any}( + "scope" => string(application.scope), + "applicationId" => string(application.application_id), + "instance" => isnothing(application.instance) ? nothing : string(application.instance), + ) +end -function _resolve_model_type(label) - for model_type in PlantSimEngine.available_models() - string(model_type) == label && return model_type - string(nameof(model_type)) == label && return model_type +function _application_ref_from_command(command) + payload = get(command, "applicationRef", nothing) + payload isa AbstractDict || error("Application commands require an `applicationRef` object.") + scope = Symbol(get(payload, "scope", "")) + application_id = Symbol(get(payload, "applicationId", "")) + scope == :global && return PlantSimEngine.GraphEditor.GlobalApplicationRef(application_id) + scope == :template && return PlantSimEngine.GraphEditor.TemplateApplicationRef( + payload["instance"], + application_id, + ) + error("Unsupported application owner scope `$(scope)`.") +end + +function _model_local_templates(session) + templates = Any[] + for instance in session.model.instances + any(template -> template === instance.template, values(session.templates)) && continue + any(template -> template === instance.template, templates) || push!(templates, instance.template) end - error("No loaded PlantSimEngine model type matches `$label`. Load the package that defines it first.") + return templates end -function _parameters_from_command(session::GraphEditorSession, parameters) - pairs = Pair{Symbol,Any}[] - for (key, value) in parameters - push!(pairs, Symbol(key) => _parse_parameter_value(session, value)) +function _template_from_id(session, template_id) + text = String(template_id) + if startswith(text, "catalog:") + name = Symbol(chopprefix(text, "catalog:")) + haskey(session.templates, name) || error("Unknown template catalog entry `$(name)`.") + return session.templates[name] + elseif startswith(text, "model:") + index = parse(Int, chopprefix(text, "model:")) + templates = _model_local_templates(session) + checkbounds(Bool, templates, index) || error("Unknown model-local template `$(text)`.") + return templates[index] end - return (; pairs...) + error("Unsupported template id `$(text)`.") end -function _parse_parameter_value(session::GraphEditorSession, value) - value isa AbstractDict || return value - choice = Symbol(get(value, "type", "julia")) - raw = get(value, "value", nothing) - choice == :float && return parse(Float64, raw) - choice == :integer && return parse(Int, raw) - choice == :boolean && return parse(Bool, raw) - choice == :symbol && return Symbol(raw) - choice == :string && return String(raw) - choice == :nothing && return nothing - choice == :julia && !session.allow_julia_eval && error("Raw Julia parameter values are disabled for this graph editor session.") - choice == :julia && return Core.eval(Main, Meta.parse(String(raw))) - return raw +function _environment_from_id(session, environment_id) + isnothing(environment_id) && return nothing + text = String(environment_id) + text == "none" && return nothing + startswith(text, "environment:") || error("Unsupported environment id `$(text)`.") + name = Symbol(chopprefix(text, "environment:")) + haskey(session.environments, name) || error("Unknown environment catalog entry `$(name)`.") + return session.environments[name] end -function _state_payload(session::GraphEditorSession; ok::Bool=true, diagnostics::Vector{String}=String[]) - graph = JSON.parse(PlantSimEngine.graph_view_json(session.mapping)) - isempty(get(graph, "scales", Any[])) && (graph["scales"] = ["Default"]) - append!(graph["diagnostics"], diagnostics) - return Dict( - "ok" => ok, - "diagnostics" => diagnostics, - "graph" => graph, - "models" => [PlantSimEngine.model_descriptor(T) for T in PlantSimEngine.available_models()], - "canUndo" => !isempty(session.history), - "canRedo" => !isempty(session.future), - "url" => session.url, - "mappingCode" => current_mapping_code(session), - "initializations" => _initialization_payload(session.mapping), - "lastSavedPath" => session.last_saved_path, - "saveTargetPath" => session.save_target_path, - "autosavePath" => session.autosave_path, - "lastAutosavedPath" => session.last_autosaved_path, - "recentMappings" => session.recent_mapping_paths, - ) -end - -_state_json(session::GraphEditorSession) = JSON.json(_state_payload(session)) -_error_payload(err) = Dict("ok" => false, "diagnostics" => [sprint(showerror, err)]) - -function _editor_html(session::GraphEditorSession) - react_html = _react_editor_html(session) - isnothing(react_html) || return react_html - - graph_json = PlantSimEngine.graph_view_json(session.mapping) - config_json = JSON.json(Dict("websocketUrl" => _websocket_url(session))) - return """ - - - - - -PlantSimEngine Graph Editor - - - - -
-

PlantSimEngine Graph Editor

-

This live session is running. The React editor can connect to $(_websocket_url(session)).

-

Current graph state is available at /state.

-

-
- - - -""" +function _edit_from_command(session, command) + kind = String(get(command, "kind", "")) + kind == "add_instance" && return _add_instance_edit(session, command) + kind == "remove_instance" && return PlantSimEngine.GraphEditor.RemoveModelInstance(command["name"]) + kind == "set_model_environment" && return PlantSimEngine.GraphEditor.SetCompositeModelEnvironment( + _environment_from_id(session, get(command, "environmentId", nothing)), + ) + application = kind in ( + "remove_application", "mark_previous_timestep", "unmark_previous_timestep", + "break_cycle", "set_application_targets", "set_input_binding", + "remove_input_binding", "set_call_binding", "remove_call_binding", + "set_application_cadence", "set_application_environment", "set_output_routing", + "set_update_ordering", "set_instance_override", "remove_instance_override", + "set_object_override", "remove_object_override", "update_application", + "replace_application_model", + ) ? _application_ref_from_command(command) : nothing + kind == "remove_application" && return PlantSimEngine.GraphEditor.RemoveModelApplication(application) + kind == "mark_previous_timestep" && return PlantSimEngine.GraphEditor.MarkModelPreviousTimeStep( + application, + Symbol(command["input"]), + ) + kind == "unmark_previous_timestep" && return PlantSimEngine.GraphEditor.UnmarkModelPreviousTimeStep( + application, + Symbol(command["input"]), + ) + kind == "break_cycle" && return PlantSimEngine.GraphEditor.BreakModelCycle( + application, + Symbol(command["input"]), + Bool(get(command, "initializeMissing", false)), + _parameter_value(session, get(command, "initialValue", nothing)), + ) + kind == "set_application_targets" && return PlantSimEngine.GraphEditor.SetModelApplicationTargets( + application, + _selector_for_application(session, application, command["selector"]), + ) + kind == "set_input_binding" && return PlantSimEngine.GraphEditor.SetModelInputBinding( + application, + Symbol(command["input"]), + _selector_for_application(session, application, command["selector"]), + ) + kind == "remove_input_binding" && return PlantSimEngine.GraphEditor.RemoveModelInputBinding( + application, + Symbol(command["input"]), + ) + kind == "set_call_binding" && return PlantSimEngine.GraphEditor.SetModelCallBinding( + application, + Symbol(command["call"]), + _selector_for_application(session, application, command["selector"]), + ) + kind == "remove_call_binding" && return PlantSimEngine.GraphEditor.RemoveModelCallBinding( + application, + Symbol(command["call"]), + ) + kind == "set_application_cadence" && return PlantSimEngine.GraphEditor.SetModelApplicationCadence( + application, + _period_from_payload(get(command, "cadence", nothing)), + ) + kind == "set_application_environment" && return PlantSimEngine.GraphEditor.SetModelApplicationEnvironment( + application, + _application_environment_from_payload(session, get(command, "configuration", nothing)), + ) + kind == "set_output_routing" && return PlantSimEngine.GraphEditor.SetModelOutputRouting( + application, + Symbol(command["output"]), + Symbol(command["route"]), + ) + kind == "set_update_ordering" && return PlantSimEngine.GraphEditor.SetModelUpdateOrdering( + application, + _updates_from_payload(application, get(command, "updates", Any[])), + ) + kind == "set_object_status" && return PlantSimEngine.GraphEditor.SetModelObjectStatus( + command["objectId"], + Symbol(command["variable"]), + _parameter_value(session, command["value"]), + ) + kind == "set_object_statuses" && return PlantSimEngine.GraphEditor.SetModelObjectStatuses( + command["objectIds"], + Symbol(command["variable"]), + _parameter_value(session, command["value"]), + ) + kind == "remove_object_status" && return PlantSimEngine.GraphEditor.RemoveModelObjectStatus( + command["objectId"], + Symbol(command["variable"]), + ) + kind in ("set_object_metadata", "update_object") && return PlantSimEngine.GraphEditor.SetModelObjectMetadata( + PlantSimEngine.ObjectId(command["objectId"]), + _metadata_from_payload(get(command, "configuration", Dict())), + ) + kind == "add_object" && return PlantSimEngine.GraphEditor.AddModelObject( + _object_from_command(session, command), + ) + kind == "remove_object" && return PlantSimEngine.GraphEditor.RemoveModelObject( + command["objectId"]; + recursive=Bool(get(command, "recursive", true)), + ) + kind == "reparent_object" && return PlantSimEngine.ReparentModelObject( + command["objectId"], + get(command, "parentId", nothing), + ) + kind == "set_instance_override" && return PlantSimEngine.GraphEditor.SetModelInstanceOverride( + command["instance"], + application.application_id, + _construct_model(session, command["modelType"], get(command, "parameters", Dict())), + ) + kind == "remove_instance_override" && return PlantSimEngine.GraphEditor.RemoveModelInstanceOverride( + command["instance"], + application.application_id, + ) + kind == "set_object_override" && return PlantSimEngine.GraphEditor.SetModelObjectOverride( + command["instance"], + command["objectId"], + application.application_id, + _construct_model(session, command["modelType"], get(command, "parameters", Dict())), + ) + kind == "remove_object_override" && return PlantSimEngine.GraphEditor.RemoveModelObjectOverride( + command["instance"], + command["objectId"], + application.application_id, + ) + kind == "add_application" && return _add_application_edit(session, command) + kind == "update_application" && return _update_application_edit(session, command) + kind == "replace_application_model" && return PlantSimEngine.GraphEditor.ReplaceModelApplicationModel( + application, + _construct_model(session, command["modelType"], get(command, "parameters", Dict())), + ) + error("Unsupported Model graph edit kind `$(kind)`.") +end + +function _add_instance_edit(session, command) + root_payload = get(command, "rootObject", nothing) + root = isnothing(root_payload) ? nothing : _object_from_command(session, root_payload) + root_id = isnothing(root) ? command["rootId"] : root.id + return PlantSimEngine.GraphEditor.AddModelInstance( + command["name"], + _template_from_id(session, command["templateId"]), + root_id; + root_object=root, + ) +end + +function _selector_for_application(session, application, payload) + selector = _selector_from_payload(payload) + application.scope == :global && return selector + _, instance = PlantSimEngine._model_edit_instance( + session.model, + something(application.instance), + ) + return PlantSimEngine._model_edit_unmount_selector(selector, instance) +end + +function _application_environment_from_payload(session, payload) + isnothing(payload) && return nothing + payload isa AbstractDict || error("Application environment configuration must be an object.") + values = Pair{Symbol,Any}[] + backend_id = get(payload, "backendId", "scene") + backend_id in (nothing, "scene") || push!(values, :backend => _environment_from_id(session, backend_id)) + provider = get(payload, "provider", nothing) + isnothing(provider) || isempty(strip(String(provider))) || push!(values, :provider => Symbol(provider)) + sources = get(payload, "sources", Dict()) + isempty(sources) || push!(values, :sources => (; ( + Symbol(key) => Symbol(value) for (key, value) in pairs(sources) + if !isempty(strip(String(value))) + )...)) + sink = get(payload, "sink", nothing) + isnothing(sink) || isempty(strip(String(sink))) || push!(values, :sink => Symbol(sink)) + extra = _configuration_from_payload(session, get(payload, "extra", Dict())) + append!(values, pairs(extra)) + return (; values...) +end + +function _symbol_keyed_namedtuple(payload) + payload isa AbstractDict || error("Expected an object-valued configuration payload.") + return (; (Symbol(key) => value for (key, value) in payload)...) end -function _react_editor_html(session::GraphEditorSession) - assets_dir = _frontend_dist_dir() - manifest_path = joinpath(assets_dir, ".vite", "manifest.json") - isfile(manifest_path) || return nothing +function _metadata_from_payload(payload) + payload isa AbstractDict || error("Expected an object metadata payload.") + return (; ( + Symbol(key) => (value isa AbstractString && isempty(strip(value)) ? nothing : value) + for (key, value) in payload + )...) +end - manifest = JSON.parse(read(manifest_path, String)) - entry = nothing - for value in values(manifest) - if get(value, "isEntry", false) == true - entry = value - break +function _configuration_from_payload(session, payload) + isnothing(payload) && return nothing + payload isa AbstractDict || return payload + values = Pair{Symbol,Any}[] + for (key, value) in payload + parsed = if value isa AbstractDict && haskey(value, "type") && haskey(value, "value") + _parameter_value(session, value) + elseif value isa AbstractDict + _configuration_from_payload(session, value) + elseif value isa AbstractVector + [_configuration_from_payload(session, item) for item in value] + else + value end + push!(values, Symbol(key) => parsed) end - isnothing(entry) && (entry = get(manifest, "index.html", nothing)) - isnothing(entry) && return nothing - - js_file = get(entry, "file", nothing) - isnothing(js_file) && return nothing - css_files = get(entry, "css", Any[]) - js = read(joinpath(assets_dir, js_file), String) - css = join([read(joinpath(assets_dir, css_file), String) for css_file in css_files], "\n") - graph_json = PlantSimEngine.graph_view_json(session.mapping) - config_json = replace(JSON.json(Dict("websocketUrl" => _websocket_url(session))), " "<\\/") - - return """ - - - - - -PlantSimEngine Graph Editor - - - - - -
- - - -""" + return (; values...) end -_frontend_dist_dir() = normpath(joinpath(@__DIR__, "..", "frontend", "dist")) +function _updates_from_payload(application, payload) + payload isa AbstractVector || error("Update ordering must be an array.") + prefix = application.scope == :template ? string(application.instance, "__") : "" + return Tuple( + PlantSimEngine.Updates( + Symbol.(get(item, "variables", Any[]))...; + after=Symbol[ + Symbol( + !isempty(prefix) && startswith(String(value), prefix) ? + chopprefix(String(value), prefix) : String(value), + ) + for value in get(item, "after", Any[]) + ], + ) + for item in payload + ) +end -function _write_mapping_code!(session::GraphEditorSession, raw_path::AbstractString) - path = strip(String(raw_path)) - isempty(path) && error("The output path is empty. Provide a .jl file path.") - full_path = _normalized_output_path(path) - _atomic_write(full_path, current_mapping_code(session) * "\n") - session.last_saved_path = full_path - session.save_target_path = full_path - _remember_recent_mapping!(session, full_path) - return full_path +function _object_from_command(session, command) + configuration = get(command, "configuration", Dict()) + status_payload = get(command, "status", Dict()) + status = if isempty(status_payload) + nothing + else + PlantSimEngine.Status((; ( + Symbol(name) => _parameter_value(session, value) + for (name, value) in status_payload + )...)) + end + return PlantSimEngine.Object( + command["objectId"]; + scale=get(configuration, "scale", nothing), + kind=get(configuration, "kind", nothing), + species=get(configuration, "species", nothing), + name=get(configuration, "name", nothing), + parent=get(configuration, "parent", nothing), + status=status, + ) end -function _open_mapping_code!(session::GraphEditorSession, raw_path::AbstractString) - path = strip(String(raw_path)) - isempty(path) && error("The input path is empty. Provide a .jl file path.") - full_path = _normalized_output_path(path) - isfile(full_path) || error("No mapping code file exists at `$full_path`.") - mapping = _mapping_from_julia_file(full_path) - push!(session.history, session.mapping) - empty!(session.future) - session.mapping = _normalize_to_multiscale(mapping) - session.save_target_path = full_path - session.last_saved_path = full_path - _remember_recent_mapping!(session, full_path) - return session.mapping +function _update_application_edit(session, command) + application = _application_ref_from_command(command) + model = _construct_model(session, command["modelType"], get(command, "parameters", Dict())) + return PlantSimEngine.GraphEditor.UpdateModelApplication( + application, + model, + Symbol(get(command, "name", string(application.application_id))), + _selector_for_application(session, application, command["selector"]), + _period_from_payload(get(command, "cadence", nothing)), + ) end -function _mapping_from_julia_file(path::AbstractString) - module_ = Module(gensym(:PlantSimEngineGraphEditorMapping)) - Core.eval(module_, :(using Base)) - Core.eval(module_, :(using PlantSimEngine)) - result = Core.eval(module_, Meta.parse("begin\n" * read(path, String) * "\nend")) - mapping = isdefined(module_, :mapping) ? getfield(module_, :mapping) : result - mapping isa PlantSimEngine.ModelMapping || (!isdefined(module_, :mapping) && error("Mapping code `$path` must define a top-level `mapping` variable.")) - mapping isa PlantSimEngine.ModelMapping || error("`mapping` in `$path` is a $(typeof(mapping)), not a PlantSimEngine.ModelMapping.") - return mapping +function _add_application_edit(session, command) + model = _construct_model(session, command["modelType"], get(command, "parameters", Dict())) + name = Symbol(command["name"]) + selector = _selector_from_payload(command["selector"]) + cadence = _period_from_payload(get(command, "cadence", nothing)) + spec = PlantSimEngine.ModelSpec(model; + name=name, + on=selector, + every=cadence,) + return PlantSimEngine.GraphEditor.AddModelApplication(spec) end -function _persist_session_mapping!(session::GraphEditorSession; write_save_target::Bool=true) - diagnostics = String[] - if write_save_target && !isnothing(session.save_target_path) - try - _atomic_write(session.save_target_path, current_mapping_code(session) * "\n") - session.last_saved_path = session.save_target_path - catch err - push!(diagnostics, "Could not auto-save mapping code to $(session.save_target_path): $(sprint(showerror, err))") - end +function _resolve_model_type(label) + text = String(label) + for model_type in PlantSimEngine.GraphEditor.available_models() + text in (string(model_type), string(nameof(model_type))) && return model_type end - if !isnothing(session.autosave_path) - try - _atomic_write(session.autosave_path, current_mapping_code(session) * "\n") - session.last_autosaved_path = session.autosave_path - catch err - push!(diagnostics, "Could not write recovery autosave to $(session.autosave_path): $(sprint(showerror, err))") + error("No loaded model type matches `$(text)`. Load the defining package with `using PackageName` first.") +end + +function _construct_model(session, label, parameters) + model_type = _resolve_model_type(label) + descriptor = PlantSimEngine.GraphEditor.model_constructor_descriptor(model_type) + fields = descriptor["fields"] + isempty(fields) && return model_type() + default_instance = try + model_type() + catch + nothing + end + values = Any[] + for field in fields + name = field["name"] + if haskey(parameters, name) + push!(values, _parameter_value(session, parameters[name])) + elseif !isnothing(default_instance) + push!(values, getfield(default_instance, Symbol(name))) + else + error("Missing constructor parameter `$(name)` for model `$(model_type)`.") end end - return diagnostics + return model_type(values...) end -function _atomic_write(path::AbstractString, content::AbstractString) - full_path = _normalized_output_path(path) - mkpath(dirname(full_path)) - tmp = tempname(dirname(full_path)) - try - write(tmp, content) - mv(tmp, full_path; force=true) - finally - isfile(tmp) && rm(tmp; force=true) +function _parameter_value(session, payload) + payload isa AbstractDict || return payload + choice = Symbol(get(payload, "type", "julia")) + raw = get(payload, "value", nothing) + choice == :float && return parse(Float64, string(raw)) + choice == :integer && return parse(Int, string(raw)) + choice == :boolean && return parse(Bool, string(raw)) + choice == :symbol && return Symbol(raw) + choice == :string && return String(raw) + choice == :nothing && return nothing + choice == :julia && session.allow_julia_eval || choice != :julia || error( + "Raw Julia parameter values are disabled for this session.", + ) + choice == :julia && return Core.eval(Main, Meta.parse(String(raw))) + return raw +end + +function _selector_from_payload(payload) + payload isa AbstractDict || error("A selector payload must be an object.") + multiplicity = Symbol(get(payload, "multiplicity", "many")) + criteria = get(payload, "criteria", Dict()) + selectors = PlantSimEngine.AbstractObjectSelector[ + _selector_atom_from_payload(value) + for value in get(criteria, "selectors", Any[]) + ] + keyword_pairs = Pair{Symbol,Any}[] + for (key, value) in criteria + key == "selectors" && continue + value === nothing && continue + push!(keyword_pairs, Symbol(key) => _selector_value(Symbol(key), value)) end - return full_path + keywords = (; keyword_pairs...) + multiplicity == :one && return PlantSimEngine.One(selectors...; keywords...) + multiplicity == :optional_one && return PlantSimEngine.OptionalOne(selectors...; keywords...) + multiplicity == :many && return PlantSimEngine.Many(selectors...; keywords...) + error("Unsupported selector multiplicity `$(multiplicity)`.") end -function _normalized_output_path(path::AbstractString) - stripped = strip(String(path)) - return isabspath(stripped) ? normpath(stripped) : normpath(joinpath(pwd(), stripped)) +function _selector_value(key, value) + key in (:scale, :kind, :species, :name, :process, :var, :relation, :application) && + return value isa AbstractVector ? Symbol.(value) : Symbol(value) + key == :within && return _selector_atom_from_payload(value) + key == :policy && return _policy_from_payload(value) + key == :window && return _period_from_payload(value) + return value end -function _default_autosave_path() - stamp = string(round(Int, time() * 1000)) - suffix = string(rand(UInt32); base=16) - return joinpath(tempdir(), "PlantSimEngineGraphEditor", "session-$stamp-$suffix", "mapping.autosave.jl") +function _selector_atom_from_payload(payload) + payload isa AbstractDict || error("A structured object selector must be an object.") + type = String(get(payload, "type", "")) + type == "SceneScope" && return PlantSimEngine.SceneScope() + type == "Self" && return PlantSimEngine.Self() + type == "Subtree" && return PlantSimEngine.Subtree() + type == "SelfPlant" && return PlantSimEngine.SelfPlant() + type == "Ancestor" && return PlantSimEngine.Ancestor(; scale=get(payload, "scale", nothing)) + type == "Scope" && return PlantSimEngine.Scope(payload["name"]) + type == "Relation" && return PlantSimEngine.Relation(payload["relation"]) + error("Unsupported structured object selector type `$(type)`.") +end + +function _policy_from_payload(payload) + payload isa AbstractDict || error("A temporal policy must be a structured object.") + type = String(get(payload, "type", "")) + type == "PreviousTimeStep" && return PlantSimEngine.PreviousTimeStep( + Symbol(payload["variable"]), + Symbol(get(payload, "process", "unknown")), + ) + type == "HoldLast" && return PlantSimEngine.HoldLast() + type == "Interpolate" && return PlantSimEngine.Interpolate( + ; + mode=Symbol(get(payload, "mode", "linear")), + extrapolation=Symbol(get(payload, "extrapolation", "linear")), + ) + type == "Integrate" && return PlantSimEngine.Integrate() + type == "Aggregate" && return PlantSimEngine.Aggregate() + error("Unsupported temporal policy type `$(type)`.") end -_default_recent_file_path() = joinpath(DEPOT_PATH[1], "config", "PlantSimEngine", "graph_editor_recent.json") +function _period_from_payload(payload) + isnothing(payload) && return nothing + payload isa AbstractDict || error("A cadence or window payload must be an object.") + mode = String(get(payload, "mode", "default")) + mode == "default" && return nothing + mode == "period" || error("Unsupported cadence/window mode `$(mode)`.") + value = parse(Int, string(payload["value"])) + value > 0 || error("Cadence/window values must be positive.") + unit = String(payload["unit"]) + constructors = Dict( + "Second" => Dates.Second, + "Minute" => Dates.Minute, + "Hour" => Dates.Hour, + "Day" => Dates.Day, + ) + haskey(constructors, unit) || error( + "Unsupported period unit `$(unit)`. Use Second, Minute, Hour, or Day.", + ) + return constructors[unit](value) +end -function _load_recent_mapping_paths(path::AbstractString) - full_path = _normalized_output_path(path) - isfile(full_path) || return String[] +function _state_payload(session; ok=true, diagnostics=String[]) + graph = JSON.parse(PlantSimEngine.GraphEditor.model_graph_view_json( + session.model; + templates=session.templates, + environments=session.environments, + )) + return Dict{String,Any}( + "ok" => ok, + "diagnostics" => diagnostics, + "graph" => graph, + "canUndo" => !isempty(session.history), + "canRedo" => !isempty(session.future), + "url" => session.url, + "modelCode" => _model_to_julia(session), + "autosavePath" => session.autosave_path, + "savePath" => session.save_path, + "recentPaths" => session.recent_paths, + ) +end + +function _remember_path!(session, path) + normalized = _normalized_path(path) + filter!(!=(normalized), session.recent_paths) + pushfirst!(session.recent_paths, normalized) + length(session.recent_paths) > 12 && resize!(session.recent_paths, 12) + _persist_recent_paths!(session.recent_paths) + return normalized +end + +function _recent_paths_file() + return joinpath(tempdir(), "PlantSimEngineGraphEditor", "recent-models.json") +end + +function _load_recent_paths() + path = _recent_paths_file() + isfile(path) || return String[] try - payload = JSON.parse(read(full_path, String)) - values = payload isa AbstractDict ? get(payload, "paths", String[]) : payload - return [String(item) for item in values if item isa AbstractString && isfile(String(item))] + values = JSON.parse(read(path, String)) + values isa AbstractVector || return String[] + return String[_normalized_path(value) for value in values if value isa AbstractString] catch return String[] end end -function _remember_recent_mapping!(session::GraphEditorSession, path::AbstractString) - full_path = _normalized_output_path(path) - filter!(item -> item != full_path, session.recent_mapping_paths) - pushfirst!(session.recent_mapping_paths, full_path) - length(session.recent_mapping_paths) > 10 && resize!(session.recent_mapping_paths, 10) - _write_recent_mapping_paths(session) - return session.recent_mapping_paths +function _persist_recent_paths!(paths) + path = _recent_paths_file() + mkpath(dirname(path)) + _atomic_write(path, JSON.json(collect(paths))) + return path end -function _write_recent_mapping_paths(session::GraphEditorSession) - content = JSON.json(Dict("paths" => session.recent_mapping_paths)) - try - _atomic_write(session.recent_file_path, content * "\n") - catch err - @warn "Could not update graph editor recent mappings." path = session.recent_file_path exception = (err, catch_backtrace()) - end - return session.recent_file_path -end - -function _initialization_payload(mapping::PlantSimEngine.ModelMapping) - required_by_scale = _required_status_variables(mapping) - payload = Any[] - for scale in sort!(collect(keys(required_by_scale)); by=string) - status = _scale_status(mapping, scale) - for variable in sort!(collect(required_by_scale[scale]); by=string) - value_payload = isnothing(status) || !(variable in keys(status)) ? - _status_value_payload(nothing; provided=false) : - _status_value_payload(status[variable]; provided=true) - push!( - payload, - merge( - Dict( - "scale" => string(scale), - "name" => string(variable), - ), - value_payload - ) - ) - end +function _load_model_file(path; allow_julia_eval::Bool, environments=Dict{Symbol,Any}()) + allow_julia_eval || error("Opening Julia Composite model files is disabled for this editor session.") + isfile(path) || error("Composite model file `$(path)` does not exist.") + source = read(path, String) + required_match = match( + r"(?m)^# Requires `editor_environments` with named values: ([^.]+)\.$", + source, + ) + if !isnothing(required_match) + required = Set(Symbol(strip(name)) for name in split(required_match.captures[1], ',')) + missing = sort!(collect(setdiff(required, Set(keys(environments)))); by=string) + isempty(missing) || error( + "Composite model file `$(path)` requires environment catalog keys $(missing).", + ) end - return payload + module_name = Symbol("PlantSimEngineGraphRecovery_", string(time_ns(); base=16)) + workspace = Module(module_name) + Core.eval(workspace, :(using PlantSimEngine)) + environment_values = (; ( + name => value for (name, value) in sort!(collect(environments); by=first) + )...) + Core.eval(workspace, :(editor_environments = $environment_values)) + included = Base.include(workspace, path) + model = isdefined(workspace, :model) ? getfield(workspace, :model) : included + model isa PlantSimEngine.CompositeModel || error( + "Composite model file `$(path)` must assign its final PlantSimEngine.CompositeModel to `model`.", + ) + return model end -function _scale_status(mapping::PlantSimEngine.ModelMapping, scale::Symbol) - haskey(mapping, scale) || return nothing - for item in _scale_items(mapping[scale]) - item isa PlantSimEngine.Status && return item - end - return nothing -end +_state_json(session) = JSON.json(_state_payload(session)) -function _status_value_payload(value; provided::Bool) - choice, label = _status_value_choice(value, provided) - return Dict( - "value" => label, - "type" => choice, - "provided" => provided, +function _editor_html(session) + view = PlantSimEngine.GraphEditor.model_graph_view( + session.model; + templates=session.templates, + environments=session.environments, ) + html = PlantSimEngine.GraphEditor.model_graph_view_html(view) + config = replace(JSON.json(Dict("websocketUrl" => _websocket_url(session))), " "<\\/") + script = "" + return replace(html, "" => "$(script)") end -_status_value_choice(::Nothing, provided::Bool) = provided ? ("nothing", "") : ("julia", "") -_status_value_choice(value::Bool, ::Bool) = ("boolean", string(value)) -_status_value_choice(value::Integer, ::Bool) = ("integer", string(value)) -_status_value_choice(value::AbstractFloat, ::Bool) = ("float", string(value)) -_status_value_choice(value::Symbol, ::Bool) = ("symbol", string(value)) -_status_value_choice(value::AbstractString, ::Bool) = ("string", String(value)) -_status_value_choice(value, ::Bool) = ("julia", repr(value)) - -function _model_mapping_to_julia(mapping::PlantSimEngine.ModelMapping) +function _model_to_julia(session::GraphEditorSession) + model = session.model io = IOBuffer() - for statement in _using_statements(mapping) - println(io, statement) + diagnostics = String[] + modules = _model_code_modules(model) + for module_name in sort!(collect(modules)) + println(io, "using $(module_name)") end + println(io, "using Dates") println(io) - if isempty(keys(mapping)) - println(io, "# Add at least one model in the graph editor to generate a ModelMapping.") - print(io, "# mapping = ModelMapping(...)") - return String(take!(io)) - end - required_status_variables = _required_status_variables(mapping) - println(io, "mapping = ModelMapping(") - for scale in keys(mapping) - println(io, " $(_symbol_code(scale)) => (") - items = _scale_items(mapping[scale]) - required = get(required_status_variables, scale, Set{Symbol}()) - for item in items - code = _mapping_item_to_code(item, required) - isnothing(code) && continue - println(io, " $(code),") - end - println(io, " ),") + if !isnothing(model.source_adapter) + push!(diagnostics, "The Composite model source_adapter is runtime-specific and is not reconstructed by generated code.") end - print(io, ")") - return String(take!(io)) -end + for model in _model_code_models(model) + Base.moduleroot(parentmodule(typeof(model))) === Main || continue + push!( + diagnostics, + "Model $(typeof(model)) is defined in Main. Define or include that model before evaluating this generated Composite model script.", + ) + end + for diagnostic in unique(diagnostics) + println(io, "# WARNING: ", diagnostic) + end + required_environments = _required_environment_names(session) + if !isempty(required_environments) + names = join(sort!(string.(collect(required_environments))), ", ") + println(io, "# Requires `editor_environments` with named values: ", names, ".") + end + isempty(diagnostics) || println(io) + println(io, "objects = (") + for object in PlantSimEngine.model_objects(model) + println(io, " ", _object_code(session, object), ",") + end + println(io, ")") -_scale_items(entry) = entry isa Tuple ? entry : (entry,) + templates = Any[] + for instance in model.instances + any(template -> template === instance.template, templates) || push!(templates, instance.template) + end + for (index, template) in pairs(templates) + println(io) + println(io, "template_$(index) = ", _template_code(session, template)) + end -function _using_statements(mapping::PlantSimEngine.ModelMapping) - modules = Set{Module}([PlantSimEngine]) - for scale in keys(mapping) - for item in _scale_items(mapping[scale]) - _collect_mapping_modules!(modules, item) + if !isempty(model.instances) + println(io) + println(io, "instances = (") + for instance in model.instances + template_index = only(index for (index, template) in pairs(templates) if template === instance.template) + println(io, " ", _instance_code(instance, template_index), ",") end + println(io, ")") + else + println(io) + println(io, "instances = ()") end - return ["using $(_module_name(module_))" for module_ in sort!(collect(modules); by=_module_sort_key)] -end -function _collect_mapping_modules!(modules::Set{Module}, item) - item isa PlantSimEngine.Status && return modules - if item isa PlantSimEngine.ModelSpec || item isa PlantSimEngine.MultiScaleModel - return _collect_spec_modules!(modules, PlantSimEngine.as_model_spec(item)) + mounted_ids = Set{Symbol}() + for instance in model.instances + union!(mounted_ids, PlantSimEngine._instance_application_ids(model, instance)) end - item isa PlantSimEngine.AbstractModel && return _collect_model_modules!(modules, item) - return modules -end - -function _collect_spec_modules!(modules::Set{Module}, spec::PlantSimEngine.ModelSpec) - _collect_model_modules!(modules, PlantSimEngine.model_(spec)) - _collect_value_modules!(modules, PlantSimEngine.mapped_variables_(spec)) - _collect_value_modules!(modules, PlantSimEngine.timestep(spec)) - _collect_value_modules!(modules, spec.input_bindings) - _collect_value_modules!(modules, spec.meteo_bindings) - _collect_value_modules!(modules, spec.meteo_window) - _collect_value_modules!(modules, spec.output_routing) - _collect_value_modules!(modules, spec.scope) - return modules -end - -function _collect_model_modules!(modules::Set{Module}, model::PlantSimEngine.AbstractModel) - module_ = parentmodule(typeof(model)) - module_ in (Base, Core, Main) || push!(modules, module_) - return modules + global_applications = [ + application for application in model.applications + if PlantSimEngine._model_edit_application_id(application) ∉ mounted_ids + ] + println(io, "applications = (") + for application in global_applications + println(io, " ", _application_code(session, PlantSimEngine.as_model_spec(application)), ",") + end + println(io, ")") + environment = _environment_value_code(session, model.environment) + print(io, "model = CompositeModel(objects...; applications=applications, instances=instances, environment=$(environment))") + return String(take!(io)) end -function _collect_value_modules!(modules::Set{Module}, value) - value === nothing && return modules - if value isa Type - module_ = parentmodule(value) - module_ in (Base, Core, Main) || push!(modules, module_) - return modules - end - module_ = parentmodule(typeof(value)) - module_ in (Base, Core, Main) || push!(modules, module_) - if value isa Pair - _collect_value_modules!(modules, first(value)) - _collect_value_modules!(modules, last(value)) - elseif value isa NamedTuple - for item in values(value) - _collect_value_modules!(modules, item) - end - elseif value isa Tuple || value isa AbstractArray - for item in value - _collect_value_modules!(modules, item) +function _required_environment_names(session) + names = Set{Symbol}() + add_value = function (value) + for (name, environment) in session.environments + environment === value && push!(names, name) end end - return modules -end - -function _module_name(module_::Module) - return join(string.(Base.fullname(module_)), ".") -end - -function _module_sort_key(module_::Module) - module_ === PlantSimEngine && return "" - return _module_name(module_) + add_value(session.model.environment) + add_spec = function (raw_spec) + spec = PlantSimEngine.as_model_spec(raw_spec) + environment = PlantSimEngine.environment_config(spec) + isnothing(environment) && return + payload = environment isa PlantSimEngine.EnvironmentConfig ? environment.config : environment + payload isa NamedTuple && haskey(payload, :backend) && add_value(payload.backend) + end + foreach(add_spec, session.model.applications) + for object in PlantSimEngine.model_objects(session.model) + isnothing(object.applications) || foreach(add_spec, object.applications) + end + for instance in session.model.instances + foreach(add_spec, instance.template.applications) + end + return names end -function _required_status_variables(mapping::PlantSimEngine.ModelMapping) - stripped = Dict{Symbol,Any}() - status_only_scales = Set{Symbol}() - for scale in keys(mapping) - items = [item for item in _scale_items(mapping[scale]) if !(item isa PlantSimEngine.Status)] - if isempty(items) - push!(status_only_scales, scale) +function _model_code_models(model) + models = Any[] + add_application = function (application) + process_model = PlantSimEngine.model_(PlantSimEngine.as_model_spec(application)) + if process_model isa PlantSimEngine.ObjectModelOverrides + push!(models, process_model.base) + append!(models, values(process_model.overrides)) else - stripped[scale] = tuple(items...) + push!(models, process_model) end end - - required = isempty(stripped) ? - Dict{Symbol,Vector{Symbol}}() : - PlantSimEngine.to_initialize(PlantSimEngine.ModelMapping(stripped; check=true, type_promotion=PlantSimEngine.type_promotion(mapping))) - - required_by_scale = Dict{Symbol,Set{Symbol}}( - scale => Set{Symbol}(variables) - for (scale, variables) in pairs(required) - ) - for scale in status_only_scales - required_by_scale[scale] = Set{Symbol}() - for item in _scale_items(mapping[scale]) - item isa PlantSimEngine.Status || continue - union!(required_by_scale[scale], keys(item)) - end + foreach(add_application, model.applications) + for object in PlantSimEngine.model_objects(model) + isnothing(object.applications) && continue + foreach(add_application, object.applications) + end + for instance in model.instances + foreach(add_application, instance.template.applications) + append!(models, values(instance.overrides)) + append!(models, (override.model for override in instance.object_overrides)) end - return required_by_scale + return models end -function _mapping_item_to_code(item, required_status_variables=nothing) - if item isa PlantSimEngine.Status - return _status_to_code(item, required_status_variables) - end - if item isa PlantSimEngine.ModelSpec || item isa PlantSimEngine.MultiScaleModel - return _model_spec_to_code(PlantSimEngine.as_model_spec(item)) +function _model_code_modules(model) + modules = Set{String}(["PlantSimEngine"]) + add_model = function (model) + module_ = parentmodule(typeof(model)) + module_ in (Base, Core, Main) || push!(modules, string(module_)) end - return repr(item) + foreach(add_model, _model_code_models(model)) + return modules end -function _status_to_code(status::PlantSimEngine.Status, required_variables) - isnothing(required_variables) && (required_variables = Set{Symbol}(keys(status))) - kept = Pair{Symbol,Any}[ - name => status[name] - for name in keys(status) - if name in required_variables +function _object_code(session, object) + keywords = String[ + "scale=$(repr(object.scale))", + "kind=$(repr(object.kind))", + "species=$(repr(object.species))", + "name=$(repr(object.name))", + "parent=$(isnothing(object.parent) ? "nothing" : repr(object.parent.value))", ] - isempty(kept) && return nothing - names_code = _tuple_code(_symbol_code.(first.(kept))) - values_code = _tuple_code([repr(last(item)) for item in kept]) - return "Status(NamedTuple{$names_code}($values_code))" + if object.status isa PlantSimEngine.Status + values = join(("$(name)=$(repr(object.status[name]))" for name in propertynames(object.status)), ", ") + push!(keywords, "status=Status(; $(values))") + end + isnothing(object.geometry) || push!(keywords, "geometry=$(repr(object.geometry))") + if !isnothing(object.applications) && object.applications != () + applications = join( + (_application_code(session, PlantSimEngine.as_model_spec(application)) for application in object.applications), + ", ", + ) + push!(keywords, "applications=($(applications),)") + end + return "Object($(repr(object.id.value)); $(join(keywords, ", ")))" end -_symbol_code(symbol::Symbol) = repr(symbol) - -function _tuple_code(items) - values = collect(items) - suffix = length(values) == 1 ? "," : "" - return "(" * join(values, ", ") * suffix * ")" +function _template_code(session, template) + applications = join( + (" " * _application_code(session, PlantSimEngine.as_model_spec(application)) * "," for application in template.applications), + "\n", + ) + return "CompositeModelTemplate((\n$(applications)\n ); kind=$(repr(template.kind)), species=$(repr(template.species)), parameters=$(repr(template.parameters)))" end -function _model_spec_to_code(spec::PlantSimEngine.ModelSpec) - code = "ModelSpec($(repr(PlantSimEngine.model_(spec))))" - mapped_variables = PlantSimEngine.mapped_variables_(spec) - isempty(mapped_variables) || (code *= " |> MultiScaleModel($(_mapped_variables_to_code(mapped_variables)))") - isnothing(PlantSimEngine.timestep(spec)) || (code *= " |> TimeStepModel($(_timestep_to_code(PlantSimEngine.timestep(spec))))") - _is_empty_namedtuple(spec.input_bindings) || (code *= " |> InputBindings($(_julia_code(spec.input_bindings)))") - _is_empty_namedtuple(spec.meteo_bindings) || (code *= " |> MeteoBindings($(_julia_code(spec.meteo_bindings)))") - isnothing(spec.meteo_window) || (code *= " |> MeteoWindow($(_julia_code(spec.meteo_window)))") - _is_empty_namedtuple(spec.output_routing) || (code *= " |> OutputRouting($(_julia_code(spec.output_routing)))") - _is_default_scope(spec.scope) || (code *= " |> ScopeModel($(_julia_code(spec.scope)))") - return code +function _instance_code(instance, template_index) + overrides = if isempty(keys(instance.overrides)) + "NamedTuple()" + else + entries = join(("$(key)=$(repr(model))" for (key, model) in pairs(instance.overrides)), ", ") + "($(entries),)" + end + object_overrides = if isempty(instance.object_overrides) + "()" + else + entries = join((_object_override_code(override) for override in instance.object_overrides), ", ") + "($(entries),)" + end + return "ObjectInstance($(repr(instance.name)), template_$(template_index); root=$(repr(PlantSimEngine._instance_root_id(instance).value)), overrides=$(overrides), object_overrides=$(object_overrides))" end -_julia_code(value) = repr(value) -_is_empty_namedtuple(value) = value isa NamedTuple && isempty(keys(value)) -_is_default_scope(scope) = scope == :global +function _object_override_code(override) + options = String["object=$(repr(override.object.value))"] + isnothing(override.application) || push!(options, "application=$(repr(override.application))") + push!(options, "model=$(repr(override.model))") + return "Override(; $(join(options, ", ")))" +end -function _timestep_to_code(timestep::PlantSimEngine.ClockSpec) - return "ClockSpec($(repr(timestep.dt)), $(repr(timestep.phase)))" +function _environment_value_code(session, value) + isnothing(value) && return "nothing" + for (name, environment) in session.environments + environment === value && return "editor_environments.$(name)" + end + return repr(value) end -_timestep_to_code(timestep) = repr(timestep) +function _environment_configuration_code(session, payload) + payload isa NamedTuple || return repr(payload) + entries = String[] + for (name, value) in pairs(payload) + code = Symbol(name) == :backend ? _environment_value_code(session, value) : repr(value) + push!(entries, "$(name)=$(code)") + end + return isempty(entries) ? "NamedTuple()" : "($(join(entries, ", ")),)" +end -function _mapped_variables_to_code(mapped_variables) - isempty(mapped_variables) && return "[]" - return "[" * join((_mapped_variable_to_code(i) for i in mapped_variables), ", ") * "]" +function _application_code(session, spec) + options = String["name=$(repr(PlantSimEngine.application_name(spec)))"] + selector = PlantSimEngine.applies_to(spec) + isnothing(selector) || push!(options, "on=$(repr(selector))") + isempty(keys(PlantSimEngine.value_inputs(spec))) || + push!(options, "inputs=$(repr(PlantSimEngine.value_inputs(spec)))") + isempty(keys(PlantSimEngine.model_calls(spec))) || + push!(options, "calls=$(repr(PlantSimEngine.model_calls(spec)))") + environment = PlantSimEngine.environment_config(spec) + if !isnothing(environment) + payload = environment isa PlantSimEngine.EnvironmentConfig ? environment.config : environment + push!(options, "environment=Environment($(_environment_configuration_code(session, payload)))") + end + isnothing(spec.timestep) || push!(options, "every=$(repr(spec.timestep))") + if !isempty(keys(PlantSimEngine.environment_bindings(spec))) + push!( + options, + "environment_bindings=$(repr(PlantSimEngine.environment_bindings(spec)))", + ) + end + if !isnothing(PlantSimEngine.environment_window(spec)) + push!( + options, + "environment_window=$(repr(PlantSimEngine.environment_window(spec)))", + ) + end + isempty(keys(PlantSimEngine.output_routing(spec))) || + push!(options, "output_routing=$(repr(PlantSimEngine.output_routing(spec)))") + update_codes = String[] + for update in PlantSimEngine.updates(spec) + variables = join(repr.(collect(update.variables)), ", ") + push!(update_codes, "Updates($(variables); after=$(repr(update.after)))") + end + if length(update_codes) == 1 + push!(options, "updates=$(only(update_codes))") + elseif !isempty(update_codes) + push!(options, "updates=($(join(update_codes, ", ")),)") + end + return "ModelSpec($(repr(PlantSimEngine.model_(spec))); $(join(options, ", ")))" end -function _mapped_variable_to_code(mapping) - lhs = first(mapping) - rhs = last(mapping) - lhs_code = _mapped_lhs_to_code(lhs) - variable = _mapped_variable_symbol(lhs) - rhs_code = _mapped_rhs_to_code(rhs, variable) - return "$(lhs_code) => $(rhs_code)" +function _persist_model!(session) + code = _model_to_julia(session) * "\n" + isnothing(session.autosave_path) || _atomic_write(session.autosave_path, code) + isnothing(session.save_path) || _atomic_write(session.save_path, code) + return nothing end -_mapped_variable_symbol(variable::Symbol) = variable -_mapped_variable_symbol(variable::PlantSimEngine.PreviousTimeStep) = variable.variable +function _atomic_write(path, content) + path = _normalized_path(path) + mkpath(dirname(path)) + temporary = tempname(dirname(path)) + try + write(temporary, content) + mv(temporary, path; force=true) + finally + isfile(temporary) && rm(temporary; force=true) + end + return path +end -_mapped_lhs_to_code(variable::Symbol) = _symbol_code(variable) -_mapped_lhs_to_code(variable::PlantSimEngine.PreviousTimeStep) = "PreviousTimeStep($(_symbol_code(variable.variable)))" +_normalized_path(path) = isabspath(String(path)) ? normpath(String(path)) : normpath(joinpath(pwd(), String(path))) -function _mapped_rhs_to_code(rhs::Pair{Symbol,Symbol}, variable::Symbol) - source_scale = first(rhs) - source_variable = last(rhs) - if source_scale == Symbol("") - return "($(_symbol_code(source_scale)) => $(_symbol_code(source_variable)))" - end - if source_variable == variable - return _symbol_code(source_scale) - end - return "($(_symbol_code(source_scale)) => $(_symbol_code(source_variable)))" +function _default_autosave_path() + return joinpath( + tempdir(), + "PlantSimEngineGraphEditor", + string("session-", time_ns()), + "model.autosave.jl", + ) end -function _mapped_rhs_to_code(rhs::AbstractVector{<:Pair{Symbol,Symbol}}, variable::Symbol) - compact = all(last(i) == variable for i in rhs) - if compact - return "[" * join((_symbol_code(first(i)) for i in rhs), ", ") * "]" +function _open_in_default_browser(url) + try + if Sys.isapple() + run(`open $url`) + elseif Sys.iswindows() + run(`cmd /c start "" $url`) + elseif !isnothing(Sys.which("xdg-open")) + run(`xdg-open $url`) + else + @warn "Could not locate a default-browser command." url + return false + end + return true + catch err + @warn "Could not open the graph editor automatically." url exception=(err, catch_backtrace()) + return false end - return "[" * join(("($(_symbol_code(first(i))) => $(_symbol_code(last(i))))" for i in rhs), ", ") * "]" end end diff --git a/frontend/.vite/deps/_metadata.json b/frontend/.vite/deps/_metadata.json deleted file mode 100644 index 76dbdb36e..000000000 --- a/frontend/.vite/deps/_metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "hash": "9cb674f6", - "configHash": "2b83bb6c", - "lockfileHash": "dfbd2d0d", - "browserHash": "d060dbeb", - "optimized": {}, - "chunks": {} -} \ No newline at end of file diff --git a/frontend/.vite/deps/package.json b/frontend/.vite/deps/package.json deleted file mode 100644 index 3dbc1ca59..000000000 --- a/frontend/.vite/deps/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/frontend/dist/.vite/manifest.json b/frontend/dist/.vite/manifest.json index b4fde8484..ebe27b401 100644 --- a/frontend/dist/.vite/manifest.json +++ b/frontend/dist/.vite/manifest.json @@ -1,11 +1,11 @@ { "index.html": { - "file": "assets/index--4z54nN9.js", + "file": "assets/index-CfC2_AOV.js", "name": "index", "src": "index.html", "isEntry": true, "css": [ - "assets/index-DwZ0xeih.css" + "assets/index-DH4q_-2-.css" ] } } \ No newline at end of file diff --git a/frontend/dist/assets/index--4z54nN9.js b/frontend/dist/assets/index--4z54nN9.js deleted file mode 100644 index 4ba2bf006..000000000 --- a/frontend/dist/assets/index--4z54nN9.js +++ /dev/null @@ -1,38 +0,0 @@ -(function(){const E=document.createElement("link").relList;if(E&&E.supports&&E.supports("modulepreload"))return;for(const O of document.querySelectorAll('link[rel="modulepreload"]'))x(O);new MutationObserver(O=>{for(const P of O)if(P.type==="childList")for(const k of P.addedNodes)k.tagName==="LINK"&&k.rel==="modulepreload"&&x(k)}).observe(document,{childList:!0,subtree:!0});function M(O){const P={};return O.integrity&&(P.integrity=O.integrity),O.referrerPolicy&&(P.referrerPolicy=O.referrerPolicy),O.crossOrigin==="use-credentials"?P.credentials="include":O.crossOrigin==="anonymous"?P.credentials="omit":P.credentials="same-origin",P}function x(O){if(O.ep)return;O.ep=!0;const P=M(O);fetch(O.href,P)}})();var Ohn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ake(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var x7e={exports:{}},LG={};var Nhn;function bzn(){if(Nhn)return LG;Nhn=1;var g=Symbol.for("react.transitional.element"),E=Symbol.for("react.fragment");function M(x,O,P){var k=null;if(P!==void 0&&(k=""+P),O.key!==void 0&&(k=""+O.key),"key"in O){P={};for(var H in O)H!=="key"&&(P[H]=O[H])}else P=O;return O=P.ref,{$$typeof:g,type:x,key:k,ref:O!==void 0?O:null,props:P}}return LG.Fragment=E,LG.jsx=M,LG.jsxs=M,LG}var Dhn;function gzn(){return Dhn||(Dhn=1,x7e.exports=bzn()),x7e.exports}var G=gzn(),T7e={exports:{}},Tc={};var _hn;function wzn(){if(_hn)return Tc;_hn=1;var g=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),k=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),F=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ne=Symbol.iterator;function le(Se){return Se===null||typeof Se!="object"?null:(Se=ne&&Se[ne]||Se["@@iterator"],typeof Se=="function"?Se:null)}var se={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ee=Object.assign,Ce={};function je(Se,on,ct){this.props=Se,this.context=on,this.refs=Ce,this.updater=ct||se}je.prototype.isReactComponent={},je.prototype.setState=function(Se,on){if(typeof Se!="object"&&typeof Se!="function"&&Se!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Se,on,"setState")},je.prototype.forceUpdate=function(Se){this.updater.enqueueForceUpdate(this,Se,"forceUpdate")};function ze(){}ze.prototype=je.prototype;function be(Se,on,ct){this.props=Se,this.context=on,this.refs=Ce,this.updater=ct||se}var De=be.prototype=new ze;De.constructor=be,ee(De,je.prototype),De.isPureReactComponent=!0;var rn=Array.isArray;function an(){}var un={H:null,A:null,T:null,S:null},An=Object.prototype.hasOwnProperty;function Dn(Se,on,ct){var lt=ct.ref;return{$$typeof:g,type:Se,key:on,ref:lt!==void 0?lt:null,props:ct}}function $t(Se,on){return Dn(Se.type,on,Se.props)}function In(Se){return typeof Se=="object"&&Se!==null&&Se.$$typeof===g}function et(Se){var on={"=":"=0",":":"=2"};return"$"+Se.replace(/[=:]/g,function(ct){return on[ct]})}var Y=/\/+/g;function He(Se,on){return typeof Se=="object"&&Se!==null&&Se.key!=null?et(""+Se.key):on.toString(36)}function en(Se){switch(Se.status){case"fulfilled":return Se.value;case"rejected":throw Se.reason;default:switch(typeof Se.status=="string"?Se.then(an,an):(Se.status="pending",Se.then(function(on){Se.status==="pending"&&(Se.status="fulfilled",Se.value=on)},function(on){Se.status==="pending"&&(Se.status="rejected",Se.reason=on)})),Se.status){case"fulfilled":return Se.value;case"rejected":throw Se.reason}}throw Se}function ke(Se,on,ct,lt,qt){var wi=typeof Se;(wi==="undefined"||wi==="boolean")&&(Se=null);var li=!1;if(Se===null)li=!0;else switch(wi){case"bigint":case"string":case"number":li=!0;break;case"object":switch(Se.$$typeof){case g:case E:li=!0;break;case W:return li=Se._init,ke(li(Se._payload),on,ct,lt,qt)}}if(li)return qt=qt(Se),li=lt===""?"."+He(Se,0):lt,rn(qt)?(ct="",li!=null&&(ct=li.replace(Y,"$&/")+"/"),ke(qt,on,ct,"",function(rc){return rc})):qt!=null&&(In(qt)&&(qt=$t(qt,ct+(qt.key==null||Se&&Se.key===qt.key?"":(""+qt.key).replace(Y,"$&/")+"/")+li)),on.push(qt)),1;li=0;var Ut=lt===""?".":lt+":";if(rn(Se))for(var ai=0;ai>>1,nt=ke[En];if(0>>1;EnO(ct,ln))ltO(qt,ct)?(ke[En]=qt,ke[lt]=ln,En=lt):(ke[En]=ct,ke[on]=ln,En=on);else if(ltO(qt,ln))ke[En]=qt,ke[lt]=ln,En=lt;else break e}}return Ze}function O(ke,Ze){var ln=ke.sortIndex-Ze.sortIndex;return ln!==0?ln:ke.id-Ze.id}if(g.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var P=performance;g.unstable_now=function(){return P.now()}}else{var k=Date,H=k.now();g.unstable_now=function(){return k.now()-H}}var q=[],F=[],W=1,Z=null,ne=3,le=!1,se=!1,ee=!1,Ce=!1,je=typeof setTimeout=="function"?setTimeout:null,ze=typeof clearTimeout=="function"?clearTimeout:null,be=typeof setImmediate<"u"?setImmediate:null;function De(ke){for(var Ze=M(F);Ze!==null;){if(Ze.callback===null)x(F);else if(Ze.startTime<=ke)x(F),Ze.sortIndex=Ze.expirationTime,E(q,Ze);else break;Ze=M(F)}}function rn(ke){if(ee=!1,De(ke),!se)if(M(q)!==null)se=!0,an||(an=!0,et());else{var Ze=M(F);Ze!==null&&en(rn,Ze.startTime-ke)}}var an=!1,un=-1,An=5,Dn=-1;function $t(){return Ce?!0:!(g.unstable_now()-Dnke&&$t());){var En=Z.callback;if(typeof En=="function"){Z.callback=null,ne=Z.priorityLevel;var nt=En(Z.expirationTime<=ke);if(ke=g.unstable_now(),typeof nt=="function"){Z.callback=nt,De(ke),Ze=!0;break n}Z===M(q)&&x(q),De(ke)}else x(q);Z=M(q)}if(Z!==null)Ze=!0;else{var Se=M(F);Se!==null&&en(rn,Se.startTime-ke),Ze=!1}}break e}finally{Z=null,ne=ln,le=!1}Ze=void 0}}finally{Ze?et():an=!1}}}var et;if(typeof be=="function")et=function(){be(In)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,He=Y.port2;Y.port1.onmessage=In,et=function(){He.postMessage(null)}}else et=function(){je(In,0)};function en(ke,Ze){un=je(function(){ke(g.unstable_now())},Ze)}g.unstable_IdlePriority=5,g.unstable_ImmediatePriority=1,g.unstable_LowPriority=4,g.unstable_NormalPriority=3,g.unstable_Profiling=null,g.unstable_UserBlockingPriority=2,g.unstable_cancelCallback=function(ke){ke.callback=null},g.unstable_forceFrameRate=function(ke){0>ke||125En?(ke.sortIndex=ln,E(F,ke),M(q)===null&&ke===M(F)&&(ee?(ze(un),un=-1):ee=!0,en(rn,ln-En))):(ke.sortIndex=nt,E(q,ke),se||le||(se=!0,an||(an=!0,et()))),ke},g.unstable_shouldYield=$t,g.unstable_wrapCallback=function(ke){var Ze=ne;return function(){var ln=ne;ne=Ze;try{return ke.apply(this,arguments)}finally{ne=ln}}}})(N7e)),N7e}var Phn;function vzn(){return Phn||(Phn=1,O7e.exports=mzn()),O7e.exports}var D7e={exports:{}},jd={};var $hn;function yzn(){if($hn)return jd;$hn=1;var g=eq();function E(q){var F="https://react.dev/errors/"+q;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g)}catch(E){console.error(E)}}return g(),D7e.exports=yzn(),D7e.exports}var Bhn;function kzn(){if(Bhn)return PG;Bhn=1;var g=vzn(),E=eq(),M=ydn();function x(a){var d="https://react.dev/errors/"+a;if(1nt||(a.current=En[nt],En[nt]=null,nt--)}function ct(a,d){nt++,En[nt]=a.current,a.current=d}var lt=Se(null),qt=Se(null),wi=Se(null),li=Se(null);function Ut(a,d){switch(ct(wi,d),ct(qt,a),ct(lt,null),d.nodeType){case 9:case 11:a=(a=d.documentElement)&&(a=a.namespaceURI)?dP(a):0;break;default:if(a=d.tagName,d=d.namespaceURI)d=dP(d),a=bP(d,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}on(lt),ct(lt,a)}function ai(){on(lt),on(qt),on(wi)}function rc(a){a.memoizedState!==null&&ct(li,a);var d=lt.current,w=bP(d,a.type);d!==w&&(ct(qt,a),ct(lt,w))}function Qr(a){qt.current===a&&(on(lt),on(qt)),li.current===a&&(on(li),w5._currentValue=ln)}var vr,Si;function Ui(a){if(vr===void 0)try{throw Error()}catch(w){var d=w.stack.trim().match(/\n( *(at )?)/);vr=d&&d[1]||"",Si=-1)":-1C||We[j]!==_n[C]){var tt=` -`+We[j].replace(" at new "," at ");return a.displayName&&tt.includes("")&&(tt=tt.replace("",a.displayName)),tt}while(1<=j&&0<=C);break}}}finally{Su=!1,Error.prepareStackTrace=w}return(w=a?a.displayName||a.name:"")?Ui(w):""}function Js(a,d){switch(a.tag){case 26:case 27:case 5:return Ui(a.type);case 16:return Ui("Lazy");case 13:return a.child!==d&&d!==null?Ui("Suspense Fallback"):Ui("Suspense");case 19:return Ui("SuspenseList");case 0:case 15:return uu(a.type,!1);case 11:return uu(a.type.render,!1);case 1:return uu(a.type,!0);case 31:return Ui("Activity");default:return""}}function fa(a){try{var d="",w=null;do d+=Js(a,w),w=a,a=a.return;while(a);return d}catch(j){return` -Error generating stack: `+j.message+` -`+j.stack}}var bh=Object.prototype.hasOwnProperty,aa=g.unstable_scheduleCallback,nu=g.unstable_cancelCallback,cl=g.unstable_shouldYield,S0=g.unstable_requestPaint,Dl=g.unstable_now,fw=g.unstable_getCurrentPriorityLevel,A1=g.unstable_ImmediatePriority,qb=g.unstable_UserBlockingPriority,x1=g.unstable_NormalPriority,S3=g.unstable_LowPriority,Ub=g.unstable_IdlePriority,M0=g.log,S6=g.unstable_setDisableYieldValue,ha=null,Gs=null;function qh(a){if(typeof M0=="function"&&S6(a),Gs&&typeof Gs.setStrictMode=="function")try{Gs.setStrictMode(ha,a)}catch{}}var Ho=Math.clz32?Math.clz32:A6,Sd=Math.log,M6=Math.LN2;function A6(a){return a>>>=0,a===0?32:31-(Sd(a)/M6|0)|0}var aw=256,hw=262144,Xb=4194304;function T1(a){var d=a&42;if(d!==0)return d;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Nf(a,d,w){var j=a.pendingLanes;if(j===0)return 0;var C=0,D=a.suspendedLanes,Q=a.pingedLanes;a=a.warmLanes;var he=j&134217727;return he!==0?(j=he&~D,j!==0?C=T1(j):(Q&=he,Q!==0?C=T1(Q):w||(w=he&~a,w!==0&&(C=T1(w))))):(he=j&~D,he!==0?C=T1(he):Q!==0?C=T1(Q):w||(w=j&~a,w!==0&&(C=T1(w)))),C===0?0:d!==0&&d!==C&&(d&D)===0&&(D=C&-C,w=d&-d,D>=w||D===32&&(w&4194048)!==0)?d:C}function dw(a,d){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&d)===0}function A0(a,d){switch(a){case 1:case 2:case 4:case 8:case 64:return d+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function x0(){var a=Xb;return Xb<<=1,(Xb&62914560)===0&&(Xb=4194304),a}function M3(a){for(var d=[],w=0;31>w;w++)d.push(a);return d}function T0(a,d){a.pendingLanes|=d,d!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Q2(a,d,w,j,C,D){var Q=a.pendingLanes;a.pendingLanes=w,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=w,a.entangledLanes&=w,a.errorRecoveryDisabledLanes&=w,a.shellSuspendCounter=0;var he=a.entanglements,We=a.expirationTimes,_n=a.hiddenUpdates;for(w=Q&~w;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Zn=/[\n"\\]/g;function Ft(a){return a.replace(Zn,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function nr(a,d,w,j,C,D,Q,he){a.name="",Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?a.type=Q:a.removeAttribute("type"),d!=null?Q==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+Df(d)):a.value!==""+Df(d)&&(a.value=""+Df(d)):Q!=="submit"&&Q!=="reset"||a.removeAttribute("value"),d!=null?ms(a,Q,Df(d)):w!=null?ms(a,Q,Df(w)):j!=null&&a.removeAttribute("value"),C==null&&D!=null&&(a.defaultChecked=!!D),C!=null&&(a.checked=C&&typeof C!="function"&&typeof C!="symbol"),he!=null&&typeof he!="function"&&typeof he!="symbol"&&typeof he!="boolean"?a.name=""+Df(he):a.removeAttribute("name")}function Sr(a,d,w,j,C,D,Q,he){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(a.type=D),d!=null||w!=null){if(!(D!=="submit"&&D!=="reset"||d!=null)){ep(a);return}w=w!=null?""+Df(w):"",d=d!=null?""+Df(d):w,he||d===a.value||(a.value=d),a.defaultValue=d}j=j??C,j=typeof j!="function"&&typeof j!="symbol"&&!!j,a.checked=he?a.checked:!!j,a.defaultChecked=!!j,Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"&&(a.name=Q),ep(a)}function ms(a,d,w){d==="number"&&yw(a.ownerDocument)===a||a.defaultValue===""+w||(a.defaultValue=""+w)}function N0(a,d,w,j){if(a=a.options,d){d={};for(var C=0;C"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zA=!1;if(Ew)try{var C6={};Object.defineProperty(C6,"passive",{get:function(){zA=!0}}),window.addEventListener("test",C6,C6),window.removeEventListener("test",C6,C6)}catch{zA=!1}var np=null,FA=null,pk=null;function O_(){if(pk)return pk;var a,d=FA,w=d.length,j,C="value"in np?np.value:np.textContent,D=C.length;for(a=0;a=D6),P_=" ",$_=!1;function R_(a,d){switch(a){case"keyup":return Lq.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B_(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var F4=!1;function $q(a,d){switch(a){case"compositionend":return B_(d);case"keypress":return d.which!==32?null:($_=!0,P_);case"textInput":return a=d.data,a===P_&&$_?null:a;default:return null}}function Rq(a,d){if(F4)return a==="compositionend"||!UA&&R_(a,d)?(a=O_(),pk=FA=np=null,F4=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:w,offset:d-a};a=j}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=U_(w)}}function V_(a,d){return a&&d?a===d?!0:a&&a.nodeType===3?!1:d&&d.nodeType===3?V_(a,d.parentNode):"contains"in a?a.contains(d):a.compareDocumentPosition?!!(a.compareDocumentPosition(d)&16):!1:!1}function K_(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var d=yw(a.document);d instanceof a.HTMLIFrameElement;){try{var w=typeof d.contentWindow.location.href=="string"}catch{w=!1}if(w)a=d.contentWindow;else break;d=yw(a.document)}return d}function QA(a){var d=a&&a.nodeName&&a.nodeName.toLowerCase();return d&&(d==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||d==="textarea"||a.contentEditable==="true")}var Uq=Ew&&"documentMode"in document&&11>=document.documentMode,H4=null,YA=null,P6=null,WA=!1;function Q_(a,d,w){var j=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;WA||H4==null||H4!==yw(j)||(j=H4,"selectionStart"in j&&QA(j)?j={start:j.selectionStart,end:j.selectionEnd}:(j=(j.ownerDocument&&j.ownerDocument.defaultView||window).getSelection(),j={anchorNode:j.anchorNode,anchorOffset:j.anchorOffset,focusNode:j.focusNode,focusOffset:j.focusOffset}),P6&&L6(P6,j)||(P6=j,j=lE(YA,"onSelect"),0>=Q,C-=Q,Kb=1<<32-Ho(d)+C|w<qr?(cc=Xi,Xi=null):cc=Xi.sibling;var qc=Fn(kn,Xi,On[qr],ut);if(qc===null){Xi===null&&(Xi=cc);break}a&&Xi&&qc.alternate===null&&d(kn,Xi),sn=D(qc,sn,qr),Lu===null?Hi=qc:Lu.sibling=qc,Lu=qc,Xi=cc}if(qr===On.length)return w(kn,Xi),ou&&Sw(kn,qr),Hi;if(Xi===null){for(;qrqr?(cc=Xi,Xi=null):cc=Xi.sibling;var St=Fn(kn,Xi,qc.value,ut);if(St===null){Xi===null&&(Xi=cc);break}a&&Xi&&St.alternate===null&&d(kn,Xi),sn=D(St,sn,qr),Lu===null?Hi=St:Lu.sibling=St,Lu=St,Xi=cc}if(qc.done)return w(kn,Xi),ou&&Sw(kn,qr),Hi;if(Xi===null){for(;!qc.done;qr++,qc=On.next())qc=gt(kn,qc.value,ut),qc!==null&&(sn=D(qc,sn,qr),Lu===null?Hi=qc:Lu.sibling=qc,Lu=qc);return ou&&Sw(kn,qr),Hi}for(Xi=j(Xi);!qc.done;qr++,qc=On.next())qc=Yn(Xi,kn,qr,qc.value,ut),qc!==null&&(a&&qc.alternate!==null&&Xi.delete(qc.key===null?qr:qc.key),sn=D(qc,sn,qr),Lu===null?Hi=qc:Lu.sibling=qc,Lu=qc);return a&&Xi.forEach(function(aX){return d(kn,aX)}),ou&&Sw(kn,qr),Hi}function co(kn,sn,On,ut){if(typeof On=="object"&&On!==null&&On.type===ee&&On.key===null&&(On=On.props.children),typeof On=="object"&&On!==null){switch(On.$$typeof){case le:e:{for(var Hi=On.key;sn!==null;){if(sn.key===Hi){if(Hi=On.type,Hi===ee){if(sn.tag===7){w(kn,sn.sibling),ut=C(sn,On.props.children),ut.return=kn,kn=ut;break e}}else if(sn.elementType===Hi||typeof Hi=="object"&&Hi!==null&&Hi.$$typeof===An&&L3(Hi)===sn.type){w(kn,sn.sibling),ut=C(sn,On.props),G6(ut,On),ut.return=kn,kn=ut;break e}w(kn,sn);break}else d(kn,sn);sn=sn.sibling}On.type===ee?(ut=D3(On.props.children,kn.mode,ut,On.key),ut.return=kn,kn=ut):(ut=xk(On.type,On.key,On.props,null,kn.mode,ut),G6(ut,On),ut.return=kn,kn=ut)}return Q(kn);case se:e:{for(Hi=On.key;sn!==null;){if(sn.key===Hi)if(sn.tag===4&&sn.stateNode.containerInfo===On.containerInfo&&sn.stateNode.implementation===On.implementation){w(kn,sn.sibling),ut=C(sn,On.children||[]),ut.return=kn,kn=ut;break e}else{w(kn,sn);break}else d(kn,sn);sn=sn.sibling}ut=cx(On,kn.mode,ut),ut.return=kn,kn=ut}return Q(kn);case An:return On=L3(On),co(kn,sn,On,ut)}if(en(On))return _i(kn,sn,On,ut);if(et(On)){if(Hi=et(On),typeof Hi!="function")throw Error(x(150));return On=Hi.call(On),Or(kn,sn,On,ut)}if(typeof On.then=="function")return co(kn,sn,Dk(On),ut);if(On.$$typeof===be)return co(kn,sn,B6(kn,On),ut);_k(kn,On)}return typeof On=="string"&&On!==""||typeof On=="number"||typeof On=="bigint"?(On=""+On,sn!==null&&sn.tag===6?(w(kn,sn.sibling),ut=C(sn,On),ut.return=kn,kn=ut):(w(kn,sn),ut=rx(On,kn.mode,ut),ut.return=kn,kn=ut),Q(kn)):w(kn,sn)}return function(kn,sn,On,ut){try{J6=0;var Hi=co(kn,sn,On,ut);return e5=null,Hi}catch(Xi){if(Xi===Z4||Xi===Ok)throw Xi;var Lu=L1(29,Xi,null,kn.mode);return Lu.lanes=ut,Lu.return=kn,Lu}}}var $3=pI(!0),mI=pI(!1),lp=!1;function mx(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vx(a,d){a=a.updateQueue,d.updateQueue===a&&(d.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function fp(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ap(a,d,w){var j=a.updateQueue;if(j===null)return null;if(j=j.shared,(Hu&2)!==0){var C=j.pending;return C===null?d.next=d:(d.next=C.next,C.next=d),j.pending=d,d=Ak(a),iI(a,null,w),d}return Mk(a,j,d,w),Ak(a)}function q6(a,d,w){if(d=d.updateQueue,d!==null&&(d=d.shared,(w&4194048)!==0)){var j=d.lanes;j&=a.pendingLanes,w|=j,d.lanes=w,gw(a,w)}}function yx(a,d){var w=a.updateQueue,j=a.alternate;if(j!==null&&(j=j.updateQueue,w===j)){var C=null,D=null;if(w=w.firstBaseUpdate,w!==null){do{var Q={lane:w.lane,tag:w.tag,payload:w.payload,callback:null,next:null};D===null?C=D=Q:D=D.next=Q,w=w.next}while(w!==null);D===null?C=D=d:D=D.next=d}else C=D=d;w={baseState:j.baseState,firstBaseUpdate:C,lastBaseUpdate:D,shared:j.shared,callbacks:j.callbacks},a.updateQueue=w;return}a=w.lastBaseUpdate,a===null?w.firstBaseUpdate=d:a.next=d,w.lastBaseUpdate=d}var kx=!1;function U6(){if(kx){var a=W4;if(a!==null)throw a}}function X6(a,d,w,j){kx=!1;var C=a.updateQueue;lp=!1;var D=C.firstBaseUpdate,Q=C.lastBaseUpdate,he=C.shared.pending;if(he!==null){C.shared.pending=null;var We=he,_n=We.next;We.next=null,Q===null?D=_n:Q.next=_n,Q=We;var tt=a.alternate;tt!==null&&(tt=tt.updateQueue,he=tt.lastBaseUpdate,he!==Q&&(he===null?tt.firstBaseUpdate=_n:he.next=_n,tt.lastBaseUpdate=We))}if(D!==null){var gt=C.baseState;Q=0,tt=_n=We=null,he=D;do{var Fn=he.lane&-536870913,Yn=Fn!==he.lane;if(Yn?(tu&Fn)===Fn:(j&Fn)===Fn){Fn!==0&&Fn===Y4&&(kx=!0),tt!==null&&(tt=tt.next={lane:0,tag:he.tag,payload:he.payload,callback:null,next:null});e:{var _i=a,Or=he;Fn=d;var co=w;switch(Or.tag){case 1:if(_i=Or.payload,typeof _i=="function"){gt=_i.call(co,gt,Fn);break e}gt=_i;break e;case 3:_i.flags=_i.flags&-65537|128;case 0:if(_i=Or.payload,Fn=typeof _i=="function"?_i.call(co,gt,Fn):_i,Fn==null)break e;gt=Z({},gt,Fn);break e;case 2:lp=!0}}Fn=he.callback,Fn!==null&&(a.flags|=64,Yn&&(a.flags|=8192),Yn=C.callbacks,Yn===null?C.callbacks=[Fn]:Yn.push(Fn))}else Yn={lane:Fn,tag:he.tag,payload:he.payload,callback:he.callback,next:null},tt===null?(_n=tt=Yn,We=gt):tt=tt.next=Yn,Q|=Fn;if(he=he.next,he===null){if(he=C.shared.pending,he===null)break;Yn=he,he=Yn.next,Yn.next=null,C.lastBaseUpdate=Yn,C.shared.pending=null}}while(!0);tt===null&&(We=gt),C.baseState=We,C.firstBaseUpdate=_n,C.lastBaseUpdate=tt,D===null&&(C.shared.lanes=0),wp|=Q,a.lanes=Q,a.memoizedState=gt}}function vI(a,d){if(typeof a!="function")throw Error(x(191,a));a.call(d)}function yI(a,d){var w=a.callbacks;if(w!==null)for(a.callbacks=null,a=0;aD?D:8;var Q=ke.T,he={};ke.T=he,zx(a,!1,d,w);try{var We=C(),_n=ke.S;if(_n!==null&&_n(he,We),We!==null&&typeof We=="object"&&typeof We.then=="function"){var tt=eU(We,j);Y6(a,d,tt,z1(a))}else Y6(a,d,j,z1(a))}catch(gt){Y6(a,d,{then:function(){},status:"rejected",reason:gt},z1())}finally{Ze.p=D,Q!==null&&he.types!==null&&(Q.types=he.types),ke.T=Q}}function Rx(){}function Q6(a,d,w,j){if(a.tag!==5)throw Error(x(476));var C=YI(a).queue;QI(a,C,d,ln,w===null?Rx:function(){return Jk(a),w(j)})}function YI(a){var d=a.memoizedState;if(d!==null)return d;d={memoizedState:ln,baseState:ln,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tw,lastRenderedState:ln},next:null};var w={};return d.next={memoizedState:w,baseState:w,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tw,lastRenderedState:w},next:null},a.memoizedState=d,a=a.alternate,a!==null&&(a.memoizedState=d),d}function Jk(a){var d=YI(a);d.next===null&&(d=a.alternate.memoizedState),Y6(a,d.next.queue,{},z1())}function Bx(){return ba(w5)}function WI(){return sl().memoizedState}function ZI(){return sl().memoizedState}function oU(a){for(var d=a.return;d!==null;){switch(d.tag){case 24:case 3:var w=z1();a=fp(w);var j=ap(d,a,w);j!==null&&(Wh(j,d,w),q6(j,d,w)),d={cache:dx()},a.payload=d;return}d=d.return}}function sU(a,d,w){var j=z1();w={lane:j,revertLane:0,gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null},Gk(a)?nL(d,w):(w=tx(a,d,w,j),w!==null&&(Wh(w,a,j),Fx(w,d,j)))}function eL(a,d,w){var j=z1();Y6(a,d,w,j)}function Y6(a,d,w,j){var C={lane:j,revertLane:0,gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null};if(Gk(a))nL(d,C);else{var D=a.alternate;if(a.lanes===0&&(D===null||D.lanes===0)&&(D=d.lastRenderedReducer,D!==null))try{var Q=d.lastRenderedState,he=D(Q,w);if(C.hasEagerState=!0,C.eagerState=he,I1(he,Q))return Mk(a,d,C,0),_o===null&&Sk(),!1}catch{}if(w=tx(a,d,C,j),w!==null)return Wh(w,a,j),Fx(w,d,j),!0}return!1}function zx(a,d,w,j){if(j={lane:2,revertLane:ET(),gesture:null,action:j,hasEagerState:!1,eagerState:null,next:null},Gk(a)){if(d)throw Error(x(479))}else d=tx(a,w,j,2),d!==null&&Wh(d,a,2)}function Gk(a){var d=a.alternate;return a===wc||d!==null&&d===wc}function nL(a,d){t5=Pk=!0;var w=a.pending;w===null?d.next=d:(d.next=w.next,w.next=d),a.pending=d}function Fx(a,d,w){if((w&4194048)!==0){var j=d.lanes;j&=a.pendingLanes,w|=j,d.lanes=w,gw(a,w)}}var W6={readContext:ba,use:Bk,useCallback:Us,useContext:Us,useEffect:Us,useImperativeHandle:Us,useLayoutEffect:Us,useInsertionEffect:Us,useMemo:Us,useReducer:Us,useRef:Us,useState:Us,useDebugValue:Us,useDeferredValue:Us,useTransition:Us,useSyncExternalStore:Us,useId:Us,useHostTransitionStatus:Us,useFormState:Us,useActionState:Us,useOptimistic:Us,useMemoCache:Us,useCacheRefresh:Us};W6.useEffectEvent=Us;var lU={readContext:ba,use:Bk,useCallback:function(a,d){return ph().memoizedState=[a,d===void 0?null:d],a},useContext:ba,useEffect:FI,useImperativeHandle:function(a,d,w){w=w!=null?w.concat([a]):null,Fk(4194308,4,qI.bind(null,d,a),w)},useLayoutEffect:function(a,d){return Fk(4194308,4,a,d)},useInsertionEffect:function(a,d){Fk(4,2,a,d)},useMemo:function(a,d){var w=ph();d=d===void 0?null:d;var j=a();if(R3){qh(!0);try{a()}finally{qh(!1)}}return w.memoizedState=[j,d],j},useReducer:function(a,d,w){var j=ph();if(w!==void 0){var C=w(d);if(R3){qh(!0);try{w(d)}finally{qh(!1)}}}else C=d;return j.memoizedState=j.baseState=C,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:C},j.queue=a,a=a.dispatch=sU.bind(null,wc,a),[j.memoizedState,a]},useRef:function(a){var d=ph();return a={current:a},d.memoizedState=a},useState:function(a){a=_x(a);var d=a.queue,w=eL.bind(null,wc,d);return d.dispatch=w,[a.memoizedState,w]},useDebugValue:Px,useDeferredValue:function(a,d){var w=ph();return $x(w,a,d)},useTransition:function(){var a=_x(!1);return a=QI.bind(null,wc,a.queue,!0,!1),ph().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,d,w){var j=wc,C=ph();if(ou){if(w===void 0)throw Error(x(407));w=w()}else{if(w=d(),_o===null)throw Error(x(349));(tu&127)!==0||AI(j,d,w)}C.memoizedState=w;var D={value:w,getSnapshot:d};return C.queue=D,FI(iU.bind(null,j,D,a),[a]),j.flags|=2048,r5(9,{destroy:void 0},xI.bind(null,j,D,w,d),null),w},useId:function(){var a=ph(),d=_o.identifierPrefix;if(ou){var w=Qb,j=Kb;w=(j&~(1<<32-Ho(j)-1)).toString(32)+w,d="_"+d+"R_"+w,w=$k++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof j.is=="string"?Q.createElement("select",{is:j.is}):Q.createElement("select"),j.multiple?D.multiple=!0:j.size&&(D.size=j.size);break;default:D=typeof j.is=="string"?Q.createElement(C,{is:j.is}):Q.createElement(C)}}D[Jo]=d,D[ul]=j;e:for(Q=d.child;Q!==null;){if(Q.tag===5||Q.tag===6)D.appendChild(Q.stateNode);else if(Q.tag!==4&&Q.tag!==27&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===d)break e;for(;Q.sibling===null;){if(Q.return===null||Q.return===d)break e;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}d.stateNode=D;e:switch(wa(D,C,j),C){case"button":case"input":case"select":case"textarea":j=!!j.autoFocus;break e;case"img":j=!0;break e;default:j=!1}j&&I0(d)}}return yo(d),nT(d,d.type,a===null?null:a.memoizedProps,d.pendingProps,w),null;case 6:if(a&&d.stateNode!=null)a.memoizedProps!==j&&I0(d);else{if(typeof j!="string"&&d.stateNode===null)throw Error(x(166));if(a=wi.current,V4(d)){if(a=d.stateNode,w=d.memoizedProps,j=null,C=da,C!==null)switch(C.tag){case 27:case 5:j=C.memoizedProps}a[Jo]=d,a=!!(a.nodeValue===w||j!==null&&j.suppressHydrationWarning===!0||aP(a.nodeValue,w)),a||rp(d,!0)}else a=fE(a).createTextNode(j),a[Jo]=d,d.stateNode=a}return yo(d),null;case 31:if(w=d.memoizedState,a===null||a.memoizedState!==null){if(j=V4(d),w!==null){if(a===null){if(!j)throw Error(x(318));if(a=d.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(x(557));a[Jo]=d}else _3(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;yo(d),a=!1}else w=K4(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=w),a=!0;if(!a)return d.flags&256?($1(d),d):($1(d),null);if((d.flags&128)!==0)throw Error(x(558))}return yo(d),null;case 13:if(j=d.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(C=V4(d),j!==null&&j.dehydrated!==null){if(a===null){if(!C)throw Error(x(318));if(C=d.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(x(317));C[Jo]=d}else _3(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;yo(d),C=!1}else C=K4(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=C),C=!0;if(!C)return d.flags&256?($1(d),d):($1(d),null)}return $1(d),(d.flags&128)!==0?(d.lanes=w,d):(w=j!==null,a=a!==null&&a.memoizedState!==null,w&&(j=d.child,C=null,j.alternate!==null&&j.alternate.memoizedState!==null&&j.alternate.memoizedState.cachePool!==null&&(C=j.alternate.memoizedState.cachePool.pool),D=null,j.memoizedState!==null&&j.memoizedState.cachePool!==null&&(D=j.memoizedState.cachePool.pool),D!==C&&(j.flags|=2048)),w!==a&&w&&(d.child.flags|=8192),Vk(d,d.updateQueue),yo(d),null);case 4:return ai(),a===null&&AT(d.stateNode.containerInfo),yo(d),null;case 10:return Aw(d.type),yo(d),null;case 19:if(on(ol),j=d.memoizedState,j===null)return yo(d),null;if(C=(d.flags&128)!==0,D=j.rendering,D===null)if(C)z3(j,!1);else{if(Xs!==0||a!==null&&(a.flags&128)!==0)for(a=d.child;a!==null;){if(D=Lk(a),D!==null){for(d.flags|=128,z3(j,!1),a=D.updateQueue,d.updateQueue=a,Vk(d,a),d.subtreeFlags=0,a=w,w=d.child;w!==null;)rI(w,a),w=w.sibling;return ct(ol,ol.current&1|2),ou&&Sw(d,j.treeForkCount),d.child}a=a.sibling}j.tail!==null&&Dl()>eE&&(d.flags|=128,C=!0,z3(j,!1),d.lanes=4194304)}else{if(!C)if(a=Lk(D),a!==null){if(d.flags|=128,C=!0,a=a.updateQueue,d.updateQueue=a,Vk(d,a),z3(j,!0),j.tail===null&&j.tailMode==="hidden"&&!D.alternate&&!ou)return yo(d),null}else 2*Dl()-j.renderingStartTime>eE&&w!==536870912&&(d.flags|=128,C=!0,z3(j,!1),d.lanes=4194304);j.isBackwards?(D.sibling=d.child,d.child=D):(a=j.last,a!==null?a.sibling=D:d.child=D,j.last=D)}return j.tail!==null?(a=j.tail,j.rendering=a,j.tail=a.sibling,j.renderingStartTime=Dl(),a.sibling=null,w=ol.current,ct(ol,C?w&1|2:w&1),ou&&Sw(d,j.treeForkCount),a):(yo(d),null);case 22:case 23:return $1(d),jx(),j=d.memoizedState!==null,a!==null?a.memoizedState!==null!==j&&(d.flags|=8192):j&&(d.flags|=8192),j?(w&536870912)!==0&&(d.flags&128)===0&&(yo(d),d.subtreeFlags&6&&(d.flags|=8192)):yo(d),w=d.updateQueue,w!==null&&Vk(d,w.retryQueue),w=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(w=a.memoizedState.cachePool.pool),j=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(j=d.memoizedState.cachePool.pool),j!==w&&(d.flags|=2048),a!==null&&on(I3),null;case 24:return w=null,a!==null&&(w=a.memoizedState.cache),d.memoizedState.cache!==w&&(d.flags|=2048),Aw(Ll),yo(d),null;case 25:return null;case 30:return null}throw Error(x(156,d.tag))}function dU(a,d){switch(ox(d),d.tag){case 1:return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 3:return Aw(Ll),ai(),a=d.flags,(a&65536)!==0&&(a&128)===0?(d.flags=a&-65537|128,d):null;case 26:case 27:case 5:return Qr(d),null;case 31:if(d.memoizedState!==null){if($1(d),d.alternate===null)throw Error(x(340));_3()}return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 13:if($1(d),a=d.memoizedState,a!==null&&a.dehydrated!==null){if(d.alternate===null)throw Error(x(340));_3()}return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 19:return on(ol),null;case 4:return ai(),null;case 10:return Aw(d.type),null;case 22:case 23:return $1(d),jx(),a!==null&&on(I3),a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 24:return Aw(Ll),null;case 25:return null;default:return null}}function tT(a,d){switch(ox(d),d.tag){case 3:Aw(Ll),ai();break;case 26:case 27:case 5:Qr(d);break;case 4:ai();break;case 31:d.memoizedState!==null&&$1(d);break;case 13:$1(d);break;case 19:on(ol);break;case 10:Aw(d.type);break;case 22:case 23:$1(d),jx(),a!==null&&on(I3);break;case 24:Aw(Ll)}}function n9(a,d){try{var w=d.updateQueue,j=w!==null?w.lastEffect:null;if(j!==null){var C=j.next;w=C;do{if((w.tag&a)===a){j=void 0;var D=w.create,Q=w.inst;j=D(),Q.destroy=j}w=w.next}while(w!==C)}}catch(he){ro(d,d.return,he)}}function bp(a,d,w){try{var j=d.updateQueue,C=j!==null?j.lastEffect:null;if(C!==null){var D=C.next;j=D;do{if((j.tag&a)===a){var Q=j.inst,he=Q.destroy;if(he!==void 0){Q.destroy=void 0,C=d;var We=w,_n=he;try{_n()}catch(tt){ro(C,We,tt)}}}j=j.next}while(j!==D)}}catch(tt){ro(d,d.return,tt)}}function t9(a){var d=a.updateQueue;if(d!==null){var w=a.stateNode;try{yI(d,w)}catch(j){ro(a,a.return,j)}}}function EL(a,d,w){w.props=B3(a.type,a.memoizedProps),w.state=a.memoizedState;try{w.componentWillUnmount()}catch(j){ro(a,d,j)}}function i9(a,d){try{var w=a.ref;if(w!==null){switch(a.tag){case 26:case 27:case 5:var j=a.stateNode;break;case 30:j=a.stateNode;break;default:j=a.stateNode}typeof w=="function"?a.refCleanup=w(j):w.current=j}}catch(C){ro(a,d,C)}}function Yb(a,d){var w=a.ref,j=a.refCleanup;if(w!==null)if(typeof j=="function")try{j()}catch(C){ro(a,d,C)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof w=="function")try{w(null)}catch(C){ro(a,d,C)}else w.current=null}function r9(a){var d=a.type,w=a.memoizedProps,j=a.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":w.autoFocus&&j.focus();break e;case"img":w.src?j.src=w.src:w.srcSet&&(j.srcset=w.srcSet)}}catch(C){ro(a,a.return,C)}}function iT(a,d,w){try{var j=a.stateNode;IU(j,a.type,w,d),j[ul]=d}catch(C){ro(a,a.return,C)}}function jL(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&kp(a.type)||a.tag===4}function rT(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||jL(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&kp(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function cT(a,d,w){var j=a.tag;if(j===5||j===6)a=a.stateNode,d?(w.nodeType===9?w.body:w.nodeName==="HTML"?w.ownerDocument.body:w).insertBefore(a,d):(d=w.nodeType===9?w.body:w.nodeName==="HTML"?w.ownerDocument.body:w,d.appendChild(a),w=w._reactRootContainer,w!=null||d.onclick!==null||(d.onclick=kw));else if(j!==4&&(j===27&&kp(a.type)&&(w=a.stateNode,d=null),a=a.child,a!==null))for(cT(a,d,w),a=a.sibling;a!==null;)cT(a,d,w),a=a.sibling}function F3(a,d,w){var j=a.tag;if(j===5||j===6)a=a.stateNode,d?w.insertBefore(a,d):w.appendChild(a);else if(j!==4&&(j===27&&kp(a.type)&&(w=a.stateNode),a=a.child,a!==null))for(F3(a,d,w),a=a.sibling;a!==null;)F3(a,d,w),a=a.sibling}function SL(a){var d=a.stateNode,w=a.memoizedProps;try{for(var j=a.type,C=d.attributes;C.length;)d.removeAttributeNode(C[0]);wa(d,j,w),d[Jo]=a,d[ul]=w}catch(D){ro(a,a.return,D)}}var Wb=!1,Rl=!1,c9=!1,uT=typeof WeakSet=="function"?WeakSet:Set,_f=null;function bU(a,d){if(a=a.containerInfo,CT=If,a=K_(a),QA(a)){if("selectionStart"in a)var w={start:a.selectionStart,end:a.selectionEnd};else e:{w=(w=a.ownerDocument)&&w.defaultView||window;var j=w.getSelection&&w.getSelection();if(j&&j.rangeCount!==0){w=j.anchorNode;var C=j.anchorOffset,D=j.focusNode;j=j.focusOffset;try{w.nodeType,D.nodeType}catch{w=null;break e}var Q=0,he=-1,We=-1,_n=0,tt=0,gt=a,Fn=null;n:for(;;){for(var Yn;gt!==w||C!==0&>.nodeType!==3||(he=Q+C),gt!==D||j!==0&>.nodeType!==3||(We=Q+j),gt.nodeType===3&&(Q+=gt.nodeValue.length),(Yn=gt.firstChild)!==null;)Fn=gt,gt=Yn;for(;;){if(gt===a)break n;if(Fn===w&&++_n===C&&(he=Q),Fn===D&&++tt===j&&(We=Q),(Yn=gt.nextSibling)!==null)break;gt=Fn,Fn=gt.parentNode}gt=Yn}w=he===-1||We===-1?null:{start:he,end:We}}else w=null}w=w||{start:0,end:0}}else w=null;for(OT={focusedElem:a,selectionRange:w},If=!1,_f=d;_f!==null;)if(d=_f,a=d.child,(d.subtreeFlags&1028)!==0&&a!==null)a.return=d,_f=a;else for(;_f!==null;){switch(d=_f,D=d.alternate,a=d.flags,d.tag){case 0:if((a&4)!==0&&(a=d.updateQueue,a=a!==null?a.events:null,a!==null))for(w=0;w title"))),wa(D,j,w),D[Jo]=a,us(D),j=D;break e;case"link":var Q=SP("link","href",C).get(j+(w.href||""));if(Q){for(var he=0;heco&&(Q=co,co=Or,Or=Q);var kn=X_(he,Or),sn=X_(he,co);if(kn&&sn&&(Yn.rangeCount!==1||Yn.anchorNode!==kn.node||Yn.anchorOffset!==kn.offset||Yn.focusNode!==sn.node||Yn.focusOffset!==sn.offset)){var On=gt.createRange();On.setStart(kn.node,kn.offset),Yn.removeAllRanges(),Or>co?(Yn.addRange(On),Yn.extend(sn.node,sn.offset)):(On.setEnd(sn.node,sn.offset),Yn.addRange(On))}}}}for(gt=[],Yn=he;Yn=Yn.parentNode;)Yn.nodeType===1&>.push({element:Yn,left:Yn.scrollLeft,top:Yn.scrollTop});for(typeof he.focus=="function"&&he.focus(),he=0;hew?32:w,ke.T=null,w=dT,dT=null;var D=mp,Q=Iw;if(ff=0,l5=mp=null,Iw=0,(Hu&6)!==0)throw Error(x(331));var he=Hu;if(Hu|=4,IL(D.current),NL(D,D.current,Q,w),Hu=he,a9(0,!1),Gs&&typeof Gs.onPostCommitFiberRoot=="function")try{Gs.onPostCommitFiberRoot(ha,D)}catch{}return!0}finally{Ze.p=C,ke.T=j,WL(a,d)}}function eP(a,d,w){d=Ad(w,d),d=Ux(a.stateNode,d,2),a=ap(a,d,2),a!==null&&(T0(a,2),Zb(a))}function ro(a,d,w){if(a.tag===3)eP(a,a,w);else for(;d!==null;){if(d.tag===3){eP(d,a,w);break}else if(d.tag===1){var j=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof j.componentDidCatch=="function"&&(pp===null||!pp.has(j))){a=Ad(w,a),w=oL(2),j=ap(d,w,2),j!==null&&(sL(w,j,d,a),T0(j,2),Zb(j));break}}d=d.return}}function pT(a,d,w){var j=a.pingCache;if(j===null){j=a.pingCache=new pU;var C=new Set;j.set(d,C)}else C=j.get(d),C===void 0&&(C=new Set,j.set(d,C));C.has(w)||(lT=!0,C.add(w),a=EU.bind(null,a,d,w),d.then(a,a))}function EU(a,d,w){var j=a.pingCache;j!==null&&j.delete(d),a.pingedLanes|=a.suspendedLanes&w,a.warmLanes&=~w,_o===a&&(tu&w)===w&&(Xs===4||Xs===3&&(tu&62914560)===tu&&300>Dl()-Zk?(Hu&2)===0&&f5(a,0):fT|=w,s5===tu&&(s5=0)),Zb(a)}function nP(a,d){d===0&&(d=x0()),a=N3(a,d),a!==null&&(T0(a,d),Zb(a))}function jU(a){var d=a.memoizedState,w=0;d!==null&&(w=d.retryLane),nP(a,w)}function SU(a,d){var w=0;switch(a.tag){case 31:case 13:var j=a.stateNode,C=a.memoizedState;C!==null&&(w=C.retryLane);break;case 19:j=a.stateNode;break;case 22:j=a.stateNode._retryCache;break;default:throw Error(x(314))}j!==null&&j.delete(d),nP(a,w)}function MU(a,d){return aa(a,d)}var uE=null,h5=null,mT=!1,oE=!1,vT=!1,yp=0;function Zb(a){a!==h5&&a.next===null&&(h5===null?uE=h5=a:h5=h5.next=a),oE=!0,mT||(mT=!0,kT())}function a9(a,d){if(!vT&&oE){vT=!0;do for(var w=!1,j=uE;j!==null;){if(a!==0){var C=j.pendingLanes;if(C===0)var D=0;else{var Q=j.suspendedLanes,he=j.pingedLanes;D=(1<<31-Ho(42|a)+1)-1,D&=C&~(Q&~he),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(w=!0,rP(j,D))}else D=tu,D=Nf(j,j===_o?D:0,j.cancelPendingCommit!==null||j.timeoutHandle!==-1),(D&3)===0||dw(j,D)||(w=!0,rP(j,D));j=j.next}while(w);vT=!1}}function AU(){tP()}function tP(){oE=mT=!1;var a=0;yp!==0&&PU()&&(a=yp);for(var d=Dl(),w=null,j=uE;j!==null;){var C=j.next,D=yT(j,d);D===0?(j.next=null,w===null?uE=C:w.next=C,C===null&&(h5=w)):(w=j,(a!==0||(D&3)!==0)&&(oE=!0)),j=C}ff!==0&&ff!==5||a9(a),yp!==0&&(yp=0)}function yT(a,d){for(var w=a.suspendedLanes,j=a.pingedLanes,C=a.expirationTimes,D=a.pendingLanes&-62914561;0he)break;var tt=We.transferSize,gt=We.initiatorType;tt&&hP(gt)&&(We=We.responseEnd,Q+=tt*(We"u"?null:document;function yP(a,d,w){var j=d5;if(j&&typeof d=="string"&&d){var C=Ft(d);C='link[rel="'+a+'"][href="'+C+'"]',typeof w=="string"&&(C+='[crossorigin="'+w+'"]'),$T.has(C)||($T.add(C),a={rel:a,crossOrigin:w,href:d},j.querySelector(C)===null&&(d=j.createElement("link"),wa(d,"link",a),us(d),j.head.appendChild(d)))}}function qU(a){$0.D(a),yP("dns-prefetch",a,null)}function UU(a,d){$0.C(a,d),yP("preconnect",a,d)}function RT(a,d,w){$0.L(a,d,w);var j=d5;if(j&&a&&d){var C='link[rel="preload"][as="'+Ft(d)+'"]';d==="image"&&w&&w.imageSrcSet?(C+='[imagesrcset="'+Ft(w.imageSrcSet)+'"]',typeof w.imageSizes=="string"&&(C+='[imagesizes="'+Ft(w.imageSizes)+'"]')):C+='[href="'+Ft(a)+'"]';var D=C;switch(d){case"style":D=b5(a);break;case"script":D=g5(a)}H1.has(D)||(a=Z({rel:"preload",href:d==="image"&&w&&w.imageSrcSet?void 0:a,as:d},w),H1.set(D,a),j.querySelector(C)!==null||d==="style"&&j.querySelector(G3(D))||d==="script"&&j.querySelector(w9(D))||(d=j.createElement("link"),wa(d,"link",a),us(d),j.head.appendChild(d)))}}function XU(a,d){$0.m(a,d);var w=d5;if(w&&a){var j=d&&typeof d.as=="string"?d.as:"script",C='link[rel="modulepreload"][as="'+Ft(j)+'"][href="'+Ft(a)+'"]',D=C;switch(j){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=g5(a)}if(!H1.has(D)&&(a=Z({rel:"modulepreload",href:a},d),H1.set(D,a),w.querySelector(C)===null)){switch(j){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(w.querySelector(w9(D)))return}j=w.createElement("link"),wa(j,"link",a),us(j),w.head.appendChild(j)}}}function VU(a,d,w){$0.S(a,d,w);var j=d5;if(j&&a){var C=Ra(j).hoistableStyles,D=b5(a);d=d||"default";var Q=C.get(D);if(!Q){var he={loading:0,preload:null};if(Q=j.querySelector(G3(D)))he.loading=5;else{a=Z({rel:"stylesheet",href:a,"data-precedence":d},w),(w=H1.get(D))&&FT(a,w);var We=Q=j.createElement("link");us(We),wa(We,"link",a),We._p=new Promise(function(_n,tt){We.onload=_n,We.onerror=tt}),We.addEventListener("load",function(){he.loading|=1}),We.addEventListener("error",function(){he.loading|=2}),he.loading|=4,dE(Q,d,j)}Q={type:"stylesheet",instance:Q,count:1,state:he},C.set(D,Q)}}}function KU(a,d){$0.X(a,d);var w=d5;if(w&&a){var j=Ra(w).hoistableScripts,C=g5(a),D=j.get(C);D||(D=w.querySelector(w9(C)),D||(a=Z({src:a,async:!0},d),(d=H1.get(C))&&HT(a,d),D=w.createElement("script"),us(D),wa(D,"link",a),w.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},j.set(C,D))}}function BT(a,d){$0.M(a,d);var w=d5;if(w&&a){var j=Ra(w).hoistableScripts,C=g5(a),D=j.get(C);D||(D=w.querySelector(w9(C)),D||(a=Z({src:a,async:!0,type:"module"},d),(d=H1.get(C))&&HT(a,d),D=w.createElement("script"),us(D),wa(D,"link",a),w.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},j.set(C,D))}}function kP(a,d,w,j){var C=(C=wi.current)?hE(C):null;if(!C)throw Error(x(446));switch(a){case"meta":case"title":return null;case"style":return typeof w.precedence=="string"&&typeof w.href=="string"?(d=b5(w.href),w=Ra(C).hoistableStyles,j=w.get(d),j||(j={type:"style",instance:null,count:0,state:null},w.set(d,j)),j):{type:"void",instance:null,count:0,state:null};case"link":if(w.rel==="stylesheet"&&typeof w.href=="string"&&typeof w.precedence=="string"){a=b5(w.href);var D=Ra(C).hoistableStyles,Q=D.get(a);if(Q||(C=C.ownerDocument||C,Q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(a,Q),(D=C.querySelector(G3(a)))&&!D._p&&(Q.instance=D,Q.state.loading=5),H1.has(a)||(w={rel:"preload",as:"style",href:w.href,crossOrigin:w.crossOrigin,integrity:w.integrity,media:w.media,hrefLang:w.hrefLang,referrerPolicy:w.referrerPolicy},H1.set(a,w),D||zT(C,a,w,Q.state))),d&&j===null)throw Error(x(528,""));return Q}if(d&&j!==null)throw Error(x(529,""));return null;case"script":return d=w.async,w=w.src,typeof w=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=g5(w),w=Ra(C).hoistableScripts,j=w.get(d),j||(j={type:"script",instance:null,count:0,state:null},w.set(d,j)),j):{type:"void",instance:null,count:0,state:null};default:throw Error(x(444,a))}}function b5(a){return'href="'+Ft(a)+'"'}function G3(a){return'link[rel="stylesheet"]['+a+"]"}function EP(a){return Z({},a,{"data-precedence":a.precedence,precedence:null})}function zT(a,d,w,j){a.querySelector('link[rel="preload"][as="style"]['+d+"]")?j.loading=1:(d=a.createElement("link"),j.preload=d,d.addEventListener("load",function(){return j.loading|=1}),d.addEventListener("error",function(){return j.loading|=2}),wa(d,"link",w),us(d),a.head.appendChild(d))}function g5(a){return'[src="'+Ft(a)+'"]'}function w9(a){return"script[async]"+a}function jP(a,d,w){if(d.count++,d.instance===null)switch(d.type){case"style":var j=a.querySelector('style[data-href~="'+Ft(w.href)+'"]');if(j)return d.instance=j,us(j),j;var C=Z({},w,{"data-href":w.href,"data-precedence":w.precedence,href:null,precedence:null});return j=(a.ownerDocument||a).createElement("style"),us(j),wa(j,"style",C),dE(j,w.precedence,a),d.instance=j;case"stylesheet":C=b5(w.href);var D=a.querySelector(G3(C));if(D)return d.state.loading|=4,d.instance=D,us(D),D;j=EP(w),(C=H1.get(C))&&FT(j,C),D=(a.ownerDocument||a).createElement("link"),us(D);var Q=D;return Q._p=new Promise(function(he,We){Q.onload=he,Q.onerror=We}),wa(D,"link",j),d.state.loading|=4,dE(D,w.precedence,a),d.instance=D;case"script":return D=g5(w.src),(C=a.querySelector(w9(D)))?(d.instance=C,us(C),C):(j=w,(C=H1.get(D))&&(j=Z({},w),HT(j,C)),a=a.ownerDocument||a,C=a.createElement("script"),us(C),wa(C,"link",j),a.head.appendChild(C),d.instance=C);case"void":return null;default:throw Error(x(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(j=d.instance,d.state.loading|=4,dE(j,w.precedence,a));return d.instance}function dE(a,d,w){for(var j=w.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=j.length?j[j.length-1]:null,D=C,Q=0;Q title"):null)}function QU(a,d,w){if(w===1||d.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;return d.rel==="stylesheet"?(a=d.disabled,typeof d.precedence=="string"&&a==null):!0;case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function AP(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function YU(a,d,w,j){if(w.type==="stylesheet"&&(typeof j.media!="string"||matchMedia(j.media).matches!==!1)&&(w.state.loading&4)===0){if(w.instance===null){var C=b5(j.href),D=d.querySelector(G3(C));if(D){d=D._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(a.count++,a=p9.bind(a),d.then(a,a)),w.state.loading|=4,w.instance=D,us(D);return}D=d.ownerDocument||d,j=EP(j),(C=H1.get(C))&&FT(j,C),D=D.createElement("link"),us(D);var Q=D;Q._p=new Promise(function(he,We){Q.onload=he,Q.onerror=We}),wa(D,"link",j),w.instance=D}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(w,d),(d=w.state.preload)&&(w.state.loading&3)===0&&(a.count++,w=p9.bind(a),d.addEventListener("load",w),d.addEventListener("error",w))}}var JT=0;function WU(a,d){return a.stylesheets&&a.count===0&&q3(a,a.stylesheets),0JT?50:800)+d);return a.unsuspend=w,function(){a.unsuspend=null,clearTimeout(j),clearTimeout(C)}}:null}function p9(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)q3(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var m9=null;function q3(a,d){a.stylesheets=null,a.unsuspend!==null&&(a.count++,m9=new Map,d.forEach(v9,a),m9=null,p9.call(a))}function v9(a,d){if(!(d.state.loading&4)){var w=m9.get(a);if(w)var j=w.get(null);else{w=new Map,m9.set(a,w);for(var C=a.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g)}catch(E){console.error(E)}}return g(),C7e.exports=kzn(),C7e.exports}var jzn=Ezn();function $a(g){if(typeof g=="string"||typeof g=="number")return""+g;let E="";if(Array.isArray(g))for(let M=0,x;M{}};function Cue(){for(var g=0,E=arguments.length,M={},x;g=0&&(x=M.slice(O+1),M=M.slice(0,O)),M&&!E.hasOwnProperty(M))throw new Error("unknown type: "+M);return{type:M,name:x}})}fue.prototype=Cue.prototype={constructor:fue,on:function(g,E){var M=this._,x=Mzn(g+"",M),O,P=-1,k=x.length;if(arguments.length<2){for(;++P0)for(var M=new Array(O),x=0,O,P;x=0&&(E=g.slice(0,M))!=="xmlns"&&(g=g.slice(M+1)),Hhn.hasOwnProperty(E)?{space:Hhn[E],local:g}:g}function xzn(g){return function(){var E=this.ownerDocument,M=this.namespaceURI;return M===V7e&&E.documentElement.namespaceURI===V7e?E.createElement(g):E.createElementNS(M,g)}}function Tzn(g){return function(){return this.ownerDocument.createElementNS(g.space,g.local)}}function kdn(g){var E=Oue(g);return(E.local?Tzn:xzn)(E)}function Czn(){}function hke(g){return g==null?Czn:function(){return this.querySelector(g)}}function Ozn(g){typeof g!="function"&&(g=hke(g));for(var E=this._groups,M=E.length,x=new Array(M),O=0;O=be&&(be=ze+1);!(rn=Ce[be])&&++be=0;)(k=x[O])&&(P&&k.compareDocumentPosition(P)^4&&P.parentNode.insertBefore(k,P),P=k);return this}function nFn(g){g||(g=tFn);function E(Z,ne){return Z&&ne?g(Z.__data__,ne.__data__):!Z-!ne}for(var M=this._groups,x=M.length,O=new Array(x),P=0;PE?1:g>=E?0:NaN}function iFn(){var g=arguments[0];return arguments[0]=this,g.apply(null,arguments),this}function rFn(){return Array.from(this)}function cFn(){for(var g=this._groups,E=0,M=g.length;E1?this.each((E==null?wFn:typeof E=="function"?mFn:pFn)(g,E,M??"")):w_(this.node(),g)}function w_(g,E){return g.style.getPropertyValue(E)||Adn(g).getComputedStyle(g,null).getPropertyValue(E)}function yFn(g){return function(){delete this[g]}}function kFn(g,E){return function(){this[g]=E}}function EFn(g,E){return function(){var M=E.apply(this,arguments);M==null?delete this[g]:this[g]=M}}function jFn(g,E){return arguments.length>1?this.each((E==null?yFn:typeof E=="function"?EFn:kFn)(g,E)):this.node()[g]}function xdn(g){return g.trim().split(/^|\s+/)}function dke(g){return g.classList||new Tdn(g)}function Tdn(g){this._node=g,this._names=xdn(g.getAttribute("class")||"")}Tdn.prototype={add:function(g){var E=this._names.indexOf(g);E<0&&(this._names.push(g),this._node.setAttribute("class",this._names.join(" ")))},remove:function(g){var E=this._names.indexOf(g);E>=0&&(this._names.splice(E,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(g){return this._names.indexOf(g)>=0}};function Cdn(g,E){for(var M=dke(g),x=-1,O=E.length;++x=0&&(M=E.slice(x+1),E=E.slice(0,x)),{type:E,name:M}})}function YFn(g){return function(){var E=this.__on;if(E){for(var M=0,x=-1,O=E.length,P;M()=>g;function K7e(g,{sourceEvent:E,subject:M,target:x,identifier:O,active:P,x:k,y:H,dx:q,dy:F,dispatch:W}){Object.defineProperties(this,{type:{value:g,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},subject:{value:M,enumerable:!0,configurable:!0},target:{value:x,enumerable:!0,configurable:!0},identifier:{value:O,enumerable:!0,configurable:!0},active:{value:P,enumerable:!0,configurable:!0},x:{value:k,enumerable:!0,configurable:!0},y:{value:H,enumerable:!0,configurable:!0},dx:{value:q,enumerable:!0,configurable:!0},dy:{value:F,enumerable:!0,configurable:!0},_:{value:W}})}K7e.prototype.on=function(){var g=this._.on.apply(this._,arguments);return g===this._?this:g};function oHn(g){return!g.ctrlKey&&!g.button}function sHn(){return this.parentNode}function lHn(g,E){return E??{x:g.x,y:g.y}}function fHn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ldn(){var g=oHn,E=sHn,M=lHn,x=fHn,O={},P=Cue("start","drag","end"),k=0,H,q,F,W,Z=0;function ne(De){De.on("mousedown.drag",le).filter(x).on("touchstart.drag",Ce).on("touchmove.drag",je,uHn).on("touchend.drag touchcancel.drag",ze).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function le(De,rn){if(!(W||!g.call(this,De,rn))){var an=be(this,E.call(this,De,rn),De,rn,"mouse");an&&(sw(De.view).on("mousemove.drag",se,JG).on("mouseup.drag",ee,JG),_dn(De.view),_7e(De),F=!1,H=De.clientX,q=De.clientY,an("start",De))}}function se(De){if(b_(De),!F){var rn=De.clientX-H,an=De.clientY-q;F=rn*rn+an*an>Z}O.mouse("drag",De)}function ee(De){sw(De.view).on("mousemove.drag mouseup.drag",null),Idn(De.view,F),b_(De),O.mouse("end",De)}function Ce(De,rn){if(g.call(this,De,rn)){var an=De.changedTouches,un=E.call(this,De,rn),An=an.length,Dn,$t;for(Dn=0;Dn>8&15|E>>4&240,E>>4&15|E&240,(E&15)<<4|E&15,1):M===8?Zce(E>>24&255,E>>16&255,E>>8&255,(E&255)/255):M===4?Zce(E>>12&15|E>>8&240,E>>8&15|E>>4&240,E>>4&15|E&240,((E&15)<<4|E&15)/255):null):(E=hHn.exec(g))?new Gb(E[1],E[2],E[3],1):(E=dHn.exec(g))?new Gb(E[1]*255/100,E[2]*255/100,E[3]*255/100,1):(E=bHn.exec(g))?Zce(E[1],E[2],E[3],E[4]):(E=gHn.exec(g))?Zce(E[1]*255/100,E[2]*255/100,E[3]*255/100,E[4]):(E=wHn.exec(g))?Khn(E[1],E[2]/100,E[3]/100,1):(E=pHn.exec(g))?Khn(E[1],E[2]/100,E[3]/100,E[4]):Jhn.hasOwnProperty(g)?Uhn(Jhn[g]):g==="transparent"?new Gb(NaN,NaN,NaN,0):null}function Uhn(g){return new Gb(g>>16&255,g>>8&255,g&255,1)}function Zce(g,E,M,x){return x<=0&&(g=E=M=NaN),new Gb(g,E,M,x)}function yHn(g){return g instanceof tq||(g=NA(g)),g?(g=g.rgb(),new Gb(g.r,g.g,g.b,g.opacity)):new Gb}function Q7e(g,E,M,x){return arguments.length===1?yHn(g):new Gb(g,E,M,x??1)}function Gb(g,E,M,x){this.r=+g,this.g=+E,this.b=+M,this.opacity=+x}bke(Gb,Q7e,Pdn(tq,{brighter(g){return g=g==null?wue:Math.pow(wue,g),new Gb(this.r*g,this.g*g,this.b*g,this.opacity)},darker(g){return g=g==null?GG:Math.pow(GG,g),new Gb(this.r*g,this.g*g,this.b*g,this.opacity)},rgb(){return this},clamp(){return new Gb(CA(this.r),CA(this.g),CA(this.b),pue(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xhn,formatHex:Xhn,formatHex8:kHn,formatRgb:Vhn,toString:Vhn}));function Xhn(){return`#${TA(this.r)}${TA(this.g)}${TA(this.b)}`}function kHn(){return`#${TA(this.r)}${TA(this.g)}${TA(this.b)}${TA((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vhn(){const g=pue(this.opacity);return`${g===1?"rgb(":"rgba("}${CA(this.r)}, ${CA(this.g)}, ${CA(this.b)}${g===1?")":`, ${g})`}`}function pue(g){return isNaN(g)?1:Math.max(0,Math.min(1,g))}function CA(g){return Math.max(0,Math.min(255,Math.round(g)||0))}function TA(g){return g=CA(g),(g<16?"0":"")+g.toString(16)}function Khn(g,E,M,x){return x<=0?g=E=M=NaN:M<=0||M>=1?g=E=NaN:E<=0&&(g=NaN),new y3(g,E,M,x)}function $dn(g){if(g instanceof y3)return new y3(g.h,g.s,g.l,g.opacity);if(g instanceof tq||(g=NA(g)),!g)return new y3;if(g instanceof y3)return g;g=g.rgb();var E=g.r/255,M=g.g/255,x=g.b/255,O=Math.min(E,M,x),P=Math.max(E,M,x),k=NaN,H=P-O,q=(P+O)/2;return H?(E===P?k=(M-x)/H+(M0&&q<1?0:k,new y3(k,H,q,g.opacity)}function EHn(g,E,M,x){return arguments.length===1?$dn(g):new y3(g,E,M,x??1)}function y3(g,E,M,x){this.h=+g,this.s=+E,this.l=+M,this.opacity=+x}bke(y3,EHn,Pdn(tq,{brighter(g){return g=g==null?wue:Math.pow(wue,g),new y3(this.h,this.s,this.l*g,this.opacity)},darker(g){return g=g==null?GG:Math.pow(GG,g),new y3(this.h,this.s,this.l*g,this.opacity)},rgb(){var g=this.h%360+(this.h<0)*360,E=isNaN(g)||isNaN(this.s)?0:this.s,M=this.l,x=M+(M<.5?M:1-M)*E,O=2*M-x;return new Gb(I7e(g>=240?g-240:g+120,O,x),I7e(g,O,x),I7e(g<120?g+240:g-120,O,x),this.opacity)},clamp(){return new y3(Qhn(this.h),eue(this.s),eue(this.l),pue(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const g=pue(this.opacity);return`${g===1?"hsl(":"hsla("}${Qhn(this.h)}, ${eue(this.s)*100}%, ${eue(this.l)*100}%${g===1?")":`, ${g})`}`}}));function Qhn(g){return g=(g||0)%360,g<0?g+360:g}function eue(g){return Math.max(0,Math.min(1,g||0))}function I7e(g,E,M){return(g<60?E+(M-E)*g/60:g<180?M:g<240?E+(M-E)*(240-g)/60:E)*255}const gke=g=>()=>g;function jHn(g,E){return function(M){return g+M*E}}function SHn(g,E,M){return g=Math.pow(g,M),E=Math.pow(E,M)-g,M=1/M,function(x){return Math.pow(g+x*E,M)}}function MHn(g){return(g=+g)==1?Rdn:function(E,M){return M-E?SHn(E,M,g):gke(isNaN(E)?M:E)}}function Rdn(g,E){var M=E-g;return M?jHn(g,M):gke(isNaN(g)?E:g)}const mue=(function g(E){var M=MHn(E);function x(O,P){var k=M((O=Q7e(O)).r,(P=Q7e(P)).r),H=M(O.g,P.g),q=M(O.b,P.b),F=Rdn(O.opacity,P.opacity);return function(W){return O.r=k(W),O.g=H(W),O.b=q(W),O.opacity=F(W),O+""}}return x.gamma=g,x})(1);function AHn(g,E){E||(E=[]);var M=g?Math.min(E.length,g.length):0,x=E.slice(),O;return function(P){for(O=0;OM&&(P=E.slice(M,P),H[k]?H[k]+=P:H[++k]=P),(x=x[0])===(O=O[0])?H[k]?H[k]+=O:H[++k]=O:(H[++k]=null,q.push({i:k,x:T4(x,O)})),M=L7e.lastIndex;return M180?W+=360:W-F>180&&(F+=360),ne.push({i:Z.push(O(Z)+"rotate(",null,x)-2,x:T4(F,W)})):W&&Z.push(O(Z)+"rotate("+W+x)}function H(F,W,Z,ne){F!==W?ne.push({i:Z.push(O(Z)+"skewX(",null,x)-2,x:T4(F,W)}):W&&Z.push(O(Z)+"skewX("+W+x)}function q(F,W,Z,ne,le,se){if(F!==Z||W!==ne){var ee=le.push(O(le)+"scale(",null,",",null,")");se.push({i:ee-4,x:T4(F,Z)},{i:ee-2,x:T4(W,ne)})}else(Z!==1||ne!==1)&&le.push(O(le)+"scale("+Z+","+ne+")")}return function(F,W){var Z=[],ne=[];return F=g(F),W=g(W),P(F.translateX,F.translateY,W.translateX,W.translateY,Z,ne),k(F.rotate,W.rotate,Z,ne),H(F.skewX,W.skewX,Z,ne),q(F.scaleX,F.scaleY,W.scaleX,W.scaleY,Z,ne),F=W=null,function(le){for(var se=-1,ee=ne.length,Ce;++se=0&&g._call.call(void 0,E),g=g._next;--p_}function Zhn(){DA=(yue=UG.now())+Nue,p_=BG=0;try{FHn()}finally{p_=0,JHn(),DA=0}}function HHn(){var g=UG.now(),E=g-yue;E>Hdn&&(Nue-=E,yue=g)}function JHn(){for(var g,E=vue,M,x=1/0;E;)E._call?(x>E._time&&(x=E._time),g=E,E=E._next):(M=E._next,E._next=null,E=g?g._next=M:vue=M);zG=g,Z7e(x)}function Z7e(g){if(!p_){BG&&(BG=clearTimeout(BG));var E=g-DA;E>24?(g<1/0&&(BG=setTimeout(Zhn,g-UG.now()-Nue)),$G&&($G=clearInterval($G))):($G||(yue=UG.now(),$G=setInterval(HHn,Hdn)),p_=1,Jdn(Zhn))}}function e1n(g,E,M){var x=new kue;return E=E==null?0:+E,x.restart(O=>{x.stop(),g(O+E)},E,M),x}var GHn=Cue("start","end","cancel","interrupt"),qHn=[],qdn=0,n1n=1,eke=2,hue=3,t1n=4,nke=5,due=6;function Due(g,E,M,x,O,P){var k=g.__transition;if(!k)g.__transition={};else if(M in k)return;UHn(g,M,{name:E,index:x,group:O,on:GHn,tween:qHn,time:P.time,delay:P.delay,duration:P.duration,ease:P.ease,timer:null,state:qdn})}function pke(g,E){var M=j3(g,E);if(M.state>qdn)throw new Error("too late; already scheduled");return M}function _4(g,E){var M=j3(g,E);if(M.state>hue)throw new Error("too late; already running");return M}function j3(g,E){var M=g.__transition;if(!M||!(M=M[E]))throw new Error("transition not found");return M}function UHn(g,E,M){var x=g.__transition,O;x[E]=M,M.timer=Gdn(P,0,M.time);function P(F){M.state=n1n,M.timer.restart(k,M.delay,M.time),M.delay<=F&&k(F-M.delay)}function k(F){var W,Z,ne,le;if(M.state!==n1n)return q();for(W in x)if(le=x[W],le.name===M.name){if(le.state===hue)return e1n(k);le.state===t1n?(le.state=due,le.timer.stop(),le.on.call("interrupt",g,g.__data__,le.index,le.group),delete x[W]):+Weke&&x.state=0&&(E=E.slice(0,M)),!E||E==="start"})}function EJn(g,E,M){var x,O,P=kJn(E)?pke:_4;return function(){var k=P(this,g),H=k.on;H!==x&&(O=(x=H).copy()).on(E,M),k.on=O}}function jJn(g,E){var M=this._id;return arguments.length<2?j3(this.node(),M).on.on(g):this.each(EJn(M,g,E))}function SJn(g){return function(){var E=this.parentNode;for(var M in this.__transition)if(+M!==g)return;E&&E.removeChild(this)}}function MJn(){return this.on("end.remove",SJn(this._id))}function AJn(g){var E=this._name,M=this._id;typeof g!="function"&&(g=hke(g));for(var x=this._groups,O=x.length,P=new Array(O),k=0;k()=>g;function YJn(g,{sourceEvent:E,target:M,transform:x,dispatch:O}){Object.defineProperties(this,{type:{value:g,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},target:{value:M,enumerable:!0,configurable:!0},transform:{value:x,enumerable:!0,configurable:!0},_:{value:O}})}function k6(g,E,M){this.k=g,this.x=E,this.y=M}k6.prototype={constructor:k6,scale:function(g){return g===1?this:new k6(this.k*g,this.x,this.y)},translate:function(g,E){return g===0&E===0?this:new k6(this.k,this.x+this.k*g,this.y+this.k*E)},apply:function(g){return[g[0]*this.k+this.x,g[1]*this.k+this.y]},applyX:function(g){return g*this.k+this.x},applyY:function(g){return g*this.k+this.y},invert:function(g){return[(g[0]-this.x)/this.k,(g[1]-this.y)/this.k]},invertX:function(g){return(g-this.x)/this.k},invertY:function(g){return(g-this.y)/this.k},rescaleX:function(g){return g.copy().domain(g.range().map(this.invertX,this).map(g.invert,g))},rescaleY:function(g){return g.copy().domain(g.range().map(this.invertY,this).map(g.invert,g))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var _ue=new k6(1,0,0);Kdn.prototype=k6.prototype;function Kdn(g){for(;!g.__zoom;)if(!(g=g.parentNode))return _ue;return g.__zoom}function P7e(g){g.stopImmediatePropagation()}function RG(g){g.preventDefault(),g.stopImmediatePropagation()}function WJn(g){return(!g.ctrlKey||g.type==="wheel")&&!g.button}function ZJn(){var g=this;return g instanceof SVGElement?(g=g.ownerSVGElement||g,g.hasAttribute("viewBox")?(g=g.viewBox.baseVal,[[g.x,g.y],[g.x+g.width,g.y+g.height]]):[[0,0],[g.width.baseVal.value,g.height.baseVal.value]]):[[0,0],[g.clientWidth,g.clientHeight]]}function i1n(){return this.__zoom||_ue}function eGn(g){return-g.deltaY*(g.deltaMode===1?.05:g.deltaMode?1:.002)*(g.ctrlKey?10:1)}function nGn(){return navigator.maxTouchPoints||"ontouchstart"in this}function tGn(g,E,M){var x=g.invertX(E[0][0])-M[0][0],O=g.invertX(E[1][0])-M[1][0],P=g.invertY(E[0][1])-M[0][1],k=g.invertY(E[1][1])-M[1][1];return g.translate(O>x?(x+O)/2:Math.min(0,x)||Math.max(0,O),k>P?(P+k)/2:Math.min(0,P)||Math.max(0,k))}function Qdn(){var g=WJn,E=ZJn,M=tGn,x=eGn,O=nGn,P=[0,1/0],k=[[-1/0,-1/0],[1/0,1/0]],H=250,q=aue,F=Cue("start","zoom","end"),W,Z,ne,le=500,se=150,ee=0,Ce=10;function je(He){He.property("__zoom",i1n).on("wheel.zoom",An,{passive:!1}).on("mousedown.zoom",Dn).on("dblclick.zoom",$t).filter(O).on("touchstart.zoom",In).on("touchmove.zoom",et).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}je.transform=function(He,en,ke,Ze){var ln=He.selection?He.selection():He;ln.property("__zoom",i1n),He!==ln?rn(He,en,ke,Ze):ln.interrupt().each(function(){an(this,arguments).event(Ze).start().zoom(null,typeof en=="function"?en.apply(this,arguments):en).end()})},je.scaleBy=function(He,en,ke,Ze){je.scaleTo(He,function(){var ln=this.__zoom.k,En=typeof en=="function"?en.apply(this,arguments):en;return ln*En},ke,Ze)},je.scaleTo=function(He,en,ke,Ze){je.transform(He,function(){var ln=E.apply(this,arguments),En=this.__zoom,nt=ke==null?De(ln):typeof ke=="function"?ke.apply(this,arguments):ke,Se=En.invert(nt),on=typeof en=="function"?en.apply(this,arguments):en;return M(be(ze(En,on),nt,Se),ln,k)},ke,Ze)},je.translateBy=function(He,en,ke,Ze){je.transform(He,function(){return M(this.__zoom.translate(typeof en=="function"?en.apply(this,arguments):en,typeof ke=="function"?ke.apply(this,arguments):ke),E.apply(this,arguments),k)},null,Ze)},je.translateTo=function(He,en,ke,Ze,ln){je.transform(He,function(){var En=E.apply(this,arguments),nt=this.__zoom,Se=Ze==null?De(En):typeof Ze=="function"?Ze.apply(this,arguments):Ze;return M(_ue.translate(Se[0],Se[1]).scale(nt.k).translate(typeof en=="function"?-en.apply(this,arguments):-en,typeof ke=="function"?-ke.apply(this,arguments):-ke),En,k)},Ze,ln)};function ze(He,en){return en=Math.max(P[0],Math.min(P[1],en)),en===He.k?He:new k6(en,He.x,He.y)}function be(He,en,ke){var Ze=en[0]-ke[0]*He.k,ln=en[1]-ke[1]*He.k;return Ze===He.x&&ln===He.y?He:new k6(He.k,Ze,ln)}function De(He){return[(+He[0][0]+ +He[1][0])/2,(+He[0][1]+ +He[1][1])/2]}function rn(He,en,ke,Ze){He.on("start.zoom",function(){an(this,arguments).event(Ze).start()}).on("interrupt.zoom end.zoom",function(){an(this,arguments).event(Ze).end()}).tween("zoom",function(){var ln=this,En=arguments,nt=an(ln,En).event(Ze),Se=E.apply(ln,En),on=ke==null?De(Se):typeof ke=="function"?ke.apply(ln,En):ke,ct=Math.max(Se[1][0]-Se[0][0],Se[1][1]-Se[0][1]),lt=ln.__zoom,qt=typeof en=="function"?en.apply(ln,En):en,wi=q(lt.invert(on).concat(ct/lt.k),qt.invert(on).concat(ct/qt.k));return function(li){if(li===1)li=qt;else{var Ut=wi(li),ai=ct/Ut[2];li=new k6(ai,on[0]-Ut[0]*ai,on[1]-Ut[1]*ai)}nt.zoom(null,li)}})}function an(He,en,ke){return!ke&&He.__zooming||new un(He,en)}function un(He,en){this.that=He,this.args=en,this.active=0,this.sourceEvent=null,this.extent=E.apply(He,en),this.taps=0}un.prototype={event:function(He){return He&&(this.sourceEvent=He),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(He,en){return this.mouse&&He!=="mouse"&&(this.mouse[1]=en.invert(this.mouse[0])),this.touch0&&He!=="touch"&&(this.touch0[1]=en.invert(this.touch0[0])),this.touch1&&He!=="touch"&&(this.touch1[1]=en.invert(this.touch1[0])),this.that.__zoom=en,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(He){var en=sw(this.that).datum();F.call(He,this.that,new YJn(He,{sourceEvent:this.sourceEvent,target:je,transform:this.that.__zoom,dispatch:F}),en)}};function An(He,...en){if(!g.apply(this,arguments))return;var ke=an(this,en).event(He),Ze=this.__zoom,ln=Math.max(P[0],Math.min(P[1],Ze.k*Math.pow(2,x.apply(this,arguments)))),En=v3(He);if(ke.wheel)(ke.mouse[0][0]!==En[0]||ke.mouse[0][1]!==En[1])&&(ke.mouse[1]=Ze.invert(ke.mouse[0]=En)),clearTimeout(ke.wheel);else{if(Ze.k===ln)return;ke.mouse=[En,Ze.invert(En)],bue(this),ke.start()}RG(He),ke.wheel=setTimeout(nt,se),ke.zoom("mouse",M(be(ze(Ze,ln),ke.mouse[0],ke.mouse[1]),ke.extent,k));function nt(){ke.wheel=null,ke.end()}}function Dn(He,...en){if(ne||!g.apply(this,arguments))return;var ke=He.currentTarget,Ze=an(this,en,!0).event(He),ln=sw(He.view).on("mousemove.zoom",on,!0).on("mouseup.zoom",ct,!0),En=v3(He,ke),nt=He.clientX,Se=He.clientY;_dn(He.view),P7e(He),Ze.mouse=[En,this.__zoom.invert(En)],bue(this),Ze.start();function on(lt){if(RG(lt),!Ze.moved){var qt=lt.clientX-nt,wi=lt.clientY-Se;Ze.moved=qt*qt+wi*wi>ee}Ze.event(lt).zoom("mouse",M(be(Ze.that.__zoom,Ze.mouse[0]=v3(lt,ke),Ze.mouse[1]),Ze.extent,k))}function ct(lt){ln.on("mousemove.zoom mouseup.zoom",null),Idn(lt.view,Ze.moved),RG(lt),Ze.event(lt).end()}}function $t(He,...en){if(g.apply(this,arguments)){var ke=this.__zoom,Ze=v3(He.changedTouches?He.changedTouches[0]:He,this),ln=ke.invert(Ze),En=ke.k*(He.shiftKey?.5:2),nt=M(be(ze(ke,En),Ze,ln),E.apply(this,en),k);RG(He),H>0?sw(this).transition().duration(H).call(rn,nt,Ze,He):sw(this).call(je.transform,nt,Ze,He)}}function In(He,...en){if(g.apply(this,arguments)){var ke=He.touches,Ze=ke.length,ln=an(this,en,He.changedTouches.length===Ze).event(He),En,nt,Se,on;for(P7e(He),nt=0;nt"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:g=>`Node type "${g}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:g=>`The old edge with id=${g} does not exist.`,error009:g=>`Marker type "${g}" doesn't exist.`,error008:(g,{id:E,sourceHandle:M,targetHandle:x})=>`Couldn't create edge for ${g} handle id: "${g==="source"?M:x}", edge id: ${E}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:g=>`Edge type "${g}" not found. Using fallback type "default".`,error012:g=>`Node with id "${g}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(g="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${g}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},XG=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ydn=["Enter"," ","Escape"],Wdn={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:g,x:E,y:M})=>`Moved selected node ${g}. New position, x: ${E}, y: ${M}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var m_;(function(g){g.Strict="strict",g.Loose="loose"})(m_||(m_={}));var OA;(function(g){g.Free="free",g.Vertical="vertical",g.Horizontal="horizontal"})(OA||(OA={}));var VG;(function(g){g.Partial="partial",g.Full="full"})(VG||(VG={}));const Zdn={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var bk;(function(g){g.Bezier="default",g.Straight="straight",g.Step="step",g.SmoothStep="smoothstep",g.SimpleBezier="simplebezier"})(bk||(bk={}));var KG;(function(g){g.Arrow="arrow",g.ArrowClosed="arrowclosed"})(KG||(KG={}));var er;(function(g){g.Left="left",g.Top="top",g.Right="right",g.Bottom="bottom"})(er||(er={}));const r1n={[er.Left]:er.Right,[er.Right]:er.Left,[er.Top]:er.Bottom,[er.Bottom]:er.Top};function e0n(g){return g===null?null:g?"valid":"invalid"}const n0n=g=>"id"in g&&"source"in g&&"target"in g,iGn=g=>"id"in g&&"position"in g&&!("source"in g)&&!("target"in g),vke=g=>"id"in g&&"internals"in g&&!("source"in g)&&!("target"in g),iq=(g,E=[0,0])=>{const{width:M,height:x}=j6(g),O=g.origin??E,P=M*O[0],k=x*O[1];return{x:g.position.x-P,y:g.position.y-k}},rGn=(g,E={nodeOrigin:[0,0]})=>{if(g.length===0)return{x:0,y:0,width:0,height:0};const M=g.reduce((x,O)=>{const P=typeof O=="string";let k=!E.nodeLookup&&!P?O:void 0;E.nodeLookup&&(k=P?E.nodeLookup.get(O):vke(O)?O:E.nodeLookup.get(O.id));const H=k?Eue(k,E.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Iue(x,H)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Lue(M)},rq=(g,E={})=>{let M={x:1/0,y:1/0,x2:-1/0,y2:-1/0},x=!1;return g.forEach(O=>{(E.filter===void 0||E.filter(O))&&(M=Iue(M,Eue(O)),x=!0)}),x?Lue(M):{x:0,y:0,width:0,height:0}},yke=(g,E,[M,x,O]=[0,0,1],P=!1,k=!1)=>{const H={...uq(E,[M,x,O]),width:E.width/O,height:E.height/O},q=[];for(const F of g.values()){const{measured:W,selectable:Z=!0,hidden:ne=!1}=F;if(k&&!Z||ne)continue;const le=W.width??F.width??F.initialWidth??null,se=W.height??F.height??F.initialHeight??null,ee=QG(H,y_(F)),Ce=(le??0)*(se??0),je=P&&ee>0;(!F.internals.handleBounds||je||ee>=Ce||F.dragging)&&q.push(F)}return q},cGn=(g,E)=>{const M=new Set;return g.forEach(x=>{M.add(x.id)}),E.filter(x=>M.has(x.source)||M.has(x.target))};function uGn(g,E){const M=new Map,x=E?.nodes?new Set(E.nodes.map(O=>O.id)):null;return g.forEach(O=>{O.measured.width&&O.measured.height&&(E?.includeHiddenNodes||!O.hidden)&&(!x||x.has(O.id))&&M.set(O.id,O)}),M}async function oGn({nodes:g,width:E,height:M,panZoom:x,minZoom:O,maxZoom:P},k){if(g.size===0)return Promise.resolve(!0);const H=uGn(g,k),q=rq(H),F=kke(q,E,M,k?.minZoom??O,k?.maxZoom??P,k?.padding??.1);return await x.setViewport(F,{duration:k?.duration,ease:k?.ease,interpolate:k?.interpolate}),Promise.resolve(!0)}function t0n({nodeId:g,nextPosition:E,nodeLookup:M,nodeOrigin:x=[0,0],nodeExtent:O,onError:P}){const k=M.get(g),H=k.parentId?M.get(k.parentId):void 0,{x:q,y:F}=H?H.internals.positionAbsolute:{x:0,y:0},W=k.origin??x;let Z=k.extent||O;if(k.extent==="parent"&&!k.expandParent)if(!H)P?.("005",N4.error005());else{const le=H.measured.width,se=H.measured.height;le&&se&&(Z=[[q,F],[q+le,F+se]])}else H&&k_(k.extent)&&(Z=[[k.extent[0][0]+q,k.extent[0][1]+F],[k.extent[1][0]+q,k.extent[1][1]+F]]);const ne=k_(Z)?_A(E,Z,k.measured):E;return(k.measured.width===void 0||k.measured.height===void 0)&&P?.("015",N4.error015()),{position:{x:ne.x-q+(k.measured.width??0)*W[0],y:ne.y-F+(k.measured.height??0)*W[1]},positionAbsolute:ne}}async function sGn({nodesToRemove:g=[],edgesToRemove:E=[],nodes:M,edges:x,onBeforeDelete:O}){const P=new Set(g.map(ne=>ne.id)),k=[];for(const ne of M){if(ne.deletable===!1)continue;const le=P.has(ne.id),se=!le&&ne.parentId&&k.find(ee=>ee.id===ne.parentId);(le||se)&&k.push(ne)}const H=new Set(E.map(ne=>ne.id)),q=x.filter(ne=>ne.deletable!==!1),W=cGn(k,q);for(const ne of q)H.has(ne.id)&&!W.find(se=>se.id===ne.id)&&W.push(ne);if(!O)return{edges:W,nodes:k};const Z=await O({nodes:k,edges:W});return typeof Z=="boolean"?Z?{edges:W,nodes:k}:{edges:[],nodes:[]}:Z}const v_=(g,E=0,M=1)=>Math.min(Math.max(g,E),M),_A=(g={x:0,y:0},E,M)=>({x:v_(g.x,E[0][0],E[1][0]-(M?.width??0)),y:v_(g.y,E[0][1],E[1][1]-(M?.height??0))});function i0n(g,E,M){const{width:x,height:O}=j6(M),{x:P,y:k}=M.internals.positionAbsolute;return _A(g,[[P,k],[P+x,k+O]],E)}const c1n=(g,E,M)=>gM?-v_(Math.abs(g-M),1,E)/E:0,r0n=(g,E,M=15,x=40)=>{const O=c1n(g.x,x,E.width-x)*M,P=c1n(g.y,x,E.height-x)*M;return[O,P]},Iue=(g,E)=>({x:Math.min(g.x,E.x),y:Math.min(g.y,E.y),x2:Math.max(g.x2,E.x2),y2:Math.max(g.y2,E.y2)}),tke=({x:g,y:E,width:M,height:x})=>({x:g,y:E,x2:g+M,y2:E+x}),Lue=({x:g,y:E,x2:M,y2:x})=>({x:g,y:E,width:M-g,height:x-E}),y_=(g,E=[0,0])=>{const{x:M,y:x}=vke(g)?g.internals.positionAbsolute:iq(g,E);return{x:M,y:x,width:g.measured?.width??g.width??g.initialWidth??0,height:g.measured?.height??g.height??g.initialHeight??0}},Eue=(g,E=[0,0])=>{const{x:M,y:x}=vke(g)?g.internals.positionAbsolute:iq(g,E);return{x:M,y:x,x2:M+(g.measured?.width??g.width??g.initialWidth??0),y2:x+(g.measured?.height??g.height??g.initialHeight??0)}},c0n=(g,E)=>Lue(Iue(tke(g),tke(E))),QG=(g,E)=>{const M=Math.max(0,Math.min(g.x+g.width,E.x+E.width)-Math.max(g.x,E.x)),x=Math.max(0,Math.min(g.y+g.height,E.y+E.height)-Math.max(g.y,E.y));return Math.ceil(M*x)},u1n=g=>k3(g.width)&&k3(g.height)&&k3(g.x)&&k3(g.y),k3=g=>!isNaN(g)&&isFinite(g),lGn=(g,E)=>{},cq=(g,E=[1,1])=>({x:E[0]*Math.round(g.x/E[0]),y:E[1]*Math.round(g.y/E[1])}),uq=({x:g,y:E},[M,x,O],P=!1,k=[1,1])=>{const H={x:(g-M)/O,y:(E-x)/O};return P?cq(H,k):H},jue=({x:g,y:E},[M,x,O])=>({x:g*O+M,y:E*O+x});function a_(g,E){if(typeof g=="number")return Math.floor((E-E/(1+g))*.5);if(typeof g=="string"&&g.endsWith("px")){const M=parseFloat(g);if(!Number.isNaN(M))return Math.floor(M)}if(typeof g=="string"&&g.endsWith("%")){const M=parseFloat(g);if(!Number.isNaN(M))return Math.floor(E*M*.01)}return console.error(`[React Flow] The padding value "${g}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function fGn(g,E,M){if(typeof g=="string"||typeof g=="number"){const x=a_(g,M),O=a_(g,E);return{top:x,right:O,bottom:x,left:O,x:O*2,y:x*2}}if(typeof g=="object"){const x=a_(g.top??g.y??0,M),O=a_(g.bottom??g.y??0,M),P=a_(g.left??g.x??0,E),k=a_(g.right??g.x??0,E);return{top:x,right:k,bottom:O,left:P,x:P+k,y:x+O}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function aGn(g,E,M,x,O,P){const{x:k,y:H}=jue(g,[E,M,x]),{x:q,y:F}=jue({x:g.x+g.width,y:g.y+g.height},[E,M,x]),W=O-q,Z=P-F;return{left:Math.floor(k),top:Math.floor(H),right:Math.floor(W),bottom:Math.floor(Z)}}const kke=(g,E,M,x,O,P)=>{const k=fGn(P,E,M),H=(E-k.x)/g.width,q=(M-k.y)/g.height,F=Math.min(H,q),W=v_(F,x,O),Z=g.x+g.width/2,ne=g.y+g.height/2,le=E/2-Z*W,se=M/2-ne*W,ee=aGn(g,le,se,W,E,M),Ce={left:Math.min(ee.left-k.left,0),top:Math.min(ee.top-k.top,0),right:Math.min(ee.right-k.right,0),bottom:Math.min(ee.bottom-k.bottom,0)};return{x:le-Ce.left+Ce.right,y:se-Ce.top+Ce.bottom,zoom:W}},YG=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function k_(g){return g!=null&&g!=="parent"}function j6(g){return{width:g.measured?.width??g.width??g.initialWidth??0,height:g.measured?.height??g.height??g.initialHeight??0}}function u0n(g){return(g.measured?.width??g.width??g.initialWidth)!==void 0&&(g.measured?.height??g.height??g.initialHeight)!==void 0}function o0n(g,E={width:0,height:0},M,x,O){const P={...g},k=x.get(M);if(k){const H=k.origin||O;P.x+=k.internals.positionAbsolute.x-(E.width??0)*H[0],P.y+=k.internals.positionAbsolute.y-(E.height??0)*H[1]}return P}function o1n(g,E){if(g.size!==E.size)return!1;for(const M of g)if(!E.has(M))return!1;return!0}function hGn(){let g,E;return{promise:new Promise((x,O)=>{g=x,E=O}),resolve:g,reject:E}}function dGn(g){return{...Wdn,...g||{}}}function HG(g,{snapGrid:E=[0,0],snapToGrid:M=!1,transform:x,containerBounds:O}){const{x:P,y:k}=E3(g),H=uq({x:P-(O?.left??0),y:k-(O?.top??0)},x),{x:q,y:F}=M?cq(H,E):H;return{xSnapped:q,ySnapped:F,...H}}const Eke=g=>({width:g.offsetWidth,height:g.offsetHeight}),s0n=g=>g?.getRootNode?.()||window?.document,bGn=["INPUT","SELECT","TEXTAREA"];function l0n(g){const E=g.composedPath?.()?.[0]||g.target;return E?.nodeType!==1?!1:bGn.includes(E.nodeName)||E.hasAttribute("contenteditable")||!!E.closest(".nokey")}const f0n=g=>"clientX"in g,E3=(g,E)=>{const M=f0n(g),x=M?g.clientX:g.touches?.[0].clientX,O=M?g.clientY:g.touches?.[0].clientY;return{x:x-(E?.left??0),y:O-(E?.top??0)}},s1n=(g,E,M,x,O)=>{const P=E.querySelectorAll(`.${g}`);return!P||!P.length?null:Array.from(P).map(k=>{const H=k.getBoundingClientRect();return{id:k.getAttribute("data-handleid"),type:g,nodeId:O,position:k.getAttribute("data-handlepos"),x:(H.left-M.left)/x,y:(H.top-M.top)/x,...Eke(k)}})};function a0n({sourceX:g,sourceY:E,targetX:M,targetY:x,sourceControlX:O,sourceControlY:P,targetControlX:k,targetControlY:H}){const q=g*.125+O*.375+k*.375+M*.125,F=E*.125+P*.375+H*.375+x*.125,W=Math.abs(q-g),Z=Math.abs(F-E);return[q,F,W,Z]}function iue(g,E){return g>=0?.5*g:E*25*Math.sqrt(-g)}function l1n({pos:g,x1:E,y1:M,x2:x,y2:O,c:P}){switch(g){case er.Left:return[E-iue(E-x,P),M];case er.Right:return[E+iue(x-E,P),M];case er.Top:return[E,M-iue(M-O,P)];case er.Bottom:return[E,M+iue(O-M,P)]}}function h0n({sourceX:g,sourceY:E,sourcePosition:M=er.Bottom,targetX:x,targetY:O,targetPosition:P=er.Top,curvature:k=.25}){const[H,q]=l1n({pos:M,x1:g,y1:E,x2:x,y2:O,c:k}),[F,W]=l1n({pos:P,x1:x,y1:O,x2:g,y2:E,c:k}),[Z,ne,le,se]=a0n({sourceX:g,sourceY:E,targetX:x,targetY:O,sourceControlX:H,sourceControlY:q,targetControlX:F,targetControlY:W});return[`M${g},${E} C${H},${q} ${F},${W} ${x},${O}`,Z,ne,le,se]}function d0n({sourceX:g,sourceY:E,targetX:M,targetY:x}){const O=Math.abs(M-g)/2,P=M0}const pGn=({source:g,sourceHandle:E,target:M,targetHandle:x})=>`xy-edge__${g}${E||""}-${M}${x||""}`,mGn=(g,E)=>E.some(M=>M.source===g.source&&M.target===g.target&&(M.sourceHandle===g.sourceHandle||!M.sourceHandle&&!g.sourceHandle)&&(M.targetHandle===g.targetHandle||!M.targetHandle&&!g.targetHandle)),vGn=(g,E,M={})=>{if(!g.source||!g.target)return E;const x=M.getEdgeId||pGn;let O;return n0n(g)?O={...g}:O={...g,id:x(g)},mGn(O,E)?E:(O.sourceHandle===null&&delete O.sourceHandle,O.targetHandle===null&&delete O.targetHandle,E.concat(O))};function b0n({sourceX:g,sourceY:E,targetX:M,targetY:x}){const[O,P,k,H]=d0n({sourceX:g,sourceY:E,targetX:M,targetY:x});return[`M ${g},${E}L ${M},${x}`,O,P,k,H]}const f1n={[er.Left]:{x:-1,y:0},[er.Right]:{x:1,y:0},[er.Top]:{x:0,y:-1},[er.Bottom]:{x:0,y:1}},yGn=({source:g,sourcePosition:E=er.Bottom,target:M})=>E===er.Left||E===er.Right?g.xMath.sqrt(Math.pow(E.x-g.x,2)+Math.pow(E.y-g.y,2));function kGn({source:g,sourcePosition:E=er.Bottom,target:M,targetPosition:x=er.Top,center:O,offset:P,stepPosition:k}){const H=f1n[E],q=f1n[x],F={x:g.x+H.x*P,y:g.y+H.y*P},W={x:M.x+q.x*P,y:M.y+q.y*P},Z=yGn({source:F,sourcePosition:E,target:W}),ne=Z.x!==0?"x":"y",le=Z[ne];let se=[],ee,Ce;const je={x:0,y:0},ze={x:0,y:0},[,,be,De]=d0n({sourceX:g.x,sourceY:g.y,targetX:M.x,targetY:M.y});if(H[ne]*q[ne]===-1){ne==="x"?(ee=O.x??F.x+(W.x-F.x)*k,Ce=O.y??(F.y+W.y)/2):(ee=O.x??(F.x+W.x)/2,Ce=O.y??F.y+(W.y-F.y)*k);const An=[{x:ee,y:F.y},{x:ee,y:W.y}],Dn=[{x:F.x,y:Ce},{x:W.x,y:Ce}];H[ne]===le?se=ne==="x"?An:Dn:se=ne==="x"?Dn:An}else{const An=[{x:F.x,y:W.y}],Dn=[{x:W.x,y:F.y}];if(ne==="x"?se=H.x===le?Dn:An:se=H.y===le?An:Dn,E===x){const He=Math.abs(g[ne]-M[ne]);if(He<=P){const en=Math.min(P-1,P-He);H[ne]===le?je[ne]=(F[ne]>g[ne]?-1:1)*en:ze[ne]=(W[ne]>M[ne]?-1:1)*en}}if(E!==x){const He=ne==="x"?"y":"x",en=H[ne]===q[He],ke=F[He]>W[He],Ze=F[He]=Y?(ee=($t.x+In.x)/2,Ce=se[0].y):(ee=se[0].x,Ce=($t.y+In.y)/2)}const rn={x:F.x+je.x,y:F.y+je.y},an={x:W.x+ze.x,y:W.y+ze.y};return[[g,...rn.x!==se[0].x||rn.y!==se[0].y?[rn]:[],...se,...an.x!==se[se.length-1].x||an.y!==se[se.length-1].y?[an]:[],M],ee,Ce,be,De]}function EGn(g,E,M,x){const O=Math.min(a1n(g,E)/2,a1n(E,M)/2,x),{x:P,y:k}=E;if(g.x===P&&P===M.x||g.y===k&&k===M.y)return`L${P} ${k}`;if(g.y===k){const F=g.xM.id===E):g[0])||null}function ike(g,E){return g?typeof g=="string"?g:`${E?`${E}__`:""}${Object.keys(g).sort().map(x=>`${x}=${g[x]}`).join("&")}`:""}function SGn(g,{id:E,defaultColor:M,defaultMarkerStart:x,defaultMarkerEnd:O}){const P=new Set;return g.reduce((k,H)=>([H.markerStart||x,H.markerEnd||O].forEach(q=>{if(q&&typeof q=="object"){const F=ike(q,E);P.has(F)||(k.push({id:F,color:q.color||M,...q}),P.add(F))}}),k),[]).sort((k,H)=>k.id.localeCompare(H.id))}const g0n=1e3,MGn=10,jke={nodeOrigin:[0,0],nodeExtent:XG,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},AGn={...jke,checkEquality:!0};function Ske(g,E){const M={...g};for(const x in E)E[x]!==void 0&&(M[x]=E[x]);return M}function xGn(g,E,M){const x=Ske(jke,M);for(const O of g.values())if(O.parentId)Ake(O,g,E,x);else{const P=iq(O,x.nodeOrigin),k=k_(O.extent)?O.extent:x.nodeExtent,H=_A(P,k,j6(O));O.internals.positionAbsolute=H}}function TGn(g,E){if(!g.handles)return g.measured?E?.internals.handleBounds:void 0;const M=[],x=[];for(const O of g.handles){const P={id:O.id,width:O.width??1,height:O.height??1,nodeId:g.id,x:O.x,y:O.y,position:O.position,type:O.type};O.type==="source"?M.push(P):O.type==="target"&&x.push(P)}return{source:M,target:x}}function Mke(g){return g==="manual"}function rke(g,E,M,x={}){const O=Ske(AGn,x),P={i:0},k=new Map(E),H=O?.elevateNodesOnSelect&&!Mke(O.zIndexMode)?g0n:0;let q=g.length>0,F=!1;E.clear(),M.clear();for(const W of g){let Z=k.get(W.id);if(O.checkEquality&&W===Z?.internals.userNode)E.set(W.id,Z);else{const ne=iq(W,O.nodeOrigin),le=k_(W.extent)?W.extent:O.nodeExtent,se=_A(ne,le,j6(W));Z={...O.defaults,...W,measured:{width:W.measured?.width,height:W.measured?.height},internals:{positionAbsolute:se,handleBounds:TGn(W,Z),z:w0n(W,H,O.zIndexMode),userNode:W}},E.set(W.id,Z)}(Z.measured===void 0||Z.measured.width===void 0||Z.measured.height===void 0)&&!Z.hidden&&(q=!1),W.parentId&&Ake(Z,E,M,x,P),F||=W.selected??!1}return{nodesInitialized:q,hasSelectedNodes:F}}function CGn(g,E){if(!g.parentId)return;const M=E.get(g.parentId);M?M.set(g.id,g):E.set(g.parentId,new Map([[g.id,g]]))}function Ake(g,E,M,x,O){const{elevateNodesOnSelect:P,nodeOrigin:k,nodeExtent:H,zIndexMode:q}=Ske(jke,x),F=g.parentId,W=E.get(F);if(!W){console.warn(`Parent node ${F} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}CGn(g,M),O&&!W.parentId&&W.internals.rootParentIndex===void 0&&q==="auto"&&(W.internals.rootParentIndex=++O.i,W.internals.z=W.internals.z+O.i*MGn),O&&W.internals.rootParentIndex!==void 0&&(O.i=W.internals.rootParentIndex);const Z=P&&!Mke(q)?g0n:0,{x:ne,y:le,z:se}=OGn(g,W,k,H,Z,q),{positionAbsolute:ee}=g.internals,Ce=ne!==ee.x||le!==ee.y;(Ce||se!==g.internals.z)&&E.set(g.id,{...g,internals:{...g.internals,positionAbsolute:Ce?{x:ne,y:le}:ee,z:se}})}function w0n(g,E,M){const x=k3(g.zIndex)?g.zIndex:0;return Mke(M)?x:x+(g.selected?E:0)}function OGn(g,E,M,x,O,P){const{x:k,y:H}=E.internals.positionAbsolute,q=j6(g),F=iq(g,M),W=k_(g.extent)?_A(F,g.extent,q):F;let Z=_A({x:k+W.x,y:H+W.y},x,q);g.extent==="parent"&&(Z=i0n(Z,q,E));const ne=w0n(g,O,P),le=E.internals.z??0;return{x:Z.x,y:Z.y,z:le>=ne?le+1:ne}}function xke(g,E,M,x=[0,0]){const O=[],P=new Map;for(const k of g){const H=E.get(k.parentId);if(!H)continue;const q=P.get(k.parentId)?.expandedRect??y_(H),F=c0n(q,k.rect);P.set(k.parentId,{expandedRect:F,parent:H})}return P.size>0&&P.forEach(({expandedRect:k,parent:H},q)=>{const F=H.internals.positionAbsolute,W=j6(H),Z=H.origin??x,ne=k.x0||le>0||Ce||je)&&(O.push({id:q,type:"position",position:{x:H.position.x-ne+Ce,y:H.position.y-le+je}}),M.get(q)?.forEach(ze=>{g.some(be=>be.id===ze.id)||O.push({id:ze.id,type:"position",position:{x:ze.position.x+ne,y:ze.position.y+le}})})),(W.width0){const le=xke(ne,E,M,O);F.push(...le)}return{changes:F,updatedInternals:q}}async function DGn({delta:g,panZoom:E,transform:M,translateExtent:x,width:O,height:P}){if(!E||!g.x&&!g.y)return Promise.resolve(!1);const k=await E.setViewportConstrained({x:M[0]+g.x,y:M[1]+g.y,zoom:M[2]},[[0,0],[O,P]],x),H=!!k&&(k.x!==M[0]||k.y!==M[1]||k.k!==M[2]);return Promise.resolve(H)}function g1n(g,E,M,x,O,P){let k=O;const H=x.get(k)||new Map;x.set(k,H.set(M,E)),k=`${O}-${g}`;const q=x.get(k)||new Map;if(x.set(k,q.set(M,E)),P){k=`${O}-${g}-${P}`;const F=x.get(k)||new Map;x.set(k,F.set(M,E))}}function p0n(g,E,M){g.clear(),E.clear();for(const x of M){const{source:O,target:P,sourceHandle:k=null,targetHandle:H=null}=x,q={edgeId:x.id,source:O,target:P,sourceHandle:k,targetHandle:H},F=`${O}-${k}--${P}-${H}`,W=`${P}-${H}--${O}-${k}`;g1n("source",q,W,g,O,k),g1n("target",q,F,g,P,H),E.set(x.id,x)}}function m0n(g,E){if(!g.parentId)return!1;const M=E.get(g.parentId);return M?M.selected?!0:m0n(M,E):!1}function w1n(g,E,M){let x=g;do{if(x?.matches?.(E))return!0;if(x===M)return!1;x=x?.parentElement}while(x);return!1}function _Gn(g,E,M,x){const O=new Map;for(const[P,k]of g)if((k.selected||k.id===x)&&(!k.parentId||!m0n(k,g))&&(k.draggable||E&&typeof k.draggable>"u")){const H=g.get(P);H&&O.set(P,{id:P,position:H.position||{x:0,y:0},distance:{x:M.x-H.internals.positionAbsolute.x,y:M.y-H.internals.positionAbsolute.y},extent:H.extent,parentId:H.parentId,origin:H.origin,expandParent:H.expandParent,internals:{positionAbsolute:H.internals.positionAbsolute||{x:0,y:0}},measured:{width:H.measured.width??0,height:H.measured.height??0}})}return O}function $7e({nodeId:g,dragItems:E,nodeLookup:M,dragging:x=!0}){const O=[];for(const[k,H]of E){const q=M.get(k)?.internals.userNode;q&&O.push({...q,position:H.position,dragging:x})}if(!g)return[O[0],O];const P=M.get(g)?.internals.userNode;return[P?{...P,position:E.get(g)?.position||P.position,dragging:x}:O[0],O]}function IGn({dragItems:g,snapGrid:E,x:M,y:x}){const O=g.values().next().value;if(!O)return null;const P={x:M-O.distance.x,y:x-O.distance.y},k=cq(P,E);return{x:k.x-P.x,y:k.y-P.y}}function LGn({onNodeMouseDown:g,getStoreItems:E,onDragStart:M,onDrag:x,onDragStop:O}){let P={x:null,y:null},k=0,H=new Map,q=!1,F={x:0,y:0},W=null,Z=!1,ne=null,le=!1,se=!1,ee=null;function Ce({noDragClassName:ze,handleSelector:be,domNode:De,isSelectable:rn,nodeId:an,nodeClickDistance:un=0}){ne=sw(De);function An({x:et,y:Y}){const{nodeLookup:He,nodeExtent:en,snapGrid:ke,snapToGrid:Ze,nodeOrigin:ln,onNodeDrag:En,onSelectionDrag:nt,onError:Se,updateNodePositions:on}=E();P={x:et,y:Y};let ct=!1;const lt=H.size>1,qt=lt&&en?tke(rq(H)):null,wi=lt&&Ze?IGn({dragItems:H,snapGrid:ke,x:et,y:Y}):null;for(const[li,Ut]of H){if(!He.has(li))continue;let ai={x:et-Ut.distance.x,y:Y-Ut.distance.y};Ze&&(ai=wi?{x:Math.round(ai.x+wi.x),y:Math.round(ai.y+wi.y)}:cq(ai,ke));let rc=null;if(lt&&en&&!Ut.extent&&qt){const{positionAbsolute:Si}=Ut.internals,Ui=Si.x-qt.x+en[0][0],Su=Si.x+Ut.measured.width-qt.x2+en[1][0],uu=Si.y-qt.y+en[0][1],Js=Si.y+Ut.measured.height-qt.y2+en[1][1];rc=[[Ui,uu],[Su,Js]]}const{position:Qr,positionAbsolute:vr}=t0n({nodeId:li,nextPosition:ai,nodeLookup:He,nodeExtent:rc||en,nodeOrigin:ln,onError:Se});ct=ct||Ut.position.x!==Qr.x||Ut.position.y!==Qr.y,Ut.position=Qr,Ut.internals.positionAbsolute=vr}if(se=se||ct,!!ct&&(on(H,!0),ee&&(x||En||!an&&nt))){const[li,Ut]=$7e({nodeId:an,dragItems:H,nodeLookup:He});x?.(ee,H,li,Ut),En?.(ee,li,Ut),an||nt?.(ee,Ut)}}async function Dn(){if(!W)return;const{transform:et,panBy:Y,autoPanSpeed:He,autoPanOnNodeDrag:en}=E();if(!en){q=!1,cancelAnimationFrame(k);return}const[ke,Ze]=r0n(F,W,He);(ke!==0||Ze!==0)&&(P.x=(P.x??0)-ke/et[2],P.y=(P.y??0)-Ze/et[2],await Y({x:ke,y:Ze})&&An(P)),k=requestAnimationFrame(Dn)}function $t(et){const{nodeLookup:Y,multiSelectionActive:He,nodesDraggable:en,transform:ke,snapGrid:Ze,snapToGrid:ln,selectNodesOnDrag:En,onNodeDragStart:nt,onSelectionDragStart:Se,unselectNodesAndEdges:on}=E();Z=!0,(!En||!rn)&&!He&&an&&(Y.get(an)?.selected||on()),rn&&En&&an&&g?.(an);const ct=HG(et.sourceEvent,{transform:ke,snapGrid:Ze,snapToGrid:ln,containerBounds:W});if(P=ct,H=_Gn(Y,en,ct,an),H.size>0&&(M||nt||!an&&Se)){const[lt,qt]=$7e({nodeId:an,dragItems:H,nodeLookup:Y});M?.(et.sourceEvent,H,lt,qt),nt?.(et.sourceEvent,lt,qt),an||Se?.(et.sourceEvent,qt)}}const In=Ldn().clickDistance(un).on("start",et=>{const{domNode:Y,nodeDragThreshold:He,transform:en,snapGrid:ke,snapToGrid:Ze}=E();W=Y?.getBoundingClientRect()||null,le=!1,se=!1,ee=et.sourceEvent,He===0&&$t(et),P=HG(et.sourceEvent,{transform:en,snapGrid:ke,snapToGrid:Ze,containerBounds:W}),F=E3(et.sourceEvent,W)}).on("drag",et=>{const{autoPanOnNodeDrag:Y,transform:He,snapGrid:en,snapToGrid:ke,nodeDragThreshold:Ze,nodeLookup:ln}=E(),En=HG(et.sourceEvent,{transform:He,snapGrid:en,snapToGrid:ke,containerBounds:W});if(ee=et.sourceEvent,(et.sourceEvent.type==="touchmove"&&et.sourceEvent.touches.length>1||an&&!ln.has(an))&&(le=!0),!le){if(!q&&Y&&Z&&(q=!0,Dn()),!Z){const nt=E3(et.sourceEvent,W),Se=nt.x-F.x,on=nt.y-F.y;Math.sqrt(Se*Se+on*on)>Ze&&$t(et)}(P.x!==En.xSnapped||P.y!==En.ySnapped)&&H&&Z&&(F=E3(et.sourceEvent,W),An(En))}}).on("end",et=>{if(!(!Z||le)&&(q=!1,Z=!1,cancelAnimationFrame(k),H.size>0)){const{nodeLookup:Y,updateNodePositions:He,onNodeDragStop:en,onSelectionDragStop:ke}=E();if(se&&(He(H,!1),se=!1),O||en||!an&&ke){const[Ze,ln]=$7e({nodeId:an,dragItems:H,nodeLookup:Y,dragging:!1});O?.(et.sourceEvent,H,Ze,ln),en?.(et.sourceEvent,Ze,ln),an||ke?.(et.sourceEvent,ln)}}}).filter(et=>{const Y=et.target;return!et.button&&(!ze||!w1n(Y,`.${ze}`,De))&&(!be||w1n(Y,be,De))});ne.call(In)}function je(){ne?.on(".drag",null)}return{update:Ce,destroy:je}}function PGn(g,E,M){const x=[],O={x:g.x-M,y:g.y-M,width:M*2,height:M*2};for(const P of E.values())QG(O,y_(P))>0&&x.push(P);return x}const $Gn=250;function RGn(g,E,M,x){let O=[],P=1/0;const k=PGn(g,M,E+$Gn);for(const H of k){const q=[...H.internals.handleBounds?.source??[],...H.internals.handleBounds?.target??[]];for(const F of q){if(x.nodeId===F.nodeId&&x.type===F.type&&x.id===F.id)continue;const{x:W,y:Z}=IA(H,F,F.position,!0),ne=Math.sqrt(Math.pow(W-g.x,2)+Math.pow(Z-g.y,2));ne>E||(ne1){const H=x.type==="source"?"target":"source";return O.find(q=>q.type===H)??O[0]}return O[0]}function v0n(g,E,M,x,O,P=!1){const k=x.get(g);if(!k)return null;const H=O==="strict"?k.internals.handleBounds?.[E]:[...k.internals.handleBounds?.source??[],...k.internals.handleBounds?.target??[]],q=(M?H?.find(F=>F.id===M):H?.[0])??null;return q&&P?{...q,...IA(k,q,q.position,!0)}:q}function y0n(g,E){return g||(E?.classList.contains("target")?"target":E?.classList.contains("source")?"source":null)}function BGn(g,E){let M=null;return E?M=!0:g&&!E&&(M=!1),M}const k0n=()=>!0;function zGn(g,{connectionMode:E,connectionRadius:M,handleId:x,nodeId:O,edgeUpdaterType:P,isTarget:k,domNode:H,nodeLookup:q,lib:F,autoPanOnConnect:W,flowId:Z,panBy:ne,cancelConnection:le,onConnectStart:se,onConnect:ee,onConnectEnd:Ce,isValidConnection:je=k0n,onReconnectEnd:ze,updateConnection:be,getTransform:De,getFromHandle:rn,autoPanSpeed:an,dragThreshold:un=1,handleDomNode:An}){const Dn=s0n(g.target);let $t=0,In;const{x:et,y:Y}=E3(g),He=y0n(P,An),en=H?.getBoundingClientRect();let ke=!1;if(!en||!He)return;const Ze=v0n(O,He,x,q,E);if(!Ze)return;let ln=E3(g,en),En=!1,nt=null,Se=!1,on=null;function ct(){if(!W||!en)return;const[Qr,vr]=r0n(ln,en,an);ne({x:Qr,y:vr}),$t=requestAnimationFrame(ct)}const lt={...Ze,nodeId:O,type:He,position:Ze.position},qt=q.get(O);let li={inProgress:!0,isValid:null,from:IA(qt,lt,er.Left,!0),fromHandle:lt,fromPosition:lt.position,fromNode:qt,to:ln,toHandle:null,toPosition:r1n[lt.position],toNode:null,pointer:ln};function Ut(){ke=!0,be(li),se?.(g,{nodeId:O,handleId:x,handleType:He})}un===0&&Ut();function ai(Qr){if(!ke){const{x:Js,y:fa}=E3(Qr),bh=Js-et,aa=fa-Y;if(!(bh*bh+aa*aa>un*un))return;Ut()}if(!rn()||!lt){rc(Qr);return}const vr=De();ln=E3(Qr,en),In=RGn(uq(ln,vr,!1,[1,1]),M,q,lt),En||(ct(),En=!0);const Si=E0n(Qr,{handle:In,connectionMode:E,fromNodeId:O,fromHandleId:x,fromType:k?"target":"source",isValidConnection:je,doc:Dn,lib:F,flowId:Z,nodeLookup:q});on=Si.handleDomNode,nt=Si.connection,Se=BGn(!!In,Si.isValid);const Ui=q.get(O),Su=Ui?IA(Ui,lt,er.Left,!0):li.from,uu={...li,from:Su,isValid:Se,to:Si.toHandle&&Se?jue({x:Si.toHandle.x,y:Si.toHandle.y},vr):ln,toHandle:Si.toHandle,toPosition:Se&&Si.toHandle?Si.toHandle.position:r1n[lt.position],toNode:Si.toHandle?q.get(Si.toHandle.nodeId):null,pointer:ln};be(uu),li=uu}function rc(Qr){if(!("touches"in Qr&&Qr.touches.length>0)){if(ke){(In||on)&&nt&&Se&&ee?.(nt);const{inProgress:vr,...Si}=li,Ui={...Si,toPosition:li.toHandle?li.toPosition:null};Ce?.(Qr,Ui),P&&ze?.(Qr,Ui)}le(),cancelAnimationFrame($t),En=!1,Se=!1,nt=null,on=null,Dn.removeEventListener("mousemove",ai),Dn.removeEventListener("mouseup",rc),Dn.removeEventListener("touchmove",ai),Dn.removeEventListener("touchend",rc)}}Dn.addEventListener("mousemove",ai),Dn.addEventListener("mouseup",rc),Dn.addEventListener("touchmove",ai),Dn.addEventListener("touchend",rc)}function E0n(g,{handle:E,connectionMode:M,fromNodeId:x,fromHandleId:O,fromType:P,doc:k,lib:H,flowId:q,isValidConnection:F=k0n,nodeLookup:W}){const Z=P==="target",ne=E?k.querySelector(`.${H}-flow__handle[data-id="${q}-${E?.nodeId}-${E?.id}-${E?.type}"]`):null,{x:le,y:se}=E3(g),ee=k.elementFromPoint(le,se),Ce=ee?.classList.contains(`${H}-flow__handle`)?ee:ne,je={handleDomNode:Ce,isValid:!1,connection:null,toHandle:null};if(Ce){const ze=y0n(void 0,Ce),be=Ce.getAttribute("data-nodeid"),De=Ce.getAttribute("data-handleid"),rn=Ce.classList.contains("connectable"),an=Ce.classList.contains("connectableend");if(!be||!ze)return je;const un={source:Z?be:x,sourceHandle:Z?De:O,target:Z?x:be,targetHandle:Z?O:De};je.connection=un;const Dn=rn&&an&&(M===m_.Strict?Z&&ze==="source"||!Z&&ze==="target":be!==x||De!==O);je.isValid=Dn&&F(un),je.toHandle=v0n(be,ze,De,W,M,!0)}return je}const cke={onPointerDown:zGn,isValid:E0n};function FGn({domNode:g,panZoom:E,getTransform:M,getViewScale:x}){const O=sw(g);function P({translateExtent:H,width:q,height:F,zoomStep:W=1,pannable:Z=!0,zoomable:ne=!0,inversePan:le=!1}){const se=be=>{if(be.sourceEvent.type!=="wheel"||!E)return;const De=M(),rn=be.sourceEvent.ctrlKey&&YG()?10:1,an=-be.sourceEvent.deltaY*(be.sourceEvent.deltaMode===1?.05:be.sourceEvent.deltaMode?1:.002)*W,un=De[2]*Math.pow(2,an*rn);E.scaleTo(un)};let ee=[0,0];const Ce=be=>{(be.sourceEvent.type==="mousedown"||be.sourceEvent.type==="touchstart")&&(ee=[be.sourceEvent.clientX??be.sourceEvent.touches[0].clientX,be.sourceEvent.clientY??be.sourceEvent.touches[0].clientY])},je=be=>{const De=M();if(be.sourceEvent.type!=="mousemove"&&be.sourceEvent.type!=="touchmove"||!E)return;const rn=[be.sourceEvent.clientX??be.sourceEvent.touches[0].clientX,be.sourceEvent.clientY??be.sourceEvent.touches[0].clientY],an=[rn[0]-ee[0],rn[1]-ee[1]];ee=rn;const un=x()*Math.max(De[2],Math.log(De[2]))*(le?-1:1),An={x:De[0]-an[0]*un,y:De[1]-an[1]*un},Dn=[[0,0],[q,F]];E.setViewportConstrained({x:An.x,y:An.y,zoom:De[2]},Dn,H)},ze=Qdn().on("start",Ce).on("zoom",Z?je:null).on("zoom.wheel",ne?se:null);O.call(ze,{})}function k(){O.on("zoom",null)}return{update:P,destroy:k,pointer:v3}}const Pue=g=>({x:g.x,y:g.y,zoom:g.k}),R7e=({x:g,y:E,zoom:M})=>_ue.translate(g,E).scale(M),h_=(g,E)=>g.target.closest(`.${E}`),j0n=(g,E)=>E===2&&Array.isArray(g)&&g.includes(2),HGn=g=>((g*=2)<=1?g*g*g:(g-=2)*g*g+2)/2,B7e=(g,E=0,M=HGn,x=()=>{})=>{const O=typeof E=="number"&&E>0;return O||x(),O?g.transition().duration(E).ease(M).on("end",x):g},S0n=g=>{const E=g.ctrlKey&&YG()?10:1;return-g.deltaY*(g.deltaMode===1?.05:g.deltaMode?1:.002)*E};function JGn({zoomPanValues:g,noWheelClassName:E,d3Selection:M,d3Zoom:x,panOnScrollMode:O,panOnScrollSpeed:P,zoomOnPinch:k,onPanZoomStart:H,onPanZoom:q,onPanZoomEnd:F}){return W=>{if(h_(W,E))return W.ctrlKey&&W.preventDefault(),!1;W.preventDefault(),W.stopImmediatePropagation();const Z=M.property("__zoom").k||1;if(W.ctrlKey&&k){const Ce=v3(W),je=S0n(W),ze=Z*Math.pow(2,je);x.scaleTo(M,ze,Ce,W);return}const ne=W.deltaMode===1?20:1;let le=O===OA.Vertical?0:W.deltaX*ne,se=O===OA.Horizontal?0:W.deltaY*ne;!YG()&&W.shiftKey&&O!==OA.Vertical&&(le=W.deltaY*ne,se=0),x.translateBy(M,-(le/Z)*P,-(se/Z)*P,{internal:!0});const ee=Pue(M.property("__zoom"));clearTimeout(g.panScrollTimeout),g.isPanScrolling?(q?.(W,ee),g.panScrollTimeout=setTimeout(()=>{F?.(W,ee),g.isPanScrolling=!1},150)):(g.isPanScrolling=!0,H?.(W,ee))}}function GGn({noWheelClassName:g,preventScrolling:E,d3ZoomHandler:M}){return function(x,O){const P=x.type==="wheel",k=!E&&P&&!x.ctrlKey,H=h_(x,g);if(x.ctrlKey&&P&&H&&x.preventDefault(),k||H)return null;x.preventDefault(),M.call(this,x,O)}}function qGn({zoomPanValues:g,onDraggingChange:E,onPanZoomStart:M}){return x=>{if(x.sourceEvent?.internal)return;const O=Pue(x.transform);g.mouseButton=x.sourceEvent?.button||0,g.isZoomingOrPanning=!0,g.prevViewport=O,x.sourceEvent?.type==="mousedown"&&E(!0),M&&M?.(x.sourceEvent,O)}}function UGn({zoomPanValues:g,panOnDrag:E,onPaneContextMenu:M,onTransformChange:x,onPanZoom:O}){return P=>{g.usedRightMouseButton=!!(M&&j0n(E,g.mouseButton??0)),P.sourceEvent?.sync||x([P.transform.x,P.transform.y,P.transform.k]),O&&!P.sourceEvent?.internal&&O?.(P.sourceEvent,Pue(P.transform))}}function XGn({zoomPanValues:g,panOnDrag:E,panOnScroll:M,onDraggingChange:x,onPanZoomEnd:O,onPaneContextMenu:P}){return k=>{if(!k.sourceEvent?.internal&&(g.isZoomingOrPanning=!1,P&&j0n(E,g.mouseButton??0)&&!g.usedRightMouseButton&&k.sourceEvent&&P(k.sourceEvent),g.usedRightMouseButton=!1,x(!1),O)){const H=Pue(k.transform);g.prevViewport=H,clearTimeout(g.timerId),g.timerId=setTimeout(()=>{O?.(k.sourceEvent,H)},M?150:0)}}}function VGn({zoomActivationKeyPressed:g,zoomOnScroll:E,zoomOnPinch:M,panOnDrag:x,panOnScroll:O,zoomOnDoubleClick:P,userSelectionActive:k,noWheelClassName:H,noPanClassName:q,lib:F,connectionInProgress:W}){return Z=>{const ne=g||E,le=M&&Z.ctrlKey,se=Z.type==="wheel";if(Z.button===1&&Z.type==="mousedown"&&(h_(Z,`${F}-flow__node`)||h_(Z,`${F}-flow__edge`)))return!0;if(!x&&!ne&&!O&&!P&&!M||k||W&&!se||h_(Z,H)&&se||h_(Z,q)&&(!se||O&&se&&!g)||!M&&Z.ctrlKey&&se)return!1;if(!M&&Z.type==="touchstart"&&Z.touches?.length>1)return Z.preventDefault(),!1;if(!ne&&!O&&!le&&se||!x&&(Z.type==="mousedown"||Z.type==="touchstart")||Array.isArray(x)&&!x.includes(Z.button)&&Z.type==="mousedown")return!1;const ee=Array.isArray(x)&&x.includes(Z.button)||!Z.button||Z.button<=1;return(!Z.ctrlKey||se)&&ee}}function KGn({domNode:g,minZoom:E,maxZoom:M,translateExtent:x,viewport:O,onPanZoom:P,onPanZoomStart:k,onPanZoomEnd:H,onDraggingChange:q}){const F={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},W=g.getBoundingClientRect(),Z=Qdn().scaleExtent([E,M]).translateExtent(x),ne=sw(g).call(Z);ze({x:O.x,y:O.y,zoom:v_(O.zoom,E,M)},[[0,0],[W.width,W.height]],x);const le=ne.on("wheel.zoom"),se=ne.on("dblclick.zoom");Z.wheelDelta(S0n);function ee(In,et){return ne?new Promise(Y=>{Z?.interpolate(et?.interpolate==="linear"?FG:aue).transform(B7e(ne,et?.duration,et?.ease,()=>Y(!0)),In)}):Promise.resolve(!1)}function Ce({noWheelClassName:In,noPanClassName:et,onPaneContextMenu:Y,userSelectionActive:He,panOnScroll:en,panOnDrag:ke,panOnScrollMode:Ze,panOnScrollSpeed:ln,preventScrolling:En,zoomOnPinch:nt,zoomOnScroll:Se,zoomOnDoubleClick:on,zoomActivationKeyPressed:ct,lib:lt,onTransformChange:qt,connectionInProgress:wi,paneClickDistance:li,selectionOnDrag:Ut}){He&&!F.isZoomingOrPanning&&je();const ai=en&&!ct&&!He;Z.clickDistance(Ut?1/0:!k3(li)||li<0?0:li);const rc=ai?JGn({zoomPanValues:F,noWheelClassName:In,d3Selection:ne,d3Zoom:Z,panOnScrollMode:Ze,panOnScrollSpeed:ln,zoomOnPinch:nt,onPanZoomStart:k,onPanZoom:P,onPanZoomEnd:H}):GGn({noWheelClassName:In,preventScrolling:En,d3ZoomHandler:le});if(ne.on("wheel.zoom",rc,{passive:!1}),!He){const vr=qGn({zoomPanValues:F,onDraggingChange:q,onPanZoomStart:k});Z.on("start",vr);const Si=UGn({zoomPanValues:F,panOnDrag:ke,onPaneContextMenu:!!Y,onPanZoom:P,onTransformChange:qt});Z.on("zoom",Si);const Ui=XGn({zoomPanValues:F,panOnDrag:ke,panOnScroll:en,onPaneContextMenu:Y,onPanZoomEnd:H,onDraggingChange:q});Z.on("end",Ui)}const Qr=VGn({zoomActivationKeyPressed:ct,panOnDrag:ke,zoomOnScroll:Se,panOnScroll:en,zoomOnDoubleClick:on,zoomOnPinch:nt,userSelectionActive:He,noPanClassName:et,noWheelClassName:In,lib:lt,connectionInProgress:wi});Z.filter(Qr),on?ne.on("dblclick.zoom",se):ne.on("dblclick.zoom",null)}function je(){Z.on("zoom",null)}async function ze(In,et,Y){const He=R7e(In),en=Z?.constrain()(He,et,Y);return en&&await ee(en),new Promise(ke=>ke(en))}async function be(In,et){const Y=R7e(In);return await ee(Y,et),new Promise(He=>He(Y))}function De(In){if(ne){const et=R7e(In),Y=ne.property("__zoom");(Y.k!==In.zoom||Y.x!==In.x||Y.y!==In.y)&&Z?.transform(ne,et,null,{sync:!0})}}function rn(){const In=ne?Kdn(ne.node()):{x:0,y:0,k:1};return{x:In.x,y:In.y,zoom:In.k}}function an(In,et){return ne?new Promise(Y=>{Z?.interpolate(et?.interpolate==="linear"?FG:aue).scaleTo(B7e(ne,et?.duration,et?.ease,()=>Y(!0)),In)}):Promise.resolve(!1)}function un(In,et){return ne?new Promise(Y=>{Z?.interpolate(et?.interpolate==="linear"?FG:aue).scaleBy(B7e(ne,et?.duration,et?.ease,()=>Y(!0)),In)}):Promise.resolve(!1)}function An(In){Z?.scaleExtent(In)}function Dn(In){Z?.translateExtent(In)}function $t(In){const et=!k3(In)||In<0?0:In;Z?.clickDistance(et)}return{update:Ce,destroy:je,setViewport:be,setViewportConstrained:ze,getViewport:rn,scaleTo:an,scaleBy:un,setScaleExtent:An,setTranslateExtent:Dn,syncViewport:De,setClickDistance:$t}}var E_;(function(g){g.Line="line",g.Handle="handle"})(E_||(E_={}));function QGn({width:g,prevWidth:E,height:M,prevHeight:x,affectsX:O,affectsY:P}){const k=g-E,H=M-x,q=[k>0?1:k<0?-1:0,H>0?1:H<0?-1:0];return k&&O&&(q[0]=q[0]*-1),H&&P&&(q[1]=q[1]*-1),q}function p1n(g){const E=g.includes("right")||g.includes("left"),M=g.includes("bottom")||g.includes("top"),x=g.includes("left"),O=g.includes("top");return{isHorizontal:E,isVertical:M,affectsX:x,affectsY:O}}function hk(g,E){return Math.max(0,E-g)}function dk(g,E){return Math.max(0,g-E)}function rue(g,E,M){return Math.max(0,E-g,g-M)}function m1n(g,E){return g?!E:E}function YGn(g,E,M,x,O,P,k,H){let{affectsX:q,affectsY:F}=E;const{isHorizontal:W,isVertical:Z}=E,ne=W&&Z,{xSnapped:le,ySnapped:se}=M,{minWidth:ee,maxWidth:Ce,minHeight:je,maxHeight:ze}=x,{x:be,y:De,width:rn,height:an,aspectRatio:un}=g;let An=Math.floor(W?le-g.pointerX:0),Dn=Math.floor(Z?se-g.pointerY:0);const $t=rn+(q?-An:An),In=an+(F?-Dn:Dn),et=-P[0]*rn,Y=-P[1]*an;let He=rue($t,ee,Ce),en=rue(In,je,ze);if(k){let ln=0,En=0;q&&An<0?ln=hk(be+An+et,k[0][0]):!q&&An>0&&(ln=dk(be+$t+et,k[1][0])),F&&Dn<0?En=hk(De+Dn+Y,k[0][1]):!F&&Dn>0&&(En=dk(De+In+Y,k[1][1])),He=Math.max(He,ln),en=Math.max(en,En)}if(H){let ln=0,En=0;q&&An>0?ln=dk(be+An,H[0][0]):!q&&An<0&&(ln=hk(be+$t,H[1][0])),F&&Dn>0?En=dk(De+Dn,H[0][1]):!F&&Dn<0&&(En=hk(De+In,H[1][1])),He=Math.max(He,ln),en=Math.max(en,En)}if(O){if(W){const ln=rue($t/un,je,ze)*un;if(He=Math.max(He,ln),k){let En=0;!q&&!F||q&&!F&&ne?En=dk(De+Y+$t/un,k[1][1])*un:En=hk(De+Y+(q?An:-An)/un,k[0][1])*un,He=Math.max(He,En)}if(H){let En=0;!q&&!F||q&&!F&&ne?En=hk(De+$t/un,H[1][1])*un:En=dk(De+(q?An:-An)/un,H[0][1])*un,He=Math.max(He,En)}}if(Z){const ln=rue(In*un,ee,Ce)/un;if(en=Math.max(en,ln),k){let En=0;!q&&!F||F&&!q&&ne?En=dk(be+In*un+et,k[1][0])/un:En=hk(be+(F?Dn:-Dn)*un+et,k[0][0])/un,en=Math.max(en,En)}if(H){let En=0;!q&&!F||F&&!q&&ne?En=hk(be+In*un,H[1][0])/un:En=dk(be+(F?Dn:-Dn)*un,H[0][0])/un,en=Math.max(en,En)}}}Dn=Dn+(Dn<0?en:-en),An=An+(An<0?He:-He),O&&(ne?$t>In*un?Dn=(m1n(q,F)?-An:An)/un:An=(m1n(q,F)?-Dn:Dn)*un:W?(Dn=An/un,F=q):(An=Dn*un,q=F));const ke=q?be+An:be,Ze=F?De+Dn:De;return{width:rn+(q?-An:An),height:an+(F?-Dn:Dn),x:P[0]*An*(q?-1:1)+ke,y:P[1]*Dn*(F?-1:1)+Ze}}const M0n={width:0,height:0,x:0,y:0},WGn={...M0n,pointerX:0,pointerY:0,aspectRatio:1};function ZGn(g){return[[0,0],[g.measured.width,g.measured.height]]}function eqn(g,E,M){const x=E.position.x+g.position.x,O=E.position.y+g.position.y,P=g.measured.width??0,k=g.measured.height??0,H=M[0]*P,q=M[1]*k;return[[x-H,O-q],[x+P-H,O+k-q]]}function nqn({domNode:g,nodeId:E,getStoreItems:M,onChange:x,onEnd:O}){const P=sw(g);let k={controlDirection:p1n("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function H({controlPosition:F,boundaries:W,keepAspectRatio:Z,resizeDirection:ne,onResizeStart:le,onResize:se,onResizeEnd:ee,shouldResize:Ce}){let je={...M0n},ze={...WGn};k={boundaries:W,resizeDirection:ne,keepAspectRatio:Z,controlDirection:p1n(F)};let be,De=null,rn=[],an,un,An,Dn=!1;const $t=Ldn().on("start",In=>{const{nodeLookup:et,transform:Y,snapGrid:He,snapToGrid:en,nodeOrigin:ke,paneDomNode:Ze}=M();if(be=et.get(E),!be)return;De=Ze?.getBoundingClientRect()??null;const{xSnapped:ln,ySnapped:En}=HG(In.sourceEvent,{transform:Y,snapGrid:He,snapToGrid:en,containerBounds:De});je={width:be.measured.width??0,height:be.measured.height??0,x:be.position.x??0,y:be.position.y??0},ze={...je,pointerX:ln,pointerY:En,aspectRatio:je.width/je.height},an=void 0,be.parentId&&(be.extent==="parent"||be.expandParent)&&(an=et.get(be.parentId),un=an&&be.extent==="parent"?ZGn(an):void 0),rn=[],An=void 0;for(const[nt,Se]of et)if(Se.parentId===E&&(rn.push({id:nt,position:{...Se.position},extent:Se.extent}),Se.extent==="parent"||Se.expandParent)){const on=eqn(Se,be,Se.origin??ke);An?An=[[Math.min(on[0][0],An[0][0]),Math.min(on[0][1],An[0][1])],[Math.max(on[1][0],An[1][0]),Math.max(on[1][1],An[1][1])]]:An=on}le?.(In,{...je})}).on("drag",In=>{const{transform:et,snapGrid:Y,snapToGrid:He,nodeOrigin:en}=M(),ke=HG(In.sourceEvent,{transform:et,snapGrid:Y,snapToGrid:He,containerBounds:De}),Ze=[];if(!be)return;const{x:ln,y:En,width:nt,height:Se}=je,on={},ct=be.origin??en,{width:lt,height:qt,x:wi,y:li}=YGn(ze,k.controlDirection,ke,k.boundaries,k.keepAspectRatio,ct,un,An),Ut=lt!==nt,ai=qt!==Se,rc=wi!==ln&&Ut,Qr=li!==En&&ai;if(!rc&&!Qr&&!Ut&&!ai)return;if((rc||Qr||ct[0]===1||ct[1]===1)&&(on.x=rc?wi:je.x,on.y=Qr?li:je.y,je.x=on.x,je.y=on.y,rn.length>0)){const Su=wi-ln,uu=li-En;for(const Js of rn)Js.position={x:Js.position.x-Su+ct[0]*(lt-nt),y:Js.position.y-uu+ct[1]*(qt-Se)},Ze.push(Js)}if((Ut||ai)&&(on.width=Ut&&(!k.resizeDirection||k.resizeDirection==="horizontal")?lt:je.width,on.height=ai&&(!k.resizeDirection||k.resizeDirection==="vertical")?qt:je.height,je.width=on.width,je.height=on.height),an&&be.expandParent){const Su=ct[0]*(on.width??0);on.x&&on.x{Dn&&(ee?.(In,{...je}),O?.({...je}),Dn=!1)});P.call($t)}function q(){P.on(".drag",null)}return{update:H,destroy:q}}var z7e={exports:{}},F7e={},H7e={exports:{}},J7e={};var v1n;function tqn(){if(v1n)return J7e;v1n=1;var g=eq();function E(Z,ne){return Z===ne&&(Z!==0||1/Z===1/ne)||Z!==Z&&ne!==ne}var M=typeof Object.is=="function"?Object.is:E,x=g.useState,O=g.useEffect,P=g.useLayoutEffect,k=g.useDebugValue;function H(Z,ne){var le=ne(),se=x({inst:{value:le,getSnapshot:ne}}),ee=se[0].inst,Ce=se[1];return P(function(){ee.value=le,ee.getSnapshot=ne,q(ee)&&Ce({inst:ee})},[Z,le,ne]),O(function(){return q(ee)&&Ce({inst:ee}),Z(function(){q(ee)&&Ce({inst:ee})})},[Z]),k(le),le}function q(Z){var ne=Z.getSnapshot;Z=Z.value;try{var le=ne();return!M(Z,le)}catch{return!0}}function F(Z,ne){return ne()}var W=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?F:H;return J7e.useSyncExternalStore=g.useSyncExternalStore!==void 0?g.useSyncExternalStore:W,J7e}var y1n;function iqn(){return y1n||(y1n=1,H7e.exports=tqn()),H7e.exports}var k1n;function rqn(){if(k1n)return F7e;k1n=1;var g=eq(),E=iqn();function M(F,W){return F===W&&(F!==0||1/F===1/W)||F!==F&&W!==W}var x=typeof Object.is=="function"?Object.is:M,O=E.useSyncExternalStore,P=g.useRef,k=g.useEffect,H=g.useMemo,q=g.useDebugValue;return F7e.useSyncExternalStoreWithSelector=function(F,W,Z,ne,le){var se=P(null);if(se.current===null){var ee={hasValue:!1,value:null};se.current=ee}else ee=se.current;se=H(function(){function je(an){if(!ze){if(ze=!0,be=an,an=ne(an),le!==void 0&&ee.hasValue){var un=ee.value;if(le(un,an))return De=un}return De=an}if(un=De,x(be,an))return un;var An=ne(an);return le!==void 0&&le(un,An)?(be=an,un):(be=an,De=An)}var ze=!1,be,De,rn=Z===void 0?null:Z;return[function(){return je(W())},rn===null?void 0:function(){return je(rn())}]},[W,Z,ne,le]);var Ce=O(F,se[0],se[1]);return k(function(){ee.hasValue=!0,ee.value=Ce},[Ce]),q(Ce),Ce},F7e}var E1n;function cqn(){return E1n||(E1n=1,z7e.exports=rqn()),z7e.exports}var uqn=cqn();const oqn=ake(uqn),sqn={},j1n=g=>{let E;const M=new Set,x=(W,Z)=>{const ne=typeof W=="function"?W(E):W;if(!Object.is(ne,E)){const le=E;E=Z??(typeof ne!="object"||ne===null)?ne:Object.assign({},E,ne),M.forEach(se=>se(E,le))}},O=()=>E,q={setState:x,getState:O,getInitialState:()=>F,subscribe:W=>(M.add(W),()=>M.delete(W)),destroy:()=>{(sqn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),M.clear()}},F=E=g(x,O,q);return q},lqn=g=>g?j1n(g):j1n,{useDebugValue:fqn}=pzn,{useSyncExternalStoreWithSelector:aqn}=oqn,hqn=g=>g;function A0n(g,E=hqn,M){const x=aqn(g.subscribe,g.getState,g.getServerState||g.getInitialState,E,M);return fqn(x),x}const S1n=(g,E)=>{const M=lqn(g),x=(O,P=E)=>A0n(M,O,P);return Object.assign(x,M),x},dqn=(g,E)=>g?S1n(g,E):S1n;function Ol(g,E){if(Object.is(g,E))return!0;if(typeof g!="object"||g===null||typeof E!="object"||E===null)return!1;if(g instanceof Map&&E instanceof Map){if(g.size!==E.size)return!1;for(const[x,O]of g)if(!Object.is(O,E.get(x)))return!1;return!0}if(g instanceof Set&&E instanceof Set){if(g.size!==E.size)return!1;for(const x of g)if(!E.has(x))return!1;return!0}const M=Object.keys(g);if(M.length!==Object.keys(E).length)return!1;for(const x of M)if(!Object.prototype.hasOwnProperty.call(E,x)||!Object.is(g[x],E[x]))return!1;return!0}var bqn=ydn();const $ue=Pe.createContext(null),gqn=$ue.Provider,x0n=N4.error001();function Fu(g,E){const M=Pe.useContext($ue);if(M===null)throw new Error(x0n);return A0n(M,g,E)}function Nl(){const g=Pe.useContext($ue);if(g===null)throw new Error(x0n);return Pe.useMemo(()=>({getState:g.getState,setState:g.setState,subscribe:g.subscribe}),[g])}const M1n={display:"none"},wqn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},T0n="react-flow__node-desc",C0n="react-flow__edge-desc",pqn="react-flow__aria-live",mqn=g=>g.ariaLiveMessage,vqn=g=>g.ariaLabelConfig;function yqn({rfId:g}){const E=Fu(mqn);return G.jsx("div",{id:`${pqn}-${g}`,"aria-live":"assertive","aria-atomic":"true",style:wqn,children:E})}function kqn({rfId:g,disableKeyboardA11y:E}){const M=Fu(vqn);return G.jsxs(G.Fragment,{children:[G.jsx("div",{id:`${T0n}-${g}`,style:M1n,children:E?M["node.a11yDescription.default"]:M["node.a11yDescription.keyboardDisabled"]}),G.jsx("div",{id:`${C0n}-${g}`,style:M1n,children:M["edge.a11yDescription.default"]}),!E&&G.jsx(yqn,{rfId:g})]})}const Rue=Pe.forwardRef(({position:g="top-left",children:E,className:M,style:x,...O},P)=>{const k=`${g}`.split("-");return G.jsx("div",{className:$a(["react-flow__panel",M,...k]),style:x,ref:P,...O,children:E})});Rue.displayName="Panel";function Eqn({proOptions:g,position:E="bottom-right"}){return g?.hideAttribution?null:G.jsx(Rue,{position:E,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:G.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const jqn=g=>{const E=[],M=[];for(const[,x]of g.nodeLookup)x.selected&&E.push(x.internals.userNode);for(const[,x]of g.edgeLookup)x.selected&&M.push(x);return{selectedNodes:E,selectedEdges:M}},cue=g=>g.id;function Sqn(g,E){return Ol(g.selectedNodes.map(cue),E.selectedNodes.map(cue))&&Ol(g.selectedEdges.map(cue),E.selectedEdges.map(cue))}function Mqn({onSelectionChange:g}){const E=Nl(),{selectedNodes:M,selectedEdges:x}=Fu(jqn,Sqn);return Pe.useEffect(()=>{const O={nodes:M,edges:x};g?.(O),E.getState().onSelectionChangeHandlers.forEach(P=>P(O))},[M,x,g]),null}const Aqn=g=>!!g.onSelectionChangeHandlers;function xqn({onSelectionChange:g}){const E=Fu(Aqn);return g||E?G.jsx(Mqn,{onSelectionChange:g}):null}const uke=typeof window<"u"?Pe.useLayoutEffect:Pe.useEffect,O0n=[0,0],Tqn={x:0,y:0,zoom:1},Cqn=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],A1n=[...Cqn,"rfId"],Oqn=g=>({setNodes:g.setNodes,setEdges:g.setEdges,setMinZoom:g.setMinZoom,setMaxZoom:g.setMaxZoom,setTranslateExtent:g.setTranslateExtent,setNodeExtent:g.setNodeExtent,reset:g.reset,setDefaultNodesAndEdges:g.setDefaultNodesAndEdges}),x1n={translateExtent:XG,nodeOrigin:O0n,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Nqn(g){const{setNodes:E,setEdges:M,setMinZoom:x,setMaxZoom:O,setTranslateExtent:P,setNodeExtent:k,reset:H,setDefaultNodesAndEdges:q}=Fu(Oqn,Ol),F=Nl();uke(()=>(q(g.defaultNodes,g.defaultEdges),()=>{W.current=x1n,H()}),[]);const W=Pe.useRef(x1n);return uke(()=>{for(const Z of A1n){const ne=g[Z],le=W.current[Z];ne!==le&&(typeof g[Z]>"u"||(Z==="nodes"?E(ne):Z==="edges"?M(ne):Z==="minZoom"?x(ne):Z==="maxZoom"?O(ne):Z==="translateExtent"?P(ne):Z==="nodeExtent"?k(ne):Z==="ariaLabelConfig"?F.setState({ariaLabelConfig:dGn(ne)}):Z==="fitView"?F.setState({fitViewQueued:ne}):Z==="fitViewOptions"?F.setState({fitViewOptions:ne}):F.setState({[Z]:ne})))}W.current=g},A1n.map(Z=>g[Z])),null}function T1n(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Dqn(g){const[E,M]=Pe.useState(g==="system"?null:g);return Pe.useEffect(()=>{if(g!=="system"){M(g);return}const x=T1n(),O=()=>M(x?.matches?"dark":"light");return O(),x?.addEventListener("change",O),()=>{x?.removeEventListener("change",O)}},[g]),E!==null?E:T1n()?.matches?"dark":"light"}const C1n=typeof document<"u"?document:null;function WG(g=null,E={target:C1n,actInsideInputWithModifier:!0}){const[M,x]=Pe.useState(!1),O=Pe.useRef(!1),P=Pe.useRef(new Set([])),[k,H]=Pe.useMemo(()=>{if(g!==null){const F=(Array.isArray(g)?g:[g]).filter(Z=>typeof Z=="string").map(Z=>Z.replace("+",` -`).replace(` - -`,` -+`).split(` -`)),W=F.reduce((Z,ne)=>Z.concat(...ne),[]);return[F,W]}return[[],[]]},[g]);return Pe.useEffect(()=>{const q=E?.target??C1n,F=E?.actInsideInputWithModifier??!0;if(g!==null){const W=le=>{if(O.current=le.ctrlKey||le.metaKey||le.shiftKey||le.altKey,(!O.current||O.current&&!F)&&l0n(le))return!1;const ee=N1n(le.code,H);if(P.current.add(le[ee]),O1n(k,P.current,!1)){const Ce=le.composedPath?.()?.[0]||le.target,je=Ce?.nodeName==="BUTTON"||Ce?.nodeName==="A";E.preventDefault!==!1&&(O.current||!je)&&le.preventDefault(),x(!0)}},Z=le=>{const se=N1n(le.code,H);O1n(k,P.current,!0)?(x(!1),P.current.clear()):P.current.delete(le[se]),le.key==="Meta"&&P.current.clear(),O.current=!1},ne=()=>{P.current.clear(),x(!1)};return q?.addEventListener("keydown",W),q?.addEventListener("keyup",Z),window.addEventListener("blur",ne),window.addEventListener("contextmenu",ne),()=>{q?.removeEventListener("keydown",W),q?.removeEventListener("keyup",Z),window.removeEventListener("blur",ne),window.removeEventListener("contextmenu",ne)}}},[g,x]),M}function O1n(g,E,M){return g.filter(x=>M||x.length===E.size).some(x=>x.every(O=>E.has(O)))}function N1n(g,E){return E.includes(g)?"code":"key"}const _qn=()=>{const g=Nl();return Pe.useMemo(()=>({zoomIn:E=>{const{panZoom:M}=g.getState();return M?M.scaleBy(1.2,E):Promise.resolve(!1)},zoomOut:E=>{const{panZoom:M}=g.getState();return M?M.scaleBy(1/1.2,E):Promise.resolve(!1)},zoomTo:(E,M)=>{const{panZoom:x}=g.getState();return x?x.scaleTo(E,M):Promise.resolve(!1)},getZoom:()=>g.getState().transform[2],setViewport:async(E,M)=>{const{transform:[x,O,P],panZoom:k}=g.getState();return k?(await k.setViewport({x:E.x??x,y:E.y??O,zoom:E.zoom??P},M),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[E,M,x]=g.getState().transform;return{x:E,y:M,zoom:x}},setCenter:async(E,M,x)=>g.getState().setCenter(E,M,x),fitBounds:async(E,M)=>{const{width:x,height:O,minZoom:P,maxZoom:k,panZoom:H}=g.getState(),q=kke(E,x,O,P,k,M?.padding??.1);return H?(await H.setViewport(q,{duration:M?.duration,ease:M?.ease,interpolate:M?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(E,M={})=>{const{transform:x,snapGrid:O,snapToGrid:P,domNode:k}=g.getState();if(!k)return E;const{x:H,y:q}=k.getBoundingClientRect(),F={x:E.x-H,y:E.y-q},W=M.snapGrid??O,Z=M.snapToGrid??P;return uq(F,x,Z,W)},flowToScreenPosition:E=>{const{transform:M,domNode:x}=g.getState();if(!x)return E;const{x:O,y:P}=x.getBoundingClientRect(),k=jue(E,M);return{x:k.x+O,y:k.y+P}}}),[])};function N0n(g,E){const M=[],x=new Map,O=[];for(const P of g)if(P.type==="add"){O.push(P);continue}else if(P.type==="remove"||P.type==="replace")x.set(P.id,[P]);else{const k=x.get(P.id);k?k.push(P):x.set(P.id,[P])}for(const P of E){const k=x.get(P.id);if(!k){M.push(P);continue}if(k[0].type==="remove")continue;if(k[0].type==="replace"){M.push({...k[0].item});continue}const H={...P};for(const q of k)Iqn(q,H);M.push(H)}return O.length&&O.forEach(P=>{P.index!==void 0?M.splice(P.index,0,{...P.item}):M.push({...P.item})}),M}function Iqn(g,E){switch(g.type){case"select":{E.selected=g.selected;break}case"position":{typeof g.position<"u"&&(E.position=g.position),typeof g.dragging<"u"&&(E.dragging=g.dragging);break}case"dimensions":{typeof g.dimensions<"u"&&(E.measured={...g.dimensions},g.setAttributes&&((g.setAttributes===!0||g.setAttributes==="width")&&(E.width=g.dimensions.width),(g.setAttributes===!0||g.setAttributes==="height")&&(E.height=g.dimensions.height))),typeof g.resizing=="boolean"&&(E.resizing=g.resizing);break}}}function D0n(g,E){return N0n(g,E)}function _0n(g,E){return N0n(g,E)}function xA(g,E){return{id:g,type:"select",selected:E}}function d_(g,E=new Set,M=!1){const x=[];for(const[O,P]of g){const k=E.has(O);!(P.selected===void 0&&!k)&&P.selected!==k&&(M&&(P.selected=k),x.push(xA(P.id,k)))}return x}function D1n({items:g=[],lookup:E}){const M=[],x=new Map(g.map(O=>[O.id,O]));for(const[O,P]of g.entries()){const k=E.get(P.id),H=k?.internals?.userNode??k;H!==void 0&&H!==P&&M.push({id:P.id,item:P,type:"replace"}),H===void 0&&M.push({item:P,type:"add",index:O})}for(const[O]of E)x.get(O)===void 0&&M.push({id:O,type:"remove"});return M}function _1n(g){return{id:g.id,type:"remove"}}const I1n=g=>iGn(g),Lqn=g=>n0n(g);function I0n(g){return Pe.forwardRef(g)}function L1n(g){const[E,M]=Pe.useState(BigInt(0)),[x]=Pe.useState(()=>Pqn(()=>M(O=>O+BigInt(1))));return uke(()=>{const O=x.get();O.length&&(g(O),x.reset())},[E]),x}function Pqn(g){let E=[];return{get:()=>E,reset:()=>{E=[]},push:M=>{E.push(M),g()}}}const L0n=Pe.createContext(null);function $qn({children:g}){const E=Nl(),M=Pe.useCallback(H=>{const{nodes:q=[],setNodes:F,hasDefaultNodes:W,onNodesChange:Z,nodeLookup:ne,fitViewQueued:le,onNodesChangeMiddlewareMap:se}=E.getState();let ee=q;for(const je of H)ee=typeof je=="function"?je(ee):je;let Ce=D1n({items:ee,lookup:ne});for(const je of se.values())Ce=je(Ce);W&&F(ee),Ce.length>0?Z?.(Ce):le&&window.requestAnimationFrame(()=>{const{fitViewQueued:je,nodes:ze,setNodes:be}=E.getState();je&&be(ze)})},[]),x=L1n(M),O=Pe.useCallback(H=>{const{edges:q=[],setEdges:F,hasDefaultEdges:W,onEdgesChange:Z,edgeLookup:ne}=E.getState();let le=q;for(const se of H)le=typeof se=="function"?se(le):se;W?F(le):Z&&Z(D1n({items:le,lookup:ne}))},[]),P=L1n(O),k=Pe.useMemo(()=>({nodeQueue:x,edgeQueue:P}),[]);return G.jsx(L0n.Provider,{value:k,children:g})}function Rqn(){const g=Pe.useContext(L0n);if(!g)throw new Error("useBatchContext must be used within a BatchProvider");return g}const Bqn=g=>!!g.panZoom;function Tke(){const g=_qn(),E=Nl(),M=Rqn(),x=Fu(Bqn),O=Pe.useMemo(()=>{const P=Z=>E.getState().nodeLookup.get(Z),k=Z=>{M.nodeQueue.push(Z)},H=Z=>{M.edgeQueue.push(Z)},q=Z=>{const{nodeLookup:ne,nodeOrigin:le}=E.getState(),se=I1n(Z)?Z:ne.get(Z.id),ee=se.parentId?o0n(se.position,se.measured,se.parentId,ne,le):se.position,Ce={...se,position:ee,width:se.measured?.width??se.width,height:se.measured?.height??se.height};return y_(Ce)},F=(Z,ne,le={replace:!1})=>{k(se=>se.map(ee=>{if(ee.id===Z){const Ce=typeof ne=="function"?ne(ee):ne;return le.replace&&I1n(Ce)?Ce:{...ee,...Ce}}return ee}))},W=(Z,ne,le={replace:!1})=>{H(se=>se.map(ee=>{if(ee.id===Z){const Ce=typeof ne=="function"?ne(ee):ne;return le.replace&&Lqn(Ce)?Ce:{...ee,...Ce}}return ee}))};return{getNodes:()=>E.getState().nodes.map(Z=>({...Z})),getNode:Z=>P(Z)?.internals.userNode,getInternalNode:P,getEdges:()=>{const{edges:Z=[]}=E.getState();return Z.map(ne=>({...ne}))},getEdge:Z=>E.getState().edgeLookup.get(Z),setNodes:k,setEdges:H,addNodes:Z=>{const ne=Array.isArray(Z)?Z:[Z];M.nodeQueue.push(le=>[...le,...ne])},addEdges:Z=>{const ne=Array.isArray(Z)?Z:[Z];M.edgeQueue.push(le=>[...le,...ne])},toObject:()=>{const{nodes:Z=[],edges:ne=[],transform:le}=E.getState(),[se,ee,Ce]=le;return{nodes:Z.map(je=>({...je})),edges:ne.map(je=>({...je})),viewport:{x:se,y:ee,zoom:Ce}}},deleteElements:async({nodes:Z=[],edges:ne=[]})=>{const{nodes:le,edges:se,onNodesDelete:ee,onEdgesDelete:Ce,triggerNodeChanges:je,triggerEdgeChanges:ze,onDelete:be,onBeforeDelete:De}=E.getState(),{nodes:rn,edges:an}=await sGn({nodesToRemove:Z,edgesToRemove:ne,nodes:le,edges:se,onBeforeDelete:De}),un=an.length>0,An=rn.length>0;if(un){const Dn=an.map(_1n);Ce?.(an),ze(Dn)}if(An){const Dn=rn.map(_1n);ee?.(rn),je(Dn)}return(An||un)&&be?.({nodes:rn,edges:an}),{deletedNodes:rn,deletedEdges:an}},getIntersectingNodes:(Z,ne=!0,le)=>{const se=u1n(Z),ee=se?Z:q(Z),Ce=le!==void 0;return ee?(le||E.getState().nodes).filter(je=>{const ze=E.getState().nodeLookup.get(je.id);if(ze&&!se&&(je.id===Z.id||!ze.internals.positionAbsolute))return!1;const be=y_(Ce?je:ze),De=QG(be,ee);return ne&&De>0||De>=be.width*be.height||De>=ee.width*ee.height}):[]},isNodeIntersecting:(Z,ne,le=!0)=>{const ee=u1n(Z)?Z:q(Z);if(!ee)return!1;const Ce=QG(ee,ne);return le&&Ce>0||Ce>=ne.width*ne.height||Ce>=ee.width*ee.height},updateNode:F,updateNodeData:(Z,ne,le={replace:!1})=>{F(Z,se=>{const ee=typeof ne=="function"?ne(se):ne;return le.replace?{...se,data:ee}:{...se,data:{...se.data,...ee}}},le)},updateEdge:W,updateEdgeData:(Z,ne,le={replace:!1})=>{W(Z,se=>{const ee=typeof ne=="function"?ne(se):ne;return le.replace?{...se,data:ee}:{...se,data:{...se.data,...ee}}},le)},getNodesBounds:Z=>{const{nodeLookup:ne,nodeOrigin:le}=E.getState();return rGn(Z,{nodeLookup:ne,nodeOrigin:le})},getHandleConnections:({type:Z,id:ne,nodeId:le})=>Array.from(E.getState().connectionLookup.get(`${le}-${Z}${ne?`-${ne}`:""}`)?.values()??[]),getNodeConnections:({type:Z,handleId:ne,nodeId:le})=>Array.from(E.getState().connectionLookup.get(`${le}${Z?ne?`-${Z}-${ne}`:`-${Z}`:""}`)?.values()??[]),fitView:async Z=>{const ne=E.getState().fitViewResolver??hGn();return E.setState({fitViewQueued:!0,fitViewOptions:Z,fitViewResolver:ne}),M.nodeQueue.push(le=>[...le]),ne.promise}}},[]);return Pe.useMemo(()=>({...O,...g,viewportInitialized:x}),[x])}const P1n=g=>g.selected,zqn=typeof window<"u"?window:void 0;function Fqn({deleteKeyCode:g,multiSelectionKeyCode:E}){const M=Nl(),{deleteElements:x}=Tke(),O=WG(g,{actInsideInputWithModifier:!1}),P=WG(E,{target:zqn});Pe.useEffect(()=>{if(O){const{edges:k,nodes:H}=M.getState();x({nodes:H.filter(P1n),edges:k.filter(P1n)}),M.setState({nodesSelectionActive:!1})}},[O]),Pe.useEffect(()=>{M.setState({multiSelectionActive:P})},[P])}function Hqn(g){const E=Nl();Pe.useEffect(()=>{const M=()=>{if(!g.current||!(g.current.checkVisibility?.()??!0))return!1;const x=Eke(g.current);(x.height===0||x.width===0)&&E.getState().onError?.("004",N4.error004()),E.setState({width:x.width||500,height:x.height||500})};if(g.current){M(),window.addEventListener("resize",M);const x=new ResizeObserver(()=>M());return x.observe(g.current),()=>{window.removeEventListener("resize",M),x&&g.current&&x.unobserve(g.current)}}},[])}const Bue={position:"absolute",width:"100%",height:"100%",top:0,left:0},Jqn=g=>({userSelectionActive:g.userSelectionActive,lib:g.lib,connectionInProgress:g.connection.inProgress});function Gqn({onPaneContextMenu:g,zoomOnScroll:E=!0,zoomOnPinch:M=!0,panOnScroll:x=!1,panOnScrollSpeed:O=.5,panOnScrollMode:P=OA.Free,zoomOnDoubleClick:k=!0,panOnDrag:H=!0,defaultViewport:q,translateExtent:F,minZoom:W,maxZoom:Z,zoomActivationKeyCode:ne,preventScrolling:le=!0,children:se,noWheelClassName:ee,noPanClassName:Ce,onViewportChange:je,isControlledViewport:ze,paneClickDistance:be,selectionOnDrag:De}){const rn=Nl(),an=Pe.useRef(null),{userSelectionActive:un,lib:An,connectionInProgress:Dn}=Fu(Jqn,Ol),$t=WG(ne),In=Pe.useRef();Hqn(an);const et=Pe.useCallback(Y=>{je?.({x:Y[0],y:Y[1],zoom:Y[2]}),ze||rn.setState({transform:Y})},[je,ze]);return Pe.useEffect(()=>{if(an.current){In.current=KGn({domNode:an.current,minZoom:W,maxZoom:Z,translateExtent:F,viewport:q,onDraggingChange:ke=>rn.setState(Ze=>Ze.paneDragging===ke?Ze:{paneDragging:ke}),onPanZoomStart:(ke,Ze)=>{const{onViewportChangeStart:ln,onMoveStart:En}=rn.getState();En?.(ke,Ze),ln?.(Ze)},onPanZoom:(ke,Ze)=>{const{onViewportChange:ln,onMove:En}=rn.getState();En?.(ke,Ze),ln?.(Ze)},onPanZoomEnd:(ke,Ze)=>{const{onViewportChangeEnd:ln,onMoveEnd:En}=rn.getState();En?.(ke,Ze),ln?.(Ze)}});const{x:Y,y:He,zoom:en}=In.current.getViewport();return rn.setState({panZoom:In.current,transform:[Y,He,en],domNode:an.current.closest(".react-flow")}),()=>{In.current?.destroy()}}},[]),Pe.useEffect(()=>{In.current?.update({onPaneContextMenu:g,zoomOnScroll:E,zoomOnPinch:M,panOnScroll:x,panOnScrollSpeed:O,panOnScrollMode:P,zoomOnDoubleClick:k,panOnDrag:H,zoomActivationKeyPressed:$t,preventScrolling:le,noPanClassName:Ce,userSelectionActive:un,noWheelClassName:ee,lib:An,onTransformChange:et,connectionInProgress:Dn,selectionOnDrag:De,paneClickDistance:be})},[g,E,M,x,O,P,k,H,$t,le,Ce,un,ee,An,et,Dn,De,be]),G.jsx("div",{className:"react-flow__renderer",ref:an,style:Bue,children:se})}const qqn=g=>({userSelectionActive:g.userSelectionActive,userSelectionRect:g.userSelectionRect});function Uqn(){const{userSelectionActive:g,userSelectionRect:E}=Fu(qqn,Ol);return g&&E?G.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:E.width,height:E.height,transform:`translate(${E.x}px, ${E.y}px)`}}):null}const G7e=(g,E)=>M=>{M.target===E.current&&g?.(M)},Xqn=g=>({userSelectionActive:g.userSelectionActive,elementsSelectable:g.elementsSelectable,connectionInProgress:g.connection.inProgress,dragging:g.paneDragging});function Vqn({isSelecting:g,selectionKeyPressed:E,selectionMode:M=VG.Full,panOnDrag:x,paneClickDistance:O,selectionOnDrag:P,onSelectionStart:k,onSelectionEnd:H,onPaneClick:q,onPaneContextMenu:F,onPaneScroll:W,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:le,children:se}){const ee=Nl(),{userSelectionActive:Ce,elementsSelectable:je,dragging:ze,connectionInProgress:be}=Fu(Xqn,Ol),De=je&&(g||Ce),rn=Pe.useRef(null),an=Pe.useRef(),un=Pe.useRef(new Set),An=Pe.useRef(new Set),Dn=Pe.useRef(!1),$t=ln=>{if(Dn.current||be){Dn.current=!1;return}q?.(ln),ee.getState().resetSelectedElements(),ee.setState({nodesSelectionActive:!1})},In=ln=>{if(Array.isArray(x)&&x?.includes(2)){ln.preventDefault();return}F?.(ln)},et=W?ln=>W(ln):void 0,Y=ln=>{Dn.current&&(ln.stopPropagation(),Dn.current=!1)},He=ln=>{const{domNode:En}=ee.getState();if(an.current=En?.getBoundingClientRect(),!an.current)return;const nt=ln.target===rn.current;if(!nt&&!!ln.target.closest(".nokey")||!g||!(P&&nt||E)||ln.button!==0||!ln.isPrimary)return;ln.target?.setPointerCapture?.(ln.pointerId),Dn.current=!1;const{x:ct,y:lt}=E3(ln.nativeEvent,an.current);ee.setState({userSelectionRect:{width:0,height:0,startX:ct,startY:lt,x:ct,y:lt}}),nt||(ln.stopPropagation(),ln.preventDefault())},en=ln=>{const{userSelectionRect:En,transform:nt,nodeLookup:Se,edgeLookup:on,connectionLookup:ct,triggerNodeChanges:lt,triggerEdgeChanges:qt,defaultEdgeOptions:wi,resetSelectedElements:li}=ee.getState();if(!an.current||!En)return;const{x:Ut,y:ai}=E3(ln.nativeEvent,an.current),{startX:rc,startY:Qr}=En;if(!Dn.current){const uu=E?0:O;if(Math.hypot(Ut-rc,ai-Qr)<=uu)return;li(),k?.(ln)}Dn.current=!0;const vr={startX:rc,startY:Qr,x:Utuu.id)),An.current=new Set;const Su=wi?.selectable??!0;for(const uu of un.current){const Js=ct.get(uu);if(Js)for(const{edgeId:fa}of Js.values()){const bh=on.get(fa);bh&&(bh.selectable??Su)&&An.current.add(fa)}}if(!o1n(Si,un.current)){const uu=d_(Se,un.current,!0);lt(uu)}if(!o1n(Ui,An.current)){const uu=d_(on,An.current);qt(uu)}ee.setState({userSelectionRect:vr,userSelectionActive:!0,nodesSelectionActive:!1})},ke=ln=>{ln.button===0&&(ln.target?.releasePointerCapture?.(ln.pointerId),!Ce&&ln.target===rn.current&&ee.getState().userSelectionRect&&$t?.(ln),ee.setState({userSelectionActive:!1,userSelectionRect:null}),Dn.current&&(H?.(ln),ee.setState({nodesSelectionActive:un.current.size>0})))},Ze=x===!0||Array.isArray(x)&&x.includes(0);return G.jsxs("div",{className:$a(["react-flow__pane",{draggable:Ze,dragging:ze,selection:g}]),onClick:De?void 0:G7e($t,rn),onContextMenu:G7e(In,rn),onWheel:G7e(et,rn),onPointerEnter:De?void 0:Z,onPointerMove:De?en:ne,onPointerUp:De?ke:void 0,onPointerDownCapture:De?He:void 0,onClickCapture:De?Y:void 0,onPointerLeave:le,ref:rn,style:Bue,children:[se,G.jsx(Uqn,{})]})}function oke({id:g,store:E,unselect:M=!1,nodeRef:x}){const{addSelectedNodes:O,unselectNodesAndEdges:P,multiSelectionActive:k,nodeLookup:H,onError:q}=E.getState(),F=H.get(g);if(!F){q?.("012",N4.error012(g));return}E.setState({nodesSelectionActive:!1}),F.selected?(M||F.selected&&k)&&(P({nodes:[F],edges:[]}),requestAnimationFrame(()=>x?.current?.blur())):O([g])}function P0n({nodeRef:g,disabled:E=!1,noDragClassName:M,handleSelector:x,nodeId:O,isSelectable:P,nodeClickDistance:k}){const H=Nl(),[q,F]=Pe.useState(!1),W=Pe.useRef();return Pe.useEffect(()=>{W.current=LGn({getStoreItems:()=>H.getState(),onNodeMouseDown:Z=>{oke({id:Z,store:H,nodeRef:g})},onDragStart:()=>{F(!0)},onDragStop:()=>{F(!1)}})},[]),Pe.useEffect(()=>{if(!(E||!g.current||!W.current))return W.current.update({noDragClassName:M,handleSelector:x,domNode:g.current,isSelectable:P,nodeId:O,nodeClickDistance:k}),()=>{W.current?.destroy()}},[M,x,E,P,g,O,k]),q}const Kqn=g=>E=>E.selected&&(E.draggable||g&&typeof E.draggable>"u");function $0n(){const g=Nl();return Pe.useCallback(M=>{const{nodeExtent:x,snapToGrid:O,snapGrid:P,nodesDraggable:k,onError:H,updateNodePositions:q,nodeLookup:F,nodeOrigin:W}=g.getState(),Z=new Map,ne=Kqn(k),le=O?P[0]:5,se=O?P[1]:5,ee=M.direction.x*le*M.factor,Ce=M.direction.y*se*M.factor;for(const[,je]of F){if(!ne(je))continue;let ze={x:je.internals.positionAbsolute.x+ee,y:je.internals.positionAbsolute.y+Ce};O&&(ze=cq(ze,P));const{position:be,positionAbsolute:De}=t0n({nodeId:je.id,nextPosition:ze,nodeLookup:F,nodeExtent:x,nodeOrigin:W,onError:H});je.position=be,je.internals.positionAbsolute=De,Z.set(je.id,je)}q(Z)},[])}const Cke=Pe.createContext(null),Qqn=Cke.Provider;Cke.Consumer;const R0n=()=>Pe.useContext(Cke),Yqn=g=>({connectOnClick:g.connectOnClick,noPanClassName:g.noPanClassName,rfId:g.rfId}),Wqn=(g,E,M)=>x=>{const{connectionClickStartHandle:O,connectionMode:P,connection:k}=x,{fromHandle:H,toHandle:q,isValid:F}=k,W=q?.nodeId===g&&q?.id===E&&q?.type===M;return{connectingFrom:H?.nodeId===g&&H?.id===E&&H?.type===M,connectingTo:W,clickConnecting:O?.nodeId===g&&O?.id===E&&O?.type===M,isPossibleEndHandle:P===m_.Strict?H?.type!==M:g!==H?.nodeId||E!==H?.id,connectionInProcess:!!H,clickConnectionInProcess:!!O,valid:W&&F}};function Zqn({type:g="source",position:E=er.Top,isValidConnection:M,isConnectable:x=!0,isConnectableStart:O=!0,isConnectableEnd:P=!0,id:k,onConnect:H,children:q,className:F,onMouseDown:W,onTouchStart:Z,...ne},le){const se=k||null,ee=g==="target",Ce=Nl(),je=R0n(),{connectOnClick:ze,noPanClassName:be,rfId:De}=Fu(Yqn,Ol),{connectingFrom:rn,connectingTo:an,clickConnecting:un,isPossibleEndHandle:An,connectionInProcess:Dn,clickConnectionInProcess:$t,valid:In}=Fu(Wqn(je,se,g),Ol);je||Ce.getState().onError?.("010",N4.error010());const et=en=>{const{defaultEdgeOptions:ke,onConnect:Ze,hasDefaultEdges:ln}=Ce.getState(),En={...ke,...en};if(ln){const{edges:nt,setEdges:Se}=Ce.getState();Se(vGn(En,nt))}Ze?.(En),H?.(En)},Y=en=>{if(!je)return;const ke=f0n(en.nativeEvent);if(O&&(ke&&en.button===0||!ke)){const Ze=Ce.getState();cke.onPointerDown(en.nativeEvent,{handleDomNode:en.currentTarget,autoPanOnConnect:Ze.autoPanOnConnect,connectionMode:Ze.connectionMode,connectionRadius:Ze.connectionRadius,domNode:Ze.domNode,nodeLookup:Ze.nodeLookup,lib:Ze.lib,isTarget:ee,handleId:se,nodeId:je,flowId:Ze.rfId,panBy:Ze.panBy,cancelConnection:Ze.cancelConnection,onConnectStart:Ze.onConnectStart,onConnectEnd:(...ln)=>Ce.getState().onConnectEnd?.(...ln),updateConnection:Ze.updateConnection,onConnect:et,isValidConnection:M||((...ln)=>Ce.getState().isValidConnection?.(...ln)??!0),getTransform:()=>Ce.getState().transform,getFromHandle:()=>Ce.getState().connection.fromHandle,autoPanSpeed:Ze.autoPanSpeed,dragThreshold:Ze.connectionDragThreshold})}ke?W?.(en):Z?.(en)},He=en=>{const{onClickConnectStart:ke,onClickConnectEnd:Ze,connectionClickStartHandle:ln,connectionMode:En,isValidConnection:nt,lib:Se,rfId:on,nodeLookup:ct,connection:lt}=Ce.getState();if(!je||!ln&&!O)return;if(!ln){ke?.(en.nativeEvent,{nodeId:je,handleId:se,handleType:g}),Ce.setState({connectionClickStartHandle:{nodeId:je,type:g,id:se}});return}const qt=s0n(en.target),wi=M||nt,{connection:li,isValid:Ut}=cke.isValid(en.nativeEvent,{handle:{nodeId:je,id:se,type:g},connectionMode:En,fromNodeId:ln.nodeId,fromHandleId:ln.id||null,fromType:ln.type,isValidConnection:wi,flowId:on,doc:qt,lib:Se,nodeLookup:ct});Ut&&li&&et(li);const ai=structuredClone(lt);delete ai.inProgress,ai.toPosition=ai.toHandle?ai.toHandle.position:null,Ze?.(en,ai),Ce.setState({connectionClickStartHandle:null})};return G.jsx("div",{"data-handleid":se,"data-nodeid":je,"data-handlepos":E,"data-id":`${De}-${je}-${se}-${g}`,className:$a(["react-flow__handle",`react-flow__handle-${E}`,"nodrag",be,F,{source:!ee,target:ee,connectable:x,connectablestart:O,connectableend:P,clickconnecting:un,connectingfrom:rn,connectingto:an,valid:In,connectionindicator:x&&(!Dn||An)&&(Dn||$t?P:O)}]),onMouseDown:Y,onTouchStart:Y,onClick:ze?He:void 0,ref:le,...ne,children:q})}const D4=Pe.memo(I0n(Zqn));function eUn({data:g,isConnectable:E,sourcePosition:M=er.Bottom}){return G.jsxs(G.Fragment,{children:[g?.label,G.jsx(D4,{type:"source",position:M,isConnectable:E})]})}function nUn({data:g,isConnectable:E,targetPosition:M=er.Top,sourcePosition:x=er.Bottom}){return G.jsxs(G.Fragment,{children:[G.jsx(D4,{type:"target",position:M,isConnectable:E}),g?.label,G.jsx(D4,{type:"source",position:x,isConnectable:E})]})}function tUn(){return null}function iUn({data:g,isConnectable:E,targetPosition:M=er.Top}){return G.jsxs(G.Fragment,{children:[G.jsx(D4,{type:"target",position:M,isConnectable:E}),g?.label]})}const Mue={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$1n={input:eUn,default:nUn,output:iUn,group:tUn};function rUn(g){return g.internals.handleBounds===void 0?{width:g.width??g.initialWidth??g.style?.width,height:g.height??g.initialHeight??g.style?.height}:{width:g.width??g.style?.width,height:g.height??g.style?.height}}const cUn=g=>{const{width:E,height:M,x,y:O}=rq(g.nodeLookup,{filter:P=>!!P.selected});return{width:k3(E)?E:null,height:k3(M)?M:null,userSelectionActive:g.userSelectionActive,transformString:`translate(${g.transform[0]}px,${g.transform[1]}px) scale(${g.transform[2]}) translate(${x}px,${O}px)`}};function uUn({onSelectionContextMenu:g,noPanClassName:E,disableKeyboardA11y:M}){const x=Nl(),{width:O,height:P,transformString:k,userSelectionActive:H}=Fu(cUn,Ol),q=$0n(),F=Pe.useRef(null);Pe.useEffect(()=>{M||F.current?.focus({preventScroll:!0})},[M]);const W=!H&&O!==null&&P!==null;if(P0n({nodeRef:F,disabled:!W}),!W)return null;const Z=g?le=>{const se=x.getState().nodes.filter(ee=>ee.selected);g(le,se)}:void 0,ne=le=>{Object.prototype.hasOwnProperty.call(Mue,le.key)&&(le.preventDefault(),q({direction:Mue[le.key],factor:le.shiftKey?4:1}))};return G.jsx("div",{className:$a(["react-flow__nodesselection","react-flow__container",E]),style:{transform:k},children:G.jsx("div",{ref:F,className:"react-flow__nodesselection-rect",onContextMenu:Z,tabIndex:M?void 0:-1,onKeyDown:M?void 0:ne,style:{width:O,height:P}})})}const R1n=typeof window<"u"?window:void 0,oUn=g=>({nodesSelectionActive:g.nodesSelectionActive,userSelectionActive:g.userSelectionActive});function B0n({children:g,onPaneClick:E,onPaneMouseEnter:M,onPaneMouseMove:x,onPaneMouseLeave:O,onPaneContextMenu:P,onPaneScroll:k,paneClickDistance:H,deleteKeyCode:q,selectionKeyCode:F,selectionOnDrag:W,selectionMode:Z,onSelectionStart:ne,onSelectionEnd:le,multiSelectionKeyCode:se,panActivationKeyCode:ee,zoomActivationKeyCode:Ce,elementsSelectable:je,zoomOnScroll:ze,zoomOnPinch:be,panOnScroll:De,panOnScrollSpeed:rn,panOnScrollMode:an,zoomOnDoubleClick:un,panOnDrag:An,defaultViewport:Dn,translateExtent:$t,minZoom:In,maxZoom:et,preventScrolling:Y,onSelectionContextMenu:He,noWheelClassName:en,noPanClassName:ke,disableKeyboardA11y:Ze,onViewportChange:ln,isControlledViewport:En}){const{nodesSelectionActive:nt,userSelectionActive:Se}=Fu(oUn,Ol),on=WG(F,{target:R1n}),ct=WG(ee,{target:R1n}),lt=ct||An,qt=ct||De,wi=W&<!==!0,li=on||Se||wi;return Fqn({deleteKeyCode:q,multiSelectionKeyCode:se}),G.jsx(Gqn,{onPaneContextMenu:P,elementsSelectable:je,zoomOnScroll:ze,zoomOnPinch:be,panOnScroll:qt,panOnScrollSpeed:rn,panOnScrollMode:an,zoomOnDoubleClick:un,panOnDrag:!on&<,defaultViewport:Dn,translateExtent:$t,minZoom:In,maxZoom:et,zoomActivationKeyCode:Ce,preventScrolling:Y,noWheelClassName:en,noPanClassName:ke,onViewportChange:ln,isControlledViewport:En,paneClickDistance:H,selectionOnDrag:wi,children:G.jsxs(Vqn,{onSelectionStart:ne,onSelectionEnd:le,onPaneClick:E,onPaneMouseEnter:M,onPaneMouseMove:x,onPaneMouseLeave:O,onPaneContextMenu:P,onPaneScroll:k,panOnDrag:lt,isSelecting:!!li,selectionMode:Z,selectionKeyPressed:on,paneClickDistance:H,selectionOnDrag:wi,children:[g,nt&&G.jsx(uUn,{onSelectionContextMenu:He,noPanClassName:ke,disableKeyboardA11y:Ze})]})})}B0n.displayName="FlowRenderer";const sUn=Pe.memo(B0n),lUn=g=>E=>g?yke(E.nodeLookup,{x:0,y:0,width:E.width,height:E.height},E.transform,!0).map(M=>M.id):Array.from(E.nodeLookup.keys());function fUn(g){return Fu(Pe.useCallback(lUn(g),[g]),Ol)}const aUn=g=>g.updateNodeInternals;function hUn(){const g=Fu(aUn),[E]=Pe.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(M=>{const x=new Map;M.forEach(O=>{const P=O.target.getAttribute("data-id");x.set(P,{id:P,nodeElement:O.target,force:!0})}),g(x)}));return Pe.useEffect(()=>()=>{E?.disconnect()},[E]),E}function dUn({node:g,nodeType:E,hasDimensions:M,resizeObserver:x}){const O=Nl(),P=Pe.useRef(null),k=Pe.useRef(null),H=Pe.useRef(g.sourcePosition),q=Pe.useRef(g.targetPosition),F=Pe.useRef(E),W=M&&!!g.internals.handleBounds;return Pe.useEffect(()=>{P.current&&!g.hidden&&(!W||k.current!==P.current)&&(k.current&&x?.unobserve(k.current),x?.observe(P.current),k.current=P.current)},[W,g.hidden]),Pe.useEffect(()=>()=>{k.current&&(x?.unobserve(k.current),k.current=null)},[]),Pe.useEffect(()=>{if(P.current){const Z=F.current!==E,ne=H.current!==g.sourcePosition,le=q.current!==g.targetPosition;(Z||ne||le)&&(F.current=E,H.current=g.sourcePosition,q.current=g.targetPosition,O.getState().updateNodeInternals(new Map([[g.id,{id:g.id,nodeElement:P.current,force:!0}]])))}},[g.id,E,g.sourcePosition,g.targetPosition]),P}function bUn({id:g,onClick:E,onMouseEnter:M,onMouseMove:x,onMouseLeave:O,onContextMenu:P,onDoubleClick:k,nodesDraggable:H,elementsSelectable:q,nodesConnectable:F,nodesFocusable:W,resizeObserver:Z,noDragClassName:ne,noPanClassName:le,disableKeyboardA11y:se,rfId:ee,nodeTypes:Ce,nodeClickDistance:je,onError:ze}){const{node:be,internals:De,isParent:rn}=Fu(Ut=>{const ai=Ut.nodeLookup.get(g),rc=Ut.parentLookup.has(g);return{node:ai,internals:ai.internals,isParent:rc}},Ol);let an=be.type||"default",un=Ce?.[an]||$1n[an];un===void 0&&(ze?.("003",N4.error003(an)),an="default",un=Ce?.default||$1n.default);const An=!!(be.draggable||H&&typeof be.draggable>"u"),Dn=!!(be.selectable||q&&typeof be.selectable>"u"),$t=!!(be.connectable||F&&typeof be.connectable>"u"),In=!!(be.focusable||W&&typeof be.focusable>"u"),et=Nl(),Y=u0n(be),He=dUn({node:be,nodeType:an,hasDimensions:Y,resizeObserver:Z}),en=P0n({nodeRef:He,disabled:be.hidden||!An,noDragClassName:ne,handleSelector:be.dragHandle,nodeId:g,isSelectable:Dn,nodeClickDistance:je}),ke=$0n();if(be.hidden)return null;const Ze=j6(be),ln=rUn(be),En=Dn||An||E||M||x||O,nt=M?Ut=>M(Ut,{...De.userNode}):void 0,Se=x?Ut=>x(Ut,{...De.userNode}):void 0,on=O?Ut=>O(Ut,{...De.userNode}):void 0,ct=P?Ut=>P(Ut,{...De.userNode}):void 0,lt=k?Ut=>k(Ut,{...De.userNode}):void 0,qt=Ut=>{const{selectNodesOnDrag:ai,nodeDragThreshold:rc}=et.getState();Dn&&(!ai||!An||rc>0)&&oke({id:g,store:et,nodeRef:He}),E&&E(Ut,{...De.userNode})},wi=Ut=>{if(!(l0n(Ut.nativeEvent)||se)){if(Ydn.includes(Ut.key)&&Dn){const ai=Ut.key==="Escape";oke({id:g,store:et,unselect:ai,nodeRef:He})}else if(An&&be.selected&&Object.prototype.hasOwnProperty.call(Mue,Ut.key)){Ut.preventDefault();const{ariaLabelConfig:ai}=et.getState();et.setState({ariaLiveMessage:ai["node.a11yDescription.ariaLiveMessage"]({direction:Ut.key.replace("Arrow","").toLowerCase(),x:~~De.positionAbsolute.x,y:~~De.positionAbsolute.y})}),ke({direction:Mue[Ut.key],factor:Ut.shiftKey?4:1})}}},li=()=>{if(se||!He.current?.matches(":focus-visible"))return;const{transform:Ut,width:ai,height:rc,autoPanOnNodeFocus:Qr,setCenter:vr}=et.getState();if(!Qr)return;yke(new Map([[g,be]]),{x:0,y:0,width:ai,height:rc},Ut,!0).length>0||vr(be.position.x+Ze.width/2,be.position.y+Ze.height/2,{zoom:Ut[2]})};return G.jsx("div",{className:$a(["react-flow__node",`react-flow__node-${an}`,{[le]:An},be.className,{selected:be.selected,selectable:Dn,parent:rn,draggable:An,dragging:en}]),ref:He,style:{zIndex:De.z,transform:`translate(${De.positionAbsolute.x}px,${De.positionAbsolute.y}px)`,pointerEvents:En?"all":"none",visibility:Y?"visible":"hidden",...be.style,...ln},"data-id":g,"data-testid":`rf__node-${g}`,onMouseEnter:nt,onMouseMove:Se,onMouseLeave:on,onContextMenu:ct,onClick:qt,onDoubleClick:lt,onKeyDown:In?wi:void 0,tabIndex:In?0:void 0,onFocus:In?li:void 0,role:be.ariaRole??(In?"group":void 0),"aria-roledescription":"node","aria-describedby":se?void 0:`${T0n}-${ee}`,"aria-label":be.ariaLabel,...be.domAttributes,children:G.jsx(Qqn,{value:g,children:G.jsx(un,{id:g,data:be.data,type:an,positionAbsoluteX:De.positionAbsolute.x,positionAbsoluteY:De.positionAbsolute.y,selected:be.selected??!1,selectable:Dn,draggable:An,deletable:be.deletable??!0,isConnectable:$t,sourcePosition:be.sourcePosition,targetPosition:be.targetPosition,dragging:en,dragHandle:be.dragHandle,zIndex:De.z,parentId:be.parentId,...Ze})})})}var gUn=Pe.memo(bUn);const wUn=g=>({nodesDraggable:g.nodesDraggable,nodesConnectable:g.nodesConnectable,nodesFocusable:g.nodesFocusable,elementsSelectable:g.elementsSelectable,onError:g.onError});function z0n(g){const{nodesDraggable:E,nodesConnectable:M,nodesFocusable:x,elementsSelectable:O,onError:P}=Fu(wUn,Ol),k=fUn(g.onlyRenderVisibleElements),H=hUn();return G.jsx("div",{className:"react-flow__nodes",style:Bue,children:k.map(q=>G.jsx(gUn,{id:q,nodeTypes:g.nodeTypes,nodeExtent:g.nodeExtent,onClick:g.onNodeClick,onMouseEnter:g.onNodeMouseEnter,onMouseMove:g.onNodeMouseMove,onMouseLeave:g.onNodeMouseLeave,onContextMenu:g.onNodeContextMenu,onDoubleClick:g.onNodeDoubleClick,noDragClassName:g.noDragClassName,noPanClassName:g.noPanClassName,rfId:g.rfId,disableKeyboardA11y:g.disableKeyboardA11y,resizeObserver:H,nodesDraggable:E,nodesConnectable:M,nodesFocusable:x,elementsSelectable:O,nodeClickDistance:g.nodeClickDistance,onError:P},q))})}z0n.displayName="NodeRenderer";const pUn=Pe.memo(z0n);function mUn(g){return Fu(Pe.useCallback(M=>{if(!g)return M.edges.map(O=>O.id);const x=[];if(M.width&&M.height)for(const O of M.edges){const P=M.nodeLookup.get(O.source),k=M.nodeLookup.get(O.target);P&&k&&wGn({sourceNode:P,targetNode:k,width:M.width,height:M.height,transform:M.transform})&&x.push(O.id)}return x},[g]),Ol)}const vUn=({color:g="none",strokeWidth:E=1})=>{const M={strokeWidth:E,...g&&{stroke:g}};return G.jsx("polyline",{className:"arrow",style:M,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},yUn=({color:g="none",strokeWidth:E=1})=>{const M={strokeWidth:E,...g&&{stroke:g,fill:g}};return G.jsx("polyline",{className:"arrowclosed",style:M,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},B1n={[KG.Arrow]:vUn,[KG.ArrowClosed]:yUn};function kUn(g){const E=Nl();return Pe.useMemo(()=>Object.prototype.hasOwnProperty.call(B1n,g)?B1n[g]:(E.getState().onError?.("009",N4.error009(g)),null),[g])}const EUn=({id:g,type:E,color:M,width:x=12.5,height:O=12.5,markerUnits:P="strokeWidth",strokeWidth:k,orient:H="auto-start-reverse"})=>{const q=kUn(E);return q?G.jsx("marker",{className:"react-flow__arrowhead",id:g,markerWidth:`${x}`,markerHeight:`${O}`,viewBox:"-10 -10 20 20",markerUnits:P,orient:H,refX:"0",refY:"0",children:G.jsx(q,{color:M,strokeWidth:k})}):null},F0n=({defaultColor:g,rfId:E})=>{const M=Fu(P=>P.edges),x=Fu(P=>P.defaultEdgeOptions),O=Pe.useMemo(()=>SGn(M,{id:E,defaultColor:g,defaultMarkerStart:x?.markerStart,defaultMarkerEnd:x?.markerEnd}),[M,x,E,g]);return O.length?G.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:G.jsx("defs",{children:O.map(P=>G.jsx(EUn,{id:P.id,type:P.type,color:P.color,width:P.width,height:P.height,markerUnits:P.markerUnits,strokeWidth:P.strokeWidth,orient:P.orient},P.id))})}):null};F0n.displayName="MarkerDefinitions";var jUn=Pe.memo(F0n);function H0n({x:g,y:E,label:M,labelStyle:x,labelShowBg:O=!0,labelBgStyle:P,labelBgPadding:k=[2,4],labelBgBorderRadius:H=2,children:q,className:F,...W}){const[Z,ne]=Pe.useState({x:1,y:0,width:0,height:0}),le=$a(["react-flow__edge-textwrapper",F]),se=Pe.useRef(null);return Pe.useEffect(()=>{if(se.current){const ee=se.current.getBBox();ne({x:ee.x,y:ee.y,width:ee.width,height:ee.height})}},[M]),M?G.jsxs("g",{transform:`translate(${g-Z.width/2} ${E-Z.height/2})`,className:le,visibility:Z.width?"visible":"hidden",...W,children:[O&&G.jsx("rect",{width:Z.width+2*k[0],x:-k[0],y:-k[1],height:Z.height+2*k[1],className:"react-flow__edge-textbg",style:P,rx:H,ry:H}),G.jsx("text",{className:"react-flow__edge-text",y:Z.height/2,dy:"0.3em",ref:se,style:x,children:M}),q]}):null}H0n.displayName="EdgeText";const SUn=Pe.memo(H0n);function j_({path:g,labelX:E,labelY:M,label:x,labelStyle:O,labelShowBg:P,labelBgStyle:k,labelBgPadding:H,labelBgBorderRadius:q,interactionWidth:F=20,...W}){return G.jsxs(G.Fragment,{children:[G.jsx("path",{...W,d:g,fill:"none",className:$a(["react-flow__edge-path",W.className])}),F?G.jsx("path",{d:g,fill:"none",strokeOpacity:0,strokeWidth:F,className:"react-flow__edge-interaction"}):null,x&&k3(E)&&k3(M)?G.jsx(SUn,{x:E,y:M,label:x,labelStyle:O,labelShowBg:P,labelBgStyle:k,labelBgPadding:H,labelBgBorderRadius:q}):null]})}function z1n({pos:g,x1:E,y1:M,x2:x,y2:O}){return g===er.Left||g===er.Right?[.5*(E+x),M]:[E,.5*(M+O)]}function J0n({sourceX:g,sourceY:E,sourcePosition:M=er.Bottom,targetX:x,targetY:O,targetPosition:P=er.Top}){const[k,H]=z1n({pos:M,x1:g,y1:E,x2:x,y2:O}),[q,F]=z1n({pos:P,x1:x,y1:O,x2:g,y2:E}),[W,Z,ne,le]=a0n({sourceX:g,sourceY:E,targetX:x,targetY:O,sourceControlX:k,sourceControlY:H,targetControlX:q,targetControlY:F});return[`M${g},${E} C${k},${H} ${q},${F} ${x},${O}`,W,Z,ne,le]}function G0n(g){return Pe.memo(({id:E,sourceX:M,sourceY:x,targetX:O,targetY:P,sourcePosition:k,targetPosition:H,label:q,labelStyle:F,labelShowBg:W,labelBgStyle:Z,labelBgPadding:ne,labelBgBorderRadius:le,style:se,markerEnd:ee,markerStart:Ce,interactionWidth:je})=>{const[ze,be,De]=J0n({sourceX:M,sourceY:x,sourcePosition:k,targetX:O,targetY:P,targetPosition:H}),rn=g.isInternal?void 0:E;return G.jsx(j_,{id:rn,path:ze,labelX:be,labelY:De,label:q,labelStyle:F,labelShowBg:W,labelBgStyle:Z,labelBgPadding:ne,labelBgBorderRadius:le,style:se,markerEnd:ee,markerStart:Ce,interactionWidth:je})})}const MUn=G0n({isInternal:!1}),q0n=G0n({isInternal:!0});MUn.displayName="SimpleBezierEdge";q0n.displayName="SimpleBezierEdgeInternal";function U0n(g){return Pe.memo(({id:E,sourceX:M,sourceY:x,targetX:O,targetY:P,label:k,labelStyle:H,labelShowBg:q,labelBgStyle:F,labelBgPadding:W,labelBgBorderRadius:Z,style:ne,sourcePosition:le=er.Bottom,targetPosition:se=er.Top,markerEnd:ee,markerStart:Ce,pathOptions:je,interactionWidth:ze})=>{const[be,De,rn]=Sue({sourceX:M,sourceY:x,sourcePosition:le,targetX:O,targetY:P,targetPosition:se,borderRadius:je?.borderRadius,offset:je?.offset,stepPosition:je?.stepPosition}),an=g.isInternal?void 0:E;return G.jsx(j_,{id:an,path:be,labelX:De,labelY:rn,label:k,labelStyle:H,labelShowBg:q,labelBgStyle:F,labelBgPadding:W,labelBgBorderRadius:Z,style:ne,markerEnd:ee,markerStart:Ce,interactionWidth:ze})})}const X0n=U0n({isInternal:!1}),V0n=U0n({isInternal:!0});X0n.displayName="SmoothStepEdge";V0n.displayName="SmoothStepEdgeInternal";function K0n(g){return Pe.memo(({id:E,...M})=>{const x=g.isInternal?void 0:E;return G.jsx(X0n,{...M,id:x,pathOptions:Pe.useMemo(()=>({borderRadius:0,offset:M.pathOptions?.offset}),[M.pathOptions?.offset])})})}const AUn=K0n({isInternal:!1}),Q0n=K0n({isInternal:!0});AUn.displayName="StepEdge";Q0n.displayName="StepEdgeInternal";function Y0n(g){return Pe.memo(({id:E,sourceX:M,sourceY:x,targetX:O,targetY:P,label:k,labelStyle:H,labelShowBg:q,labelBgStyle:F,labelBgPadding:W,labelBgBorderRadius:Z,style:ne,markerEnd:le,markerStart:se,interactionWidth:ee})=>{const[Ce,je,ze]=b0n({sourceX:M,sourceY:x,targetX:O,targetY:P}),be=g.isInternal?void 0:E;return G.jsx(j_,{id:be,path:Ce,labelX:je,labelY:ze,label:k,labelStyle:H,labelShowBg:q,labelBgStyle:F,labelBgPadding:W,labelBgBorderRadius:Z,style:ne,markerEnd:le,markerStart:se,interactionWidth:ee})})}const xUn=Y0n({isInternal:!1}),W0n=Y0n({isInternal:!0});xUn.displayName="StraightEdge";W0n.displayName="StraightEdgeInternal";function Z0n(g){return Pe.memo(({id:E,sourceX:M,sourceY:x,targetX:O,targetY:P,sourcePosition:k=er.Bottom,targetPosition:H=er.Top,label:q,labelStyle:F,labelShowBg:W,labelBgStyle:Z,labelBgPadding:ne,labelBgBorderRadius:le,style:se,markerEnd:ee,markerStart:Ce,pathOptions:je,interactionWidth:ze})=>{const[be,De,rn]=h0n({sourceX:M,sourceY:x,sourcePosition:k,targetX:O,targetY:P,targetPosition:H,curvature:je?.curvature}),an=g.isInternal?void 0:E;return G.jsx(j_,{id:an,path:be,labelX:De,labelY:rn,label:q,labelStyle:F,labelShowBg:W,labelBgStyle:Z,labelBgPadding:ne,labelBgBorderRadius:le,style:se,markerEnd:ee,markerStart:Ce,interactionWidth:ze})})}const TUn=Z0n({isInternal:!1}),ebn=Z0n({isInternal:!0});TUn.displayName="BezierEdge";ebn.displayName="BezierEdgeInternal";const F1n={default:ebn,straight:W0n,step:Q0n,smoothstep:V0n,simplebezier:q0n},H1n={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},CUn=(g,E,M)=>M===er.Left?g-E:M===er.Right?g+E:g,OUn=(g,E,M)=>M===er.Top?g-E:M===er.Bottom?g+E:g,J1n="react-flow__edgeupdater";function G1n({position:g,centerX:E,centerY:M,radius:x=10,onMouseDown:O,onMouseEnter:P,onMouseOut:k,type:H}){return G.jsx("circle",{onMouseDown:O,onMouseEnter:P,onMouseOut:k,className:$a([J1n,`${J1n}-${H}`]),cx:CUn(E,x,g),cy:OUn(M,x,g),r:x,stroke:"transparent",fill:"transparent"})}function NUn({isReconnectable:g,reconnectRadius:E,edge:M,sourceX:x,sourceY:O,targetX:P,targetY:k,sourcePosition:H,targetPosition:q,onReconnect:F,onReconnectStart:W,onReconnectEnd:Z,setReconnecting:ne,setUpdateHover:le}){const se=Nl(),ee=(De,rn)=>{if(De.button!==0)return;const{autoPanOnConnect:an,domNode:un,connectionMode:An,connectionRadius:Dn,lib:$t,onConnectStart:In,cancelConnection:et,nodeLookup:Y,rfId:He,panBy:en,updateConnection:ke}=se.getState(),Ze=rn.type==="target",ln=(Se,on)=>{ne(!1),Z?.(Se,M,rn.type,on)},En=Se=>F?.(M,Se),nt=(Se,on)=>{ne(!0),W?.(De,M,rn.type),In?.(Se,on)};cke.onPointerDown(De.nativeEvent,{autoPanOnConnect:an,connectionMode:An,connectionRadius:Dn,domNode:un,handleId:rn.id,nodeId:rn.nodeId,nodeLookup:Y,isTarget:Ze,edgeUpdaterType:rn.type,lib:$t,flowId:He,cancelConnection:et,panBy:en,isValidConnection:(...Se)=>se.getState().isValidConnection?.(...Se)??!0,onConnect:En,onConnectStart:nt,onConnectEnd:(...Se)=>se.getState().onConnectEnd?.(...Se),onReconnectEnd:ln,updateConnection:ke,getTransform:()=>se.getState().transform,getFromHandle:()=>se.getState().connection.fromHandle,dragThreshold:se.getState().connectionDragThreshold,handleDomNode:De.currentTarget})},Ce=De=>ee(De,{nodeId:M.target,id:M.targetHandle??null,type:"target"}),je=De=>ee(De,{nodeId:M.source,id:M.sourceHandle??null,type:"source"}),ze=()=>le(!0),be=()=>le(!1);return G.jsxs(G.Fragment,{children:[(g===!0||g==="source")&&G.jsx(G1n,{position:H,centerX:x,centerY:O,radius:E,onMouseDown:Ce,onMouseEnter:ze,onMouseOut:be,type:"source"}),(g===!0||g==="target")&&G.jsx(G1n,{position:q,centerX:P,centerY:k,radius:E,onMouseDown:je,onMouseEnter:ze,onMouseOut:be,type:"target"})]})}function DUn({id:g,edgesFocusable:E,edgesReconnectable:M,elementsSelectable:x,onClick:O,onDoubleClick:P,onContextMenu:k,onMouseEnter:H,onMouseMove:q,onMouseLeave:F,reconnectRadius:W,onReconnect:Z,onReconnectStart:ne,onReconnectEnd:le,rfId:se,edgeTypes:ee,noPanClassName:Ce,onError:je,disableKeyboardA11y:ze}){let be=Fu(vr=>vr.edgeLookup.get(g));const De=Fu(vr=>vr.defaultEdgeOptions);be=De?{...De,...be}:be;let rn=be.type||"default",an=ee?.[rn]||F1n[rn];an===void 0&&(je?.("011",N4.error011(rn)),rn="default",an=ee?.default||F1n.default);const un=!!(be.focusable||E&&typeof be.focusable>"u"),An=typeof Z<"u"&&(be.reconnectable||M&&typeof be.reconnectable>"u"),Dn=!!(be.selectable||x&&typeof be.selectable>"u"),$t=Pe.useRef(null),[In,et]=Pe.useState(!1),[Y,He]=Pe.useState(!1),en=Nl(),{zIndex:ke,sourceX:Ze,sourceY:ln,targetX:En,targetY:nt,sourcePosition:Se,targetPosition:on}=Fu(Pe.useCallback(vr=>{const Si=vr.nodeLookup.get(be.source),Ui=vr.nodeLookup.get(be.target);if(!Si||!Ui)return{zIndex:be.zIndex,...H1n};const Su=jGn({id:g,sourceNode:Si,targetNode:Ui,sourceHandle:be.sourceHandle||null,targetHandle:be.targetHandle||null,connectionMode:vr.connectionMode,onError:je});return{zIndex:gGn({selected:be.selected,zIndex:be.zIndex,sourceNode:Si,targetNode:Ui,elevateOnSelect:vr.elevateEdgesOnSelect,zIndexMode:vr.zIndexMode}),...Su||H1n}},[be.source,be.target,be.sourceHandle,be.targetHandle,be.selected,be.zIndex]),Ol),ct=Pe.useMemo(()=>be.markerStart?`url('#${ike(be.markerStart,se)}')`:void 0,[be.markerStart,se]),lt=Pe.useMemo(()=>be.markerEnd?`url('#${ike(be.markerEnd,se)}')`:void 0,[be.markerEnd,se]);if(be.hidden||Ze===null||ln===null||En===null||nt===null)return null;const qt=vr=>{const{addSelectedEdges:Si,unselectNodesAndEdges:Ui,multiSelectionActive:Su}=en.getState();Dn&&(en.setState({nodesSelectionActive:!1}),be.selected&&Su?(Ui({nodes:[],edges:[be]}),$t.current?.blur()):Si([g])),O&&O(vr,be)},wi=P?vr=>{P(vr,{...be})}:void 0,li=k?vr=>{k(vr,{...be})}:void 0,Ut=H?vr=>{H(vr,{...be})}:void 0,ai=q?vr=>{q(vr,{...be})}:void 0,rc=F?vr=>{F(vr,{...be})}:void 0,Qr=vr=>{if(!ze&&Ydn.includes(vr.key)&&Dn){const{unselectNodesAndEdges:Si,addSelectedEdges:Ui}=en.getState();vr.key==="Escape"?($t.current?.blur(),Si({edges:[be]})):Ui([g])}};return G.jsx("svg",{style:{zIndex:ke},children:G.jsxs("g",{className:$a(["react-flow__edge",`react-flow__edge-${rn}`,be.className,Ce,{selected:be.selected,animated:be.animated,inactive:!Dn&&!O,updating:In,selectable:Dn}]),onClick:qt,onDoubleClick:wi,onContextMenu:li,onMouseEnter:Ut,onMouseMove:ai,onMouseLeave:rc,onKeyDown:un?Qr:void 0,tabIndex:un?0:void 0,role:be.ariaRole??(un?"group":"img"),"aria-roledescription":"edge","data-id":g,"data-testid":`rf__edge-${g}`,"aria-label":be.ariaLabel===null?void 0:be.ariaLabel||`Edge from ${be.source} to ${be.target}`,"aria-describedby":un?`${C0n}-${se}`:void 0,ref:$t,...be.domAttributes,children:[!Y&&G.jsx(an,{id:g,source:be.source,target:be.target,type:be.type,selected:be.selected,animated:be.animated,selectable:Dn,deletable:be.deletable??!0,label:be.label,labelStyle:be.labelStyle,labelShowBg:be.labelShowBg,labelBgStyle:be.labelBgStyle,labelBgPadding:be.labelBgPadding,labelBgBorderRadius:be.labelBgBorderRadius,sourceX:Ze,sourceY:ln,targetX:En,targetY:nt,sourcePosition:Se,targetPosition:on,data:be.data,style:be.style,sourceHandleId:be.sourceHandle,targetHandleId:be.targetHandle,markerStart:ct,markerEnd:lt,pathOptions:"pathOptions"in be?be.pathOptions:void 0,interactionWidth:be.interactionWidth}),An&&G.jsx(NUn,{edge:be,isReconnectable:An,reconnectRadius:W,onReconnect:Z,onReconnectStart:ne,onReconnectEnd:le,sourceX:Ze,sourceY:ln,targetX:En,targetY:nt,sourcePosition:Se,targetPosition:on,setUpdateHover:et,setReconnecting:He})]})})}var _Un=Pe.memo(DUn);const IUn=g=>({edgesFocusable:g.edgesFocusable,edgesReconnectable:g.edgesReconnectable,elementsSelectable:g.elementsSelectable,connectionMode:g.connectionMode,onError:g.onError});function nbn({defaultMarkerColor:g,onlyRenderVisibleElements:E,rfId:M,edgeTypes:x,noPanClassName:O,onReconnect:P,onEdgeContextMenu:k,onEdgeMouseEnter:H,onEdgeMouseMove:q,onEdgeMouseLeave:F,onEdgeClick:W,reconnectRadius:Z,onEdgeDoubleClick:ne,onReconnectStart:le,onReconnectEnd:se,disableKeyboardA11y:ee}){const{edgesFocusable:Ce,edgesReconnectable:je,elementsSelectable:ze,onError:be}=Fu(IUn,Ol),De=mUn(E);return G.jsxs("div",{className:"react-flow__edges",children:[G.jsx(jUn,{defaultColor:g,rfId:M}),De.map(rn=>G.jsx(_Un,{id:rn,edgesFocusable:Ce,edgesReconnectable:je,elementsSelectable:ze,noPanClassName:O,onReconnect:P,onContextMenu:k,onMouseEnter:H,onMouseMove:q,onMouseLeave:F,onClick:W,reconnectRadius:Z,onDoubleClick:ne,onReconnectStart:le,onReconnectEnd:se,rfId:M,onError:be,edgeTypes:x,disableKeyboardA11y:ee},rn))]})}nbn.displayName="EdgeRenderer";const LUn=Pe.memo(nbn),PUn=g=>`translate(${g.transform[0]}px,${g.transform[1]}px) scale(${g.transform[2]})`;function $Un({children:g}){const E=Fu(PUn);return G.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:E},children:g})}function RUn(g){const E=Tke(),M=Pe.useRef(!1);Pe.useEffect(()=>{!M.current&&E.viewportInitialized&&g&&(setTimeout(()=>g(E),1),M.current=!0)},[g,E.viewportInitialized])}const BUn=g=>g.panZoom?.syncViewport;function zUn(g){const E=Fu(BUn),M=Nl();return Pe.useEffect(()=>{g&&(E?.(g),M.setState({transform:[g.x,g.y,g.zoom]}))},[g,E]),null}function FUn(g){return g.connection.inProgress?{...g.connection,to:uq(g.connection.to,g.transform)}:{...g.connection}}function HUn(g){return FUn}function JUn(g){const E=HUn();return Fu(E,Ol)}const GUn=g=>({nodesConnectable:g.nodesConnectable,isValid:g.connection.isValid,inProgress:g.connection.inProgress,width:g.width,height:g.height});function qUn({containerStyle:g,style:E,type:M,component:x}){const{nodesConnectable:O,width:P,height:k,isValid:H,inProgress:q}=Fu(GUn,Ol);return!(P&&O&&q)?null:G.jsx("svg",{style:g,width:P,height:k,className:"react-flow__connectionline react-flow__container",children:G.jsx("g",{className:$a(["react-flow__connection",e0n(H)]),children:G.jsx(tbn,{style:E,type:M,CustomComponent:x,isValid:H})})})}const tbn=({style:g,type:E=bk.Bezier,CustomComponent:M,isValid:x})=>{const{inProgress:O,from:P,fromNode:k,fromHandle:H,fromPosition:q,to:F,toNode:W,toHandle:Z,toPosition:ne,pointer:le}=JUn();if(!O)return;if(M)return G.jsx(M,{connectionLineType:E,connectionLineStyle:g,fromNode:k,fromHandle:H,fromX:P.x,fromY:P.y,toX:F.x,toY:F.y,fromPosition:q,toPosition:ne,connectionStatus:e0n(x),toNode:W,toHandle:Z,pointer:le});let se="";const ee={sourceX:P.x,sourceY:P.y,sourcePosition:q,targetX:F.x,targetY:F.y,targetPosition:ne};switch(E){case bk.Bezier:[se]=h0n(ee);break;case bk.SimpleBezier:[se]=J0n(ee);break;case bk.Step:[se]=Sue({...ee,borderRadius:0});break;case bk.SmoothStep:[se]=Sue(ee);break;default:[se]=b0n(ee)}return G.jsx("path",{d:se,fill:"none",className:"react-flow__connection-path",style:g})};tbn.displayName="ConnectionLine";const UUn={};function q1n(g=UUn){Pe.useRef(g),Nl(),Pe.useEffect(()=>{},[g])}function XUn(){Nl(),Pe.useRef(!1),Pe.useEffect(()=>{},[])}function ibn({nodeTypes:g,edgeTypes:E,onInit:M,onNodeClick:x,onEdgeClick:O,onNodeDoubleClick:P,onEdgeDoubleClick:k,onNodeMouseEnter:H,onNodeMouseMove:q,onNodeMouseLeave:F,onNodeContextMenu:W,onSelectionContextMenu:Z,onSelectionStart:ne,onSelectionEnd:le,connectionLineType:se,connectionLineStyle:ee,connectionLineComponent:Ce,connectionLineContainerStyle:je,selectionKeyCode:ze,selectionOnDrag:be,selectionMode:De,multiSelectionKeyCode:rn,panActivationKeyCode:an,zoomActivationKeyCode:un,deleteKeyCode:An,onlyRenderVisibleElements:Dn,elementsSelectable:$t,defaultViewport:In,translateExtent:et,minZoom:Y,maxZoom:He,preventScrolling:en,defaultMarkerColor:ke,zoomOnScroll:Ze,zoomOnPinch:ln,panOnScroll:En,panOnScrollSpeed:nt,panOnScrollMode:Se,zoomOnDoubleClick:on,panOnDrag:ct,onPaneClick:lt,onPaneMouseEnter:qt,onPaneMouseMove:wi,onPaneMouseLeave:li,onPaneScroll:Ut,onPaneContextMenu:ai,paneClickDistance:rc,nodeClickDistance:Qr,onEdgeContextMenu:vr,onEdgeMouseEnter:Si,onEdgeMouseMove:Ui,onEdgeMouseLeave:Su,reconnectRadius:uu,onReconnect:Js,onReconnectStart:fa,onReconnectEnd:bh,noDragClassName:aa,noWheelClassName:nu,noPanClassName:cl,disableKeyboardA11y:S0,nodeExtent:Dl,rfId:fw,viewport:A1,onViewportChange:qb}){return q1n(g),q1n(E),XUn(),RUn(M),zUn(A1),G.jsx(sUn,{onPaneClick:lt,onPaneMouseEnter:qt,onPaneMouseMove:wi,onPaneMouseLeave:li,onPaneContextMenu:ai,onPaneScroll:Ut,paneClickDistance:rc,deleteKeyCode:An,selectionKeyCode:ze,selectionOnDrag:be,selectionMode:De,onSelectionStart:ne,onSelectionEnd:le,multiSelectionKeyCode:rn,panActivationKeyCode:an,zoomActivationKeyCode:un,elementsSelectable:$t,zoomOnScroll:Ze,zoomOnPinch:ln,zoomOnDoubleClick:on,panOnScroll:En,panOnScrollSpeed:nt,panOnScrollMode:Se,panOnDrag:ct,defaultViewport:In,translateExtent:et,minZoom:Y,maxZoom:He,onSelectionContextMenu:Z,preventScrolling:en,noDragClassName:aa,noWheelClassName:nu,noPanClassName:cl,disableKeyboardA11y:S0,onViewportChange:qb,isControlledViewport:!!A1,children:G.jsxs($Un,{children:[G.jsx(LUn,{edgeTypes:E,onEdgeClick:O,onEdgeDoubleClick:k,onReconnect:Js,onReconnectStart:fa,onReconnectEnd:bh,onlyRenderVisibleElements:Dn,onEdgeContextMenu:vr,onEdgeMouseEnter:Si,onEdgeMouseMove:Ui,onEdgeMouseLeave:Su,reconnectRadius:uu,defaultMarkerColor:ke,noPanClassName:cl,disableKeyboardA11y:S0,rfId:fw}),G.jsx(qUn,{style:ee,type:se,component:Ce,containerStyle:je}),G.jsx("div",{className:"react-flow__edgelabel-renderer"}),G.jsx(pUn,{nodeTypes:g,onNodeClick:x,onNodeDoubleClick:P,onNodeMouseEnter:H,onNodeMouseMove:q,onNodeMouseLeave:F,onNodeContextMenu:W,nodeClickDistance:Qr,onlyRenderVisibleElements:Dn,noPanClassName:cl,noDragClassName:aa,disableKeyboardA11y:S0,nodeExtent:Dl,rfId:fw}),G.jsx("div",{className:"react-flow__viewport-portal"})]})})}ibn.displayName="GraphView";const VUn=Pe.memo(ibn),U1n=({nodes:g,edges:E,defaultNodes:M,defaultEdges:x,width:O,height:P,fitView:k,fitViewOptions:H,minZoom:q=.5,maxZoom:F=2,nodeOrigin:W,nodeExtent:Z,zIndexMode:ne="basic"}={})=>{const le=new Map,se=new Map,ee=new Map,Ce=new Map,je=x??E??[],ze=M??g??[],be=W??[0,0],De=Z??XG;p0n(ee,Ce,je);const{nodesInitialized:rn}=rke(ze,le,se,{nodeOrigin:be,nodeExtent:De,zIndexMode:ne});let an=[0,0,1];if(k&&O&&P){const un=rq(le,{filter:In=>!!((In.width||In.initialWidth)&&(In.height||In.initialHeight))}),{x:An,y:Dn,zoom:$t}=kke(un,O,P,q,F,H?.padding??.1);an=[An,Dn,$t]}return{rfId:"1",width:O??0,height:P??0,transform:an,nodes:ze,nodesInitialized:rn,nodeLookup:le,parentLookup:se,edges:je,edgeLookup:Ce,connectionLookup:ee,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:M!==void 0,hasDefaultEdges:x!==void 0,panZoom:null,minZoom:q,maxZoom:F,translateExtent:XG,nodeExtent:De,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:m_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:be,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:k??!1,fitViewOptions:H,fitViewResolver:null,connection:{...Zdn},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lGn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Wdn,zIndexMode:ne,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},KUn=({nodes:g,edges:E,defaultNodes:M,defaultEdges:x,width:O,height:P,fitView:k,fitViewOptions:H,minZoom:q,maxZoom:F,nodeOrigin:W,nodeExtent:Z,zIndexMode:ne})=>dqn((le,se)=>{async function ee(){const{nodeLookup:Ce,panZoom:je,fitViewOptions:ze,fitViewResolver:be,width:De,height:rn,minZoom:an,maxZoom:un}=se();je&&(await oGn({nodes:Ce,width:De,height:rn,panZoom:je,minZoom:an,maxZoom:un},ze),be?.resolve(!0),le({fitViewResolver:null}))}return{...U1n({nodes:g,edges:E,width:O,height:P,fitView:k,fitViewOptions:H,minZoom:q,maxZoom:F,nodeOrigin:W,nodeExtent:Z,defaultNodes:M,defaultEdges:x,zIndexMode:ne}),setNodes:Ce=>{const{nodeLookup:je,parentLookup:ze,nodeOrigin:be,elevateNodesOnSelect:De,fitViewQueued:rn,zIndexMode:an,nodesSelectionActive:un}=se(),{nodesInitialized:An,hasSelectedNodes:Dn}=rke(Ce,je,ze,{nodeOrigin:be,nodeExtent:Z,elevateNodesOnSelect:De,checkEquality:!0,zIndexMode:an}),$t=un&&Dn;rn&&An?(ee(),le({nodes:Ce,nodesInitialized:An,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:$t})):le({nodes:Ce,nodesInitialized:An,nodesSelectionActive:$t})},setEdges:Ce=>{const{connectionLookup:je,edgeLookup:ze}=se();p0n(je,ze,Ce),le({edges:Ce})},setDefaultNodesAndEdges:(Ce,je)=>{if(Ce){const{setNodes:ze}=se();ze(Ce),le({hasDefaultNodes:!0})}if(je){const{setEdges:ze}=se();ze(je),le({hasDefaultEdges:!0})}},updateNodeInternals:Ce=>{const{triggerNodeChanges:je,nodeLookup:ze,parentLookup:be,domNode:De,nodeOrigin:rn,nodeExtent:an,debug:un,fitViewQueued:An,zIndexMode:Dn}=se(),{changes:$t,updatedInternals:In}=NGn(Ce,ze,be,De,rn,an,Dn);In&&(xGn(ze,be,{nodeOrigin:rn,nodeExtent:an,zIndexMode:Dn}),An?(ee(),le({fitViewQueued:!1,fitViewOptions:void 0})):le({}),$t?.length>0&&(un&&console.log("React Flow: trigger node changes",$t),je?.($t)))},updateNodePositions:(Ce,je=!1)=>{const ze=[];let be=[];const{nodeLookup:De,triggerNodeChanges:rn,connection:an,updateConnection:un,onNodesChangeMiddlewareMap:An}=se();for(const[Dn,$t]of Ce){const In=De.get(Dn),et=!!(In?.expandParent&&In?.parentId&&$t?.position),Y={id:Dn,type:"position",position:et?{x:Math.max(0,$t.position.x),y:Math.max(0,$t.position.y)}:$t.position,dragging:je};if(In&&an.inProgress&&an.fromNode.id===In.id){const He=IA(In,an.fromHandle,er.Left,!0);un({...an,from:He})}et&&In.parentId&&ze.push({id:Dn,parentId:In.parentId,rect:{...$t.internals.positionAbsolute,width:$t.measured.width??0,height:$t.measured.height??0}}),be.push(Y)}if(ze.length>0){const{parentLookup:Dn,nodeOrigin:$t}=se(),In=xke(ze,De,Dn,$t);be.push(...In)}for(const Dn of An.values())be=Dn(be);rn(be)},triggerNodeChanges:Ce=>{const{onNodesChange:je,setNodes:ze,nodes:be,hasDefaultNodes:De,debug:rn}=se();if(Ce?.length){if(De){const an=D0n(Ce,be);ze(an)}rn&&console.log("React Flow: trigger node changes",Ce),je?.(Ce)}},triggerEdgeChanges:Ce=>{const{onEdgesChange:je,setEdges:ze,edges:be,hasDefaultEdges:De,debug:rn}=se();if(Ce?.length){if(De){const an=_0n(Ce,be);ze(an)}rn&&console.log("React Flow: trigger edge changes",Ce),je?.(Ce)}},addSelectedNodes:Ce=>{const{multiSelectionActive:je,edgeLookup:ze,nodeLookup:be,triggerNodeChanges:De,triggerEdgeChanges:rn}=se();if(je){const an=Ce.map(un=>xA(un,!0));De(an);return}De(d_(be,new Set([...Ce]),!0)),rn(d_(ze))},addSelectedEdges:Ce=>{const{multiSelectionActive:je,edgeLookup:ze,nodeLookup:be,triggerNodeChanges:De,triggerEdgeChanges:rn}=se();if(je){const an=Ce.map(un=>xA(un,!0));rn(an);return}rn(d_(ze,new Set([...Ce]))),De(d_(be,new Set,!0))},unselectNodesAndEdges:({nodes:Ce,edges:je}={})=>{const{edges:ze,nodes:be,nodeLookup:De,triggerNodeChanges:rn,triggerEdgeChanges:an}=se(),un=Ce||be,An=je||ze,Dn=[];for(const In of un){if(!In.selected)continue;const et=De.get(In.id);et&&(et.selected=!1),Dn.push(xA(In.id,!1))}const $t=[];for(const In of An)In.selected&&$t.push(xA(In.id,!1));rn(Dn),an($t)},setMinZoom:Ce=>{const{panZoom:je,maxZoom:ze}=se();je?.setScaleExtent([Ce,ze]),le({minZoom:Ce})},setMaxZoom:Ce=>{const{panZoom:je,minZoom:ze}=se();je?.setScaleExtent([ze,Ce]),le({maxZoom:Ce})},setTranslateExtent:Ce=>{se().panZoom?.setTranslateExtent(Ce),le({translateExtent:Ce})},resetSelectedElements:()=>{const{edges:Ce,nodes:je,triggerNodeChanges:ze,triggerEdgeChanges:be,elementsSelectable:De}=se();if(!De)return;const rn=je.reduce((un,An)=>An.selected?[...un,xA(An.id,!1)]:un,[]),an=Ce.reduce((un,An)=>An.selected?[...un,xA(An.id,!1)]:un,[]);ze(rn),be(an)},setNodeExtent:Ce=>{const{nodes:je,nodeLookup:ze,parentLookup:be,nodeOrigin:De,elevateNodesOnSelect:rn,nodeExtent:an,zIndexMode:un}=se();Ce[0][0]===an[0][0]&&Ce[0][1]===an[0][1]&&Ce[1][0]===an[1][0]&&Ce[1][1]===an[1][1]||(rke(je,ze,be,{nodeOrigin:De,nodeExtent:Ce,elevateNodesOnSelect:rn,checkEquality:!1,zIndexMode:un}),le({nodeExtent:Ce}))},panBy:Ce=>{const{transform:je,width:ze,height:be,panZoom:De,translateExtent:rn}=se();return DGn({delta:Ce,panZoom:De,transform:je,translateExtent:rn,width:ze,height:be})},setCenter:async(Ce,je,ze)=>{const{width:be,height:De,maxZoom:rn,panZoom:an}=se();if(!an)return Promise.resolve(!1);const un=typeof ze?.zoom<"u"?ze.zoom:rn;return await an.setViewport({x:be/2-Ce*un,y:De/2-je*un,zoom:un},{duration:ze?.duration,ease:ze?.ease,interpolate:ze?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{le({connection:{...Zdn}})},updateConnection:Ce=>{le({connection:Ce})},reset:()=>le({...U1n()})}},Object.is);function QUn({initialNodes:g,initialEdges:E,defaultNodes:M,defaultEdges:x,initialWidth:O,initialHeight:P,initialMinZoom:k,initialMaxZoom:H,initialFitViewOptions:q,fitView:F,nodeOrigin:W,nodeExtent:Z,zIndexMode:ne,children:le}){const[se]=Pe.useState(()=>KUn({nodes:g,edges:E,defaultNodes:M,defaultEdges:x,width:O,height:P,fitView:F,minZoom:k,maxZoom:H,fitViewOptions:q,nodeOrigin:W,nodeExtent:Z,zIndexMode:ne}));return G.jsx(gqn,{value:se,children:G.jsx($qn,{children:le})})}function YUn({children:g,nodes:E,edges:M,defaultNodes:x,defaultEdges:O,width:P,height:k,fitView:H,fitViewOptions:q,minZoom:F,maxZoom:W,nodeOrigin:Z,nodeExtent:ne,zIndexMode:le}){return Pe.useContext($ue)?G.jsx(G.Fragment,{children:g}):G.jsx(QUn,{initialNodes:E,initialEdges:M,defaultNodes:x,defaultEdges:O,initialWidth:P,initialHeight:k,fitView:H,initialFitViewOptions:q,initialMinZoom:F,initialMaxZoom:W,nodeOrigin:Z,nodeExtent:ne,zIndexMode:le,children:g})}const WUn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ZUn({nodes:g,edges:E,defaultNodes:M,defaultEdges:x,className:O,nodeTypes:P,edgeTypes:k,onNodeClick:H,onEdgeClick:q,onInit:F,onMove:W,onMoveStart:Z,onMoveEnd:ne,onConnect:le,onConnectStart:se,onConnectEnd:ee,onClickConnectStart:Ce,onClickConnectEnd:je,onNodeMouseEnter:ze,onNodeMouseMove:be,onNodeMouseLeave:De,onNodeContextMenu:rn,onNodeDoubleClick:an,onNodeDragStart:un,onNodeDrag:An,onNodeDragStop:Dn,onNodesDelete:$t,onEdgesDelete:In,onDelete:et,onSelectionChange:Y,onSelectionDragStart:He,onSelectionDrag:en,onSelectionDragStop:ke,onSelectionContextMenu:Ze,onSelectionStart:ln,onSelectionEnd:En,onBeforeDelete:nt,connectionMode:Se,connectionLineType:on=bk.Bezier,connectionLineStyle:ct,connectionLineComponent:lt,connectionLineContainerStyle:qt,deleteKeyCode:wi="Backspace",selectionKeyCode:li="Shift",selectionOnDrag:Ut=!1,selectionMode:ai=VG.Full,panActivationKeyCode:rc="Space",multiSelectionKeyCode:Qr=YG()?"Meta":"Control",zoomActivationKeyCode:vr=YG()?"Meta":"Control",snapToGrid:Si,snapGrid:Ui,onlyRenderVisibleElements:Su=!1,selectNodesOnDrag:uu,nodesDraggable:Js,autoPanOnNodeFocus:fa,nodesConnectable:bh,nodesFocusable:aa,nodeOrigin:nu=O0n,edgesFocusable:cl,edgesReconnectable:S0,elementsSelectable:Dl=!0,defaultViewport:fw=Tqn,minZoom:A1=.5,maxZoom:qb=2,translateExtent:x1=XG,preventScrolling:S3=!0,nodeExtent:Ub,defaultMarkerColor:M0="#b1b1b7",zoomOnScroll:S6=!0,zoomOnPinch:ha=!0,panOnScroll:Gs=!1,panOnScrollSpeed:qh=.5,panOnScrollMode:Ho=OA.Free,zoomOnDoubleClick:Sd=!0,panOnDrag:M6=!0,onPaneClick:A6,onPaneMouseEnter:aw,onPaneMouseMove:hw,onPaneMouseLeave:Xb,onPaneScroll:T1,onPaneContextMenu:Nf,paneClickDistance:dw=1,nodeClickDistance:A0=0,children:x0,onReconnect:M3,onReconnectStart:T0,onReconnectEnd:Q2,onEdgeContextMenu:bw,onEdgeDoubleClick:gw,onEdgeMouseEnter:gh,onEdgeMouseMove:cs,onEdgeMouseLeave:C1,reconnectRadius:I4=10,onNodesChange:Uh,onEdgesChange:_l,noDragClassName:Jo="nodrag",noWheelClassName:ul="nowheel",noPanClassName:wh="nopan",fitView:ww,fitViewOptions:Vb,connectOnClick:A3,attributionPosition:Y2,proOptions:C0,defaultEdgeOptions:O1,elevateNodesOnSelect:N1=!0,elevateEdgesOnSelect:D1=!1,disableKeyboardA11y:O0=!1,autoPanOnConnect:Ra,autoPanOnNodeDrag:us,autoPanSpeed:Xh,connectionRadius:pw,isValidConnection:qs,onError:_1,style:W2,id:mw,nodeDragThreshold:L4,connectionDragThreshold:x3,viewport:vw,onViewportChange:Z2,width:Il,height:Df,colorMode:P4="light",debug:x6,onScroll:ep,ariaLabelConfig:$4,zIndexMode:yw="basic",...Zn},Ft){const nr=mw||"1",Sr=Dqn(P4),ms=Pe.useCallback(N0=>{N0.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ep?.(N0)},[ep]);return G.jsx("div",{"data-testid":"rf__wrapper",...Zn,onScroll:ms,style:{...W2,...WUn},ref:Ft,className:$a(["react-flow",O,Sr]),id:mw,role:"application",children:G.jsxs(YUn,{nodes:g,edges:E,width:Il,height:Df,fitView:ww,fitViewOptions:Vb,minZoom:A1,maxZoom:qb,nodeOrigin:nu,nodeExtent:Ub,zIndexMode:yw,children:[G.jsx(Nqn,{nodes:g,edges:E,defaultNodes:M,defaultEdges:x,onConnect:le,onConnectStart:se,onConnectEnd:ee,onClickConnectStart:Ce,onClickConnectEnd:je,nodesDraggable:Js,autoPanOnNodeFocus:fa,nodesConnectable:bh,nodesFocusable:aa,edgesFocusable:cl,edgesReconnectable:S0,elementsSelectable:Dl,elevateNodesOnSelect:N1,elevateEdgesOnSelect:D1,minZoom:A1,maxZoom:qb,nodeExtent:Ub,onNodesChange:Uh,onEdgesChange:_l,snapToGrid:Si,snapGrid:Ui,connectionMode:Se,translateExtent:x1,connectOnClick:A3,defaultEdgeOptions:O1,fitView:ww,fitViewOptions:Vb,onNodesDelete:$t,onEdgesDelete:In,onDelete:et,onNodeDragStart:un,onNodeDrag:An,onNodeDragStop:Dn,onSelectionDrag:en,onSelectionDragStart:He,onSelectionDragStop:ke,onMove:W,onMoveStart:Z,onMoveEnd:ne,noPanClassName:wh,nodeOrigin:nu,rfId:nr,autoPanOnConnect:Ra,autoPanOnNodeDrag:us,autoPanSpeed:Xh,onError:_1,connectionRadius:pw,isValidConnection:qs,selectNodesOnDrag:uu,nodeDragThreshold:L4,connectionDragThreshold:x3,onBeforeDelete:nt,debug:x6,ariaLabelConfig:$4,zIndexMode:yw}),G.jsx(VUn,{onInit:F,onNodeClick:H,onEdgeClick:q,onNodeMouseEnter:ze,onNodeMouseMove:be,onNodeMouseLeave:De,onNodeContextMenu:rn,onNodeDoubleClick:an,nodeTypes:P,edgeTypes:k,connectionLineType:on,connectionLineStyle:ct,connectionLineComponent:lt,connectionLineContainerStyle:qt,selectionKeyCode:li,selectionOnDrag:Ut,selectionMode:ai,deleteKeyCode:wi,multiSelectionKeyCode:Qr,panActivationKeyCode:rc,zoomActivationKeyCode:vr,onlyRenderVisibleElements:Su,defaultViewport:fw,translateExtent:x1,minZoom:A1,maxZoom:qb,preventScrolling:S3,zoomOnScroll:S6,zoomOnPinch:ha,zoomOnDoubleClick:Sd,panOnScroll:Gs,panOnScrollSpeed:qh,panOnScrollMode:Ho,panOnDrag:M6,onPaneClick:A6,onPaneMouseEnter:aw,onPaneMouseMove:hw,onPaneMouseLeave:Xb,onPaneScroll:T1,onPaneContextMenu:Nf,paneClickDistance:dw,nodeClickDistance:A0,onSelectionContextMenu:Ze,onSelectionStart:ln,onSelectionEnd:En,onReconnect:M3,onReconnectStart:T0,onReconnectEnd:Q2,onEdgeContextMenu:bw,onEdgeDoubleClick:gw,onEdgeMouseEnter:gh,onEdgeMouseMove:cs,onEdgeMouseLeave:C1,reconnectRadius:I4,defaultMarkerColor:M0,noDragClassName:Jo,noWheelClassName:ul,noPanClassName:wh,rfId:nr,disableKeyboardA11y:O0,nodeExtent:Ub,viewport:vw,onViewportChange:Z2}),G.jsx(xqn,{onSelectionChange:Y}),x0,G.jsx(Eqn,{proOptions:C0,position:Y2}),G.jsx(kqn,{rfId:nr,disableKeyboardA11y:O0})]})})}var eXn=I0n(ZUn);const nXn=g=>g.domNode?.querySelector(".react-flow__edgelabel-renderer");function tXn({children:g}){const E=Fu(nXn);return E?bqn.createPortal(g,E):null}function iXn(g){const[E,M]=Pe.useState(g),x=Pe.useCallback(O=>M(P=>D0n(O,P)),[]);return[E,M,x]}function rXn(g){const[E,M]=Pe.useState(g),x=Pe.useCallback(O=>M(P=>_0n(O,P)),[]);return[E,M,x]}function cXn({dimensions:g,lineWidth:E,variant:M,className:x}){return G.jsx("path",{strokeWidth:E,d:`M${g[0]/2} 0 V${g[1]} M0 ${g[1]/2} H${g[0]}`,className:$a(["react-flow__background-pattern",M,x])})}function uXn({radius:g,className:E}){return G.jsx("circle",{cx:g,cy:g,r:g,className:$a(["react-flow__background-pattern","dots",E])})}var gk;(function(g){g.Lines="lines",g.Dots="dots",g.Cross="cross"})(gk||(gk={}));const oXn={[gk.Dots]:1,[gk.Lines]:1,[gk.Cross]:6},sXn=g=>({transform:g.transform,patternId:`pattern-${g.rfId}`});function rbn({id:g,variant:E=gk.Dots,gap:M=20,size:x,lineWidth:O=1,offset:P=0,color:k,bgColor:H,style:q,className:F,patternClassName:W}){const Z=Pe.useRef(null),{transform:ne,patternId:le}=Fu(sXn,Ol),se=x||oXn[E],ee=E===gk.Dots,Ce=E===gk.Cross,je=Array.isArray(M)?M:[M,M],ze=[je[0]*ne[2]||1,je[1]*ne[2]||1],be=se*ne[2],De=Array.isArray(P)?P:[P,P],rn=Ce?[be,be]:ze,an=[De[0]*ne[2]||1+rn[0]/2,De[1]*ne[2]||1+rn[1]/2],un=`${le}${g||""}`;return G.jsxs("svg",{className:$a(["react-flow__background",F]),style:{...q,...Bue,"--xy-background-color-props":H,"--xy-background-pattern-color-props":k},ref:Z,"data-testid":"rf__background",children:[G.jsx("pattern",{id:un,x:ne[0]%ze[0],y:ne[1]%ze[1],width:ze[0],height:ze[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${an[0]},-${an[1]})`,children:ee?G.jsx(uXn,{radius:be/2,className:W}):G.jsx(cXn,{dimensions:rn,lineWidth:O,variant:E,className:W})}),G.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${un})`})]})}rbn.displayName="Background";const lXn=Pe.memo(rbn);function fXn(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:G.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function aXn(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:G.jsx("path",{d:"M0 0h32v4.2H0z"})})}function hXn(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:G.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"})})}function dXn(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.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"})})}function bXn(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.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"})})}function uue({children:g,className:E,...M}){return G.jsx("button",{type:"button",className:$a(["react-flow__controls-button",E]),...M,children:g})}const gXn=g=>({isInteractive:g.nodesDraggable||g.nodesConnectable||g.elementsSelectable,minZoomReached:g.transform[2]<=g.minZoom,maxZoomReached:g.transform[2]>=g.maxZoom,ariaLabelConfig:g.ariaLabelConfig});function cbn({style:g,showZoom:E=!0,showFitView:M=!0,showInteractive:x=!0,fitViewOptions:O,onZoomIn:P,onZoomOut:k,onFitView:H,onInteractiveChange:q,className:F,children:W,position:Z="bottom-left",orientation:ne="vertical","aria-label":le}){const se=Nl(),{isInteractive:ee,minZoomReached:Ce,maxZoomReached:je,ariaLabelConfig:ze}=Fu(gXn,Ol),{zoomIn:be,zoomOut:De,fitView:rn}=Tke(),an=()=>{be(),P?.()},un=()=>{De(),k?.()},An=()=>{rn(O),H?.()},Dn=()=>{se.setState({nodesDraggable:!ee,nodesConnectable:!ee,elementsSelectable:!ee}),q?.(!ee)},$t=ne==="horizontal"?"horizontal":"vertical";return G.jsxs(Rue,{className:$a(["react-flow__controls",$t,F]),position:Z,style:g,"data-testid":"rf__controls","aria-label":le??ze["controls.ariaLabel"],children:[E&&G.jsxs(G.Fragment,{children:[G.jsx(uue,{onClick:an,className:"react-flow__controls-zoomin",title:ze["controls.zoomIn.ariaLabel"],"aria-label":ze["controls.zoomIn.ariaLabel"],disabled:je,children:G.jsx(fXn,{})}),G.jsx(uue,{onClick:un,className:"react-flow__controls-zoomout",title:ze["controls.zoomOut.ariaLabel"],"aria-label":ze["controls.zoomOut.ariaLabel"],disabled:Ce,children:G.jsx(aXn,{})})]}),M&&G.jsx(uue,{className:"react-flow__controls-fitview",onClick:An,title:ze["controls.fitView.ariaLabel"],"aria-label":ze["controls.fitView.ariaLabel"],children:G.jsx(hXn,{})}),x&&G.jsx(uue,{className:"react-flow__controls-interactive",onClick:Dn,title:ze["controls.interactive.ariaLabel"],"aria-label":ze["controls.interactive.ariaLabel"],children:ee?G.jsx(bXn,{}):G.jsx(dXn,{})}),W]})}cbn.displayName="Controls";const wXn=Pe.memo(cbn);function pXn({id:g,x:E,y:M,width:x,height:O,style:P,color:k,strokeColor:H,strokeWidth:q,className:F,borderRadius:W,shapeRendering:Z,selected:ne,onClick:le}){const{background:se,backgroundColor:ee}=P||{},Ce=k||se||ee;return G.jsx("rect",{className:$a(["react-flow__minimap-node",{selected:ne},F]),x:E,y:M,rx:W,ry:W,width:x,height:O,style:{fill:Ce,stroke:H,strokeWidth:q},shapeRendering:Z,onClick:le?je=>le(je,g):void 0})}const mXn=Pe.memo(pXn),vXn=g=>g.nodes.map(E=>E.id),q7e=g=>g instanceof Function?g:()=>g;function yXn({nodeStrokeColor:g,nodeColor:E,nodeClassName:M="",nodeBorderRadius:x=5,nodeStrokeWidth:O,nodeComponent:P=mXn,onClick:k}){const H=Fu(vXn,Ol),q=q7e(E),F=q7e(g),W=q7e(M),Z=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return G.jsx(G.Fragment,{children:H.map(ne=>G.jsx(EXn,{id:ne,nodeColorFunc:q,nodeStrokeColorFunc:F,nodeClassNameFunc:W,nodeBorderRadius:x,nodeStrokeWidth:O,NodeComponent:P,onClick:k,shapeRendering:Z},ne))})}function kXn({id:g,nodeColorFunc:E,nodeStrokeColorFunc:M,nodeClassNameFunc:x,nodeBorderRadius:O,nodeStrokeWidth:P,shapeRendering:k,NodeComponent:H,onClick:q}){const{node:F,x:W,y:Z,width:ne,height:le}=Fu(se=>{const ee=se.nodeLookup.get(g);if(!ee)return{node:void 0,x:0,y:0,width:0,height:0};const Ce=ee.internals.userNode,{x:je,y:ze}=ee.internals.positionAbsolute,{width:be,height:De}=j6(Ce);return{node:Ce,x:je,y:ze,width:be,height:De}},Ol);return!F||F.hidden||!u0n(F)?null:G.jsx(H,{x:W,y:Z,width:ne,height:le,style:F.style,selected:!!F.selected,className:x(F),color:E(F),borderRadius:O,strokeColor:M(F),strokeWidth:P,shapeRendering:k,onClick:q,id:F.id})}const EXn=Pe.memo(kXn);var jXn=Pe.memo(yXn);const SXn=200,MXn=150,AXn=g=>!g.hidden,xXn=g=>{const E={x:-g.transform[0]/g.transform[2],y:-g.transform[1]/g.transform[2],width:g.width/g.transform[2],height:g.height/g.transform[2]};return{viewBB:E,boundingRect:g.nodeLookup.size>0?c0n(rq(g.nodeLookup,{filter:AXn}),E):E,rfId:g.rfId,panZoom:g.panZoom,translateExtent:g.translateExtent,flowWidth:g.width,flowHeight:g.height,ariaLabelConfig:g.ariaLabelConfig}},TXn="react-flow__minimap-desc";function ubn({style:g,className:E,nodeStrokeColor:M,nodeColor:x,nodeClassName:O="",nodeBorderRadius:P=5,nodeStrokeWidth:k,nodeComponent:H,bgColor:q,maskColor:F,maskStrokeColor:W,maskStrokeWidth:Z,position:ne="bottom-right",onClick:le,onNodeClick:se,pannable:ee=!1,zoomable:Ce=!1,ariaLabel:je,inversePan:ze,zoomStep:be=1,offsetScale:De=5}){const rn=Nl(),an=Pe.useRef(null),{boundingRect:un,viewBB:An,rfId:Dn,panZoom:$t,translateExtent:In,flowWidth:et,flowHeight:Y,ariaLabelConfig:He}=Fu(xXn,Ol),en=g?.width??SXn,ke=g?.height??MXn,Ze=un.width/en,ln=un.height/ke,En=Math.max(Ze,ln),nt=En*en,Se=En*ke,on=De*En,ct=un.x-(nt-un.width)/2-on,lt=un.y-(Se-un.height)/2-on,qt=nt+on*2,wi=Se+on*2,li=`${TXn}-${Dn}`,Ut=Pe.useRef(0),ai=Pe.useRef();Ut.current=En,Pe.useEffect(()=>{if(an.current&&$t)return ai.current=FGn({domNode:an.current,panZoom:$t,getTransform:()=>rn.getState().transform,getViewScale:()=>Ut.current}),()=>{ai.current?.destroy()}},[$t]),Pe.useEffect(()=>{ai.current?.update({translateExtent:In,width:et,height:Y,inversePan:ze,pannable:ee,zoomStep:be,zoomable:Ce})},[ee,Ce,ze,be,In,et,Y]);const rc=le?Si=>{const[Ui,Su]=ai.current?.pointer(Si)||[0,0];le(Si,{x:Ui,y:Su})}:void 0,Qr=se?Pe.useCallback((Si,Ui)=>{const Su=rn.getState().nodeLookup.get(Ui).internals.userNode;se(Si,Su)},[]):void 0,vr=je??He["minimap.ariaLabel"];return G.jsx(Rue,{position:ne,style:{...g,"--xy-minimap-background-color-props":typeof q=="string"?q:void 0,"--xy-minimap-mask-background-color-props":typeof F=="string"?F:void 0,"--xy-minimap-mask-stroke-color-props":typeof W=="string"?W:void 0,"--xy-minimap-mask-stroke-width-props":typeof Z=="number"?Z*En:void 0,"--xy-minimap-node-background-color-props":typeof x=="string"?x:void 0,"--xy-minimap-node-stroke-color-props":typeof M=="string"?M:void 0,"--xy-minimap-node-stroke-width-props":typeof k=="number"?k:void 0},className:$a(["react-flow__minimap",E]),"data-testid":"rf__minimap",children:G.jsxs("svg",{width:en,height:ke,viewBox:`${ct} ${lt} ${qt} ${wi}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":li,ref:an,onClick:rc,children:[vr&&G.jsx("title",{id:li,children:vr}),G.jsx(jXn,{onClick:Qr,nodeColor:x,nodeStrokeColor:M,nodeBorderRadius:P,nodeClassName:O,nodeStrokeWidth:k,nodeComponent:H}),G.jsx("path",{className:"react-flow__minimap-mask",d:`M${ct-on},${lt-on}h${qt+on*2}v${wi+on*2}h${-qt-on*2}z - M${An.x},${An.y}h${An.width}v${An.height}h${-An.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ubn.displayName="MiniMap";const CXn=Pe.memo(ubn),OXn=g=>E=>g?`${Math.max(1/E.transform[2],1)}`:void 0,NXn={[E_.Line]:"right",[E_.Handle]:"bottom-right"};function DXn({nodeId:g,position:E,variant:M=E_.Handle,className:x,style:O=void 0,children:P,color:k,minWidth:H=10,minHeight:q=10,maxWidth:F=Number.MAX_VALUE,maxHeight:W=Number.MAX_VALUE,keepAspectRatio:Z=!1,resizeDirection:ne,autoScale:le=!0,shouldResize:se,onResizeStart:ee,onResize:Ce,onResizeEnd:je}){const ze=R0n(),be=typeof g=="string"?g:ze,De=Nl(),rn=Pe.useRef(null),an=M===E_.Handle,un=Fu(Pe.useCallback(OXn(an&&le),[an,le]),Ol),An=Pe.useRef(null),Dn=E??NXn[M];Pe.useEffect(()=>{if(!(!rn.current||!be))return An.current||(An.current=nqn({domNode:rn.current,nodeId:be,getStoreItems:()=>{const{nodeLookup:In,transform:et,snapGrid:Y,snapToGrid:He,nodeOrigin:en,domNode:ke}=De.getState();return{nodeLookup:In,transform:et,snapGrid:Y,snapToGrid:He,nodeOrigin:en,paneDomNode:ke}},onChange:(In,et)=>{const{triggerNodeChanges:Y,nodeLookup:He,parentLookup:en,nodeOrigin:ke}=De.getState(),Ze=[],ln={x:In.x,y:In.y},En=He.get(be);if(En&&En.expandParent&&En.parentId){const nt=En.origin??ke,Se=In.width??En.measured.width??0,on=In.height??En.measured.height??0,ct={id:En.id,parentId:En.parentId,rect:{width:Se,height:on,...o0n({x:In.x??En.position.x,y:In.y??En.position.y},{width:Se,height:on},En.parentId,He,nt)}},lt=xke([ct],He,en,ke);Ze.push(...lt),ln.x=In.x?Math.max(nt[0]*Se,In.x):void 0,ln.y=In.y?Math.max(nt[1]*on,In.y):void 0}if(ln.x!==void 0&&ln.y!==void 0){const nt={id:be,type:"position",position:{...ln}};Ze.push(nt)}if(In.width!==void 0&&In.height!==void 0){const Se={id:be,type:"dimensions",resizing:!0,setAttributes:ne?ne==="horizontal"?"width":"height":!0,dimensions:{width:In.width,height:In.height}};Ze.push(Se)}for(const nt of et){const Se={...nt,type:"position"};Ze.push(Se)}Y(Ze)},onEnd:({width:In,height:et})=>{const Y={id:be,type:"dimensions",resizing:!1,dimensions:{width:In,height:et}};De.getState().triggerNodeChanges([Y])}})),An.current.update({controlPosition:Dn,boundaries:{minWidth:H,minHeight:q,maxWidth:F,maxHeight:W},keepAspectRatio:Z,resizeDirection:ne,onResizeStart:ee,onResize:Ce,onResizeEnd:je,shouldResize:se}),()=>{An.current?.destroy()}},[Dn,H,q,F,W,Z,ee,Ce,je,se]);const $t=Dn.split("-");return G.jsx("div",{className:$a(["react-flow__resize-control","nodrag",...$t,M,x]),ref:rn,style:{...O,scale:un,...k&&{[an?"backgroundColor":"borderColor"]:k}},children:P})}Pe.memo(DXn);const _Xn=g=>g.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),obn=(...g)=>g.filter((E,M,x)=>!!E&&E.trim()!==""&&x.indexOf(E)===M).join(" ").trim();var IXn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const LXn=Pe.forwardRef(({color:g="currentColor",size:E=24,strokeWidth:M=2,absoluteStrokeWidth:x,className:O="",children:P,iconNode:k,...H},q)=>Pe.createElement("svg",{ref:q,...IXn,width:E,height:E,stroke:g,strokeWidth:x?Number(M)*24/Number(E):M,className:obn("lucide",O),...H},[...k.map(([F,W])=>Pe.createElement(F,W)),...Array.isArray(P)?P:[P]]));const Gh=(g,E)=>{const M=Pe.forwardRef(({className:x,...O},P)=>Pe.createElement(LXn,{ref:P,iconNode:E,className:obn(`lucide-${_Xn(g)}`,x),...O}));return M.displayName=`${g}`,M};const Aue=Gh("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const PXn=Gh("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const sbn=Gh("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const $Xn=Gh("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const RXn=Gh("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);const oue=Gh("GitPullRequestArrow",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]]);const X1n=Gh("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const BXn=Gh("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const ske=Gh("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const zXn=Gh("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);const FXn=Gh("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const HXn=Gh("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const JXn=Gh("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const ZG=Gh("ScissorsLineDashed",[["path",{d:"M5.42 9.42 8 12",key:"12pkuq"}],["circle",{cx:"4",cy:"8",r:"2",key:"107mxr"}],["path",{d:"m14 6-8.58 8.58",key:"gvzu5l"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"M10.8 14.8 14 18",key:"ax7m9r"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}]]);const GXn=Gh("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const qXn=Gh("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const V1n=Gh("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const zue=Gh("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function UXn({id:g,sourceX:E,sourceY:M,targetX:x,targetY:O,sourcePosition:P=er.Right,targetPosition:k=er.Left,markerEnd:H,style:q,data:F}){const[W,Z,ne]=Sue({sourceX:E,sourceY:M,sourcePosition:P,targetX:x,targetY:O,targetPosition:k,borderRadius:18,offset:28});if(!F)return G.jsx(j_,{id:g,path:W,markerEnd:H,style:q,interactionWidth:18});const le=F?.label,se=F?.sourceVariable&&F?.targetVariable&&F.sourceVariable!==F.targetVariable,ee=F?.kind==="hard_dependency"&&!F.sourcePort&&!F.targetPort,Ce=!!le&&!se&&!ee,je=F?.scaleRelation==="multiscale"&&!ee,ze=Ce||je,be=!!F?.highlighted,De=!!F?.dimmed;return G.jsxs(G.Fragment,{children:[G.jsx(j_,{id:g,path:W,markerEnd:H,style:q,interactionWidth:18}),ze&&G.jsxs(tXn,{children:[G.jsx(K1n,{className:`edge-terminal source ${F.kind} ${F.scaleRelation} ${be?"highlighted":""} ${F.focused?"focused":""} ${De?"dimmed":""}`,x:E,y:M,side:P,color:Q1n(F,be)}),G.jsx(K1n,{className:`edge-terminal target ${F.kind} ${F.scaleRelation} ${be?"highlighted":""} ${F.focused?"focused":""} ${De?"dimmed":""}`,x,y:O,side:k,color:Q1n(F,be)}),G.jsxs("div",{className:`edge-chip ${F.kind} ${F.scaleRelation} ${be?"highlighted":""} ${F.focused?"focused":""} ${De?"dimmed":""}`,style:{transform:`translate(-50%, -50%) translate(${Z}px, ${ne-14}px)`},children:[Ce&&G.jsx("span",{children:le}),je&&G.jsx("small",{children:"multiscale"})]})]})]})}function K1n({className:g,x:E,y:M,side:x,color:O}){const P=g.includes("target")?x===er.Left?-9:9:x===er.Left?9:-9;return G.jsx("div",{className:g,"data-side":x,style:{transform:`translate(-50%, -50%) translate(${E+P}px, ${M}px)`,"--terminal-color":O}})}function Q1n(g,E){return E?"#1f7a53":g.kind==="cycle_dependency"||g.diagnostics.some(M=>M.includes("Cycle edge"))?"#d3422f":g.kind==="hard_dependency"?"#bf6a54":g.kind==="mapped_variable"||g.scaleRelation==="multiscale"?"#1f7a53":"#b7a696"}const XXn=312,VXn=620,KXn=24,QXn=10,YXn=26,WXn=8.1;function lbn(g){if(g.viewMode==="overview")return 184;const E=Y1n(g.inputs),M=Y1n(g.outputs),x=W1n(E),O=W1n(M);return ZXn(Math.ceil(KXn+x+QXn+O),XXn,VXn)}function Y1n(g){return g.reduce((E,M)=>Math.max(E,M.name.length),0)}function W1n(g){return Math.ceil(YXn+g*WXn)}function ZXn(g,E,M){return Math.max(E,Math.min(M,g))}function eVn({data:g,selected:E}){const M=!!g.cyclic,x=!!g.dimmed,O=!!g.focused,P=g.viewMode==="overview";return G.jsxs("section",{className:`model-node ${g.role} ${P?"overview-node":""} ${M?"cyclic":""} ${E?"selected":""} ${O?"focused":""} ${x?"dimmed":""}`,"data-scale":g.scale,"data-testid":`model-node-${g.scale}-${g.process}`,style:{width:lbn(g)},children:[G.jsx(D4,{className:"call-handle call-target",id:`${g.id}:call-target`,type:"target",position:er.Left}),G.jsx(D4,{className:"call-handle call-source",id:`${g.id}:call-source`,type:"source",position:er.Right}),P&&G.jsx(nVn,{inputs:g.inputs,outputs:g.outputs}),E&&g.onRemoveModel&&G.jsx("button",{className:"model-remove-button nodrag nopan",type:"button",title:g.role==="hard_dependency"?`Remove owning model for ${g.process}`:`Remove ${g.process}`,"aria-label":g.role==="hard_dependency"?`Remove owning model for ${g.process}`:`Remove ${g.process}`,onClick:k=>{k.stopPropagation(),g.onRemoveModel?.(g)},children:G.jsx(qXn,{size:14})}),G.jsxs("header",{className:"node-header",children:[G.jsxs("div",{children:[G.jsx("div",{className:"process",children:g.process}),G.jsx("div",{className:"model-type",children:g.modelType})]}),g.role==="hard_dependency"?G.jsx(RXn,{size:18}):G.jsx(X1n,{size:18})]}),P?G.jsxs("div",{className:"overview-node-summary",children:[G.jsx("span",{children:g.scale}),G.jsxs("span",{children:[g.inputs.length," in"]}),G.jsxs("span",{children:[g.outputs.length," out"]})]}):G.jsxs(G.Fragment,{children:[G.jsxs("div",{className:"node-meta",children:[g.role==="hard_dependency"&&G.jsxs("span",{className:"meta-chip hard-chip","data-tooltip":"Hard dependency: this model is called from its parent model run!, not independently scheduled.","aria-label":"Hard dependency called by parent model",children:[G.jsx(zXn,{size:13})," called by parent"]}),G.jsxs("span",{className:"meta-chip","data-tooltip":`Scale: ${g.scale}. This is the ModelMapping scale where the model runs.`,title:`Scale: ${g.scale}. This is the ModelMapping scale where the model runs.`,"aria-label":`Scale: ${g.scale}. This is the ModelMapping scale where the model runs.`,children:[G.jsx(X1n,{size:13}),g.scale]}),G.jsxs("span",{className:"meta-chip","data-tooltip":`Rate: ${g.rate}. This describes the timestep used to schedule this model.`,title:`Rate: ${g.rate}. This describes the timestep used to schedule this model.`,"aria-label":`Rate: ${g.rate}. This describes the timestep used to schedule this model.`,children:[G.jsx(PXn,{size:13}),g.rate]})]}),G.jsxs("div",{className:"ports-grid",children:[G.jsx(edn,{title:"Inputs",ports:g.inputs,side:"input",data:g}),G.jsx(edn,{title:"Outputs",ports:g.outputs,side:"output",data:g})]})]}),g.diagnostics.length>0&&G.jsx("div",{className:"diagnostic",children:g.diagnostics[0]})]})}function nVn({inputs:g,outputs:E}){return G.jsxs("div",{className:"overview-port-handles","aria-hidden":"true",children:[g.map((M,x)=>G.jsx(D4,{id:M.id,type:"target",position:er.Left,style:{top:`${Z1n(x,g.length)}%`}},M.id)),E.map((M,x)=>G.jsx(D4,{id:M.id,type:"source",position:er.Right,style:{top:`${Z1n(x,E.length)}%`}},M.id))]})}function Z1n(g,E){return E<=1?50:24+g/(E-1)*52}function edn({title:g,ports:E,side:M,data:x}){const O=new Set(x.highlightedPortIds??[]),P=new Set(x.focusedPortIds??[]),k=new Set(x.requiredInputPortIds??[]),H=new Set(x.candidatePortIds??[]),q=new Set(x.cycleBreakPortIds??[]);return G.jsxs("div",{className:`port-column ${M}`,children:[G.jsx("div",{className:"port-title",children:g}),E.map(F=>G.jsxs("div",{className:`port ${F.mappingMode?"mapped":""} ${k.has(F.id)?"required-input":""} ${q.has(F.id)?"cycle-break-target":""} ${F.previousTimeStep?"previous":""} ${P.has(F.id)?"focused":""} ${O.has(F.id)?"highlighted":""} ${x.activePortId===F.id?"active":""}`,"data-testid":`port-${M}-${x.scale}-${x.process}-${F.name}`,"data-default":`${k.has(F.id)?"Required initialization":ndn(F)}: ${F.default}`,"aria-label":`${F.name}, ${M}, ${k.has(F.id)?"required initialization":ndn(F).toLowerCase()} ${F.default}`,onMouseEnter:()=>x.onPortEnter?.(F),onMouseLeave:()=>x.onPortLeave?.(F),onPointerEnter:()=>x.onPortEnter?.(F),onPointerLeave:()=>x.onPortLeave?.(F),onClick:W=>{W.stopPropagation(),x.onPortEnter?.(F)},children:[M==="input"&&G.jsx(D4,{id:F.id,type:"target",position:er.Left}),G.jsx("span",{children:F.name}),H.has(F.id)&&G.jsx("button",{className:"port-candidate-button nodrag nopan","data-testid":`candidate-${M}-${x.scale}-${x.process}-${F.name}`,type:"button",title:M==="input"?"Show models that can compute this variable":"Show models that can consume this variable","aria-label":M==="input"?"Show models that can compute this variable":"Show models that can consume this variable",onClick:W=>{W.stopPropagation();const Z=W.currentTarget.getBoundingClientRect();x.onPortEnter?.(F),x.onCandidateClick?.(F,{x:Z.right,y:Z.top+Z.height/2})},children:G.jsx(FXn,{size:10})}),M==="input"&&x.cycleBreakActive&&q.has(F.id)&&G.jsx("button",{className:"port-cycle-break-button nodrag nopan","data-testid":`cycle-break-${x.scale}-${x.process}-${F.name}`,type:"button",title:"Use this input from the previous timestep to break the cycle","aria-label":`Break cycle at ${F.name}`,onPointerDown:W=>{W.preventDefault(),W.stopPropagation()},onMouseDown:W=>{W.preventDefault(),W.stopPropagation()},onClick:W=>{W.preventDefault(),W.stopPropagation(),x.onPortEnter?.(F),x.onCycleBreakClick?.(F)},children:G.jsx(ZG,{size:11})}),F.mappingMode&&G.jsx(BXn,{size:12}),M==="output"&&G.jsx(D4,{id:F.id,type:"source",position:er.Right})]},F.id))]})}function ndn(g){return g.role==="input"?"Default":"Declaration"}function sue(g){throw new Error('Could not dynamically require "'+g+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var U7e={exports:{}},tdn;function tVn(){return tdn||(tdn=1,(function(g,E){(function(M){g.exports=M()})(function(){return(function(){function M(x,O,P){function k(F,W){if(!O[F]){if(!x[F]){var Z=typeof sue=="function"&&sue;if(!W&&Z)return Z(F,!0);if(H)return H(F,!0);var ne=new Error("Cannot find module '"+F+"'");throw ne.code="MODULE_NOT_FOUND",ne}var le=O[F]={exports:{}};x[F][0].call(le.exports,function(se){var ee=x[F][1][se];return k(ee||se)},le,le.exports,M,x,O,P)}return O[F].exports}for(var H=typeof sue=="function"&&sue,q=0;q0&&arguments[0]!==void 0?arguments[0]:{},ee=se.defaultLayoutOptions,Ce=ee===void 0?{}:ee,je=se.algorithms,ze=je===void 0?["layered","stress","mrtree","radial","force","disco","sporeOverlap","sporeCompaction","rectpacking"]:je,be=se.workerFactory,De=se.workerUrl;if(k(this,ne),this.defaultLayoutOptions=Ce,this.initialized=!1,typeof De>"u"&&typeof be>"u")throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");var rn=be;typeof De<"u"&&typeof be>"u"&&(rn=function(An){return new Worker(An)});var an=rn(De);if(typeof an.postMessage!="function")throw new TypeError("Created worker does not provide the required 'postMessage' function.");this.worker=new Z(an),this.worker.postMessage({cmd:"register",algorithms:ze}).then(function(un){return le.initialized=!0}).catch(console.err)}return q(ne,[{key:"layout",value:function(se){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ce=ee.layoutOptions,je=Ce===void 0?this.defaultLayoutOptions:Ce,ze=ee.logging,be=ze===void 0?!1:ze,De=ee.measureExecutionTime,rn=De===void 0?!1:De;return se?this.worker.postMessage({cmd:"layout",graph:se,layoutOptions:je,options:{logging:be,measureExecutionTime:rn}}):Promise.reject(new Error("Missing mandatory parameter 'graph'."))}},{key:"knownLayoutAlgorithms",value:function(){return this.worker.postMessage({cmd:"algorithms"})}},{key:"knownLayoutOptions",value:function(){return this.worker.postMessage({cmd:"options"})}},{key:"knownLayoutCategories",value:function(){return this.worker.postMessage({cmd:"categories"})}},{key:"terminateWorker",value:function(){this.worker&&this.worker.terminate()}}])})();var Z=(function(){function ne(le){var se=this;if(k(this,ne),le===void 0)throw new Error("Missing mandatory parameter 'worker'.");this.resolvers={},this.worker=le,this.worker.onmessage=function(ee){setTimeout(function(){se.receive(se,ee)},0)}}return q(ne,[{key:"postMessage",value:function(se){var ee=this.id||0;this.id=ee+1,se.id=ee;var Ce=this;return new Promise(function(je,ze){Ce.resolvers[ee]=function(be,De){be?(Ce.convertGwtStyleError(be),ze(be)):je(De)},Ce.worker.postMessage(se)})}},{key:"receive",value:function(se,ee){var Ce=ee.data,je=se.resolvers[Ce.id];je&&(delete se.resolvers[Ce.id],Ce.error?je(Ce.error):je(null,Ce.data))}},{key:"terminate",value:function(){this.worker&&this.worker.terminate()}},{key:"convertGwtStyleError",value:function(se){if(se){var ee=se.__java$exception;ee&&(ee.cause&&ee.cause.backingJsObject&&(se.cause=ee.cause.backingJsObject,this.convertGwtStyleError(se.cause)),delete se.__java$exception)}}}])})()},{}],2:[function(M,x,O){(function(P){(function(){var k;typeof window<"u"?k=window:typeof P<"u"?k=P:typeof self<"u"&&(k=self);var H;function q(){}function F(){}function W(){}function Z(){}function ne(){}function le(){}function se(){}function ee(){}function Ce(){}function je(){}function ze(){}function be(){}function De(){}function rn(){}function an(){}function un(){}function An(){}function Dn(){}function $t(){}function In(){}function et(){}function Y(){}function He(){}function en(){}function ke(){}function Ze(){}function ln(){}function En(){}function nt(){}function Se(){}function on(){}function ct(){}function lt(){}function qt(){}function wi(){}function li(){}function Ut(){}function ai(){}function rc(){}function Qr(){}function vr(){}function Si(){}function Ui(){}function Su(){}function uu(){}function Js(){}function fa(){}function bh(){}function aa(){}function nu(){}function cl(){}function S0(){}function Dl(){}function fw(){}function A1(){}function qb(){}function x1(){}function S3(){}function Ub(){}function M0(){}function S6(){}function ha(){}function Gs(){}function qh(){}function Ho(){}function Sd(){}function M6(){}function A6(){}function aw(){}function hw(){}function Xb(){}function T1(){}function Nf(){}function dw(){}function A0(){}function x0(){}function M3(){}function T0(){}function Q2(){}function bw(){}function gw(){}function gh(){}function cs(){}function C1(){}function I4(){}function Uh(){}function _l(){}function Jo(){}function ul(){}function wh(){}function ww(){}function Vb(){}function A3(){}function Y2(){}function C0(){}function O1(){}function N1(){}function D1(){}function O0(){}function Ra(){}function us(){}function Xh(){}function pw(){}function qs(){}function _1(){}function W2(){}function mw(){}function L4(){}function x3(){}function vw(){}function Z2(){}function Il(){}function Df(){}function P4(){}function x6(){}function ep(){}function $4(){}function yw(){}function Zn(){}function Ft(){}function nr(){}function Sr(){}function ms(){}function N0(){}function S_(){}function M_(){}function R4(){}function sq(){}function A_(){}function x_(){}function PA(){}function lq(){}function fq(){}function wk(){}function kw(){}function $A(){}function RA(){}function B4(){}function z4(){}function T_(){}function BA(){}function C_(){}function T6(){}function Ew(){}function zA(){}function C6(){}function np(){}function FA(){}function pk(){}function O_(){}function mk(){}function vk(){}function N_(){}function Vh(){}function T3(){}function yk(){}function O6(){}function aq(){}function HA(){}function JA(){}function N6(){}function kk(){}function D_(){}function hq(){}function dq(){}function bq(){}function GA(){}function gq(){}function wq(){}function pq(){}function mq(){}function vq(){}function __(){}function yq(){}function kq(){}function Eq(){}function jq(){}function qA(){}function Sq(){}function Mq(){}function Aq(){}function I_(){}function xq(){}function Tq(){}function Cq(){}function Oq(){}function Nq(){}function Dq(){}function _q(){}function Iq(){}function Lq(){}function UA(){}function D6(){}function Pq(){}function L_(){}function P_(){}function $_(){}function R_(){}function B_(){}function F4(){}function $q(){}function Rq(){}function Bq(){}function z_(){}function F_(){}function _6(){}function I6(){}function zq(){}function Ek(){}function H_(){}function XA(){}function VA(){}function KA(){}function J_(){}function G_(){}function q_(){}function Fq(){}function Hq(){}function Jq(){}function Gq(){}function qq(){}function I1(){}function L6(){}function U_(){}function X_(){}function V_(){}function K_(){}function QA(){}function Uq(){}function H4(){}function YA(){}function P6(){}function WA(){}function Q_(){}function C3(){}function J4(){}function ZA(){}function Y_(){}function O3(){}function W_(){}function Z_(){}function eI(){}function Xq(){}function Vq(){}function Kq(){}function nI(){}function tI(){}function ex(){}function D0(){}function jk(){}function Md(){}function G4(){}function nx(){}function Sk(){}function Mk(){}function tx(){}function N3(){}function iI(){}function Ak(){}function q4(){}function Qq(){}function L1(){}function ix(){}function jw(){}function rI(){}function xk(){}function D3(){}function rx(){}function cI(){}function cx(){}function uI(){}function Ad(){}function U4(){}function X4(){}function Tk(){}function $6(){}function xd(){}function Td(){}function tp(){}function Kb(){}function Qb(){}function Sw(){}function oI(){}function ux(){}function ox(){}function sI(){}function da(){}function Go(){}function ou(){}function ip(){}function Cd(){}function sx(){}function rp(){}function lI(){}function fI(){}function V4(){}function _3(){}function K4(){}function cp(){}function lx(){}function up(){}function Mw(){}function op(){}function Aw(){}function fx(){}function ax(){}function Q4(){}function R6(){}function sp(){}function ba(){}function B6(){}function hx(){}function Yq(){}function Wq(){}function z6(){}function Ll(){}function dx(){}function F6(){}function H6(){}function bx(){}function Y4(){}function W4(){}function Zq(){}function aI(){}function eU(){}function hI(){}function I3(){}function gx(){}function Ck(){}function dI(){}function Z4(){}function wx(){}function Ok(){}function Nk(){}function bI(){}function gI(){}function L3(){}function P3(){}function wI(){}function px(){}function e5(){}function J6(){}function Dk(){}function G6(){}function _k(){}function pI(){}function $3(){}function mI(){}function lp(){}function mx(){}function vx(){}function fp(){}function ap(){}function q6(){}function yx(){}function kx(){}function U6(){}function X6(){}function vI(){}function yI(){}function n5(){}function Ik(){}function kI(){}function Ex(){}function jx(){}function P1(){}function Od(){}function hp(){}function Sx(){}function EI(){}function dp(){}function $1(){}function ol(){}function Lk(){}function xw(){}function wc(){}function vo(){}function Pl(){}function Pk(){}function t5(){}function R3(){}function $k(){}function V6(){}function i5(){}function nU(){}function Us(){}function Mx(){}function Ax(){}function jI(){}function SI(){}function tU(){}function xx(){}function Tx(){}function Cx(){}function ph(){}function sl(){}function Rk(){}function K6(){}function Bk(){}function Ox(){}function Tw(){}function zk(){}function Nx(){}function Dx(){}function MI(){}function AI(){}function xI(){}function iU(){}function TI(){}function CI(){}function _x(){}function OI(){}function rU(){}function NI(){}function DI(){}function _I(){}function Ix(){}function II(){}function LI(){}function PI(){}function $I(){}function RI(){}function cU(){}function BI(){}function r5(){}function zI(){}function Fk(){}function Hk(){}function FI(){}function Lx(){}function uU(){}function HI(){}function JI(){}function GI(){}function qI(){}function UI(){}function Px(){}function XI(){}function VI(){}function $x(){}function KI(){}function QI(){}function Rx(){}function Q6(){}function YI(){}function Jk(){}function Bx(){}function WI(){}function ZI(){}function oU(){}function sU(){}function eL(){}function Y6(){}function zx(){}function Gk(){}function nL(){}function Fx(){}function W6(){}function lU(){}function Hx(){}function tL(){}function Jx(){}function Gx(){}function iL(){}function rL(){}function B3(){}function cL(){}function Nd(){}function uL(){}function _0(){}function qx(){}function Ux(){}function oL(){}function sL(){}function fU(){}function Xx(){}function $l(){}function ga(){}function lL(){}function fL(){}function aL(){}function hL(){}function Z6(){}function dL(){}function qk(){}function bL(){}function aU(){}function Uk(){}function Vx(){}function gL(){}function wL(){}function Fe(){}function Kx(){}function Qx(){}function Yx(){}function pL(){}function Wx(){}function Xk(){}function Zx(){}function mL(){}function eT(){}function vL(){}function Cw(){}function e9(){}function hU(){}function yL(){}function I0(){}function nT(){}function kL(){}function Vk(){}function z3(){}function yo(){}function Kk(){}function dU(){}function tT(){}function n9(){}function bp(){}function t9(){}function EL(){}function i9(){}function Yb(){}function r9(){}function iT(){}function jL(){}function rT(){}function cT(){}function F3(){}function SL(){}function Wb(){}function Rl(){}function c9(){}function uT(){}function _f(){}function bU(){}function ML(){}function AL(){}function Cs(){}function Kh(){}function Ow(){}function xL(){}function TL(){}function CL(){}function gU(){}function Qk(){}function Qh(){}function L0(){}function OL(){}function Bl(){}function Yk(){}function Nw(){}function H3(){}function Dw(){}function oT(){}function sT(){}function P0(){}function NL(){}function c5(){}function u9(){}function o9(){}function u5(){}function DL(){}function _L(){}function s9(){}function IL(){}function Wk(){}function LL(){}function wU(){}function pU(){}function Hu(){}function _o(){}function Jc(){}function tu(){}function io(){}function R1(){}function gp(){}function o5(){}function lT(){}function _w(){}function Xs(){}function wp(){}function J3(){}function fT(){}function B1(){}function s5(){}function l9(){}function Yh(){}function aT(){}function Zk(){}function PL(){}function eE(){}function nE(){}function pp(){}function ff(){}function mp(){}function l5(){}function Iw(){}function hT(){}function dT(){}function $L(){}function f9(){}function bT(){}function z1(){}function RL(){}function Wh(){}function BL(){}function zL(){}function mU(){}function vp(){}function tE(){}function gT(){}function f5(){}function FL(){}function HL(){}function JL(){}function GL(){}function iE(){}function wT(){}function vU(){}function yU(){}function kU(){}function qL(){}function UL(){}function a5(){}function rE(){}function XL(){}function VL(){}function KL(){}function QL(){}function YL(){}function WL(){}function cE(){}function ZL(){}function eP(){}function ro(){}function pT(){}function EU(){}function nP(){}function jU(){}function SU(){}function MU(){}function uE(){}function h5(){}function mT(){}function oE(){}function vT(){}function yp(){}function Zb(){}function a9(){}function AU(){}function tP(){}function yT(){}function iP(){}function rP(){}function kT(){AE()}function ET(){x0e()}function cP(){Qf()}function uP(){$de()}function xU(){FO()}function jT(){LC()}function ST(){sC()}function TU(){oC()}function CU(){Sxe()}function h9(){uy()}function OU(){ZPe()}function oP(){p8()}function Gc(){fb()}function MT(){Rhe()}function sE(){JIe()}function AT(){$he()}function sP(){qIe()}function xT(){GIe()}function d9(){UIe()}function lE(){N$e()}function NU(){XIe()}function lP(){EBe()}function DU(){Oe()}function _U(){t$()}function fP(){yBe()}function aP(){kBe()}function ko(){qLe()}function TT(){Dge()}function wa(){jBe()}function IU(){KIe()}function hP(){ry()}function LU(){LFe()}function CT(){nd()}function OT(){rbe()}function fE(){UO()}function dP(){qBe()}function bP(){Jbe()}function NT(){SJe()}function DT(){VIe()}function PU(){XXe()}function gP(){Tu()}function $U(){Ya()}function wP(){ege()}function RU(){ab()}function BU(){LW()}function kp(){GY()}function pP(){oB()}function _T(){Gt()}function IT(){Tz()}function zU(){HB()}function FU(){dde()}function LT(){Kz()}function aE(){JQ()}function ll(){CNe()}function HU(){ige()}function F1(e){Nn(e)}function PT(e){this.a=e}function b9(e){this.a=e}function mP(e){this.a=e}function vP(e){this.a=e}function g9(e){this.a=e}function H1(e){this.a=e}function $T(e){this.a=e}function hE(e){this.a=e}function $0(e){this.a=e}function JU(e){this.a=e}function GU(e){this.a=e}function d5(e){this.a=e}function yP(e){this.a=e}function qU(e){this.c=e}function UU(e){this.a=e}function RT(e){this.a=e}function XU(e){this.a=e}function VU(e){this.a=e}function KU(e){this.a=e}function BT(e){this.a=e}function kP(e){this.a=e}function b5(e){this.a=e}function G3(e){this.a=e}function EP(e){this.a=e}function zT(e){this.a=e}function g5(e){this.a=e}function w9(e){this.a=e}function jP(e){this.a=e}function dE(e){this.a=e}function FT(e){this.a=e}function HT(e){this.a=e}function bE(e){this.a=e}function SP(e){this.a=e}function MP(e){this.a=e}function QU(e){this.a=e}function AP(e){this.a=e}function YU(e){this.a=e}function JT(e){this.a=e}function WU(e){this.a=e}function p9(e){this.a=e}function m9(e){this.a=e}function q3(e){this.a=e}function v9(e){this.a=e}function w5(e){this.b=e}function Dd(){this.a=[]}function xP(e,n){e.a=n}function ZU(e,n){e.a=n}function eX(e,n){e.b=n}function nX(e,n){e.c=n}function TP(e,n){e.c=n}function tX(e,n){e.d=n}function iX(e,n){e.d=n}function If(e,n){e.k=n}function CP(e,n){e.j=n}function Fue(e,n){e.c=n}function gE(e,n){e.c=n}function wE(e,n){e.a=n}function GT(e,n){e.a=n}function OP(e,n){e.f=n}function rX(e,n){e.a=n}function NP(e,n){e.b=n}function eg(e,n){e.d=n}function R0(e,n){e.i=n}function Lw(e,n){e.o=n}function pE(e,n){e.r=n}function mE(e,n){e.a=n}function U3(e,n){e.b=n}function cX(e,n){e.e=n}function uX(e,n){e.f=n}function p5(e,n){e.g=n}function Hue(e,n){e.e=n}function oX(e,n){e.f=n}function qT(e,n){e.f=n}function vE(e,n){e.a=n}function UT(e,n){e.b=n}function XT(e,n){e.n=n}function VT(e,n){e.a=n}function sX(e,n){e.c=n}function y9(e,n){e.c=n}function lX(e,n){e.c=n}function DP(e,n){e.a=n}function KT(e,n){e.a=n}function fX(e,n){e.d=n}function Jue(e,n){e.d=n}function QT(e,n){e.e=n}function a(e,n){e.e=n}function d(e,n){e.g=n}function w(e,n){e.f=n}function j(e,n){e.j=n}function C(e,n){e.a=n}function D(e,n){e.a=n}function Q(e,n){e.b=n}function he(e){e.b=e.a}function We(e){e.c=e.d.d}function _n(e){this.a=e}function tt(e){this.a=e}function gt(e){this.a=e}function Fn(e){this.a=e}function Yn(e){this.a=e}function _i(e){this.a=e}function Or(e){this.a=e}function co(e){this.a=e}function kn(e){this.a=e}function sn(e){this.a=e}function On(e){this.a=e}function ut(e){this.a=e}function Hi(e){this.a=e}function Lu(e){this.a=e}function Xi(e){this.b=e}function qr(e){this.b=e}function cc(e){this.b=e}function qc(e){this.d=e}function St(e){this.a=e}function aX(e){this.a=e}function Gue(e){this.a=e}function Oke(e){this.a=e}function Nke(e){this.a=e}function que(e){this.a=e}function Uue(e){this.a=e}function hX(e){this.c=e}function L(e){this.c=e}function Dke(e){this.c=e}function Xue(e){this.a=e}function Vue(e){this.a=e}function Kue(e){this.a=e}function Que(e){this.a=e}function k9(e){this.a=e}function _ke(e){this.a=e}function Ike(e){this.a=e}function E9(e){this.a=e}function Lke(e){this.a=e}function Pke(e){this.a=e}function $ke(e){this.a=e}function Rke(e){this.a=e}function Bke(e){this.a=e}function zke(e){this.a=e}function Fke(e){this.a=e}function Hke(e){this.a=e}function Jke(e){this.a=e}function Gke(e){this.a=e}function qke(e){this.a=e}function yE(e){this.a=e}function Uke(e){this.a=e}function Xke(e){this.a=e}function _P(e){this.a=e}function Vke(e){this.a=e}function Kke(e){this.a=e}function Yue(e){this.a=e}function Qke(e){this.a=e}function Yke(e){this.a=e}function Wke(e){this.a=e}function Wue(e){this.a=e}function Zue(e){this.a=e}function eoe(e){this.a=e}function kE(e){this.a=e}function j9(e){this.a=e}function Zke(e){this.a=e}function m5(e){this.a=e}function noe(e){this.a=e}function eEe(e){this.a=e}function nEe(e){this.a=e}function tEe(e){this.a=e}function iEe(e){this.a=e}function rEe(e){this.a=e}function cEe(e){this.a=e}function uEe(e){this.a=e}function oEe(e){this.a=e}function sEe(e){this.a=e}function lEe(e){this.a=e}function fEe(e){this.a=e}function toe(e){this.a=e}function aEe(e){this.a=e}function hEe(e){this.a=e}function dEe(e){this.a=e}function bEe(e){this.a=e}function gEe(e){this.a=e}function wEe(e){this.a=e}function pEe(e){this.a=e}function mEe(e){this.a=e}function vEe(e){this.a=e}function yEe(e){this.a=e}function kEe(e){this.a=e}function EEe(e){this.a=e}function jEe(e){this.a=e}function SEe(e){this.a=e}function MEe(e){this.a=e}function AEe(e){this.a=e}function xEe(e){this.a=e}function TEe(e){this.a=e}function CEe(e){this.a=e}function OEe(e){this.a=e}function NEe(e){this.a=e}function DEe(e){this.a=e}function _Ee(e){this.a=e}function IEe(e){this.a=e}function LEe(e){this.a=e}function PEe(e){this.a=e}function $Ee(e){this.a=e}function REe(e){this.a=e}function BEe(e){this.a=e}function zEe(e){this.a=e}function FEe(e){this.a=e}function HEe(e){this.a=e}function JEe(e){this.a=e}function GEe(e){this.a=e}function qEe(e){this.a=e}function UEe(e){this.a=e}function XEe(e){this.b=e}function VEe(e){this.a=e}function KEe(e){this.a=e}function QEe(e){this.a=e}function YEe(e){this.a=e}function WEe(e){this.a=e}function ZEe(e){this.a=e}function eje(e){this.c=e}function nje(e){this.a=e}function tje(e){this.a=e}function ije(e){this.a=e}function rje(e){this.a=e}function cje(e){this.a=e}function uje(e){this.a=e}function oje(e){this.a=e}function sje(e){this.a=e}function lje(e){this.a=e}function fje(e){this.a=e}function aje(e){this.a=e}function hje(e){this.a=e}function dje(e){this.a=e}function bje(e){this.a=e}function gje(e){this.a=e}function wje(e){this.a=e}function pje(e){this.a=e}function mje(e){this.a=e}function vje(e){this.a=e}function yje(e){this.a=e}function kje(e){this.a=e}function Eje(e){this.a=e}function jje(e){this.a=e}function Sje(e){this.a=e}function Mje(e){this.a=e}function Aje(e){this.a=e}function xje(e){this.a=e}function J1(e){this.a=e}function X3(e){this.a=e}function Tje(e){this.a=e}function Cje(e){this.a=e}function Oje(e){this.a=e}function Nje(e){this.a=e}function Dje(e){this.a=e}function _je(e){this.a=e}function Ije(e){this.a=e}function Lje(e){this.a=e}function Pje(e){this.a=e}function $je(e){this.a=e}function Rje(e){this.a=e}function Bje(e){this.a=e}function zje(e){this.a=e}function Fje(e){this.a=e}function Hje(e){this.a=e}function Jje(e){this.a=e}function Gje(e){this.a=e}function qje(e){this.a=e}function Uje(e){this.a=e}function Xje(e){this.a=e}function Vje(e){this.a=e}function Kje(e){this.a=e}function Qje(e){this.a=e}function Yje(e){this.a=e}function Wje(e){this.a=e}function Zje(e){this.a=e}function IP(e){this.a=e}function eSe(e){this.f=e}function nSe(e){this.a=e}function tSe(e){this.a=e}function iSe(e){this.a=e}function rSe(e){this.a=e}function cSe(e){this.a=e}function uSe(e){this.a=e}function oSe(e){this.a=e}function sSe(e){this.a=e}function lSe(e){this.a=e}function fSe(e){this.a=e}function aSe(e){this.a=e}function hSe(e){this.a=e}function dSe(e){this.a=e}function bSe(e){this.a=e}function gSe(e){this.a=e}function wSe(e){this.a=e}function pSe(e){this.a=e}function mSe(e){this.a=e}function vSe(e){this.a=e}function ySe(e){this.a=e}function kSe(e){this.a=e}function ESe(e){this.a=e}function jSe(e){this.a=e}function SSe(e){this.a=e}function MSe(e){this.a=e}function ASe(e){this.a=e}function xSe(e){this.a=e}function dX(e){this.a=e}function ioe(e){this.a=e}function yi(e){this.b=e}function TSe(e){this.a=e}function CSe(e){this.a=e}function OSe(e){this.a=e}function NSe(e){this.a=e}function DSe(e){this.a=e}function _Se(e){this.a=e}function ISe(e){this.a=e}function LSe(e){this.b=e}function PSe(e){this.a=e}function YT(e){this.a=e}function $Se(e){this.a=e}function RSe(e){this.a=e}function LP(e){this.a=e}function PP(e){this.a=e}function roe(e){this.c=e}function $P(e){this.e=e}function RP(e){this.e=e}function bX(e){this.a=e}function BSe(e){this.d=e}function zSe(e){this.a=e}function coe(e){this.a=e}function uoe(e){this.a=e}function Pw(e){this.e=e}function bbn(){this.a=0}function Te(){CV(this)}function wt(){Ju(this)}function gX(){O_e(this)}function FSe(){}function $w(){this.c=Q8e}function HSe(e,n){e.b+=n}function gbn(e,n){n.Wb(e)}function wbn(e){return e.a}function pbn(e){return e.a}function mbn(e){return e.a}function vbn(e){return e.a}function ybn(e){return e.a}function $(e){return e.e}function kbn(){return null}function Ebn(){return null}function jbn(e){throw $(e)}function v5(e){this.a=Tt(e)}function JSe(){this.a=this}function ng(){oOe.call(this)}function Sbn(e){e.b.Mf(e.e)}function GSe(e){e.b=new DX}function EE(e,n){e.b=n-e.b}function jE(e,n){e.a=n-e.a}function qSe(e,n){n.gd(e.a)}function Mbn(e,n){Tr(n,e)}function Hn(e,n){e.push(n)}function USe(e,n){e.sort(n)}function Abn(e,n,t){e.Wd(t,n)}function WT(e,n){e.e=n,n.b=e}function xbn(){Boe(),KRn()}function XSe(e){Z9(),rte.je(e)}function ooe(){ng.call(this)}function wX(){ng.call(this)}function soe(){oOe.call(this)}function VSe(){ng.call(this)}function zl(){ng.call(this)}function KSe(){ng.call(this)}function ZT(){ng.call(this)}function os(){ng.call(this)}function y5(){ng.call(this)}function Nt(){ng.call(this)}function hu(){ng.call(this)}function QSe(){ng.call(this)}function BP(){this.Bb|=256}function YSe(){this.b=new uCe}function loe(){loe=Y,new wt}function Ep(e,n){e.length=n}function zP(e,n){xe(e.a,n)}function Tbn(e,n){C0e(e.c,n)}function Cbn(e,n){dr(e.b,n)}function S9(e,n){hi(e.e,n)}function Obn(e,n){bz(e.a,n)}function Nbn(e,n){pY(e.a,n)}function k5(e){Dz(e.c,e.b)}function Dbn(e,n){e.kc().Nb(n)}function foe(e){this.a=HEn(e)}function hr(){this.a=new wt}function WSe(){this.a=new wt}function FP(){this.a=new Te}function pX(){this.a=new Te}function aoe(){this.a=new Te}function tg(){this.a=new JPe}function mX(){this.a=new pxe}function hoe(){this.a=new _Ie}function doe(){this.a=new ZOe}function af(){this.a=new S6}function boe(){this.a=new gw}function ZSe(){this.a=new hLe}function eMe(){this.a=new Te}function nMe(){this.a=new Te}function goe(){this.a=new Te}function tMe(){this.a=new Te}function iMe(){this.d=new Te}function rMe(){this.a=new hr}function cMe(){this.a=new wt}function uMe(){this.b=new wt}function oMe(){this.b=new Te}function woe(){this.e=new Te}function sMe(){this.a=new Gc}function lMe(){this.d=new Te}function SE(){FSe.call(this)}function vX(){SE.call(this)}function E5(){FSe.call(this)}function poe(){E5.call(this)}function fMe(){ooe.call(this)}function HP(){FP.call(this)}function aMe(){Q$.call(this)}function hMe(){goe.call(this)}function dMe(){Te.call(this)}function bMe(){fIe.call(this)}function gMe(){fIe.call(this)}function wMe(){koe.call(this)}function pMe(){koe.call(this)}function mMe(){koe.call(this)}function vMe(){Eoe.call(this)}function ME(){Vk.call(this)}function moe(){Vk.call(this)}function Os(){Mi.call(this)}function yMe(){IMe.call(this)}function kMe(){IMe.call(this)}function EMe(){wt.call(this)}function jMe(){wt.call(this)}function SMe(){wt.call(this)}function yX(){wBe.call(this)}function MMe(){hr.call(this)}function AMe(){BP.call(this)}function kX(){rle.call(this)}function voe(){wt.call(this)}function EX(){rle.call(this)}function jX(){wt.call(this)}function xMe(){wt.call(this)}function yoe(){F3.call(this)}function TMe(){yoe.call(this)}function CMe(){F3.call(this)}function OMe(){yT.call(this)}function koe(){this.a=new hr}function NMe(){this.a=new wt}function DMe(){this.a=new Te}function _Me(){this.j=new Te}function Eoe(){this.a=new wt}function j5(){this.a=new Mi}function IMe(){this.a=new iT}function joe(){this.a=new qI}function LMe(){this.a=new DAe}function AE(){AE=Y,Qne=new F}function SX(){SX=Y,Yne=new $Me}function MX(){MX=Y,Wne=new PMe}function PMe(){G3.call(this,"")}function $Me(){G3.call(this,"")}function RMe(e){URe.call(this,e)}function BMe(e){URe.call(this,e)}function Soe(e){H1.call(this,e)}function Moe(e){qAe.call(this,e)}function _bn(e){qAe.call(this,e)}function Ibn(e){Moe.call(this,e)}function Lbn(e){Moe.call(this,e)}function Pbn(e){Moe.call(this,e)}function zMe(e){oQ.call(this,e)}function FMe(e){oQ.call(this,e)}function HMe(e){GCe.call(this,e)}function JMe(e){Uoe.call(this,e)}function xE(e){ZP.call(this,e)}function Aoe(e){ZP.call(this,e)}function GMe(e){ZP.call(this,e)}function du(e){RDe.call(this,e)}function qMe(e){du.call(this,e)}function S5(){v9.call(this,{})}function AX(e){P9(),this.a=e}function UMe(e){e.b=null,e.c=0}function $bn(e,n){e.e=n,UUe(e,n)}function Rbn(e,n){e.a=n,QTn(e)}function xX(e,n,t){e.a[n.g]=t}function Bbn(e,n,t){pAn(t,e,n)}function zbn(e,n){ppn(n.i,e.n)}function XMe(e,n){Nkn(e).Ad(n)}function Fbn(e,n){return e*e/n}function VMe(e,n){return e.g-n.g}function Hbn(e,n){e.a.ec().Kc(n)}function Jbn(e){return new q3(e)}function Gbn(e){return new qp(e)}function KMe(){KMe=Y,mme=new q}function xoe(){xoe=Y,vme=new rn}function JP(){JP=Y,eM=new An}function GP(){GP=Y,ete=new JCe}function QMe(){QMe=Y,Ven=new $t}function qP(e){e1e(),this.a=e}function TX(e){aK(),this.f=e}function B0(e){aK(),this.f=e}function YMe(e){TNe(),this.a=e}function UP(e){du.call(this,e)}function Eo(e){du.call(this,e)}function WMe(e){du.call(this,e)}function CX(e){RDe.call(this,e)}function M9(e){du.call(this,e)}function Jn(e){du.call(this,e)}function Uc(e){du.call(this,e)}function ZMe(e){du.call(this,e)}function M5(e){du.call(this,e)}function _d(e){du.call(this,e)}function Mu(e){Nn(e),this.a=e}function TE(e){Pfe(e,e.length)}function Toe(e){return Sg(e),e}function jp(e){return!!e&&e.b}function qbn(e){return!!e&&e.k}function Ubn(e){return!!e&&e.j}function CE(e){return e.b==e.c}function Re(e){return Nn(e),e}function te(e){return Nn(e),e}function eC(e){return Nn(e),e}function Coe(e){return Nn(e),e}function Xbn(e){return Nn(e),e}function mh(e){du.call(this,e)}function Id(e){du.call(this,e)}function A5(e){du.call(this,e)}function OX(e){du.call(this,e)}function Pt(e){du.call(this,e)}function NX(e){hle.call(this,e,0)}function DX(){jae.call(this,12,3)}function _X(){this.a=_t(Tt(Co))}function eAe(){throw $(new Nt)}function Ooe(){throw $(new Nt)}function nAe(){throw $(new Nt)}function Vbn(){throw $(new Nt)}function Kbn(){throw $(new Nt)}function Qbn(){throw $(new Nt)}function XP(){XP=Y,Z9()}function Ld(){_i.call(this,"")}function OE(){_i.call(this,"")}function z0(){_i.call(this,"")}function x5(){_i.call(this,"")}function Noe(e){Eo.call(this,e)}function Doe(e){Eo.call(this,e)}function vh(e){Jn.call(this,e)}function A9(e){qr.call(this,e)}function tAe(e){A9.call(this,e)}function IX(e){G$.call(this,e)}function Ybn(e,n,t){e.c.Cf(n,t)}function Wbn(e,n,t){n.Ad(e.a[t])}function Zbn(e,n,t){n.Ne(e.a[t])}function egn(e,n){return e.a-n.a}function ngn(e,n){return e.a-n.a}function tgn(e,n){return e.a-n.a}function VP(e,n){return kQ(e,n)}function B(e,n){return BIe(e,n)}function ign(e,n){return n in e.a}function iAe(e){return e.a?e.b:0}function rgn(e){return e.a?e.b:0}function rAe(e,n){return e.f=n,e}function cgn(e,n){return e.b=n,e}function cAe(e,n){return e.c=n,e}function ugn(e,n){return e.g=n,e}function _oe(e,n){return e.a=n,e}function Ioe(e,n){return e.f=n,e}function ogn(e,n){return e.f=n,e}function Loe(e,n){return e.e=n,e}function sgn(e,n){return e.k=n,e}function Poe(e,n){return e.a=n,e}function lgn(e,n){return e.e=n,e}function fgn(e,n){e.b=new mc(n)}function uAe(e,n){e._d(n),n.$d(e)}function agn(e,n){al(),n.n.a+=e}function hgn(e,n){fb(),wu(n,e)}function $oe(e){H_e.call(this,e)}function oAe(e){H_e.call(this,e)}function sAe(){Gse.call(this,"")}function lAe(){this.b=0,this.a=0}function fAe(){fAe=Y,onn=GAn()}function Sp(e,n){return e.b=n,e}function KP(e,n){return e.a=n,e}function Mp(e,n){return e.c=n,e}function Ap(e,n){return e.d=n,e}function xp(e,n){return e.e=n,e}function Roe(e,n){return e.f=n,e}function NE(e,n){return e.a=n,e}function x9(e,n){return e.b=n,e}function T9(e,n){return e.c=n,e}function Ge(e,n){return e.c=n,e}function hn(e,n){return e.b=n,e}function qe(e,n){return e.d=n,e}function Ue(e,n){return e.e=n,e}function dgn(e,n){return e.f=n,e}function Xe(e,n){return e.g=n,e}function Ve(e,n){return e.a=n,e}function Ke(e,n){return e.i=n,e}function Qe(e,n){return e.j=n,e}function bgn(e,n){return n.pg(e)}function ggn(e,n){return e.b-n.b}function wgn(e,n){return e.g-n.g}function pgn(e,n){return e.s-n.s}function mgn(e,n){return e?0:n-1}function aAe(e,n){return e?0:n-1}function vgn(e,n){return e?n-1:0}function hAe(e,n){return e.k=n,e}function ygn(e,n){return e.j=n,e}function Yr(){this.a=0,this.b=0}function QP(e){VV.call(this,e)}function F0(e){t2.call(this,e)}function dAe(e){RK.call(this,e)}function bAe(e){RK.call(this,e)}function gAe(){gAe=Y,Rr=axn()}function H0(){H0=Y,wan=nAn()}function Boe(){Boe=Y,tw=Nj()}function C9(){C9=Y,K8e=tAn()}function wAe(){wAe=Y,ehn=iAn()}function zoe(){zoe=Y,zu=XTn()}function pa(e){return e.e&&e.e()}function pAe(e,n){return e.c._b(n)}function mAe(e,n){return wFe(e.b,n)}function vAe(e,n){return Ugn(e.a,n)}function yAe(e,n){e.b=0,nm(e,n)}function kgn(e,n){e.c=n,e.b=!0}function V3(e,n){return e.a+=n,e}function LX(e,n){return e.a+=n,e}function Pd(e,n){return e.a+=n,e}function Rw(e,n){return e.a+=n,e}function ig(e){return U1(e),e.o}function Foe(e){jKe(),sBn(this,e)}function kAe(){throw $(new Nt)}function EAe(){throw $(new Nt)}function jAe(){throw $(new Nt)}function SAe(){throw $(new Nt)}function MAe(){throw $(new Nt)}function AAe(){throw $(new Nt)}function YP(e){this.a=new C5(e)}function $d(e){this.a=new wK(e)}function K3(e,n){for(;e.Pe(n););}function Hoe(e,n){for(;e.zd(n););}function Egn(e,n,t){Mvn(e.a,n,t)}function Joe(e,n,t){e.splice(n,t)}function jgn(e,n){return rPn(n,e)}function Goe(e,n){return e.d[n.p]}function nC(e){return e.b!=e.d.c}function xAe(e){return e.l|e.m<<22}function PX(e){return e?e.d:null}function Sgn(e){return e?e.g:null}function Mgn(e){return e?e.i:null}function TAe(e,n){return MDn(e,n)}function O9(e){return K0(e),e.a}function CAe(e){e.c?sXe(e):lXe(e)}function OAe(){this.b=new fS(tye)}function NAe(){this.b=new fS(Zre)}function DAe(){this.b=new fS(Zre)}function _Ae(){this.a=new fS($ye)}function IAe(){this.a=new fS(o6e)}function WP(e){this.a=0,this.b=e}function LAe(){throw $(new Nt)}function PAe(){throw $(new Nt)}function $Ae(){throw $(new Nt)}function RAe(){throw $(new Nt)}function BAe(){throw $(new Nt)}function zAe(){throw $(new Nt)}function FAe(){throw $(new Nt)}function HAe(){throw $(new Nt)}function JAe(){throw $(new Nt)}function GAe(){throw $(new Nt)}function Agn(){throw $(new hu)}function xgn(){throw $(new hu)}function tC(e){this.a=new hxe(e)}function N9(e,n){this.e=e,this.d=n}function qoe(e,n){this.b=e,this.c=n}function qAe(e){nle(e.dc()),this.c=e}function iC(e,n){sv.call(this,e,n)}function D9(e,n){iC.call(this,e,n)}function UAe(e,n){this.a=e,this.b=n}function XAe(e,n){this.a=e,this.b=n}function VAe(e,n){this.a=e,this.b=n}function KAe(e,n){this.a=e,this.b=n}function QAe(e,n){this.a=e,this.b=n}function YAe(e,n){this.a=e,this.b=n}function WAe(e,n){this.a=e,this.b=n}function ZAe(e,n){this.b=e,this.a=n}function exe(e,n){this.b=e,this.a=n}function Bw(e,n){this.g=e,this.i=n}function nxe(e,n){this.a=e,this.b=n}function txe(e,n){this.b=e,this.a=n}function ixe(e,n){this.a=e,this.b=n}function rxe(e,n){this.b=e,this.a=n}function ZP(e){this.b=u(Tt(e),50)}function e$(e){this.b=u(Tt(e),92)}function xt(e,n){this.f=e,this.g=n}function $X(e,n){this.a=e,this.b=n}function cxe(e,n){this.a=e,this.f=n}function uxe(e){this.a=u(Tt(e),16)}function Uoe(e){this.a=u(Tt(e),16)}function oxe(e,n){this.b=e,this.c=n}function sxe(e){this.a=u(Tt(e),92)}function Tgn(e,n){this.a=e,this.b=n}function lxe(e,n){this.a=e,this.b=n}function fxe(e,n){return so(e.b,n)}function axe(e,n){return e>n&&n0}function GX(e,n){return ao(e,n)<0}function Nxe(e,n){return lK(e.a,n)}function Vgn(e,n){IIe.call(this,e,n)}function tse(e){NK(),lTn.call(this,e)}function ise(e){NK(),tse.call(this,e)}function rse(e){uK(),GCe.call(this,e)}function cse(e,n){ADe(e,e.length,n)}function lC(e,n){n_e(e,e.length,n)}function zE(e,n){return e.a.get(n)}function Dxe(e,n){return so(e.e,n)}function use(e){return Nn(e),!1}function _xe(){return fAe(),new onn}function fC(e){return at(e.a),e.b}function Ixe(e,n){this.b=e,this.a=n}function l$(e,n){this.d=e,this.e=n}function Lxe(e,n){this.a=e,this.b=n}function Pxe(e,n){this.a=e,this.b=n}function $xe(e,n){this.a=e,this.b=n}function Rxe(e,n){this.a=e,this.b=n}function Bxe(e,n){this.b=e,this.a=n}function O5(e,n){this.a=e,this.b=n}function f$(e,n){xt.call(this,e,n)}function qX(e,n){xt.call(this,e,n)}function UX(e,n){xt.call(this,e,n)}function XX(e,n){xt.call(this,e,n)}function VX(e,n){xt.call(this,e,n)}function a$(e,n){xt.call(this,e,n)}function h$(e){pn.call(this,e,21)}function zxe(e,n){this.b=e,this.a=n}function ose(e,n){this.b=e,this.a=n}function sse(e,n){this.b=e,this.a=n}function lse(e,n){xt.call(this,e,n)}function KX(e,n){xt.call(this,e,n)}function aC(e,n){xt.call(this,e,n)}function fse(e,n){this.b=e,this.a=n}function L9(e,n){this.c=e,this.d=n}function d$(e,n){xt.call(this,e,n)}function b$(e,n){xt.call(this,e,n)}function Fxe(e,n){this.e=e,this.d=n}function N5(e,n){xt.call(this,e,n)}function Hxe(e,n){this.a=e,this.b=n}function ase(e,n){xt.call(this,e,n)}function gr(e,n){xt.call(this,e,n)}function g$(e,n){xt.call(this,e,n)}function FE(e,n,t){e.splice(n,0,t)}function Kgn(e,n,t){e.Mb(t)&&n.Ad(t)}function Qgn(e,n,t){n.Ne(e.a.We(t))}function Ygn(e,n,t){n.Bd(e.a.Xe(t))}function Wgn(e,n,t){n.Ad(e.a.Kb(t))}function Zgn(e,n){return ls(e.c,n)}function ewn(e,n){return ls(e.e,n)}function Jxe(e,n){this.a=e,this.b=n}function Gxe(e,n){this.a=e,this.b=n}function qxe(e,n){this.a=e,this.b=n}function Uxe(e,n){this.a=e,this.b=n}function Xxe(e,n){this.a=e,this.b=n}function Vxe(e,n){this.a=e,this.b=n}function Kxe(e,n){this.a=e,this.b=n}function Qxe(e,n){this.a=e,this.b=n}function Yxe(e,n){this.b=e,this.a=n}function Wxe(e,n){this.b=e,this.a=n}function Zxe(e,n){this.b=e,this.a=n}function eTe(e,n){this.b=n,this.c=e}function w$(e,n){xt.call(this,e,n)}function hC(e,n){xt.call(this,e,n)}function hse(e,n){xt.call(this,e,n)}function HE(e,n){xt.call(this,e,n)}function p$(e,n){xt.call(this,e,n)}function QX(e,n){xt.call(this,e,n)}function YX(e,n){xt.call(this,e,n)}function JE(e,n){xt.call(this,e,n)}function GE(e,n){xt.call(this,e,n)}function dse(e,n){xt.call(this,e,n)}function Q3(e,n){xt.call(this,e,n)}function WX(e,n){xt.call(this,e,n)}function qE(e,n){xt.call(this,e,n)}function bse(e,n){xt.call(this,e,n)}function Op(e,n){xt.call(this,e,n)}function ZX(e,n){xt.call(this,e,n)}function eV(e,n){xt.call(this,e,n)}function nV(e,n){xt.call(this,e,n)}function gse(e,n){xt.call(this,e,n)}function dC(e,n){xt.call(this,e,n)}function wse(e,n){xt.call(this,e,n)}function Y3(e,n){xt.call(this,e,n)}function tV(e,n){xt.call(this,e,n)}function m$(e,n){xt.call(this,e,n)}function bC(e,n){xt.call(this,e,n)}function Np(e,n){xt.call(this,e,n)}function v$(e,n){xt.call(this,e,n)}function pse(e,n){xt.call(this,e,n)}function iV(e,n){xt.call(this,e,n)}function rV(e,n){xt.call(this,e,n)}function cV(e,n){xt.call(this,e,n)}function uV(e,n){xt.call(this,e,n)}function oV(e,n){xt.call(this,e,n)}function sV(e,n){xt.call(this,e,n)}function y$(e,n){xt.call(this,e,n)}function nTe(e,n){this.b=e,this.a=n}function mse(e,n){xt.call(this,e,n)}function tTe(e,n){this.a=e,this.b=n}function iTe(e,n){this.a=e,this.b=n}function rTe(e,n){this.a=e,this.b=n}function vse(e,n){xt.call(this,e,n)}function yse(e,n){xt.call(this,e,n)}function cTe(e,n){this.a=e,this.b=n}function nwn(e,n){return H9(),n!=e}function lV(e){return nOn(e,e.c),e}function twn(e){k.clearTimeout(e)}function kse(e,n){xt.call(this,e,n)}function Ese(e,n){xt.call(this,e,n)}function uTe(e,n){this.a=e,this.b=n}function oTe(e,n){this.a=e,this.b=n}function sTe(e,n){this.b=e,this.d=n}function lTe(e,n){this.a=e,this.b=n}function fTe(e,n){this.b=e,this.a=n}function k$(e,n){xt.call(this,e,n)}function zw(e,n){xt.call(this,e,n)}function fV(e,n){xt.call(this,e,n)}function E$(e,n){xt.call(this,e,n)}function jse(e,n){xt.call(this,e,n)}function aTe(e,n){this.b=e,this.a=n}function hTe(e,n){this.b=e,this.a=n}function dTe(e,n){this.b=e,this.a=n}function bTe(e,n){this.b=e,this.a=n}function Sse(e,n){xt.call(this,e,n)}function gC(e,n){xt.call(this,e,n)}function Mse(e,n){xt.call(this,e,n)}function aV(e,n){xt.call(this,e,n)}function j$(e,n){xt.call(this,e,n)}function hV(e,n){xt.call(this,e,n)}function dV(e,n){xt.call(this,e,n)}function S$(e,n){xt.call(this,e,n)}function bV(e,n){xt.call(this,e,n)}function Ase(e,n){xt.call(this,e,n)}function gV(e,n){xt.call(this,e,n)}function wV(e,n){xt.call(this,e,n)}function wC(e,n){xt.call(this,e,n)}function pV(e,n){xt.call(this,e,n)}function xse(e,n){xt.call(this,e,n)}function pC(e,n){xt.call(this,e,n)}function Tse(e,n){xt.call(this,e,n)}function Cse(e,n){this.a=e,this.b=n}function gTe(e,n){this.a=e,this.b=n}function wTe(e,n){this.a=e,this.b=n}function pTe(){Z$(),this.a=new Ile}function mTe(){Hz(),this.a=new hr}function vTe(){XK(),this.b=new hr}function yTe(){kae(),Mfe.call(this)}function kTe(){yae(),lIe.call(this)}function ETe(){yae(),lIe.call(this)}function mC(e,n){xt.call(this,e,n)}function D5(e,n){xt.call(this,e,n)}function UE(e,n){xt.call(this,e,n)}function XE(e,n){xt.call(this,e,n)}function vC(e,n){xt.call(this,e,n)}function M$(e,n){xt.call(this,e,n)}function mV(e,n){xt.call(this,e,n)}function A$(e,n){xt.call(this,e,n)}function VE(e,n){xt.call(this,e,n)}function vV(e,n){xt.call(this,e,n)}function x$(e,n){xt.call(this,e,n)}function W3(e,n){xt.call(this,e,n)}function yC(e,n){xt.call(this,e,n)}function KE(e,n){xt.call(this,e,n)}function QE(e,n){xt.call(this,e,n)}function yV(e,n){xt.call(this,e,n)}function kC(e,n){xt.call(this,e,n)}function T$(e,n){xt.call(this,e,n)}function Z3(e,n){xt.call(this,e,n)}function kV(e,n){xt.call(this,e,n)}function EV(e,n){xt.call(this,e,n)}function C$(e,n){xt.call(this,e,n)}function Ee(e,n){this.a=e,this.b=n}function jTe(e,n){this.a=e,this.b=n}function STe(e,n){this.a=e,this.b=n}function MTe(e,n){this.a=e,this.b=n}function ATe(e,n){this.a=e,this.b=n}function xTe(e,n){this.a=e,this.b=n}function TTe(e,n){this.a=e,this.b=n}function jc(e,n){this.a=e,this.b=n}function CTe(e,n){this.a=e,this.b=n}function OTe(e,n){this.a=e,this.b=n}function NTe(e,n){this.a=e,this.b=n}function DTe(e,n){this.a=e,this.b=n}function _Te(e,n){this.a=e,this.b=n}function ITe(e,n){this.a=e,this.b=n}function LTe(e,n){this.b=e,this.a=n}function PTe(e,n){this.b=e,this.a=n}function $Te(e,n){this.b=e,this.a=n}function RTe(e,n){this.b=e,this.a=n}function BTe(e,n){this.a=e,this.b=n}function zTe(e,n){this.a=e,this.b=n}function FTe(e,n){this.a=e,this.b=n}function HTe(e,n){this.a=e,this.b=n}function JTe(e,n){this.f=e,this.c=n}function Ose(e,n){this.i=e,this.g=n}function O$(e,n){xt.call(this,e,n)}function _5(e,n){xt.call(this,e,n)}function N$(e,n){this.a=e,this.b=n}function GTe(e,n){this.a=e,this.b=n}function Nse(e,n){this.d=e,this.e=n}function qTe(e,n){this.a=e,this.b=n}function UTe(e,n){this.a=e,this.b=n}function XTe(e,n){this.d=e,this.b=n}function VTe(e,n){this.e=e,this.a=n}function Dse(e,n){e.i=null,TB(e,n)}function iwn(e,n){e&&Zt(i_,e,n)}function KTe(e,n){return AY(e.a,n)}function _se(e,n){return ls(e.g,n)}function rwn(e,n){return ls(n.b,e)}function cwn(e,n){return-e.b.$e(n)}function D$(e){return LO(e.c,e.b)}function uwn(e,n){y8n(new ot(e),n)}function own(e,n,t){GJe(n,yW(e,t))}function swn(e,n,t){GJe(n,yW(e,t))}function QTe(e,n){l8n(e.a,u(n,12))}function YTe(e,n){this.a=e,this.b=n}function EC(e,n){this.b=e,this.c=n}function q0(e,n){return e.Pd().Xb(n)}function _$(e,n){return _7n(e.Jc(),n)}function bu(e){return e?e.kd():null}function ue(e){return e??null}function Dp(e){return typeof e===Sy}function _p(e){return typeof e===Ige}function Br(e){return typeof e===hZ}function YE(e,n){return ao(e,n)==0}function I$(e,n){return ao(e,n)>=0}function WE(e,n){return ao(e,n)!=0}function Ise(e,n){return e.a+=""+n,e}function lwn(e){return""+(Nn(e),e)}function WTe(e){return $s(e),e.d.gc()}function Lse(e){return mn(e,0),null}function L$(e){return lj(e==null),e}function ZE(e,n){return e.a+=""+n,e}function Bc(e,n){return e.a+=""+n,e}function ej(e,n){return e.a+=""+n,e}function uo(e,n){return e.a+=""+n,e}function Xt(e,n){return e.a+=""+n,e}function ZTe(e,n){e.q.setTime(mg(n))}function eCe(e,n){Dfe.call(this,e,n)}function nCe(e,n){Dfe.call(this,e,n)}function P$(e,n){Dfe.call(this,e,n)}function pc(e,n){Vi(e,n,e.c.b,e.c)}function ev(e,n){Vi(e,n,e.a,e.a.a)}function fwn(e,n){return e.j[n.p]==2}function tCe(e,n){return e.a=n.g+1,e}function ma(e){return e.a=0,e.b=0,e}function iCe(e){Ju(this),_j(this,e)}function rCe(){this.b=0,this.a=!1}function cCe(){this.b=0,this.a=!1}function uCe(){this.b=new C5(rm(12))}function oCe(){oCe=Y,Wnn=Ot(IY())}function sCe(){sCe=Y,uin=Ot($Ue())}function lCe(){lCe=Y,Won=Ot(ize())}function Pse(){Pse=Y,loe(),yme=new wt}function awn(e){return Tt(e),new nj(e)}function fCe(e,n){return ue(e)===ue(n)}function $$(e){return e<10?"0"+e:""+e}function aCe(e){return Io(e.l,e.m,e.h)}function su(e){return typeof e===Ige}function jV(e,n){return gf(e.a,0,n)}function I5(e){return ac((Nn(e),e))}function hwn(e){return ac((Nn(e),e))}function dwn(e,n){return ki(e.a,n.a)}function $se(e,n){return oo(e.a,n.a)}function bwn(e,n){return ZDe(e.a,n.a)}function yh(e,n){return e.indexOf(n)}function Rse(e,n){r8(e,0,e.length,n)}function ni(e,n){u$(),Zt(AG,e,n)}function fn(e,n){Pi.call(this,e,n)}function SV(e,n){Bp.call(this,e,n)}function nv(e,n){Ose.call(this,e,n)}function hCe(e,n){xC.call(this,e,n)}function MV(e,n){h8.call(this,e,n)}function Zh(){que.call(this,new Z0)}function dCe(){gR.call(this,0,0,0,0)}function Bse(e){return pu(e.b.b,e,0)}function bCe(e,n){return oo(e.g,n.g)}function gwn(e){return e==D2||e==_m}function wwn(e){return e==D2||e==Dm}function pwn(e,n){return oo(e.g,n.g)}function mwn(e,n){return al(),n.a+=e}function vwn(e,n){return al(),n.a+=e}function ywn(e,n){return al(),n.c+=e}function kwn(e,n){return xe(e.c,n),e}function gCe(e,n){return xe(e.a,n),n}function zse(e,n){return pl(e.a,n),e}function wCe(e){this.a=_xe(),this.b=e}function pCe(e){this.a=_xe(),this.b=e}function mc(e){this.a=e.a,this.b=e.b}function nj(e){this.a=e,kT.call(this)}function mCe(e){this.a=e,kT.call(this)}function Vs(e){return e.sh()&&e.th()}function tv(e){return e!=fh&&e!=$b}function G1(e){return e==Zc||e==cu}function iv(e){return e==cf||e==sh}function vCe(e){return e==a4||e==f4}function R$(e){return pl(new sr,e)}function yCe(e){return DK(u(e,125))}function Ewn(e,n){return ki(n.f,e.f)}function kCe(e,n){return new h8(n,e)}function jwn(e,n){return new h8(n,e)}function Fl(e,n,t){Ls(e,n),Ps(e,t)}function AV(e,n,t){vB(e,n),yB(e,t)}function Fw(e,n,t){r2(e,n),i2(e,t)}function jC(e,n,t){pv(e,n),mv(e,t)}function SC(e,n,t){vv(e,n),yv(e,t)}function xV(e,n){v8(e,n),s8(e,e.D)}function TV(e){JTe.call(this,e,!0)}function L5(){Ff.call(this,0,0,0,0)}function ECe(){f$.call(this,"Head",1)}function jCe(){f$.call(this,"Tail",3)}function SCe(e,n,t){jle.call(this,e,n,t)}function Hw(e){gR.call(this,e,e,e,e)}function U0(e){Ch(),B7n.call(this,e)}function MCe(e){Ao(e.Qf(),new Xke(e))}function rv(e){return e!=null?Ni(e):0}function Swn(e,n){return em(n,Ha(e))}function Mwn(e,n){return em(n,Ha(e))}function Awn(e,n){return e[e.length]=n}function xwn(e,n){return e[e.length]=n}function Twn(e,n){return MB(xK(e.f),n)}function Cwn(e,n){return MB(xK(e.n),n)}function Own(e,n){return MB(xK(e.p),n)}function Fse(e){return R3n(e.b.Jc(),e.a)}function Nwn(e){return e==null?0:Ni(e)}function CV(e){e.c=oe(Cr,xn,1,0,5,1)}function ACe(e,n,t){cr(e.c[n.g],n.g,t)}function Dwn(e,n,t){u(e.c,72).Ei(n,t)}function _wn(e,n,t){Fl(t,t.i+e,t.j+n)}function Wr(e,n){Pi.call(this,e.b,n)}function Iwn(e,n){Et(Ku(e.a),iLe(n))}function Lwn(e,n){Et(Is(e.a),rLe(n))}function Pwn(e,n){ih||(e.b=n)}function OV(e,n,t){return cr(e,n,t),t}function Dt(){Dt=Y,new xCe,new Te}function xCe(){new wt,new wt,new wt}function $wn(){throw $(new _d(Den))}function Rwn(){throw $(new _d(Den))}function Bwn(){throw $(new _d(_en))}function zwn(){throw $(new _d(_en))}function TCe(){TCe=Y,hre=new Vj(Tce)}function Ba(){Ba=Y,k.Math.log(2)}function Hl(){Hl=Y,M1=(xxe(),Ean)}function tj(e){fi(),Pw.call(this,e)}function CCe(e){this.a=e,ife.call(this,e)}function NV(e){this.a=e,e$.call(this,e)}function DV(e){this.a=e,e$.call(this,e)}function Nr(e,n){sK(e.c,e.c.length,n)}function gu(e){return e.an?1:0}function Jse(e,n){return ao(e,n)>0?e:n}function Io(e,n,t){return{l:e,m:n,h:t}}function Fwn(e,n){e.a!=null&&QTe(n,e.a)}function Hwn(e){hc(e,null),Ur(e,null)}function Jwn(e,n,t){return Zt(e.g,t,n)}function Gwn(e,n){Tt(n),fv(e).Ic(new ze)}function NCe(){Vde(),this.a=new fS(w3e)}function B$(e){this.b=e,this.a=new Te}function DCe(e){this.b=new Q2,this.a=e}function Gse(e){Lle.call(this),this.a=e}function _Ce(e){aae.call(this),this.b=e}function ICe(){f$.call(this,"Range",2)}function z$(e){e.j=oe(_me,Ae,324,0,0,1)}function LCe(e){e.a=new qt,e.c=new qt}function PCe(e){e.a=new wt,e.e=new wt}function qse(e){return new Ee(e.c,e.d)}function qwn(e){return new Ee(e.c,e.d)}function vc(e){return new Ee(e.a,e.b)}function Uwn(e,n){return Zt(e.a,n.a,n)}function Xwn(e,n,t){return Zt(e.k,t,n)}function cv(e,n,t){return bde(n,t,e.c)}function Use(e,n){return re(Rn(e.i,n))}function Xse(e,n){return re(Rn(e.j,n))}function $Ce(e,n){return x$n(e.a,n,null)}function ij(e,n){return $Pn(e.c,e.b,n)}function X(e,n){return e!=null&&RY(e,n)}function RCe(e,n){yt(e),e.Fc(u(n,16))}function Vwn(e,n,t){e.c._c(n,u(t,136))}function Kwn(e,n,t){e.c.Si(n,u(t,136))}function Qwn(e,n,t){return M$n(e,n,t),t}function Ywn(e,n){return hl(),n.n.b+=e}function _V(e,n){return bkn(e.Jc(),n)!=-1}function Wwn(e,n){return new hOe(e.Jc(),n)}function F$(e){return e.Ob()?e.Pb():null}function BCe(e){return Ah(e,0,e.length)}function zCe(e){KK(e,null),QK(e,null)}function FCe(){xC.call(this,null,null)}function HCe(){X$.call(this,null,null)}function JCe(){xt.call(this,"INSTANCE",0)}function uv(){this.a=oe(Cr,xn,1,8,5,1)}function Vse(e){this.a=e,wt.call(this)}function GCe(e){this.a=(yn(),new A9(e))}function Zwn(e){this.b=(yn(),new hX(e))}function P9(){P9=Y,Jme=new AX(null)}function Kse(){Kse=Y,Kse(),fnn=new Ut}function xe(e,n){return Hn(e.c,n),!0}function qCe(e,n){e.c&&(wfe(n),kIe(n))}function e2n(e,n){e.q.setHours(n),gS(e,n)}function Qse(e,n){return e.a.Ac(n)!=null}function IV(e,n){return e.a.Ac(n)!=null}function za(e,n){return e.a[n.c.p][n.p]}function n2n(e,n){return e.e[n.c.p][n.p]}function t2n(e,n){return e.c[n.c.p][n.p]}function LV(e,n,t){return e.a[n.g][t.g]}function i2n(e,n){return e.j[n.p]=lNn(n)}function P5(e,n){return e.a*n.a+e.b*n.b}function r2n(e,n){return e.a=e}function l2n(e,n,t){return t?n!=0:n!=e-1}function UCe(e,n,t){e.a=n^1502,e.b=t^JZ}function f2n(e,n,t){return e.a=n,e.b=t,e}function q1(e,n){return e.a*=n,e.b*=n,e}function rj(e,n,t){return cr(e.g,n,t),t}function a2n(e,n,t,i){cr(e.a[n.g],t.g,i)}function yr(e,n,t){BC.call(this,e,n,t)}function H$(e,n,t){yr.call(this,e,n,t)}function ss(e,n,t){yr.call(this,e,n,t)}function XCe(e,n,t){H$.call(this,e,n,t)}function Yse(e,n,t){BC.call(this,e,n,t)}function ov(e,n,t){BC.call(this,e,n,t)}function VCe(e,n,t){rR.call(this,e,n,t)}function Wse(e,n,t){rR.call(this,e,n,t)}function KCe(e,n,t){Wse.call(this,e,n,t)}function QCe(e,n,t){Yse.call(this,e,n,t)}function X0(e){this.c=e,this.a=this.c.a}function ot(e){this.i=e,this.f=this.i.j}function sv(e,n){this.a=e,e$.call(this,n)}function YCe(e,n){this.a=e,NX.call(this,n)}function WCe(e,n){this.a=e,NX.call(this,n)}function ZCe(e,n){this.a=e,NX.call(this,n)}function Zse(e){this.a=e,qU.call(this,e.d)}function eOe(e){e.b.Qb(),--e.d.f.d,pR(e.d)}function nOe(e){e.a=u(qn(e.b.a,4),129)}function tOe(e){e.a=u(qn(e.b.a,4),129)}function h2n(e){UC(e,cZe),$z(e,ERn(e))}function ele(e,n){return JEn(e,new z0,n).a}function d2n(e){return nC(e.a)?tLe(e):null}function iOe(e){G3.call(this,u(Tt(e),35))}function rOe(e){G3.call(this,u(Tt(e),35))}function nle(e){if(!e)throw $(new ZT)}function tle(e){if(!e)throw $(new os)}function Vn(e,n){return Tt(n),new aOe(e,n)}function cOe(e,n){return new VGe(e.a,e.b,n)}function b2n(e){return e.l+e.m*Ty+e.h*_g}function g2n(e){return e==null?null:e.name}function ile(e,n,t){return e.indexOf(n,t)}function J$(e,n){return e.lastIndexOf(n)}function cj(e){return e==null?Yo:fu(e)}function Ln(){Ln=Y,jb=!1,x7=!0}function uOe(){uOe=Y,FX(),Yan=new HU}function rle(){this.Bb|=256,this.Bb|=512}function oOe(){z$(this),DR(this),this.he()}function G$(e){qr.call(this,e),this.a=e}function cle(e){cc.call(this,e),this.a=e}function ule(e){A9.call(this,e),this.a=e}function df(e){_i.call(this,(Nn(e),e))}function fl(e){_i.call(this,(Nn(e),e))}function PV(e){que.call(this,new she(e))}function sOe(e){this.a=e,Xi.call(this,e)}function ole(e,n){this.a=n,NX.call(this,e)}function lOe(e,n){this.a=n,oQ.call(this,e)}function fOe(e,n){this.a=e,oQ.call(this,n)}function aOe(e,n){this.a=n,ZP.call(this,e)}function hOe(e,n){this.a=n,ZP.call(this,e)}function sle(e){mX.call(this),dc(this,e)}function Ks(e){return at(e.a!=null),e.a}function dOe(e,n){return xe(n.a,e.a),e.a}function bOe(e,n){return xe(n.b,e.a),e.a}function Jw(e,n){return xe(n.a,e.a),e.a}function MC(e,n,t){return XQ(e,n,n,t),e}function q$(e,n){return++e.b,xe(e.a,n)}function lle(e,n){return++e.b,Xo(e.a,n)}function w2n(e,n){return ki(e.c.d,n.c.d)}function p2n(e,n){return ki(e.c.c,n.c.c)}function m2n(e,n){return ki(e.n.a,n.n.a)}function qo(e,n){return u(mi(e.b,n),16)}function v2n(e,n){return e.n.b=(Nn(n),n)}function y2n(e,n){return e.n.b=(Nn(n),n)}function ls(e,n){return!!n&&e.b[n.g]==n}function uj(e){return gu(e.a)||gu(e.b)}function k2n(e,n){return ki(e.e.b,n.e.b)}function E2n(e,n){return ki(e.e.a,n.e.a)}function j2n(e,n,t){return ZLe(e,n,t,e.b)}function fle(e,n,t){return ZLe(e,n,t,e.c)}function S2n(e){return al(),!!e&&!e.dc()}function gOe(){LE(),this.b=new CEe(this)}function U$(){U$=Y,kH=new Pi(XQe,0)}function $5(e){this.d=e,ot.call(this,e)}function R5(e){this.c=e,ot.call(this,e)}function AC(e){this.c=e,$5.call(this,e)}function ale(e,n){jde.call(this,e,n,null)}function B5(e){return e.a!=null?e.a:null}function Gw(e){return e.$H||(e.$H=++qBn)}function zd(e){var n;n=e.a,e.a=e.b,e.b=n}function xC(e,n){BE(),this.a=e,this.b=n}function X$(e,n){Bd(),this.b=e,this.c=n}function V$(e,n){aK(),this.f=n,this.d=e}function hle(e,n){Wae(n,e),this.c=e,this.b=n}function M2n(e,n){return bK(e.c).Kd().Xb(n)}function $V(e,n){return new wNe(e,e.gc(),n)}function A2n(e){return GP(),Ct((QIe(),Fen),e)}function x2n(e){return new Yp(3,e)}function e1(e){return wl(e,Em),new Mo(e)}function wOe(e){return Z9(),parseInt(e)||-1}function $9(e,n,t){return ile(e,Ko(n),t)}function dle(e,n,t){u(fO(e,n),22).Ec(t)}function T2n(e,n,t){pY(e.a,t),bz(e.a,n)}function R9(e,n,t){var i;i=e.dd(n),i.Rb(t)}function pOe(e,n,t,i){Ofe.call(this,e,n,t,i)}function mOe(e){cfe.call(this,e,null,null)}function RV(e){Tp(),this.b=e,this.a=!0}function vOe(e){n$(),this.b=e,this.a=!0}function yOe(e){if(!e)throw $(new zl)}function ble(e){if(!e)throw $(new ZT)}function C2n(e){if(!e)throw $(new wX)}function at(e){if(!e)throw $(new hu)}function Ip(e){if(!e)throw $(new os)}function kOe(e){e.d=new mOe(e),e.e=new wt}function B9(e){return at(e.b!=0),e.a.a.c}function Bf(e){return at(e.b!=0),e.c.b.c}function O2n(e,n){return XQ(e,n,n+1,""),e}function EOe(e){fZ(),GSe(this),this.Df(e)}function jOe(e){this.c=e,this.a=1,this.b=1}function TC(e){X(e,161)&&u(e,161).mi()}function SOe(e){return e.b=u(uae(e.a),45)}function Lp(e,n){return u(qa(e.a,n),35)}function bi(e,n){return!!e.q&&so(e.q,n)}function N2n(e,n){return e>0?n/(e*e):n*100}function D2n(e,n){return e>0?n*n/e:n*n*100}function _2n(e){return e.f!=null?e.f:""+e.g}function BV(e){return e.f!=null?e.f:""+e.g}function I2n(e){return nd(),e.e.a+e.f.a/2}function L2n(e){return nd(),e.e.b+e.f.b/2}function P2n(e,n,t){return nd(),t.e.b-e*n}function $2n(e,n,t){return nd(),t.e.a-e*n}function R2n(e,n,t){return i$(),t.Lg(e,n)}function B2n(e,n){return fb(),gn(e,n.e,n)}function z2n(e,n,t){return xe(n,VFe(e,t))}function F2n(e,n,t){oB(),e.nf(n)&&t.Ad(e)}function Pp(e,n,t){return e.a+=n,e.b+=t,e}function MOe(e,n,t){return e.a-=n,e.b-=t,e}function gle(e,n){return e.a=n.a,e.b=n.b,e}function K$(e){return e.a=-e.a,e.b=-e.b,e}function AOe(e){this.c=e,Ls(e,0),Ps(e,0)}function xOe(e){Mi.call(this),Dj(this,e)}function TOe(){xt.call(this,"GROW_TREE",0)}function Qs(e,n,t){as.call(this,e,n,t,2)}function COe(e,n){Bd(),wle.call(this,e,n)}function wle(e,n){Bd(),X$.call(this,e,n)}function OOe(e,n){Bd(),X$.call(this,e,n)}function NOe(e,n){BE(),xC.call(this,e,n)}function zV(e,n){Hl(),dR.call(this,e,n)}function DOe(e,n){Hl(),zV.call(this,e,n)}function ple(e,n){Hl(),zV.call(this,e,n)}function _Oe(e,n){Hl(),ple.call(this,e,n)}function mle(e,n){Hl(),dR.call(this,e,n)}function IOe(e,n){Hl(),mle.call(this,e,n)}function LOe(e,n){Hl(),dR.call(this,e,n)}function H2n(e,n){return e.c.Ec(u(n,136))}function J2n(e,n){return u(Rn(e.e,n),26)}function G2n(e,n){return u(Rn(e.e,n),26)}function vle(e,n,t){return Zz(hO(e,n),t)}function q2n(e,n,t){return n.xl(e.e,e.c,t)}function U2n(e,n,t){return n.yl(e.e,e.c,t)}function FV(e,n){return ub(e.e,u(n,52))}function X2n(e,n,t){qj(Ku(e.a),n,iLe(t))}function V2n(e,n,t){qj(Is(e.a),n,rLe(t))}function POe(e,n){return Nn(e),e+XV(n)}function K2n(e){return e==null?null:fu(e)}function Q2n(e){return e==null?null:fu(e)}function Y2n(e){return e==null?null:vTn(e)}function W2n(e){return e==null?null:dRn(e)}function U1(e){e.o==null&&ROn(e)}function $e(e){return lj(e==null||Dp(e)),e}function re(e){return lj(e==null||_p(e)),e}function _t(e){return lj(e==null||Br(e)),e}function Z2n(e,n){return UY(e,n),new x_e(e,n)}function CC(e,n){this.c=e,N9.call(this,e,n)}function oj(e,n){this.a=e,CC.call(this,e,n)}function epn(e,n){this.d=e,We(this),this.b=n}function yle(){wBe.call(this),this.Bb|=Sc}function $Oe(){this.a=new Zw,this.b=new Zw}function kle(e){this.q=new k.Date(mg(e))}function lv(){lv=Y,b4=new yi("root")}function z9(){z9=Y,c_=new yMe,new kMe}function $p(){$p=Y,Qme=nn((tl(),nw))}function npn(e,n){n.a?cOn(e,n):IV(e.a,n.b)}function ROe(e,n){ih||xe(e.a,n)}function tpn(e,n){return sC(),a8(n.d.i,e)}function ipn(e,n){return uy(),new _Xe(n,e)}function rpn(e,n,t){return e.Le(n,t)<=0?t:n}function cpn(e,n,t){return e.Le(n,t)<=0?n:t}function upn(e,n){return u(qa(e.b,n),144)}function opn(e,n){return u(qa(e.c,n),233)}function HV(e){return u(Le(e.a,e.b),295)}function BOe(e){return new Ee(e.c,e.d+e.a)}function zOe(e){return Nn(e),e?1231:1237}function FOe(e){return hl(),vCe(u(e,203))}function Ele(e,n){return u(Rn(e.b,n),278)}function HOe(e,n,t){++e.j,e.oj(n,e.Xi(n,t))}function OC(e,n,t){++e.j,e.rj(),wQ(e,n,t)}function jle(e,n,t){rB.call(this,e,n,t,null)}function JOe(e,n,t){rB.call(this,e,n,t,null)}function Sle(e,n){pQ.call(this,e),this.a=n}function Mle(e,n){pQ.call(this,e),this.a=n}function Pi(e,n){yi.call(this,e),this.a=n}function Ale(e,n){roe.call(this,e),this.a=n}function JV(e,n){roe.call(this,e),this.a=n}function GOe(e,n){this.c=e,t2.call(this,n)}function qOe(e,n){this.a=e,LSe.call(this,n)}function NC(e,n){this.a=e,LSe.call(this,n)}function xle(e,n,t){return t=yl(e,n,3,t),t}function Tle(e,n,t){return t=yl(e,n,6,t),t}function Cle(e,n,t){return t=yl(e,n,9,t),t}function kh(e,n){return UC(n,Zge),e.f=n,e}function Ole(e,n){return(n&ui)%e.d.length}function UOe(e,n,t){return dge(e.c,e.b,n,t)}function spn(e,n,t){return e.apply(n,t)}function XOe(e,n,t){var i;i=e.dd(n),i.Rb(t)}function VOe(e,n,t){return e.a+=Ah(n,0,t),e}function DC(e){return!e.a&&(e.a=new In),e.a}function Nle(e,n){var t;return t=e.e,e.e=n,t}function Dle(e,n){var t;return t=n,!!e.De(t)}function ug(e,n){return Ln(),e==n?0:e?1:-1}function Rp(e,n){e.a._c(e.b,n),++e.b,e.c=-1}function lpn(e,n){var t;t=e[HZ],t.call(e,n)}function fpn(e,n){var t;t=e[HZ],t.call(e,n)}function apn(e,n,t){rg(),xP(e,n.Te(e.a,t))}function _le(e,n,t){return X5(e,u(n,23),t)}function zf(e,n){return VP(new Array(n),e)}function hpn(e){return Lt(fg(e,32))^Lt(e)}function GV(e){return String.fromCharCode(e)}function dpn(e){return e==null?null:e.message}function qV(e){this.a=(yn(),new On(Tt(e)))}function KOe(e){this.a=(wl(e,Em),new Mo(e))}function QOe(e){this.a=(wl(e,Em),new Mo(e))}function YOe(){this.a=new Te,this.b=new Te}function WOe(){this.a=new gw,this.b=new YSe}function Ile(){this.b=new Z0,this.a=new Z0}function ZOe(){this.b=new Yr,this.c=new Te}function Lle(){this.n=new Yr,this.o=new Yr}function Q$(){this.n=new E5,this.i=new L5}function eNe(){this.b=new hr,this.a=new hr}function nNe(){this.a=new Te,this.d=new Te}function tNe(){this.a=new _U,this.b=new fI}function iNe(){this.b=new OAe,this.a=new Sx}function rNe(){this.b=new wt,this.a=new wt}function cNe(){Q$.call(this),this.a=new Yr}function Ple(e,n,t,i){gR.call(this,e,n,t,i)}function bpn(e,n){return e.n.a=(Nn(n),n+10)}function gpn(e,n){return e.n.a=(Nn(n),n+10)}function wpn(e,n){return sC(),!a8(n.d.i,e)}function uNe(e){Ju(e.e),e.d.b=e.d,e.d.a=e.d}function _C(e){e.b?_C(e.b):e.f.c.yc(e.e,e.d)}function ppn(e,n){G1(e.f)?OOn(e,n):Exn(e,n)}function oNe(e,n,t){t!=null&&AB(n,KY(e,t))}function sNe(e,n,t){t!=null&&xB(n,KY(e,t))}function z5(e,n,t,i){we.call(this,e,n,t,i)}function $le(e,n,t,i){we.call(this,e,n,t,i)}function lNe(e,n,t,i){$le.call(this,e,n,t,i)}function fNe(e,n,t,i){jR.call(this,e,n,t,i)}function UV(e,n,t,i){jR.call(this,e,n,t,i)}function aNe(e,n,t,i){UV.call(this,e,n,t,i)}function Rle(e,n,t,i){jR.call(this,e,n,t,i)}function Tn(e,n,t,i){Rle.call(this,e,n,t,i)}function Ble(e,n,t,i){UV.call(this,e,n,t,i)}function hNe(e,n,t,i){Ble.call(this,e,n,t,i)}function dNe(e,n,t,i){Ife.call(this,e,n,t,i)}function Bp(e,n){Eo.call(this,qS+e+Rg+n)}function mpn(e,n){return n==e||I8(Pz(n),e)}function zle(e,n){return e.hk().ti().oi(e,n)}function Fle(e,n){return e.hk().ti().qi(e,n)}function vpn(e,n){return e.e=u(e.d.Kb(n),162)}function bNe(e,n){return Zt(e.a,n,"")==null}function gNe(e,n){return Nn(e),ue(e)===ue(n)}function bn(e,n){return Nn(e),ue(e)===ue(n)}function Hle(e,n,t){return e.lastIndexOf(n,t)}function wNe(e,n,t){this.a=e,hle.call(this,n,t)}function pNe(e){this.c=e,P$.call(this,pN,0)}function mNe(e,n,t){this.c=n,this.b=t,this.a=e}function gi(e,n){return e.a+=n.a,e.b+=n.b,e}function _r(e,n){return e.a-=n.a,e.b-=n.b,e}function ypn(e){return Ep(e.j.c,0),e.a=-1,e}function kpn(e,n){var t;return t=n.ni(e.a),t}function Jle(e,n,t){return t=yl(e,n,11,t),t}function Epn(e,n,t){return ki(e[n.a],e[t.a])}function jpn(e,n){return oo(e.a.d.p,n.a.d.p)}function Spn(e,n){return oo(n.a.d.p,e.a.d.p)}function Mpn(e,n){return ki(e.c-e.s,n.c-n.s)}function Apn(e,n){return ki(e.b.e.a,n.b.e.a)}function xpn(e,n){return ki(e.c.e.a,n.c.e.a)}function Tpn(e,n){return ae(n,(Oe(),gD),e)}function Cpn(e,n){return e.b.zd(new Pxe(e,n))}function Opn(e,n){return e.b.zd(new $xe(e,n))}function vNe(e,n){return e.b.zd(new Rxe(e,n))}function yNe(e,n){return X(n,16)&&dXe(e.c,n)}function kNe(e){return e.c?pu(e.c.a,e,0):-1}function Npn(e){return e<100?null:new F0(e)}function F5(e){return e==ew||e==j1||e==to}function Dpn(e,n,t){return u(e.c,72).Uk(n,t)}function Y$(e,n,t){return u(e.c,72).Vk(n,t)}function _pn(e,n,t){return q2n(e,u(n,344),t)}function Gle(e,n,t){return U2n(e,u(n,344),t)}function Ipn(e,n,t){return eGe(e,u(n,344),t)}function ENe(e,n,t){return Ixn(e,u(n,344),t)}function sj(e,n){return n==null?null:um(e.b,n)}function Lpn(e,n){ih||n&&(e.d=n)}function qle(e,n){if(!e)throw $(new Jn(n))}function F9(e){if(!e)throw $(new Uc(Lge))}function XV(e){return _p(e)?(Nn(e),e):e.se()}function W$(e){return!isNaN(e)&&!isFinite(e)}function VV(e){LCe(this),Ws(this),dc(this,e)}function vs(e){CV(this),ofe(this.c,0,e.Nc())}function IC(e){H9(),this.d=e,this.a=new uv}function jNe(e,n,t){this.d=e,this.b=t,this.a=n}function Jl(e,n,t){this.a=e,this.b=n,this.c=t}function SNe(e,n,t){this.a=e,this.b=n,this.c=t}function Ule(e,n){this.c=e,kK.call(this,e,n)}function MNe(e,n){H3n.call(this,e,e.length,n)}function KV(e,n){if(e!=n)throw $(new zl)}function ANe(e){this.a=e,Rd(),Pu(Date.now())}function xNe(e){Ns(e.a),che(e.c,e.b),e.b=null}function QV(){QV=Y,Hme=new wi,snn=new li}function YV(e){var n;return n=new Sd,n.e=e,n}function Ppn(e,n,t){return rg(),e.a.Wd(n,t),n}function Xle(e,n,t){this.b=e,this.c=n,this.a=t}function Vle(e){var n;return n=new iMe,n.b=e,n}function $pn(e){return Sa(),Ct((j$e(),Mnn),e)}function Rpn(e){return c8(),Ct(($$e(),ann),e)}function Bpn(e){return Kl(),Ct((E$e(),pnn),e)}function zpn(e){return ks(),Ct((S$e(),xnn),e)}function Fpn(e){return Vo(),Ct((M$e(),Cnn),e)}function Hpn(e){return rF(),Ct((oCe(),Wnn),e)}function Jpn(e){return u2(),Ct((H$e(),etn),e)}function Gpn(e){return g8(),Ct((J$e(),Gtn),e)}function qpn(e){return bB(),Ct((CPe(),ltn),e)}function Upn(e){return Tj(),Ct((k$e(),Ltn),e)}function Xpn(e){return Hr(),Ct((NRe(),Btn),e)}function Vpn(e){return dy(),Ct((F$e(),Qtn),e)}function Kpn(e){return Bn(),Ct((ZBe(),ein),e)}function Qpn(e){return f8(),Ct((OPe(),cin),e)}function WV(e){gR.call(this,e.d,e.c,e.a,e.b)}function Kle(e){gR.call(this,e.d,e.c,e.a,e.b)}function Ypn(e){return Vr(),Ct((sCe(),uin),e)}function TNe(){TNe=Y,xan=oe(Cr,xn,1,0,5,1)}function CNe(){CNe=Y,qan=oe(Cr,xn,1,0,5,1)}function Qle(){Qle=Y,Uan=oe(Cr,xn,1,0,5,1)}function LC(){LC=Y,xH=new aq,TH=new HA}function Z$(){Z$=Y,ain=new Oq,fin=new Nq}function al(){al=Y,win=new jk,pin=new Md}function Wpn(e){return c2(),Ct((c$e(),xin),e)}function Zpn(e){return Xf(),Ct((X$e(),yin),e)}function emn(e){return am(),Ct((MRe(),Ein),e)}function nmn(e){return Gz(),Ct((tze(),Tin),e)}function tmn(e){return py(),Ct((cBe(),Cin),e)}function imn(e){return uB(),Ct((hPe(),Oin),e)}function rmn(e){return Xj(),Ct((K$e(),Nin),e)}function cmn(e){return EB(),Ct((e$e(),Din),e)}function umn(e){return ZO(),Ct((sze(),_in),e)}function omn(e){return gO(),Ct((dPe(),Iin),e)}function smn(e){return jg(),Ct((n$e(),Pin),e)}function lmn(e){return Cz(),Ct((rBe(),$in),e)}function fmn(e){return lO(),Ct((bPe(),Rin),e)}function amn(e){return qO(),Ct((tBe(),Bin),e)}function hmn(e){return P8(),Ct((iBe(),zin),e)}function dmn(e){return Dc(),Ct((Mze(),Fin),e)}function bmn(e){return b8(),Ct((t$e(),Hin),e)}function gmn(e){return ib(),Ct((i$e(),Jin),e)}function wmn(e){return Z1(),Ct((r$e(),qin),e)}function pmn(e){return XR(),Ct((gPe(),Uin),e)}function mmn(e){return el(),Ct((xRe(),Vin),e)}function vmn(e){return QR(),Ct((wPe(),Kin),e)}function ymn(e){return nN(),Ct((lze(),Pun),e)}function kmn(e){return Fj(),Ct((u$e(),$un),e)}function Emn(e){return fm(),Ct((q$e(),Run),e)}function jmn(e){return Yj(),Ct((ARe(),Bun),e)}function Smn(e){return db(),Ct((Sze(),zun),e)}function Mmn(e){return ud(),Ct((U$e(),Fun),e)}function Amn(e){return aO(),Ct((pPe(),Hun),e)}function xmn(e){return Nc(),Ct((o$e(),Gun),e)}function Tmn(e){return $B(),Ct((s$e(),qun),e)}function Cmn(e){return zj(),Ct((l$e(),Uun),e)}function Omn(e){return y8(),Ct((f$e(),Xun),e)}function Nmn(e){return kB(),Ct((a$e(),Vun),e)}function Dmn(e){return RB(),Ct((h$e(),Kun),e)}function _mn(e){return zB(),Ct((z$e(),lin),e)}function Imn(e){return Mg(),Ct((G$e(),bon),e)}function Lmn(e,n){return Nn(e),e+(Nn(n),n)}function Pmn(e){return Aj(),Ct((mPe(),von),e)}function $mn(e){return Eh(),Ct((yPe(),Aon),e)}function Rmn(e){return Fa(),Ct((vPe(),Ton),e)}function Bmn(e){return ka(),Ct((kPe(),Jon),e)}function H9(){H9=Y,eye=(Ne(),Xn),LJ=Wn}function zmn(e){return e2(),Ct((EPe(),Qon),e)}function Fmn(e){return wy(),Ct((W$e(),Yon),e)}function Hmn(e){return dS(),Ct((lCe(),Won),e)}function Jmn(e){return Bj(),Ct((d$e(),Zon),e)}function Gmn(e){return Rj(),Ct((V$e(),Esn),e)}function qmn(e){return UR(),Ct((jPe(),jsn),e)}function Umn(e){return CB(),Ct((SPe(),Tsn),e)}function Xmn(e){return Sz(),Ct((TRe(),Osn),e)}function Vmn(e){return sB(),Ct((MPe(),Nsn),e)}function Kmn(e){return TO(),Ct((b$e(),Dsn),e)}function Qmn(e){return wz(),Ct((Y$e(),Wsn),e)}function Ymn(e){return PB(),Ct((g$e(),Zsn),e)}function Wmn(e){return iz(),Ct((w$e(),eln),e)}function Zmn(e){return Az(),Ct((Q$e(),tln),e)}function e3n(e){return WB(),Ct((y$e(),cln),e)}function n3n(e){return!e.e&&(e.e=new Te),e.e}function eR(e,n,t){this.e=n,this.b=e,this.d=t}function ONe(e,n,t){this.a=e,this.b=n,this.c=t}function NNe(e,n,t){this.a=e,this.b=n,this.c=t}function Yle(e,n,t){this.a=e,this.b=n,this.c=t}function DNe(e,n,t){this.a=e,this.b=n,this.c=t}function _Ne(e,n,t){this.a=e,this.c=n,this.b=t}function nR(e,n,t){this.b=e,this.a=n,this.c=t}function INe(e,n,t){this.b=e,this.a=n,this.c=t}function ZV(e,n){this.c=e,this.a=n,this.b=n-e}function t3n(e){return XB(),Ct((m$e(),Cln),e)}function i3n(e){return c$(),Ct((JLe(),Lln),e)}function r3n(e){return iO(),Ct((xPe(),Pln),e)}function c3n(e){return XO(),Ct((ORe(),$ln),e)}function u3n(e){return r$(),Ct((HLe(),_ln),e)}function o3n(e){return lS(),Ct((CRe(),Nln),e)}function s3n(e){return _O(),Ct((v$e(),Dln),e)}function l3n(e){return eB(),Ct((APe(),xln),e)}function f3n(e){return lB(),Ct((p$e(),Tln),e)}function a3n(e){return PE(),Ct((GLe(),Zln),e)}function h3n(e){return EO(),Ct((TPe(),efn),e)}function d3n(e){return Th(),Ct((_Re(),ufn),e)}function b3n(e){return Og(),Ct((eze(),sfn),e)}function g3n(e){return cd(),Ct((eRe(),Gfn),e)}function w3n(e){return kr(),Ct((DRe(),Ffn),e)}function p3n(e){return E8(),Ct((Z$e(),Hfn),e)}function m3n(e){return Ua(),Ct((A$e(),Jfn),e)}function v3n(e){return s1(),Ct((WRe(),lfn),e)}function y3n(e){return Cg(),Ct((ZRe(),gfn),e)}function k3n(e){return gm(),Ct((aze(),Qfn),e)}function E3n(e){return Mv(),Ct((IRe(),Yfn),e)}function j3n(e){return Fr(),Ct((nBe(),Wfn),e)}function S3n(e){return Es(),Ct((eBe(),Zfn),e)}function M3n(e){return ml(),Ct((nRe(),Kfn),e)}function A3n(e){return xz(),Ct((YRe(),qfn),e)}function x3n(e){return rd(),Ct((T$e(),Xfn),e)}function T3n(e){return YR(),Ct((tRe(),lan),e)}function C3n(e){return Bs(),Ct((fze(),oan),e)}function O3n(e){return fy(),Ct((x$e(),san),e)}function N3n(e){return Ne(),Ct((LRe(),ean),e)}function D3n(e){return Oj(),Ct((C$e(),can),e)}function _3n(e){return tl(),Ct((iRe(),uan),e)}function I3n(e){return ZB(),Ct((rRe(),fan),e)}function L3n(e){return FB(),Ct((cRe(),dan),e)}function P3n(e){return R8(),Ct((nze(),Aan),e)}function LNe(e,n,t){Hl(),dae.call(this,e,n,t)}function eK(e,n,t){Hl(),Vfe.call(this,e,n,t)}function PNe(e,n,t){Hl(),eK.call(this,e,n,t)}function Wle(e,n,t){Hl(),eK.call(this,e,n,t)}function $Ne(e,n,t){Hl(),Wle.call(this,e,n,t)}function RNe(e,n,t){Hl(),Zle.call(this,e,n,t)}function Zle(e,n,t){Hl(),Vfe.call(this,e,n,t)}function efe(e,n,t){Hl(),Vfe.call(this,e,n,t)}function BNe(e,n,t){Hl(),efe.call(this,e,n,t)}function zNe(e,n,t){this.a=e,this.c=n,this.b=t}function FNe(e,n,t){this.a=e,this.b=n,this.c=t}function nfe(e,n,t){this.a=e,this.b=n,this.c=t}function tfe(e,n,t){this.a=e,this.b=n,this.c=t}function nK(e,n,t){this.a=e,this.b=n,this.c=t}function HNe(e,n,t){this.a=e,this.b=n,this.c=t}function Fd(e,n,t){this.e=e,this.a=n,this.c=t}function ife(e){this.d=e,We(this),this.b=Cvn(e.d)}function rfe(e,n){Tgn.call(this,e,QB(new Mu(n)))}function PC(e,n){return Tt(e),Tt(n),new XAe(e,n)}function H5(e,n){return Tt(e),Tt(n),new ZNe(e,n)}function $3n(e,n){return Tt(e),Tt(n),new eDe(e,n)}function R3n(e,n){return Tt(e),Tt(n),new rxe(e,n)}function tK(e){return at(e.b!=0),Ul(e,e.a.a)}function B3n(e){return at(e.b!=0),Ul(e,e.c.b)}function z3n(e){return!e.c&&(e.c=new Bl),e.c}function $C(e){var n;return n=new Mi,zQ(n,e),n}function JNe(e){var n;return n=new mX,zQ(n,e),n}function F3n(e){var n;return n=new hr,TQ(n,e),n}function J9(e){var n;return n=new Te,TQ(n,e),n}function u(e,n){return lj(e==null||RY(e,n)),e}function H3n(e,n,t){HDe.call(this,n,t),this.a=e}function GNe(e,n){this.c=e,this.b=n,this.a=!1}function qNe(){this.a=";,;",this.b="",this.c=""}function UNe(e,n,t){this.b=e,eCe.call(this,n,t)}function cfe(e,n,t){this.c=e,l$.call(this,n,t)}function ufe(e,n,t){L9.call(this,e,n),this.b=t}function ofe(e,n,t){Z0e(t,0,e,n,t.length,!1)}function n1(e,n,t,i,r){e.b=n,e.c=t,e.d=i,e.a=r}function sfe(e,n,t,i,r){e.d=n,e.c=t,e.a=i,e.b=r}function J3n(e,n){n&&(e.b=n,e.a=(K0(n),n.a))}function RC(e,n){if(!e)throw $(new Jn(n))}function J5(e,n){if(!e)throw $(new Uc(n))}function lfe(e,n){if(!e)throw $(new WMe(n))}function G3n(e,n){return t$(),oo(e.d.p,n.d.p)}function q3n(e,n){return nd(),ki(e.e.b,n.e.b)}function U3n(e,n){return nd(),ki(e.e.a,n.e.a)}function X3n(e,n){return oo(cDe(e.d),cDe(n.d))}function tR(e,n){return n&&TR(e,n.d)?n:null}function V3n(e,n){return n==(Ne(),Xn)?e.c:e.d}function K3n(e){return new Ee(e.c+e.b,e.d+e.a)}function XNe(e){return e!=null&&!jY(e,bA,gA)}function Q3n(e,n){return(CFe(e)<<4|CFe(n))&Er}function VNe(e,n,t,i,r){e.c=n,e.d=t,e.b=i,e.a=r}function ffe(e){var n,t;n=e.b,t=e.c,e.b=t,e.c=n}function afe(e){var n,t;t=e.d,n=e.a,e.d=n,e.a=t}function Y3n(e,n){var t;return t=e.c,Fhe(e,n),t}function hfe(e,n){return n<0?e.g=-1:e.g=n,e}function iR(e,n){return H8n(e),e.a*=n,e.b*=n,e}function BC(e,n,t){Nse.call(this,e,n),this.c=t}function rR(e,n,t){Nse.call(this,e,n),this.c=t}function dfe(e){Qle(),F3.call(this),this._h(e)}function KNe(){t8(),l4n.call(this,(J0(),Cf))}function QNe(e){return fi(),new t1(0,e)}function YNe(){YNe=Y,qce=(yn(),new On(zne))}function cR(){cR=Y,new Ade((MX(),Wne),(SX(),Yne))}function WNe(){this.b=te(re(Ie((Qf(),jte))))}function iK(e){this.b=e,this.a=sg(this.b.a).Md()}function ZNe(e,n){this.b=e,this.a=n,kT.call(this)}function eDe(e,n){this.a=e,this.b=n,kT.call(this)}function nDe(e,n,t){this.a=e,nv.call(this,n,t)}function tDe(e,n,t){this.a=e,nv.call(this,n,t)}function G9(e,n,t){var i;i=new qp(t),Gf(e,n,i)}function bfe(e,n,t){var i;return i=e[n],e[n]=t,i}function uR(e){var n;return n=e.slice(),kQ(n,e)}function oR(e){var n;return n=e.n,e.a.b+n.d+n.a}function iDe(e){var n;return n=e.n,e.e.b+n.d+n.a}function gfe(e){var n;return n=e.n,e.e.a+n.b+n.c}function wfe(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function Vt(e,n){return Vi(e,n,e.c.b,e.c),!0}function W3n(e){return e.a?e.a:_K(e)}function lj(e){if(!e)throw $(new M9(null))}function qw(e,n){return nS(e,new L9(n.a,n.b))}function Z3n(e){return!sc(e)&&e.c.i.c==e.d.i.c}function evn(e,n){return e.c=n)throw $(new fMe)}function Ju(e){e.f=new wCe(e),e.i=new pCe(e),++e.g}function kR(e){this.b=new Mo(11),this.a=(Yw(),e)}function wK(e){this.b=null,this.a=(Yw(),e||zme)}function Dfe(e,n){this.e=e,this.d=(n&64)!=0?n|Nh:n}function HDe(e,n){this.c=0,this.d=e,this.b=n|64|Nh}function JDe(e){this.a=JHe(e.a),this.b=new vs(e.b)}function Hd(e,n,t,i){var r;r=e.i,r.i=n,r.a=t,r.b=i}function _fe(e){var n;for(n=e;n.f;)n=n.f;return n}function Pvn(e){return e.e?the(e.e):null}function dj(e){return Es(),!e.Gc(md)&&!e.Gc(Rb)}function GDe(e,n,t){return F8(),UQ(e,n)&&UQ(e,t)}function qDe(e,n,t){return ZKe(e,u(n,12),u(t,12))}function pK(e,n){return n.Sh()?ub(e.b,u(n,52)):n}function ER(e){return new Ee(e.c+e.b/2,e.d+e.a/2)}function $vn(e,n,t){n.of(t,te(re(Rn(e.b,t)))*e.a)}function Rvn(e,n){n.Tg("General 'Rotator",1),Z$n(e)}function Lr(e,n,t,i,r){vQ.call(this,e,n,t,i,r,-1)}function bj(e,n,t,i,r){oO.call(this,e,n,t,i,r,-1)}function we(e,n,t,i){yr.call(this,e,n,t),this.b=i}function jR(e,n,t,i){BC.call(this,e,n,t),this.b=i}function UDe(e){JTe.call(this,e,!1),this.a=!1}function XDe(){EV.call(this,"LOOKAHEAD_LAYOUT",1)}function VDe(){EV.call(this,"LAYOUT_NEXT_LEVEL",3)}function KDe(e){this.b=e,$5.call(this,e),nOe(this)}function QDe(e){this.b=e,AC.call(this,e),tOe(this)}function YDe(e,n){this.b=e,qU.call(this,e.b),this.a=n}function Jp(e,n,t){this.a=e,z5.call(this,n,t,5,6)}function Ife(e,n,t,i){this.b=e,yr.call(this,n,t,i)}function ag(e,n,t){Ch(),this.e=e,this.d=n,this.a=t}function nc(e,n){for(Nn(n);e.Ob();)n.Ad(e.Pb())}function SR(e,n){return fi(),new Kfe(e,n,0)}function mK(e,n){return fi(),new Kfe(6,e,n)}function Bvn(e,n){return bn(e.substr(0,n.length),n)}function so(e,n){return Br(n)?zK(e,n):!!Xc(e.f,n)}function zvn(e){return Io(~e.l&zs,~e.m&zs,~e.h&ld)}function vK(e){return typeof e===dN||typeof e===dZ}function r1(e){return new Gn(new ole(e.a.length,e.a))}function yK(e){return new wn(null,Vvn(e,e.length))}function WDe(e){if(!e)throw $(new hu);return e.d}function U5(e){var n;return n=$j(e),at(n!=null),n}function Fvn(e){var n;return n=TEn(e),at(n!=null),n}function U9(e,n){var t;return t=e.a.gc(),Wae(n,t),t-n}function dr(e,n){var t;return t=e.a.yc(n,e),t==null}function FC(e,n){return e.a.yc(n,(Ln(),jb))==null}function Hvn(e,n){return e>0?k.Math.log(e/n):-100}function Lfe(e,n){return n?dc(e,n):!1}function X5(e,n,t){return Uf(e.a,n),bfe(e.b,n.g,t)}function Jvn(e,n,t){q9(t,e.a.c.length),bl(e.a,t,n)}function ce(e,n,t,i){Yze(n,t,e.length),Gvn(e,n,t,i)}function Gvn(e,n,t,i){var r;for(r=n;r0?1:0}function wj(e){return e.e==0?e:new ag(-e.e,e.d,e.a)}function Uvn(e){return e==Ki?VN:e==Ir?"-INF":""+e}function Xvn(e){return e==Ki?VN:e==Ir?"-INF":""+e}function Vvn(e,n){return R8n(n,e.length),new lDe(e,n)}function e_e(e,n,t,i,r){for(;n=e.g}function CK(e,n,t){var i;return i=BQ(e,n,t),Bbe(e,i)}function h_e(e,n){var t;t=console[e],t.call(console,n)}function V5(e,n){var t;t=e.a.length,Zp(e,t),iQ(e,t,n)}function d_e(e,n){var t;++e.j,t=e.Cj(),e.pj(e.Xi(t,n))}function OK(e,n){for(Nn(n);e.c=e?new Koe:s7n(e-1)}function bf(e){if(e==null)throw $(new y5);return e}function Nn(e){if(e==null)throw $(new y5);return e}function d4n(e){return!e.a&&(e.a=new yr(Bb,e,4)),e.a}function Kw(e){return!e.d&&(e.d=new yr(Rc,e,1)),e.d}function b4n(e){if(e.p!=3)throw $(new os);return e.e}function g4n(e){if(e.p!=4)throw $(new os);return e.e}function w4n(e){if(e.p!=6)throw $(new os);return e.f}function p4n(e){if(e.p!=3)throw $(new os);return e.j}function m4n(e){if(e.p!=4)throw $(new os);return e.j}function v4n(e){if(e.p!=6)throw $(new os);return e.k}function sr(){_Me.call(this),Ep(this.j.c,0),this.a=-1}function j_e(){xt.call(this,"DELAUNAY_TRIANGULATION",0)}function y4n(){return GP(),z(B(zen,1),ye,537,0,[ete])}function k4n(e,n,t){return sy(),t.Kg(e,u(n.jd(),147))}function E4n(e,n){Et((!e.a&&(e.a=new NC(e,e)),e.a),n)}function Yfe(e,n){e.c<0||e.b.b=0?e.hi(t):G0e(e,n)}function K9(e,n){var t;return t=TK("",e),t.n=n,t.i=1,t}function Qw(e){return e.c==-2&&lX(e,$xn(e.g,e.b)),e.c}function Wfe(e){return!e.b&&(e.b=new LP(new jX)),e.b}function S_e(e,n){return cR(),new Ade(new rOe(e),new iOe(n))}function S4n(e){return wl(e,pZ),gB(yc(yc(5,e),e/10|0))}function NK(){NK=Y,Jen=new ise(z(B(Fg,1),cF,45,0,[]))}function M_e(){k0e.call(this,zg,(wAe(),ehn)),HPn(this)}function A_e(){k0e.call(this,yf,(C9(),K8e)),QLn(this)}function x_e(e,n){Zwn.call(this,l7n(Tt(e),Tt(n))),this.a=n}function Zfe(e,n,t,i){Bw.call(this,e,n),this.d=t,this.a=i}function CR(e,n,t,i){Bw.call(this,e,t),this.a=n,this.f=i}function T_e(e,n){this.b=e,kK.call(this,e,n),nOe(this)}function C_e(e,n){this.b=e,Ule.call(this,e,n),tOe(this)}function yj(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function O_e(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function Q9(e){return!e.a&&(e.a=new tAe(e.c.vc())),e.a}function N_e(e){return!e.b&&(e.b=new A9(e.c.ec())),e.b}function D_e(e){return!e.d&&(e.d=new qr(e.c.Bc())),e.d}function c1(e,n){for(;n-- >0;)e=e<<1|(e<0?1:0);return e}function __e(e,n){var t;return t=new Xu(e),Hn(n.c,t),t}function M4n(e,n){dK(u(n.b,68),e),Ao(n.a,new Yue(e))}function I_e(e,n){e.u.Gc((Es(),md))&&_Cn(e,n),I9n(e,n)}function Vu(e,n){return ue(e)===ue(n)||e!=null&&di(e,n)}function Zt(e,n,t){return Br(n)?Vc(e,n,t):Qo(e.f,n,t)}function eae(e){return yn(),e?e.Me():(Yw(),Yw(),Fme)}function A4n(){return r$(),z(B(L6e,1),ye,477,0,[ece])}function x4n(){return c$(),z(B(Iln,1),ye,546,0,[nce])}function T4n(){return PE(),z(B(t9e,1),ye,527,0,[_D])}function zc(e,n){return lK(e.a,n)?e.b[u(n,23).g]:null}function C4n(e){return String.fromCharCode.apply(null,e)}function uc(e,n){return Kn(n,e.length),e.charCodeAt(n)}function JC(e){return e.j.c.length=0,iae(e.c),ypn(e.a),e}function Y9(e){return e.e==S7&&a(e,Yjn(e.g,e.b)),e.e}function GC(e){return e.f==S7&&w(e,zMn(e.g,e.b)),e.f}function O4n(e){return!e.b&&(e.b=new Tn(mt,e,4,7)),e.b}function nae(e){return!e.c&&(e.c=new Tn(mt,e,5,8)),e.c}function tae(e){return!e.c&&(e.c=new we(Hs,e,9,9)),e.c}function DK(e){return!e.n&&(e.n=new we(ju,e,1,7)),e.n}function fv(e){var n;return n=e.b,!n&&(e.b=n=new hE(e)),n}function iae(e){var n;for(n=e.Jc();n.Ob();)n.Pb(),n.Qb()}function N4n(e,n,t){var i;i=u(e.d.Kb(t),162),i&&i.Nb(n)}function D4n(e,n){return new oIe(u(Tt(e),51),u(Tt(n),51))}function oi(e,n){return ob(e),new wn(e,new ghe(n,e.a))}function So(e,n){return ob(e),new wn(e,new nhe(n,e.a))}function Up(e,n){return ob(e),new Sle(e,new VPe(n,e.a))}function OR(e,n){return ob(e),new Mle(e,new KPe(n,e.a))}function L_e(e,n){Y1e(e,te(td(n,"x")),te(td(n,"y")))}function P_e(e,n){Y1e(e,te(td(n,"x")),te(td(n,"y")))}function _4n(e,n){return Qoe(),ki((Nn(e),e),(Nn(n),n))}function I4n(e,n){return ki(e.d.c+e.d.b/2,n.d.c+n.d.b/2)}function L4n(e,n){return ki(e.g.c+e.g.b/2,n.g.c+n.g.b/2)}function P4n(e){return e!=null&&DE(xG,e.toLowerCase())}function $4n(e){al();var n;n=u(e.g,9),n.n.a=e.d.c+n.d.b}function _K(e){var n;return n=a7n(e),n||null}function ii(e,n,t,i){return VBe(e,n,t,!1),UB(e,i),e}function R4n(e,n,t){GLn(e.a,t),lkn(t),wOn(e.b,t),aPn(n,t)}function K5(e,n,t,i){xt.call(this,e,n),this.a=t,this.b=i}function NR(e,n,t,i){this.a=e,this.c=n,this.b=t,this.d=i}function rae(e,n,t,i){this.c=e,this.b=n,this.a=t,this.d=i}function $_e(e,n,t,i){this.c=e,this.b=n,this.d=t,this.a=i}function IK(e,n,t,i){this.a=e,this.e=n,this.d=t,this.c=i}function R_e(e,n,t,i){this.a=e,this.d=n,this.c=t,this.b=i}function Ff(e,n,t,i){this.c=e,this.d=n,this.b=t,this.a=i}function LK(e,n,t){this.a=Fge,this.d=e,this.b=n,this.c=t}function cae(e,n){this.b=e,this.c=n,this.a=new T5(this.b)}function B_e(e,n){this.d=(Nn(e),e),this.a=16449,this.c=n}function z_e(e,n,t,i){Jze.call(this,e,t,i,!1),this.f=n}function PK(e,n,t){var i,r;return i=Tge(e),r=n.qi(t,i),r}function V1(e){var n,t;return t=(n=new $w,n),o8(t,e),t}function $K(e){var n,t;return t=(n=new $w,n),S0e(t,e),t}function F_e(e){return!e.b&&(e.b=new we(mr,e,12,3)),e.b}function H_e(e){this.a=new Te,this.e=oe(It,Ae,54,e,0,2)}function RK(e){this.f=e,this.c=this.f.e,e.f>0&&RJe(this)}function J_e(e,n,t,i){this.a=e,this.c=n,this.d=t,this.b=i}function G_e(e,n,t,i){this.a=e,this.b=n,this.d=t,this.c=i}function q_e(e,n,t,i){this.a=e,this.b=n,this.c=t,this.d=i}function U_e(e,n,t,i){this.a=e,this.b=n,this.c=t,this.d=i}function dg(e,n,t,i){this.e=e,this.a=n,this.c=t,this.d=i}function X_e(e,n,t,i){Hl(),XPe.call(this,n,t,i),this.a=e}function V_e(e,n,t,i){Hl(),XPe.call(this,n,t,i),this.a=e}function K_e(e,n){this.a=e,epn.call(this,e,u(e.d,16).dd(n))}function B4n(e,n){return ki(fs(e)*Ys(e),fs(n)*Ys(n))}function z4n(e,n){return ki(fs(e)*Ys(e),fs(n)*Ys(n))}function Q5(e){var n;return n=e.f,n||(e.f=new N9(e,e.c))}function yn(){yn=Y,Mc=new ke,w1=new ln,pH=new En}function Yw(){Yw=Y,zme=new Se,lte=new Se,Fme=new on}function W9(e){if($s(e.d),e.d.d!=e.c)throw $(new zl)}function Ws(e){e.a.a=e.c,e.c.b=e.a,e.a.b=e.c.a=null,e.b=0}function uae(e){return at(e.b0?Jf(e):new Te}function DR(e){return e.n&&(e.e!==dQe&&e.he(),e.j=null),e}function oae(e,n){return e.b=n.b,e.c=n.c,e.d=n.d,e.a=n.a,e}function H4n(e,n,t){return xe(e.a,(UY(n,t),new Bw(n,t))),e}function J4n(e,n){return u(T(e,(pe(),Vy)),16).Ec(n),n}function G4n(e,n){return gn(e,u(T(n,(Oe(),Jm)),15),n)}function q4n(e){return b2(e)&&Re($e(ve(e,(Oe(),Ug))))}function U4n(e,n,t){return LE(),VEn(u(Rn(e.e,n),516),t)}function X4n(e,n,t){e.i=0,e.e=0,n!=t&&Bze(e,n,t)}function V4n(e,n,t){e.i=0,e.e=0,n!=t&&zze(e,n,t)}function Q_e(e,n,t,i){this.b=e,this.c=i,P$.call(this,n,t)}function Y_e(e,n){this.g=e,this.d=z(B(m1,1),i0,9,0,[n])}function W_e(e,n){e.d&&!e.d.a&&(HSe(e.d,n),W_e(e.d,n))}function Z_e(e,n){e.e&&!e.e.a&&(HSe(e.e,n),Z_e(e.e,n))}function eIe(e,n){return Sv(e.j,n.s,n.c)+Sv(n.e,e.s,e.c)}function K4n(e,n){return-ki(fs(e)*Ys(e),fs(n)*Ys(n))}function Q4n(e){return u(e.jd(),147).Og()+":"+fu(e.kd())}function nIe(){gW(this,new LT),this.wb=(V0(),$n),C9()}function tIe(e){this.b=new aI,this.a=e,k.Math.random()}function iIe(e){this.b=new Te,Ar(this.b,this.b),this.a=e}function sae(e,n){new Mi,this.a=new Os,this.b=e,this.c=n}function rIe(){du.call(this,"There is no more element.")}function Y4n(e){XP(),k.setTimeout(function(){throw e},0)}function W4n(e){e.Tg("No crossing minimization",1),e.Ug()}function Z4n(e,n){return Zs(e),Zs(n),VMe(u(e,23),u(n,23))}function bg(e,n,t){var i,r;i=XV(t),r=new q3(i),Gf(e,n,r)}function BK(e,n,t,i,r,c){oO.call(this,e,n,t,i,r,c?-2:-1)}function cIe(e,n,t,i){Nse.call(this,n,t),this.b=e,this.a=i}function lae(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function _R(e){return!e.a&&(e.a=new we(Bt,e,10,11)),e.a}function vi(e){return!e.q&&(e.q=new we(Tf,e,11,10)),e.q}function ge(e){return!e.s&&(e.s=new we(is,e,21,17)),e.s}function uIe(e){return lj(e==null||vK(e)&&e.Rm!==et),e}function IR(e,n){if(e==null)throw $(new M5(n));return e}function oIe(e,n){Ibn.call(this,new wK(e)),this.a=e,this.b=n}function zK(e,n){return n==null?!!Xc(e.f,null):Evn(e.i,n)}function FK(e){return X(e,18)?new Fp(u(e,18)):F3n(e.Jc())}function LR(e){return yn(),X(e,59)?new IX(e):new G$(e)}function e5n(e){return Tt(e),eJe(new Gn(Vn(e.a.Jc(),new ee)))}function n5n(e){return new YCe(e,e.e.Pd().gc()*e.c.Pd().gc())}function t5n(e){return new WCe(e,e.e.Pd().gc()*e.c.Pd().gc())}function fae(e){return e&&e.hashCode?e.hashCode():Gw(e)}function i5n(e){e&&$R(e,e.ge())}function r5n(e,n){var t;return t=Qse(e.a,n),t&&(n.d=null),t}function sIe(e,n,t){return e.f?e.f.cf(n,t):!1}function qC(e,n,t,i){cr(e.c[n.g],t.g,i),cr(e.c[t.g],n.g,i)}function HK(e,n,t,i){cr(e.c[n.g],n.g,t),cr(e.b[n.g],n.g,i)}function c5n(e,n,t){return te(re(t.a))<=e&&te(re(t.b))>=n}function lIe(){this.d=new Mi,this.b=new wt,this.c=new Te}function fIe(){this.b=new hr,this.d=new Mi,this.e=new HP}function aae(){this.c=new Yr,this.d=new Yr,this.e=new Yr}function Ww(){this.a=new Os,this.b=(wl(3,Em),new Mo(3))}function aIe(e){this.c=e,this.b=new $d(u(Tt(new Gs),51))}function hIe(e){this.c=e,this.b=new $d(u(Tt(new Y2),51))}function dIe(e){this.b=e,this.a=new $d(u(Tt(new T0),51))}function Jd(e,n){this.e=e,this.a=Cr,this.b=CXe(n),this.c=n}function PR(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function bIe(e,n,t,i,r,c){this.a=e,IQ.call(this,n,t,i,r,c)}function gIe(e,n,t,i,r,c){this.a=e,IQ.call(this,n,t,i,r,c)}function Q0(e,n,t,i,r,c,o){return new uQ(e.e,n,t,i,r,c,o)}function u5n(e,n,t){return t>=0&&bn(e.substr(t,n.length),n)}function wIe(e,n){return X(n,147)&&bn(e.b,u(n,147).Og())}function o5n(e,n){return e.a?n.Dh().Jc():u(n.Dh(),72).Gi()}function pIe(e,n){var t;return t=e.b.Oc(n),fPe(t,e.b.gc()),t}function UC(e,n){if(e==null)throw $(new M5(n));return e}function iu(e){return e.u||(Ds(e),e.u=new qOe(e,e)),e.u}function Uo(e){var n;return n=u(qn(e,16),29),n||e.fi()}function $R(e,n){var t;return t=ig(e.Pm),n==null?t:t+": "+n}function gf(e,n,t){return Zr(n,t,e.length),e.substr(n,t-n)}function mIe(e,n){Q$.call(this),xhe(this),this.a=e,this.c=n}function vIe(){EV.call(this,"FIXED_INTEGER_RATIO_BOXES",2)}function s5n(){return uB(),z(B(bve,1),ye,422,0,[dve,Kte])}function l5n(){return gO(),z(B(jve,1),ye,419,0,[WH,Eve])}function f5n(){return lO(),z(B(Ave,1),ye,476,0,[Mve,eJ])}function a5n(){return XR(),z(B(zve,1),ye,420,0,[wie,Bve])}function h5n(){return QR(),z(B(e4e,1),ye,423,0,[Aie,Mie])}function d5n(){return aO(),z(B(F5e,1),ye,421,0,[rre,cre])}function b5n(){return Aj(),z(B(mon,1),ye,518,0,[$M,PM])}function g5n(){return Fa(),z(B(xon,1),ye,508,0,[Yg,ch])}function w5n(){return Eh(),z(B(Mon,1),ye,509,0,[H2,f0])}function p5n(){return ka(),z(B(Hon,1),ye,515,0,[Ym,Nb])}function m5n(){return e2(),z(B(Kon,1),ye,454,0,[Db,h4])}function v5n(){return UR(),z(B(Pye,1),ye,425,0,[xre,Lye])}function y5n(){return CB(),z(B($ye,1),ye,487,0,[GJ,g4])}function k5n(){return sB(),z(B(Bye,1),ye,426,0,[Rye,_re])}function E5n(){return bB(),z(B(e3e,1),ye,424,0,[kte,EH])}function j5n(){return f8(),z(B(rin,1),ye,502,0,[tD,Ite])}function S5n(){return eB(),z(B(T6e,1),ye,478,0,[Qre,x6e])}function M5n(){return iO(),z(B(P6e,1),ye,428,0,[tce,nG])}function A5n(){return EO(),z(B(r9e,1),ye,427,0,[iG,i9e])}function RR(e,n,t,i){return t>=0?e.Rh(n,t,i):e.zh(null,t,i)}function XC(e){return e.b.b==0?e.a.uf():tK(e.b)}function x5n(e){if(e.p!=5)throw $(new os);return Lt(e.f)}function T5n(e){if(e.p!=5)throw $(new os);return Lt(e.k)}function hae(e){return ue(e.a)===ue((JQ(),Hce))&&PPn(e),e.a}function yIe(e,n){mE(this,new Ee(e.a,e.b)),U3(this,$C(n))}function Zw(){Lbn.call(this,new C5(rm(12))),nle(!0),this.a=2}function JK(e,n,t){fi(),Pw.call(this,e),this.b=n,this.a=t}function dae(e,n,t){Hl(),$P.call(this,n),this.a=e,this.b=t}function C5n(e,n){var t=ite[e.charCodeAt(0)];return t??e}function BR(e,n){return IR(e,"set1"),IR(n,"set2"),new lxe(e,n)}function zR(e,n){return sPe(n),Q8n(e,oe(It,ei,30,n,15,1),n)}function O5n(e,n){e.b=n,e.c>0&&e.b>0&&(e.g=hR(e.c,e.b,e.a))}function N5n(e,n){e.c=n,e.c>0&&e.b>0&&(e.g=hR(e.c,e.b,e.a))}function kIe(e){var n;n=e.c.d.b,e.b=n,e.a=e.c.d,n.a=e.c.d.b=e}function EIe(e){return e.b==0?null:(at(e.b!=0),Ul(e,e.a.a))}function lo(e,n){return n==null?bu(Xc(e.f,null)):zE(e.i,n)}function jIe(e,n,t,i,r){return new pW(e,(c8(),dte),n,t,i,r)}function GK(e,n,t,i){var r;r=new cNe,n.a[t.g]=r,X5(e.b,i,r)}function SIe(e,n){var t,i;return t=n,i=new ai,fKe(e,t,i),i.d}function D5n(e,n){var t;return t=G8n(e.f,n),gi(K$(t),e.f.d)}function VC(e){var n;r7n(e.a),MCe(e.a),n=new _P(e.a),ude(n)}function _5n(e,n){mXe(e,!0),Ao(e.e.Pf(),new Xle(e,!0,n))}function I5n(e,n){return nd(),u(T(n,(Tu(),Hh)),15).a==e}function ac(e){return Math.max(Math.min(e,ui),-2147483648)|0}function MIe(e){Q$.call(this),xhe(this),this.a=e,this.c=!0}function bae(e,n,t){this.a=new Te,this.e=e,this.f=n,this.c=t}function FR(e,n,t){this.c=new Te,this.e=e,this.f=n,this.b=t}function AIe(e,n,t){this.i=new Te,this.b=e,this.g=n,this.a=t}function xIe(e){this.a=u(Tt(e),277),this.b=(yn(),new ule(e))}function Z9(){Z9=Y;var e,n;n=!Njn(),e=new un,rte=n?new an:e}function gae(){gae=Y,ynn=new qb,Enn=new Sfe,knn=new ha}function Eh(){Eh=Y,H2=new vse(Oy,0),f0=new vse(Cy,1)}function Fa(){Fa=Y,Yg=new yse(KZ,0),ch=new yse("UP",1)}function e2(){e2=Y,Db=new Ese(Cy,0),h4=new Ese(Oy,1)}function av(e,n,t){HR(),e&&Zt(Bce,e,n),e&&Zt(i_,e,t)}function wae(e,n,t){var i;i=e.Fh(n),i>=0?e.$h(i,t):vbe(e,n,t)}function TIe(e,n){var t;for(Tt(n),t=e.a;t;t=t.c)n.Wd(t.g,t.i)}function KC(e,n){var t;t=e.q.getHours(),e.q.setDate(n),gS(e,t)}function CIe(e){var n;return n=new YP(rm(e.length)),p1e(n,e),n}function L5n(e){function n(){}return n.prototype=e||{},new n}function P5n(e,n){return bze(e,n)?(bBe(e),!0):!1}function K1(e,n){if(n==null)throw $(new y5);return Pjn(e,n)}function $5n(e){if(e.ye())return null;var n=e.n;return aH[n]}function Xp(e){return e.Db>>16!=3?null:u(e.Cb,26)}function Ha(e){return e.Db>>16!=9?null:u(e.Cb,26)}function OIe(e){return e.Db>>16!=6?null:u(e.Cb,85)}function NIe(e,n){var t;return t=e.Fh(n),t>=0?e.Th(t):jW(e,n)}function qK(e,n,t){var i;i=Ize(e,n,t),e.b=new NB(i.c.length)}function DIe(e){this.a=e,this.b=oe(gon,Ae,2005,e.e.length,0,2)}function _Ie(){this.a=new Zh,this.e=new hr,this.g=0,this.i=0}function IIe(e,n){z$(this),this.f=n,this.g=e,DR(this),this.he()}function LIe(e,n){return e.b+=n.b,e.c+=n.c,e.d+=n.d,e.a+=n.a,e}function pae(e){var n;return n=e.d,n=e._i(e.f),Et(e,n),n.Ob()}function PIe(e,n){var t;return t=new yfe(n),hGe(t,e),new vs(t)}function R5n(e){if(e.p!=0)throw $(new os);return WE(e.f,0)}function B5n(e){if(e.p!=0)throw $(new os);return WE(e.k,0)}function $Ie(e){return e.Db>>16!=7?null:u(e.Cb,241)}function mae(e){return e.Db>>16!=7?null:u(e.Cb,174)}function RIe(e){return e.Db>>16!=3?null:u(e.Cb,158)}function e8(e){return e.Db>>16!=6?null:u(e.Cb,241)}function zi(e){return e.Db>>16!=11?null:u(e.Cb,26)}function Vp(e){return e.Db>>16!=17?null:u(e.Cb,29)}function kj(e,n,t,i,r,c){return new ed(e.e,n,e.Jj(),t,i,r,c)}function Vc(e,n,t){return n==null?Qo(e.f,null,t):o2(e.i,n,t)}function UK(e,n){return k.Math.abs(e)0}function vae(e){var n;return ob(e),n=new hr,oi(e,new zke(n))}function BIe(e,n){var t=e.a=e.a||[];return t[n]||(t[n]=e.te(n))}function G5n(e,n){var t;t=e.q.getHours(),e.q.setMonth(n),gS(e,t)}function hc(e,n){e.c&&Xo(e.c.g,e),e.c=n,e.c&&xe(e.c.g,e)}function Dr(e,n){e.c&&Xo(e.c.a,e),e.c=n,e.c&&xe(e.c.a,e)}function Ur(e,n){e.d&&Xo(e.d.e,e),e.d=n,e.d&&xe(e.d.e,e)}function wu(e,n){e.i&&Xo(e.i.j,e),e.i=n,e.i&&xe(e.i.j,e)}function zIe(e,n,t){this.a=n,this.c=e,this.b=(Tt(t),new vs(t))}function FIe(e,n,t){this.a=n,this.c=e,this.b=(Tt(t),new vs(t))}function HIe(e,n){this.a=e,this.c=vc(this.a),this.b=new PR(n)}function Kp(e,n){if(e<0||e>n)throw $(new Eo(Qge+e+Yge+n))}function JIe(){JIe=Y,non=jo(new sr,(Hr(),Pc),(Vr(),Jy))}function yae(){yae=Y,ton=jo(new sr,(Hr(),Pc),(Vr(),Jy))}function GIe(){GIe=Y,Qun=jo(new sr,(Hr(),Pc),(Vr(),Jy))}function qIe(){qIe=Y,Yun=jo(new sr,(Hr(),Pc),(Vr(),Jy))}function UIe(){UIe=Y,Wun=jo(new sr,(Hr(),Pc),(Vr(),Jy))}function kae(){kae=Y,Zun=jo(new sr,(Hr(),Pc),(Vr(),Jy))}function XIe(){XIe=Y,yon=Ht(new sr,(Hr(),Pc),(Vr(),lM))}function hl(){hl=Y,jon=Ht(new sr,(Hr(),Pc),(Vr(),lM))}function VIe(){VIe=Y,Son=Ht(new sr,(Hr(),Pc),(Vr(),lM))}function XK(){XK=Y,Con=Ht(new sr,(Hr(),Pc),(Vr(),lM))}function KIe(){KIe=Y,Ssn=jo(new sr,(wy(),BM),(dS(),rye))}function QIe(){QIe=Y,Fen=Ot((GP(),z(B(zen,1),ye,537,0,[ete])))}function HR(){HR=Y,Bce=new wt,i_=new wt,iwn(unn,new i9)}function q5n(e,n){var t,i;t=n.c,i=t!=null,i&&V5(e,new qp(n.c))}function YIe(e,n){s4n(e,e.b,e.c),u(e.b.b,68),n&&u(n.b,68).b}function JR(e,n){X(e.Cb,184)&&(u(e.Cb,184).tb=null),xo(e,n)}function VK(e,n){X(e.Cb,88)&&bm(Ds(u(e.Cb,88)),4),xo(e,n)}function U5n(e,n){Q1e(e,n),X(e.Cb,88)&&bm(Ds(u(e.Cb,88)),2)}function X5n(e,n){return ki(u(e.c,65).c.e.b,u(n.c,65).c.e.b)}function V5n(e,n){return ki(u(e.c,65).c.e.a,u(n.c,65).c.e.a)}function fo(e,n){return Cc(),xQ(n)?new lR(n,e):new EC(n,e)}function KK(e,n){e.a&&Xo(e.a.k,e),e.a=n,e.a&&xe(e.a.k,e)}function QK(e,n){e.b&&Xo(e.b.f,e),e.b=n,e.b&&xe(e.b.f,e)}function Y0(e,n,t){AFe(n,t,e.gc()),this.c=e,this.a=n,this.b=t-n}function Y5(e){this.c=new Mi,this.b=e.b,this.d=e.c,this.a=e.a}function YK(e){this.a=k.Math.cos(e),this.b=k.Math.sin(e)}function gg(e,n,t,i){this.c=e,this.d=i,KK(this,n),QK(this,t)}function pn(e,n){this.b=(Nn(e),e),this.a=(n&jm)==0?n|64|Nh:n}function K5n(e,n){UCe(e,Lt(zr(Uw(n,24),lF)),Lt(zr(n,lF)))}function QC(e){return Ch(),ao(e,0)>=0?sb(e):wj(sb(Ud(e)))}function Q5n(){return Kl(),z(B(Zo,1),ye,130,0,[Xme,Wo,Vme])}function WIe(e,n,t){return new pW(e,(c8(),hte),null,!1,n,t)}function ZIe(e,n,t){return new pW(e,(c8(),bte),n,t,null,!1)}function eLe(e,n,t){var i;AFe(n,t,e.c.length),i=t-n,Joe(e.c,n,i)}function nLe(e,n){var t;return t=u(um(Q5(e.a),n),18),t?t.gc():0}function Eae(e){var n;return ob(e),n=(Yw(),Yw(),lte),wB(e,n)}function tLe(e){for(var n;;)if(n=e.Pb(),!e.Ob())return n}function iLe(e){var n,t;return t=(C9(),n=new $w,n),o8(t,e),t}function rLe(e){var n,t;return t=(C9(),n=new $w,n),o8(t,e),t}function hv(e){return LE(),X(e.g,9)?u(e.g,9):null}function Y5n(){return c2(),z(B(zte,1),ye,368,0,[I2,Ab,_2])}function W5n(){return EB(),z(B(vve,1),ye,350,0,[mve,YH,Qte])}function Z5n(){return jg(),z(B(Lin,1),ye,449,0,[rie,$7,e4])}function eyn(){return b8(),z(B(bie,1),ye,302,0,[hie,die,oD])}function nyn(){return ib(),z(B(gie,1),ye,329,0,[sD,Rve,Rm])}function tyn(){return Z1(),z(B(Gin,1),ye,315,0,[lD,t4,Gy])}function iyn(){return Fj(),z(B(N5e,1),ye,352,0,[Yie,O5e,CJ])}function ryn(){return Nc(),z(B(Jun,1),ye,452,0,[_M,Ms,Do])}function cyn(){return $B(),z(B(G5e,1),ye,381,0,[H5e,ure,J5e])}function uyn(){return zj(),z(B(q5e,1),ye,348,0,[sre,ore,ED])}function oyn(){return y8(),z(B(X5e,1),ye,349,0,[lre,U5e,IM])}function syn(){return kB(),z(B(Q5e,1),ye,351,0,[K5e,fre,V5e])}function lyn(){return RB(),z(B(Y5e,1),ye,382,0,[are,K7,Qm])}function fyn(){return Tj(),z(B(g3e,1),ye,384,0,[Mte,Ste,Ate])}function ayn(){return Sa(),z(B(Nm,1),ye,237,0,[Nu,No,Du])}function hyn(){return ks(),z(B(Ann,1),ye,461,0,[Bh,Sb,Wf])}function dyn(){return Vo(),z(B(Tnn,1),ye,462,0,[Oa,Mb,Zf])}function byn(){return Bj(),z(B(bye,1),ye,385,0,[dye,bre,MD])}function gyn(){return TO(),z(B(Hye,1),ye,386,0,[qJ,zye,Fye])}function wyn(){return WB(),z(B(f6e,1),ye,387,0,[l6e,Ure,s6e])}function pyn(){return PB(),z(B(u6e,1),ye,303,0,[Rre,c6e,r6e])}function myn(){return iz(),z(B(o6e,1),ye,436,0,[GM,VJ,Bre])}function vyn(){return XB(),z(B(I6e,1),ye,430,0,[D6e,_6e,Wre])}function yyn(){return _O(),z(B(Zre,1),ye,435,0,[WJ,ZJ,eG])}function kyn(){return lB(),z(B(N6e,1),ye,429,0,[Yre,O6e,C6e])}function Eyn(){return Ua(),z(B(n8e,1),ye,279,0,[ik,c3,rk])}function jyn(){return rd(),z(B(d8e,1),ye,347,0,[hG,b0,cA])}function Syn(){return Oj(),z(B(v8e,1),ye,300,0,[VD,Oce,m8e])}function Myn(){return fy(),z(B(E8e,1),ye,281,0,[k8e,o3,mG])}function Ja(e){return mu(z(B($r,1),Ae,8,0,[e.i.n,e.n,e.a]))}function Ayn(e,n,t){var i;i=new mc(t.d),gi(i,e),Y1e(n,i.a,i.b)}function cLe(e,n,t){var i;i=new mx,i.b=n,i.a=t,++n.b,xe(e.d,i)}function xyn(e,n,t){var i;return i=mS(e,n,!1),i.b<=n&&i.a<=t}function Tyn(e){if(e.p!=2)throw $(new os);return Lt(e.f)&Er}function Cyn(e){if(e.p!=2)throw $(new os);return Lt(e.k)&Er}function mn(e,n){if(e<0||e>=n)throw $(new Eo(Qge+e+Yge+n))}function Kn(e,n){if(e<0||e>=n)throw $(new Noe(Qge+e+Yge+n))}function Oyn(e){return e.Db>>16!=6?null:u(AW(e),241)}function uLe(e,n){var t,i;return i=U9(e,n),t=e.a.dd(i),new oxe(e,t)}function Nyn(e,n){var t;return t=(Nn(e),e).g,ble(!!t),Nn(n),t(n)}function Dyn(e){return e.a==(t8(),NG)&&KT(e,s_n(e.g,e.b)),e.a}function W5(e){return e.d==(t8(),NG)&&Jue(e,uLn(e.g,e.b)),e.d}function jae(e,n){_bn.call(this,new C5(rm(e))),wl(n,oQe),this.a=n}function oLe(e,n,t){Pw.call(this,25),this.b=e,this.a=n,this.c=t}function dl(e){fi(),Pw.call(this,e),this.c=!1,this.a=!1}function sLe(e,n){ag.call(this,1,2,z(B(It,1),ei,30,15,[e,n]))}function zr(e,n){return tb(Nvn(su(e)?wf(e):e,su(n)?wf(n):n))}function jh(e,n){return tb(Dvn(su(e)?wf(e):e,su(n)?wf(n):n))}function WK(e,n){return tb(_vn(su(e)?wf(e):e,su(n)?wf(n):n))}function Sae(e,n){return xDe(e.a,n)?bfe(e.b,u(n,23).g,null):null}function wg(e){return Tt(e),X(e,18)?new vs(u(e,18)):J9(e.Jc())}function ZK(e){fR(),this.a=(yn(),X(e,59)?new IX(e):new G$(e))}function _yn(e){var n;return n=u(uR(e.b),10),new Jl(e.a,n,e.c)}function Iyn(e,n){var t;t=te(re(e.a.mf((Gt(),sG)))),_Ke(e,n,t)}function Lyn(e,n){return Cj(),e.c==n.c?ki(n.d,e.d):ki(e.c,n.c)}function Pyn(e,n){return Cj(),e.c==n.c?ki(e.d,n.d):ki(e.c,n.c)}function $yn(e,n){return Cj(),e.c==n.c?ki(e.d,n.d):ki(n.c,e.c)}function Ryn(e,n){return Cj(),e.c==n.c?ki(n.d,e.d):ki(n.c,e.c)}function Byn(e,n){e.b=e.b|n.b,e.c=e.c|n.c,e.d=e.d|n.d,e.a=e.a|n.a}function I(e){return at(e.ai?1:0}function fLe(e,n){var t,i;return t=EQ(n),i=t,u(Rn(e.c,i),15).a}function eQ(e,n,t){var i;i=e.d[n.p],e.d[n.p]=e.d[t.p],e.d[t.p]=i}function Jyn(e,n,t){var i;e.n&&n&&t&&(i=new yL,xe(e.e,i))}function nQ(e,n){if(dr(e.a,n),n.d)throw $(new du(NQe));n.d=e}function xae(e,n){this.a=new Te,this.d=new Te,this.f=e,this.c=n}function aLe(){sy(),this.b=new wt,this.a=new wt,this.c=new Te}function hLe(){this.c=new NCe,this.a=new GPe,this.b=new uMe,jxe()}function dLe(e,n,t){this.d=e,this.j=n,this.e=t,this.o=-1,this.p=3}function bLe(e,n,t){this.d=e,this.k=n,this.f=t,this.o=-1,this.p=5}function gLe(e,n,t,i,r,c){The.call(this,e,n,t,i,r),c&&(this.o=-2)}function wLe(e,n,t,i,r,c){Che.call(this,e,n,t,i,r),c&&(this.o=-2)}function pLe(e,n,t,i,r,c){Jae.call(this,e,n,t,i,r),c&&(this.o=-2)}function mLe(e,n,t,i,r,c){Dhe.call(this,e,n,t,i,r),c&&(this.o=-2)}function vLe(e,n,t,i,r,c){Gae.call(this,e,n,t,i,r),c&&(this.o=-2)}function yLe(e,n,t,i,r,c){Ohe.call(this,e,n,t,i,r),c&&(this.o=-2)}function kLe(e,n,t,i,r,c){Nhe.call(this,e,n,t,i,r),c&&(this.o=-2)}function ELe(e,n,t,i,r,c){qae.call(this,e,n,t,i,r),c&&(this.o=-2)}function jLe(e,n,t,i){$P.call(this,t),this.b=e,this.c=n,this.d=i}function SLe(e,n){this.f=e,this.a=(t8(),OG),this.c=OG,this.b=n}function MLe(e,n){this.g=e,this.d=(t8(),NG),this.a=NG,this.b=n}function Tae(e,n){!e.c&&(e.c=new rr(e,0)),Wz(e.c,(ji(),pA),n)}function Gyn(e,n){return zOn(e,n,X(n,103)&&(u(n,19).Bb&Sc)!=0)}function qyn(e,n){return ZDe(Pu(e.q.getTime()),Pu(n.q.getTime()))}function ALe(e){return cK(e.e.Pd().gc()*e.c.Pd().gc(),16,new d5(e))}function Uyn(e){return!!e.u&&Ku(e.u.a).i!=0&&!(e.n&&HY(e.n))}function Xyn(e){return!!e.a&&Is(e.a.a).i!=0&&!(e.b&&JY(e.b))}function Cae(e,n){return n==0?!!e.o&&e.o.f!=0:PY(e,n)}function xLe(e){return at(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function Ej(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function TLe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(""+e.e):e.c}function Xr(e,n){this.a=e,qc.call(this,e),Kp(n,e.gc()),this.b=n}function CLe(e){this.a=oe(Cr,xn,1,d1e(k.Math.max(8,e))<<1,5,1)}function OLe(e){HQ.call(this,e,(c8(),ate),null,!1,null,!1)}function NLe(e,n){var t;return t=1-n,e.a[t]=OB(e.a[t],t),OB(e,n)}function DLe(e,n){var t,i;return i=zr(e,_c),t=i1(n,32),jh(t,i)}function Vyn(e,n,t){var i;return i=u(e.Zb().xc(n),18),!!i&&i.Gc(t)}function _Le(e,n,t){var i;return i=u(e.Zb().xc(n),18),!!i&&i.Kc(t)}function ILe(e,n,t){var i;i=(Tt(e),new vs(e)),TMn(new zIe(i,n,t))}function WC(e,n,t){var i;i=(Tt(e),new vs(e)),CMn(new FIe(i,n,t))}function Kyn(e,n,t){e.a=n,e.c=t,e.b.a.$b(),Ws(e.d),Ep(e.e.a.c,0)}function LLe(e,n){var t;e.e=new joe,t=wm(n),Nr(t,e.c),uXe(e,t,0)}function Qyn(e,n){return new nK(n,MOe(vc(n.e),e,e),(Ln(),!0))}function Yyn(e,n){return ry(),u(T(n,(Tu(),d4)),15).a>=e.gc()}function Wyn(e){return hl(),!sc(e)&&!(!sc(e)&&e.c.i.c==e.d.i.c)}function Sh(e){return u(Xa(e,oe(O7,f7,17,e.c.length,0,1)),323)}function Zyn(e){HFe((!e.a&&(e.a=new we(Bt,e,10,11)),e.a),new $x)}function Oae(){var e,n,t;return n=(t=(e=new $w,e),t),xe(c7e,n),n}function Au(e,n,t,i,r,c){return VBe(e,n,t,c),H1e(e,i),J1e(e,r),e}function PLe(e,n,t,i){return e.a+=""+gf(n==null?Yo:fu(n),t,i),e}function ZC(e,n){if(e<0||e>=n)throw $(new Eo(hCn(e,n)));return e}function $Le(e,n,t){if(e<0||nt)throw $(new Eo(_Tn(e,n,t)))}function Me(e,n,t,i){var r;r=new qx,r.a=n,r.b=t,r.c=i,Vt(e.b,r)}function Gi(e,n,t,i){var r;r=new qx,r.a=n,r.b=t,r.c=i,Vt(e.a,r)}function e6n(e,n,t){var i;i=nSn();try{return spn(e,n,t)}finally{p9n(i)}}function mg(e){var n;return su(e)?(n=e,n==-0?0:n):b8n(e)}function RLe(e,n){return X(n,45)?VY(e.a,u(n,45)):!1}function BLe(e,n){return X(n,45)?VY(e.a,u(n,45)):!1}function zLe(e,n){return X(n,45)?VY(e.a,u(n,45)):!1}function n6n(e,n){return e.a<=e.b?(n.Bd(e.a++),!0):!1}function t6n(e){return fv(e).dc()?!1:(Gwn(e,new be),!0)}function Nae(e){var n;return K0(e),n=new ct,K3(e.a,new $ke(n)),n}function GR(e){var n;return K0(e),n=new lt,K3(e.a,new Rke(n)),n}function i6n(e){if(!("stack"in e))try{throw e}catch{}return e}function qR(e){return new Mo((wl(e,pZ),gB(yc(yc(5,e),e/10|0))))}function FLe(e){return u(Xa(e,oe(nin,cYe,12,e.c.length,0,1)),2004)}function r6n(e){return cK(e.e.Pd().gc()*e.c.Pd().gc(),273,new GU(e))}function HLe(){HLe=Y,_ln=Ot((r$(),z(B(L6e,1),ye,477,0,[ece])))}function JLe(){JLe=Y,Lln=Ot((c$(),z(B(Iln,1),ye,546,0,[nce])))}function GLe(){GLe=Y,Zln=Ot((PE(),z(B(t9e,1),ye,527,0,[_D])))}function qLe(){qLe=Y,Z5e=S_e(me(1),me(4)),W5e=S_e(me(1),me(2))}function UR(){UR=Y,xre=new jse("DFS",0),Lye=new jse("BFS",1)}function XR(){XR=Y,wie=new gse(i7,0),Bve=new gse("TOP_LEFT",1)}function Dae(e,n,t){this.d=new WEe(this),this.e=e,this.i=n,this.f=t}function _ae(e,n,t,i){this.d=e,this.n=n,this.g=t,this.o=i,this.p=-1}function c6n(e,n,t){e.d&&Xo(e.d.e,e),e.d=n,e.d&&og(e.d.e,t,e)}function u6n(e,n,t){var i;return i=C8(t),Uz(e.n,i,n),Uz(e.o,n,t),n}function n8(e,n){var t,i;return t=Zp(e,n),i=null,t&&(i=t.qe()),i}function jj(e,n){var t,i;return t=K1(e,n),i=null,t&&(i=t.qe()),i}function n2(e,n){var t,i;return t=K1(e,n),i=null,t&&(i=t.ne()),i}function Q1(e,n){var t,i;return t=K1(e,n),i=null,t&&(i=N0e(t)),i}function Sj(e,n){YRn(n,e),ffe(e.d),ffe(u(T(e,(Oe(),EJ)),213))}function tQ(e,n){WRn(n,e),afe(e.d),afe(u(T(e,(Oe(),EJ)),213))}function W0(e,n){Nn(n),e.b=e.b-1&e.a.length-1,cr(e.a,e.b,n),pJe(e)}function Iae(e,n){Nn(n),cr(e.a,e.c,n),e.c=e.c+1&e.a.length-1,pJe(e)}function kt(e){return at(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function ULe(e){if(e.e.g!=e.b)throw $(new zl);return!!e.c&&e.d>0}function Qp(e){return X(e,18)?u(e,18).dc():!e.Jc().Ob()}function o6n(e){return new pn(q8n(u(e.a.kd(),18).gc(),e.a.jd()),16)}function XLe(e){var n;n=e.Dh(),this.a=X(n,72)?u(n,72).Gi():n.Jc()}function Lae(e,n){var t;return t=u(qa(e.b,n),66),!t&&(t=new Mi),t}function s6n(e,n){var t;t=n.a,hc(t,n.c.d),Ur(t,n.d.d),tm(t.a,e.n)}function VLe(e,n,t,i){return X(t,59)?new pOe(e,n,t,i):new Ofe(e,n,t,i)}function l6n(){return Xf(),z(B(vin,1),ye,413,0,[Pm,D7,_7,Bte])}function f6n(){return u2(),z(B(Znn,1),ye,409,0,[WN,YN,vte,yte])}function a6n(){return g8(),z(B(Jtn,1),ye,408,0,[D2,_m,Dm,Kv])}function h6n(){return c8(),z(B(mH,1),ye,309,0,[ate,hte,dte,bte])}function d6n(){return dy(),z(B(v3e,1),ye,383,0,[oM,m3e,Nte,Dte])}function b6n(){return zB(),z(B(sin,1),ye,367,0,[Rte,qH,UH,iD])}function g6n(){return Xj(),z(B(pve,1),ye,301,0,[aM,gve,cD,wve])}function w6n(){return fm(),z(B(Zie,1),ye,203,0,[OJ,Wie,a4,f4])}function p6n(){return ud(),z(B(z5e,1),ye,269,0,[Ob,B5e,tre,ire])}function m6n(){return Mg(),z(B(don,1),ye,404,0,[jD,LM,IJ,_J])}function v6n(e){var n;return e.j==(Ne(),bt)&&(n=Vqe(e),ls(n,Wn))}function y6n(){return wy(),z(B(tye,1),ye,398,0,[RJ,RM,BM,zM])}function KLe(e,n){return u(Ks(Hp(u(mi(e.k,n),16).Mc(),Yv)),113)}function QLe(e,n){return u(Ks(q5(u(mi(e.k,n),16).Mc(),Yv)),113)}function k6n(e,n){return P5(new Ee(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)}function E6n(){return Az(),z(B(nln,1),ye,401,0,[Jre,zre,Hre,Fre])}function j6n(){return wz(),z(B(i6e,1),ye,354,0,[$re,n6e,t6e,e6e])}function S6n(){return Rj(),z(B(Iye,1),ye,353,0,[Are,JJ,Mre,Sre])}function M6n(){return E8(),z(B(e8e,1),ye,278,0,[HD,aG,W9e,Z9e])}function A6n(){return cd(),z(B(Tce,1),ye,222,0,[xce,JD,ck,f6])}function x6n(){return ml(),z(B(Vfn,1),ye,292,0,[qD,k1,Lb,GD])}function T6n(){return YR(),z(B(ZD,1),ye,288,0,[j8e,M8e,Dce,S8e])}function C6n(){return tl(),z(B(fA,1),ye,380,0,[QD,nw,KD,u3])}function O6n(){return ZB(),z(B(C8e,1),ye,326,0,[_ce,A8e,T8e,x8e])}function N6n(){return FB(),z(B(han,1),ye,407,0,[Ice,N8e,O8e,D8e])}function Gl(e,n,t){return n<0?jW(e,t):u(t,69).uk().zk(e,e.ei(),n)}function D6n(e,n,t){var i;return i=C8(t),Uz(e.f,i,n),Zt(e.g,n,t),n}function _6n(e,n,t){var i;return i=C8(t),Uz(e.p,i,n),Zt(e.q,n,t),n}function YLe(e){var n,t;return n=(H0(),t=new z3,t),e&&$z(n,e),n}function Pae(e){var n;return n=e.$i(e.i),e.i>0&&Wu(e.g,0,n,0,e.i),n}function Z5(e){return LE(),X(e.g,156)?u(e.g,156):null}function I6n(e){return HR(),so(Bce,e)?u(Rn(Bce,e),342).Pg():null}function L6n(e){e.a=null,e.e=null,Ep(e.b.c,0),Ep(e.f.c,0),e.c=null}function WLe(e,n){var t;for(t=e.j.c.length;t>24}function $6n(e){if(e.p!=1)throw $(new os);return Lt(e.k)<<24>>24}function R6n(e){if(e.p!=7)throw $(new os);return Lt(e.k)<<16>>16}function B6n(e){if(e.p!=7)throw $(new os);return Lt(e.f)<<16>>16}function dv(e,n){return n.e==0||e.e==0?tM:(H8(),OW(e,n))}function nPe(e,n){return ue(n)===ue(e)?"(this Map)":n==null?Yo:fu(n)}function z6n(e,n,t){return gK(re(bu(Xc(e.f,n))),re(bu(Xc(e.f,t))))}function F6n(e,n,t){var i;i=u(Rn(e.g,t),60),xe(e.a.c,new jc(n,i))}function tPe(e,n){var t;return t=new x5,e.Ed(t),t.a+="..",n.Fd(t),t.a}function ya(e){var n;for(n=0;e.Ob();)e.Pb(),n=yc(n,1);return gB(n)}function H6n(e,n,t,i,r){var c;c=eNn(r,t,i),xe(n,rCn(r,c)),Wxn(e,r,n)}function iPe(e,n,t){e.i=0,e.e=0,n!=t&&(zze(e,n,t),Bze(e,n,t))}function rPe(e,n,t,i){this.e=null,this.c=e,this.d=n,this.a=t,this.b=i}function $ae(e,n,t,i,r){this.i=e,this.a=n,this.e=t,this.j=i,this.f=r}function cPe(e,n){aae.call(this),this.a=e,this.b=n,xe(this.a.b,this)}function Y1(e,n){Ch(),ag.call(this,e,1,z(B(It,1),ei,30,15,[n]))}function J6n(e,n,t){return q8(e,n,t,X(n,103)&&(u(n,19).Bb&Sc)!=0)}function VR(e,n,t){return Vz(e,n,t,X(n,103)&&(u(n,19).Bb&Sc)!=0)}function G6n(e,n,t){return UOn(e,n,t,X(n,103)&&(u(n,19).Bb&Sc)!=0)}function Rae(e,n){return e==(Bn(),Wi)&&n==Wi?4:e==Wi||n==Wi?8:32}function q6n(e,n){return u(n==null?bu(Xc(e.f,null)):zE(e.i,n),290)}function uPe(e,n){var t;for(t=n;t;)Pp(e,t.i,t.j),t=zi(t);return e}function Ku(e){return e.n||(Ds(e),e.n=new _De(e,Rc,e),iu(e)),e.n}function u1(e,n){Cc();var t;return t=u(e,69).tk(),aTn(t,n),t.vl(n)}function Mj(e){return at(e.a"+Mae(e.d):"e_"+Gw(e)}function X6n(e,n){var t;return t=n!=null?lo(e,n):bu(Xc(e.f,n)),L$(t)}function V6n(e,n){var t;return t=n!=null?lo(e,n):bu(Xc(e.f,n)),L$(t)}function fPe(e,n){var t;for(t=0;t=0&&e.a[t]===n[t];t--);return t<0}function Z6n(e,n){var t,i;i=!1;do t=Tze(e,n),i=i|t;while(t);return i}function Aj(){Aj=Y,$M=new mse("UPPER",0),PM=new mse("LOWER",1)}function QR(){QR=Y,Aie=new wse(xa,0),Mie=new wse("ALTERNATING",1)}function YR(){YR=Y,j8e=new aDe,M8e=new XDe,Dce=new vIe,S8e=new VDe}function hPe(){hPe=Y,Oin=Ot((uB(),z(B(bve,1),ye,422,0,[dve,Kte])))}function dPe(){dPe=Y,Iin=Ot((gO(),z(B(jve,1),ye,419,0,[WH,Eve])))}function bPe(){bPe=Y,Rin=Ot((lO(),z(B(Ave,1),ye,476,0,[Mve,eJ])))}function gPe(){gPe=Y,Uin=Ot((XR(),z(B(zve,1),ye,420,0,[wie,Bve])))}function wPe(){wPe=Y,Kin=Ot((QR(),z(B(e4e,1),ye,423,0,[Aie,Mie])))}function pPe(){pPe=Y,Hun=Ot((aO(),z(B(F5e,1),ye,421,0,[rre,cre])))}function mPe(){mPe=Y,von=Ot((Aj(),z(B(mon,1),ye,518,0,[$M,PM])))}function vPe(){vPe=Y,Ton=Ot((Fa(),z(B(xon,1),ye,508,0,[Yg,ch])))}function yPe(){yPe=Y,Aon=Ot((Eh(),z(B(Mon,1),ye,509,0,[H2,f0])))}function kPe(){kPe=Y,Jon=Ot((ka(),z(B(Hon,1),ye,515,0,[Ym,Nb])))}function EPe(){EPe=Y,Qon=Ot((e2(),z(B(Kon,1),ye,454,0,[Db,h4])))}function jPe(){jPe=Y,jsn=Ot((UR(),z(B(Pye,1),ye,425,0,[xre,Lye])))}function SPe(){SPe=Y,Tsn=Ot((CB(),z(B($ye,1),ye,487,0,[GJ,g4])))}function MPe(){MPe=Y,Nsn=Ot((sB(),z(B(Bye,1),ye,426,0,[Rye,_re])))}function APe(){APe=Y,xln=Ot((eB(),z(B(T6e,1),ye,478,0,[Qre,x6e])))}function xPe(){xPe=Y,Pln=Ot((iO(),z(B(P6e,1),ye,428,0,[tce,nG])))}function TPe(){TPe=Y,efn=Ot((EO(),z(B(r9e,1),ye,427,0,[iG,i9e])))}function CPe(){CPe=Y,ltn=Ot((bB(),z(B(e3e,1),ye,424,0,[kte,EH])))}function OPe(){OPe=Y,cin=Ot((f8(),z(B(rin,1),ye,502,0,[tD,Ite])))}function WR(e){g0e(),UCe(this,Lt(zr(Uw(e,24),lF)),Lt(zr(e,lF)))}function e9n(e){return(e.k==(Bn(),Wi)||e.k==pr)&&bi(e,(pe(),gM))}function n9n(e,n,t){return u(n==null?Qo(e.f,null,t):o2(e.i,n,t),290)}function t9n(){return kr(),z(B(iA,1),ye,86,0,[lh,cu,Zc,sh,cf])}function i9n(){return Ne(),z(B(Ac,1),qu,64,0,[Eu,Un,Wn,bt,Xn])}function r9n(e){return XP(),function(){return e6n(e,this,arguments)}}function NPe(e,n){var t;return t=n.jd(),new Bw(t,e.e.pc(t,u(n.kd(),18)))}function DPe(e,n){var t,i;return t=n.jd(),i=e.De(t),!!i&&Vu(i.e,n.kd())}function oc(e,n){var t,i;for(Nn(n),i=e.Jc();i.Ob();)t=i.Pb(),n.Ad(t)}function bl(e,n,t){var i;return i=(mn(n,e.c.length),e.c[n]),e.c[n]=t,i}function Hae(e,n){var t,i;for(t=n,i=0;t>0;)i+=e.a[t],t-=t&-t;return i}function _Pe(e,n){var t;for(t=n;t;)Pp(e,-t.i,-t.j),t=zi(t);return e}function c9n(e,n){var t;return t=e.a.get(n),t??oe(Cr,xn,1,0,5,1)}function bv(e,n){return(ob(e),O9(new wn(e,new ghe(n,e.a)))).zd(By)}function u9n(){return Hr(),z(B(w3e,1),ye,363,0,[ea,p1,eo,no,Pc])}function IPe(e){QKe(),GSe(this),this.a=new Mi,S1e(this,e),Vt(this.a,e)}function LPe(){CV(this),this.b=new Ee(Ki,Ki),this.a=new Ee(Ir,Ir)}function sQ(e){ZR(),!ih&&(this.c=e,this.e=!0,this.a=new Te)}function ZR(){ZR=Y,ih=!0,dnn=!1,bnn=!1,wnn=!1,gnn=!1}function eB(){eB=Y,Qre=new Ase(dwe,0),x6e=new Ase("TARGET_WIDTH",1)}function o9n(){return Sz(),z(B(Csn,1),ye,364,0,[Nre,Tre,Dre,Cre,Ore])}function s9n(){return am(),z(B(kin,1),ye,371,0,[rD,KH,QH,VH,XH])}function l9n(){return Yj(),z(B(_5e,1),ye,328,0,[D5e,ere,nre,OM,NM])}function f9n(){return el(),z(B(Zve,1),ye,165,0,[dD,mM,bd,vM,qg])}function a9n(){return lS(),z(B(Oln,1),ye,369,0,[w4,i6,QM,KM,DD])}function h9n(){return XO(),z(B(z6e,1),ye,330,0,[$6e,ice,B6e,rce,R6e])}function d9n(){return Th(),z(B(uh,1),ye,160,0,[Sn,ar,_a,h0,wd])}function b9n(){return Mv(),z(B(oA,1),ye,257,0,[Pb,UD,b8e,uA,g8e])}function lQ(e,n){var t;return t=u(qa(e.d,n),21),t||u(qa(e.e,n),21)}function PPe(e){this.b=e,ot.call(this,e),this.a=u(qn(this.b.a,4),129)}function $Pe(e){this.b=e,R5.call(this,e),this.a=u(qn(this.b.a,4),129)}function RPe(e,n){this.c=0,this.b=n,nCe.call(this,e,17493),this.a=this.c}function Hf(e,n,t,i,r){qPe.call(this,n,i,r),this.c=e,this.b=t}function Jae(e,n,t,i,r){dLe.call(this,n,i,r),this.c=e,this.a=t}function Gae(e,n,t,i,r){bLe.call(this,n,i,r),this.c=e,this.a=t}function qae(e,n,t,i,r){qPe.call(this,n,i,r),this.c=e,this.a=t}function Uae(e,n,t){e.a.c.length=0,FPn(e,n,t),e.a.c.length==0||dIn(e,n)}function eO(e){e.i=0,lC(e.b,null),lC(e.c,null),e.a=null,e.e=null,++e.g}function g9n(e){return e.e=3,e.d=e.Yb(),e.e!=2?(e.e=0,!0):!1}function Xae(e,n){return X(n,144)?bn(e.c,u(n,144).c):!1}function BPe(e){var n;return e.c||(n=e.r,X(n,88)&&(e.c=u(n,29))),e.c}function Ds(e){return e.t||(e.t=new _Se(e),qj(new YMe(e),0,e.t)),e.t}function sc(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function ey(e,n){return n==0||e.e==0?e:n>0?uHe(e,n):XUe(e,-n)}function Vae(e,n){return n==0||e.e==0?e:n>0?XUe(e,n):uHe(e,-n)}function it(e){if(ht(e))return e.c=e.a,e.a.Pb();throw $(new hu)}function zPe(e){var n;return n=e.length,bn(Pn.substr(Pn.length-n,n),e)}function FPe(e){var n,t;return n=e.c.i,t=e.d.i,n.k==(Bn(),pr)&&t.k==pr}function fQ(e){var n,t,i;return n=e&zs,t=e>>22&zs,i=e<0?ld:0,Io(n,t,i)}function w9n(e,n){var t,i;t=u(fEn(e.c,n),18),t&&(i=t.gc(),t.$b(),e.d-=i)}function p9n(e){e&&v8n((xoe(),vme)),--hH,e&&dH!=-1&&(twn(dH),dH=-1)}function Kae(e){Vgn.call(this,e==null?Yo:fu(e),X(e,80)?u(e,80):null)}function aQ(e){var n;return n=new Ww,$u(n,e),ae(n,(Oe(),Wc),null),n}function hQ(e,n,t){var i;return i=e.Fh(n),i>=0?e.Ih(i,t,!0):g2(e,n,t)}function m9n(e,n,t){return ki(P5(O8(e),vc(n.b)),P5(O8(e),vc(t.b)))}function v9n(e,n,t){return ki(P5(O8(e),vc(n.e)),P5(O8(e),vc(t.e)))}function y9n(e,n){return k.Math.min(eb(n.a,e.d.d.c),eb(n.b,e.d.d.c))}function HPe(e,n,t){var i;i=new Vse(e.a),_j(i,e.a.a),Qo(i.f,n,t),e.a.a=i}function Qae(e,n,t,i){var r;for(r=0;rn)throw $(new Eo(z0e(e,n,"index")));return e}function Zae(e){var n;return n=e.e+e.f,isNaN(n)&&W$(e.d)?e.d:n}function E9n(e,n){var t;t=e.q.getHours()+(n/60|0),e.q.setMinutes(n),gS(e,t)}function ehe(e,n){var t,i;return t=(Nn(e),e),i=(Nn(n),n),t==i?0:tn.p?-1:0}function YPe(e,n){return so(e.a,n)?(ny(e.a,n),!0):!1}function A9n(e){var n,t;return n=e.jd(),t=u(e.kd(),18),PC(t.Lc(),new g9(n))}function bQ(e){var n;return n=e.b,n.b==0?null:u(Qu(n,0),65).b}function iB(e,n){return Nn(n),e.c=0,"Initial capacity must not be negative")}function cB(){cB=Y,YM=new yi("org.eclipse.elk.labels.labelManager")}function ZPe(){ZPe=Y,sve=new Pi("separateLayerConnections",(zB(),Rte))}function ka(){ka=Y,Ym=new kse("REGULAR",0),Nb=new kse("CRITICAL",1)}function iO(){iO=Y,tce=new xse("FIXED",0),nG=new xse("CENTER_NODE",1)}function uB(){uB=Y,dve=new hse("QUADRATIC",0),Kte=new hse("SCANLINE",1)}function e$e(){e$e=Y,Din=Ot((EB(),z(B(vve,1),ye,350,0,[mve,YH,Qte])))}function n$e(){n$e=Y,Pin=Ot((jg(),z(B(Lin,1),ye,449,0,[rie,$7,e4])))}function t$e(){t$e=Y,Hin=Ot((b8(),z(B(bie,1),ye,302,0,[hie,die,oD])))}function i$e(){i$e=Y,Jin=Ot((ib(),z(B(gie,1),ye,329,0,[sD,Rve,Rm])))}function r$e(){r$e=Y,qin=Ot((Z1(),z(B(Gin,1),ye,315,0,[lD,t4,Gy])))}function c$e(){c$e=Y,xin=Ot((c2(),z(B(zte,1),ye,368,0,[I2,Ab,_2])))}function u$e(){u$e=Y,$un=Ot((Fj(),z(B(N5e,1),ye,352,0,[Yie,O5e,CJ])))}function o$e(){o$e=Y,Gun=Ot((Nc(),z(B(Jun,1),ye,452,0,[_M,Ms,Do])))}function s$e(){s$e=Y,qun=Ot(($B(),z(B(G5e,1),ye,381,0,[H5e,ure,J5e])))}function l$e(){l$e=Y,Uun=Ot((zj(),z(B(q5e,1),ye,348,0,[sre,ore,ED])))}function f$e(){f$e=Y,Xun=Ot((y8(),z(B(X5e,1),ye,349,0,[lre,U5e,IM])))}function a$e(){a$e=Y,Vun=Ot((kB(),z(B(Q5e,1),ye,351,0,[K5e,fre,V5e])))}function h$e(){h$e=Y,Kun=Ot((RB(),z(B(Y5e,1),ye,382,0,[are,K7,Qm])))}function d$e(){d$e=Y,Zon=Ot((Bj(),z(B(bye,1),ye,385,0,[dye,bre,MD])))}function b$e(){b$e=Y,Dsn=Ot((TO(),z(B(Hye,1),ye,386,0,[qJ,zye,Fye])))}function g$e(){g$e=Y,Zsn=Ot((PB(),z(B(u6e,1),ye,303,0,[Rre,c6e,r6e])))}function w$e(){w$e=Y,eln=Ot((iz(),z(B(o6e,1),ye,436,0,[GM,VJ,Bre])))}function p$e(){p$e=Y,Tln=Ot((lB(),z(B(N6e,1),ye,429,0,[Yre,O6e,C6e])))}function m$e(){m$e=Y,Cln=Ot((XB(),z(B(I6e,1),ye,430,0,[D6e,_6e,Wre])))}function v$e(){v$e=Y,Dln=Ot((_O(),z(B(Zre,1),ye,435,0,[WJ,ZJ,eG])))}function y$e(){y$e=Y,cln=Ot((WB(),z(B(f6e,1),ye,387,0,[l6e,Ure,s6e])))}function k$e(){k$e=Y,Ltn=Ot((Tj(),z(B(g3e,1),ye,384,0,[Mte,Ste,Ate])))}function E$e(){E$e=Y,pnn=Ot((Kl(),z(B(Zo,1),ye,130,0,[Xme,Wo,Vme])))}function j$e(){j$e=Y,Mnn=Ot((Sa(),z(B(Nm,1),ye,237,0,[Nu,No,Du])))}function S$e(){S$e=Y,xnn=Ot((ks(),z(B(Ann,1),ye,461,0,[Bh,Sb,Wf])))}function M$e(){M$e=Y,Cnn=Ot((Vo(),z(B(Tnn,1),ye,462,0,[Oa,Mb,Zf])))}function A$e(){A$e=Y,Jfn=Ot((Ua(),z(B(n8e,1),ye,279,0,[ik,c3,rk])))}function x$e(){x$e=Y,san=Ot((fy(),z(B(E8e,1),ye,281,0,[k8e,o3,mG])))}function T$e(){T$e=Y,Xfn=Ot((rd(),z(B(d8e,1),ye,347,0,[hG,b0,cA])))}function C$e(){C$e=Y,can=Ot((Oj(),z(B(v8e,1),ye,300,0,[VD,Oce,m8e])))}function Ea(e,n){return!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),AY(e.o,n)}function T9n(e){return!e.g&&(e.g=new r9),!e.g.d&&(e.g.d=new OSe(e)),e.g.d}function C9n(e){return!e.g&&(e.g=new r9),!e.g.b&&(e.g.b=new CSe(e)),e.g.b}function rO(e){return!e.g&&(e.g=new r9),!e.g.c&&(e.g.c=new DSe(e)),e.g.c}function O9n(e){return!e.g&&(e.g=new r9),!e.g.a&&(e.g.a=new NSe(e)),e.g.a}function N9n(e,n,t,i){return t&&(i=t.Oh(n,Fi(t.Ah(),e.c.sk()),null,i)),i}function D9n(e,n,t,i){return t&&(i=t.Qh(n,Fi(t.Ah(),e.c.sk()),null,i)),i}function gQ(e,n,t,i){var r;return r=oe(It,ei,30,n+1,15,1),VIn(r,e,n,t,i),r}function oe(e,n,t,i,r,c){var o;return o=sJe(r,i),r!=10&&z(B(e,c),n,t,r,o),o}function _9n(e,n,t){var i,r;for(r=new h8(n,e),i=0;it||n=0?e.Ih(t,!0,!0):g2(e,n,!0)}function cO(e,n){var t,i,r;return r=e.r,i=e.d,t=mS(e,n,!0),t.b!=r||t.a!=i}function _$e(e,n){return Dxe(e.e,n)||xg(e.e,n,new DHe(n)),u(qa(e.e,n),113)}function _s(e,n,t,i){return Nn(e),Nn(n),Nn(t),Nn(i),new Rfe(e,n,new uu)}function uO(e,n,t){var i,r;return r=(i=B8(e.b,n),i),r?Zz(hO(e,r),t):null}function K9n(e,n,t){var i,r,c;i=K1(e,t),r=null,i&&(r=N0e(i)),c=r,CHe(n,t,c)}function Q9n(e,n,t){var i,r,c;i=K1(e,t),r=null,i&&(r=N0e(i)),c=r,CHe(n,t,c)}function as(e,n,t,i){this.$j(),this.a=n,this.b=e,this.c=new Ife(this,n,t,i)}function vQ(e,n,t,i,r,c){_ae.call(this,n,i,r,c),this.c=e,this.b=t}function oO(e,n,t,i,r,c){_ae.call(this,n,i,r,c),this.c=e,this.a=t}function bhe(e,n,t,i,r){PCe(this),this.b=e,this.d=n,this.f=t,this.g=i,this.c=r}function ghe(e,n){P$.call(this,n.xd(),n.wd()&-16449),Nn(e),this.a=e,this.c=n}function Y9n(e,n){e.a.Le(n.d,e.b)>0&&(xe(e.c,new ufe(n.c,n.d,e.d)),e.b=n.d)}function yQ(e){e.a=oe(It,ei,30,e.b+1,15,1),e.c=oe(It,ei,30,e.b,15,1),e.d=0}function W9n(e,n,t){var i;return i=Ize(e,n,t),e.b=new NB(i.c.length),Nbe(e,i)}function Z9n(e){if(e.b<=0)throw $(new hu);return--e.b,e.a-=e.c.c,me(e.a)}function e8n(e){var n;if(!e.a)throw $(new rIe);return n=e.a,e.a=zi(e.a),n}function I$e(e){var n;if(e.ll())for(n=e.i-1;n>=0;--n)V(e,n);return Pae(e)}function iy(e){var n;return Tt(e),X(e,204)?(n=u(e,204),n):new w9(e)}function n8n(e){for(;!e.a;)if(!vNe(e.c,new Bke(e)))return!1;return!0}function whe(e,n){if(e.g==null||n>=e.i)throw $(new SV(n,e.i));return e.g[n]}function L$e(e,n,t){if(m8(e,t),t!=null&&!e.dk(t))throw $(new wX);return t}function kQ(e,n){return bO(n)!=10&&z(Zs(n),n.Qm,n.__elementTypeId$,bO(n),e),e}function P$e(e,n){var t,i;return i=n/e.c.Pd().gc()|0,t=n%e.c.Pd().gc(),ty(e,i,t)}function r8(e,n,t,i){var r;i=(Yw(),i||zme),r=e.slice(n,t),F0e(r,e,n,t,-n,i)}function ql(e,n,t,i,r){return n<0?g2(e,t,i):u(t,69).uk().wk(e,e.ei(),n,i,r)}function t8n(e,n){return ki(te(re(T(e,(pe(),$2)))),te(re(T(n,$2))))}function $$e(){$$e=Y,ann=Ot((c8(),z(B(mH,1),ye,309,0,[ate,hte,dte,bte])))}function c8(){c8=Y,ate=new f$("All",0),hte=new ECe,dte=new ICe,bte=new jCe}function ks(){ks=Y,Bh=new XX(Cy,0),Sb=new XX(i7,1),Wf=new XX(Oy,2)}function R$e(){R$e=Y,Kz(),d7e=Ki,ghn=Ir,b7e=new Yn(Ki),whn=new Yn(Ir)}function oB(){oB=Y,ifn=new B3,cfn=new cL,rfn=wkn((Gt(),Sce),ifn,Ib,cfn)}function i8n(e){oB(),u(e.mf((Gt(),t3)),182).Ec((Es(),XD)),e.of(Sce,null)}function r8n(e){return X(e,180)?""+u(e,180).a:e==null?null:fu(e)}function c8n(e){return X(e,180)?""+u(e,180).a:e==null?null:fu(e)}function phe(e){var n,t;if(!e.b)return null;for(t=e.b;n=t.a[0];)t=n;return t}function B$e(e){var n,t;if(!e.b)return null;for(t=e.b;n=t.a[1];)t=n;return t}function sO(e){var n;for(n=e.p+1;n=0?az(e,t,!0,!0):g2(e,n,!0)}function a8n(e,n){F5(u(u(e.f,26).mf((Gt(),tA)),102))&&HFe(tae(u(e.f,26)),n)}function dRe(e,n){Ls(e,n==null||W$((Nn(n),n))||isNaN((Nn(n),n))?0:(Nn(n),n))}function bRe(e,n){Ps(e,n==null||W$((Nn(n),n))||isNaN((Nn(n),n))?0:(Nn(n),n))}function gRe(e,n){r2(e,n==null||W$((Nn(n),n))||isNaN((Nn(n),n))?0:(Nn(n),n))}function wRe(e,n){i2(e,n==null||W$((Nn(n),n))||isNaN((Nn(n),n))?0:(Nn(n),n))}function pRe(e){(this.q?this.q:(yn(),yn(),w1)).zc(e.q?e.q:(yn(),yn(),w1))}function AQ(e,n,t){var i;return i=e.g[n],rj(e,n,e.Xi(n,t)),e.Pi(n,t,i),e.Li(),i}function dB(e,n){var t;return t=e.bd(n),t>=0?(e.ed(t),!0):!1}function xQ(e){var n;return e.d!=e.r&&(n=mf(e),e.e=!!n&&n.jk()==KZe,e.d=n),e.e}function TQ(e,n){var t;for(Tt(e),Tt(n),t=!1;n.Ob();)t=t|e.Ec(n.Pb());return t}function qa(e,n){var t;return t=u(Rn(e.e,n),393),t?(qCe(e,t),t.e):null}function mRe(e){var n,t;return n=e/60|0,t=e%60,t==0?""+n:""+n+":"+(""+t)}function lu(e,n){var t,i;return ob(e),i=new nhe(n,e.a),t=new pNe(i),new wn(e,t)}function Zp(e,n){var t=e.a[n],i=(ZQ(),cte)[typeof t];return i?i(t):z1e(typeof t)}function h8n(e,n){var t,i,r;r=n.c.i,t=u(Rn(e.f,r),60),i=t.d.c-t.e.c,Whe(n.a,i,0)}function o1(e,n,t){var i,r;for(i=10,r=0;r=0;)++n[0]}function jRe(e,n,t,i){fi(),Pw.call(this,26),this.c=e,this.a=n,this.d=t,this.b=i}function ed(e,n,t,i,r,c,o){IQ.call(this,n,i,r,c,o),this.c=e,this.b=t}function SRe(e){this.g=e,this.f=new Te,this.a=k.Math.min(this.g.c.c,this.g.d.c)}function Cj(){Cj=Y,Xtn=new N1,Vtn=new D1,qtn=new O0,Utn=new Ra,Ktn=new us}function bB(){bB=Y,kte=new lse("EADES",0),EH=new lse("FRUCHTERMAN_REINGOLD",1)}function gO(){gO=Y,WH=new dse("READING_DIRECTION",0),Eve=new dse("ROTATION",1)}function MRe(){MRe=Y,Ein=Ot((am(),z(B(kin,1),ye,371,0,[rD,KH,QH,VH,XH])))}function ARe(){ARe=Y,Bun=Ot((Yj(),z(B(_5e,1),ye,328,0,[D5e,ere,nre,OM,NM])))}function xRe(){xRe=Y,Vin=Ot((el(),z(B(Zve,1),ye,165,0,[dD,mM,bd,vM,qg])))}function TRe(){TRe=Y,Osn=Ot((Sz(),z(B(Csn,1),ye,364,0,[Nre,Tre,Dre,Cre,Ore])))}function CRe(){CRe=Y,Nln=Ot((lS(),z(B(Oln,1),ye,369,0,[w4,i6,QM,KM,DD])))}function ORe(){ORe=Y,$ln=Ot((XO(),z(B(z6e,1),ye,330,0,[$6e,ice,B6e,rce,R6e])))}function NRe(){NRe=Y,Btn=Ot((Hr(),z(B(w3e,1),ye,363,0,[ea,p1,eo,no,Pc])))}function DRe(){DRe=Y,Ffn=Ot((kr(),z(B(iA,1),ye,86,0,[lh,cu,Zc,sh,cf])))}function _Re(){_Re=Y,ufn=Ot((Th(),z(B(uh,1),ye,160,0,[Sn,ar,_a,h0,wd])))}function IRe(){IRe=Y,Yfn=Ot((Mv(),z(B(oA,1),ye,257,0,[Pb,UD,b8e,uA,g8e])))}function LRe(){LRe=Y,ean=Ot((Ne(),z(B(Ac,1),qu,64,0,[Eu,Un,Wn,bt,Xn])))}function PRe(e){var n;return n=u(T(e,(pe(),L2)),317),n?n.a==e:!1}function $Re(e){var n;return n=u(T(e,(pe(),L2)),317),n?n.i==e:!1}function RRe(e,n){return Nn(n),Nfe(e),e.d.Ob()?(n.Ad(e.d.Pb()),!0):!1}function gB(e){return ao(e,ui)>0?ui:ao(e,Kr)<0?Kr:Lt(e)}function k8n(e,n){var t;return t=s2(e.e.c,n.e.c),t==0?ki(e.e.d,n.e.d):t}function OQ(e,n){var t;return t=u(Rn(e.a,n),150),t||(t=new cs,Zt(e.a,n,t)),t}function Gf(e,n,t){var i;if(n==null)throw $(new y5);return i=K1(e,n),U6n(e,n,t),i}function E8n(e,n){var t,i;for(i=n.c,t=i+1;t<=n.f;t++)e.a[t]>e.a[i]&&(i=t);return i}function j8n(e,n,t){var i;return i=e.a.e[u(n.a,9).p]-e.a.e[u(t.a,9).p],ac(zC(i))}function S8n(e,n,t){var i,r;for(r=new L(t);r.a0?n-1:n,hAe(ygn(oBe(hfe(new j5,t),e.n),e.j),e.k)}function N8n(e,n,t,i){var r;e.j=-1,ebe(e,D0e(e,n,t),(Cc(),r=u(n,69).tk(),r.vl(i)))}function JRe(e,n,t,i,r,c){var o;o=aQ(i),hc(o,r),Ur(o,c),gn(e.a,i,new nR(o,n,t.f))}function wB(e,n){var t;return ob(e),t=new Q_e(e,e.a.xd(),e.a.wd()|4,n),new wn(e,t)}function D8n(e,n){var t,i;return t=u(um(e.d,n),18),t?(i=n,e.e.pc(i,t)):null}function jn(e,n){var t;return t=(e.i==null&&Oh(e),e.i),n>=0&&n=-.01&&e.a<=Za&&(e.a=0),e.b>=-.01&&e.b<=Za&&(e.b=0),e}function gv(e){F8();var n,t;for(t=z2e,n=0;nt&&(t=e[n]);return t}function _8n(e){var n;return n=te(re(T(e,(Oe(),s0)))),n<0&&(n=0,ae(e,s0,n)),n}function I8n(e,n){F5(u(T(u(e.e,9),(Oe(),Zi)),102))&&(yn(),Nr(u(e.e,9).j,n))}function pB(e,n){var t,i;for(i=e.Jc();i.Ob();)t=u(i.Pb(),70),ae(t,(pe(),Ky),n)}function L8n(e,n){var t,i,r;for(i=n.a.jd(),t=u(n.a.kd(),18).gc(),r=0;re||e>n)throw $(new Doe("fromIndex: 0, toIndex: "+e+Uge+n))}function XRe(e,n){Ei(e,(l1(),qre),n.f),Ei(e,rln,n.e),Ei(e,Gre,n.d),Ei(e,iln,n.c)}function Ao(e,n){var t,i,r,c;for(Nn(n),i=e.c,r=0,c=i.length;r0&&(e.a/=n,e.b/=n),e}function VRe(e,n,t){var i,r;i=n;do r=te(e.p[i.p])+t,e.p[i.p]=r,i=e.a[i.p];while(i!=n)}function gl(e){var n;return e.w?e.w:(n=Oyn(e),n&&!n.Sh()&&(e.w=n),n)}function Mhe(e,n){return Ba(),qf(wb),k.Math.abs(e-n)<=wb||e==n||isNaN(e)&&isNaN(n)}function J8n(e){var n;return e==null?null:(n=u(e,195),Nxn(n,n.length))}function V(e,n){if(e.g==null||n>=e.i)throw $(new SV(n,e.i));return e.Ui(n,e.g[n])}function Sa(){Sa=Y,Nu=new UX("BEGIN",0),No=new UX(i7,1),Du=new UX("END",2)}function Ua(){Ua=Y,ik=new mV(i7,0),c3=new mV("HEAD",1),rk=new mV("TAIL",2)}function ry(){ry=Y,Msn=xh(xh(xh(RE(new sr,(wy(),RM)),(dS(),dre)),uye),fye)}function nd(){nd=Y,xsn=xh(xh(xh(RE(new sr,(wy(),zM)),(dS(),sye)),iye),oye)}function wv(e,n){return Mgn(Ij(e,n,Lt(bc(h1,c1(Lt(bc(n==null?0:Ni(n),d1)),15)))))}function Ahe(e,n){return Ba(),qf(wb),k.Math.abs(e-n)<=wb||e==n||isNaN(e)&&isNaN(n)}function o8(e,n){var t,i;i=e.a,t=SEn(e,n,null),i!=n&&!e.e&&(t=V8(e,n,t)),t&&t.mj()}function G8n(e,n){var t;return t=_r(vc(u(Rn(e.g,n),8)),qse(u(Rn(e.f,n),460).b)),t}function KRe(e,n,t){var i=function(){return e.apply(i,arguments)};return n.apply(i,t),i}function cy(e){var n;return lj(e==null||Array.isArray(e)&&(n=bO(e),!(n>=14&&n<=16))),e}function xhe(e){e.b=(ks(),Sb),e.f=(Vo(),Mb),e.d=(wl(2,Em),new Mo(2)),e.e=new Yr}function mB(e){this.b=(Tt(e),new vs(e)),this.a=new Te,this.d=new Te,this.e=new Yr}function QRe(e){return ob(e),J5(!0,"n may not be negative"),new wn(e,new gBe(e.a))}function q8n(e,n){yn();var t,i;for(i=new Te,t=0;t0?u(Le(t.a,i-1),9):null}function qf(e){if(!(e>=0))throw $(new Jn("tolerance ("+e+") must be >= 0"));return e}function Nj(){return sce||(sce=new TXe,ly(sce,z(B(zy,1),xn,148,0,[new _T]))),sce}function kB(){kB=Y,K5e=new oV("NO",0),fre=new oV(dwe,1),V5e=new oV("LOOK_BACK",2)}function Nc(){Nc=Y,_M=new iV(xS,0),Ms=new iV("INPUT",1),Do=new iV("OUTPUT",2)}function EB(){EB=Y,mve=new QX("ARD",0),YH=new QX("MSD",1),Qte=new QX("MANUAL",2)}function W8n(){return ZO(),z(B(kve,1),ye,267,0,[Zte,yve,nie,tie,eie,iie,uD,Wte,Yte])}function Z8n(){return nN(),z(B(C5e,1),ye,268,0,[Qie,A5e,x5e,Vie,M5e,T5e,TJ,Xie,Kie])}function e7n(){return Bs(),z(B(y8e,1),ye,266,0,[ok,WD,bG,aA,gG,pG,wG,Nce,YD])}function n7n(){wxe();for(var e=Kne,n=0;nt)throw $(new Bp(n,t));return new Ule(e,n)}function jB(e){var n,t;for(t=e.c.Bc().Jc();t.Ob();)n=u(t.Pb(),18),n.$b();e.c.$b(),e.d=0}function t7n(e){var n,t,i,r;for(t=e.a,i=0,r=t.length;i=0),Bjn(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function gBe(e){P$.call(this,e.yd(64)?Jse(0,pf(e.xd(),1)):pN,e.wd()),this.b=1,this.a=e}function wBe(){rle.call(this),this.n=-1,this.g=null,this.i=null,this.j=null,this.Bb|=Yf}function pBe(e,n,t,i){this.$j(),this.a=n,this.b=e,this.c=null,this.c=new dNe(this,n,t,i)}function IQ(e,n,t,i,r){this.d=e,this.n=n,this.g=t,this.o=i,this.p=-1,r||(this.o=-2-i-1)}function mBe(e){Yoe(),this.g=new wt,this.f=new wt,this.b=new wt,this.c=new Zw,this.i=e}function Phe(){this.f=new Yr,this.d=new poe,this.c=new Yr,this.a=new Te,this.b=new Te}function r7n(e){var n,t;for(t=new L(bJe(e));t.a=0}function $he(){$he=Y,ion=Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)}function vBe(){vBe=Y,ron=Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)}function Rhe(){Rhe=Y,con=Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)}function yBe(){yBe=Y,uon=Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)}function kBe(){kBe=Y,oon=Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)}function EBe(){EBe=Y,son=Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)}function jBe(){jBe=Y,aon=jo(Ht(Ht(new sr,(Hr(),eo),(Vr(),$H)),no,DH),Pc,PH)}function SBe(){SBe=Y,Qen=z(B(It,1),ei,30,15,[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15])}function Bhe(e,n){var t;t=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,0,t,e.b))}function zhe(e,n){var t;t=e.c,e.c=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,1,t,e.c))}function LQ(e,n){var t;t=e.c,e.c=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,4,t,e.c))}function Fhe(e,n){var t;t=e.c,e.c=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,1,t,e.c))}function Hhe(e,n){var t;t=e.d,e.d=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,1,t,e.d))}function l8(e,n){var t;t=e.k,e.k=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,2,t,e.k))}function PQ(e,n){var t;t=e.D,e.D=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,2,t,e.D))}function AB(e,n){var t;t=e.f,e.f=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,8,t,e.f))}function xB(e,n){var t;t=e.i,e.i=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,7,t,e.i))}function Jhe(e,n){var t;t=e.a,e.a=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,8,t,e.a))}function Ghe(e,n){var t;t=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,0,t,e.b))}function o7n(e,n,t){var i;e.b=n,e.a=t,i=(e.a&512)==512?new OMe:new yT,e.c=RDn(i,e.b,e.a)}function MBe(e,n){return od(e.e,n)?(Cc(),xQ(n)?new lR(n,e):new EC(n,e)):new YTe(n,e)}function s7n(e){var n,t;return 0>e?new Koe:(n=e+1,t=new RPe(n,e),new Mle(null,t))}function l7n(e,n){yn();var t;return t=new C5(1),Br(e)?Vc(t,e,n):Qo(t.f,e,n),new hX(t)}function f7n(e,n){var t;t=new bw,u(n.b,68),u(n.b,68),u(n.b,68),Ao(n.a,new tfe(e,t,n))}function ABe(e,n){var t;return X(n,8)?(t=u(n,8),e.a==t.a&&e.b==t.b):!1}function a7n(e){var n;return n=T(e,(pe(),pi)),X(n,174)?XFe(u(n,174)):null}function xBe(e){var n;return e=k.Math.max(e,2),n=d1e(e),e>n?(n<<=1,n>0?n:ES):n}function $Q(e){switch(tle(e.e!=3),e.e){case 2:return!1;case 0:return!0}return g9n(e)}function qhe(e){var n;return e.b==null?(Bd(),Bd(),u_):(n=e.sl()?e.rl():e.ql(),n)}function TBe(e,n){var t,i;for(i=n.vc().Jc();i.Ob();)t=u(i.Pb(),45),JO(e,t.jd(),t.kd())}function Uhe(e,n){var t;t=e.d,e.d=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,11,t,e.d))}function TB(e,n){var t;t=e.j,e.j=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,13,t,e.j))}function Xhe(e,n){var t;t=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,21,t,e.b))}function Vhe(e,n){e.r>0&&e.c0&&e.g!=0&&Vhe(e.i,n/e.r*e.i.d))}function CBe(e,n,t){var i,r,c;for(c=e.a.length-1,r=e.b,i=0;i0?1:0:(!e.c&&(e.c=QC(Pu(e.f))),e.c).e}function BBe(e,n){n?e.B==null&&(e.B=e.D,e.D=null):e.B!=null&&(e.D=e.B,e.B=null)}function w7n(e,n){n.Tg(gYe,1),tr(lu(new wn(null,new pn(e.b,16)),new N0),new S_),n.Ug()}function HQ(e,n,t,i,r,c){var o;this.c=e,o=new Te,_de(e,o,n,e.b,t,i,r,c),this.a=new Xr(o,0)}function ur(e,n,t,i,r,c,o,l,f,h,b,p,y){return nqe(e,n,t,i,r,c,o,l,f,h,b,p,y),vY(e,!1),e}function p7n(e,n){typeof window===dN&&typeof window.$gwt===dN&&(window.$gwt[e]=n)}function m7n(e,n,t){var i,r,c;for(i=0,r=0;r>>31;i!=0&&(e[t]=i)}function v7n(e,n,t){t.Tg("DFS Treeifying phase",1),Cjn(e,n),uDn(e,n),e.a=null,e.b=null,t.Ug()}function y7n(e,n){var t;n.Tg("General Compactor",1),t=ajn(u(ve(e,(ab(),Lre)),386)),t.Bg(e)}function k7n(e,n){var t,i;return t=u(ve(e,(ab(),UJ)),15),i=u(ve(n,UJ),15),oo(t.a,i.a)}function Whe(e,n,t){var i,r;for(r=jt(e,0);r.b!=r.d.c;)i=u(kt(r),8),i.a+=n,i.b+=t;return e}function E7n(e,n,t,i){var r;r=new S5,bg(r,"x",Ez(e,n,i.a)),bg(r,"y",jz(e,n,i.b)),V5(t,r)}function j7n(e,n,t,i){var r;r=new S5,bg(r,"x",Ez(e,n,i.a)),bg(r,"y",jz(e,n,i.b)),V5(t,r)}function S7n(){return db(),z(B(R5e,1),ye,243,0,[NJ,yD,kD,L5e,P5e,I5e,$5e,DJ,V7,DM])}function M7n(){return Dc(),z(B(aie,1),ye,261,0,[tJ,rf,dM,iJ,z7,n4,bM,R7,B7,rJ])}function JQ(){JQ=Y,wA=new MMe,Hce=z(B(is,1),Uv,179,0,[]),Xan=z(B(Tf,1),tme,62,0,[])}function uy(){uy=Y,$te=new Pi("edgelabelcenterednessanalysis.includelabel",(Ln(),jb))}function zBe(e,n){return te(re(Ks(NO(So(new wn(null,new pn(e.c.b,16)),new UEe(e)),n))))}function Zhe(e,n){return te(re(Ks(NO(So(new wn(null,new pn(e.c.b,16)),new qEe(e)),n))))}function Ni(e){return Br(e)?Vd(e):_p(e)?I5(e):Dp(e)?zOe(e):Tfe(e)?e.Hb():jfe(e)?Gw(e):fae(e)}function FBe(e,n){return Ba(),qf(Za),k.Math.abs(0-n)<=Za||n==0||isNaN(0)&&isNaN(n)?0:e/n}function A7n(e,n){return g8(),e==D2&&n==Dm||e==D2&&n==Kv||e==_m&&n==Kv||e==_m&&n==Dm}function x7n(e,n){return g8(),e==D2&&n==_m||e==_m&&n==D2||e==Kv&&n==Dm||e==Dm&&n==Kv}function hs(){hs=Y,M3e=new Z2,j3e=new Il,S3e=new Df,E3e=new P4,A3e=new x6,x3e=new ep}function T7n(e){var n;return n=GR(e),YE(n.a,0)?(n$(),n$(),lnn):(n$(),new vOe(n.b))}function GQ(e){var n;return n=Nae(e),YE(n.a,0)?(Tp(),Tp(),fte):(Tp(),new RV(n.b))}function qQ(e){var n;return n=Nae(e),YE(n.a,0)?(Tp(),Tp(),fte):(Tp(),new RV(n.c))}function C7n(e){return e.b.c.i.k==(Bn(),pr)?u(T(e.b.c.i,(pe(),pi)),12):e.b.c}function HBe(e){return e.b.d.i.k==(Bn(),pr)?u(T(e.b.d.i,(pe(),pi)),12):e.b.d}function JBe(e){switch(e.g){case 2:return Ne(),Xn;case 4:return Ne(),Wn;default:return e}}function GBe(e){switch(e.g){case 1:return Ne(),bt;case 3:return Ne(),Un;default:return e}}function O7n(e,n){var t;return t=p0e(e),V0e(new Ee(t.c,t.d),new Ee(t.b,t.a),e.Kf(),n,e.$f())}function N7n(e,n){n.Tg(gYe,1),ude(Pgn(new _P((IE(),new IK(e,!1,!1,new x3))))),n.Ug()}function e1e(){e1e=Y,hon=xh(tCe(Ht(Ht(new sr,(Hr(),eo),(Vr(),$H)),no,DH),Pc),PH)}function qBe(){qBe=Y,won=xh(tCe(Ht(Ht(new sr,(Hr(),eo),(Vr(),$H)),no,DH),Pc),PH)}function UBe(e,n,t){this.g=e,this.d=n,this.e=t,this.a=new Te,kCn(this),yn(),Nr(this.a,null)}function Vl(e,n,t,i,r,c,o){xt.call(this,e,n),this.d=t,this.e=i,this.c=r,this.b=c,this.a=Jf(o)}function n1e(e){this.i=e.gc(),this.i>0&&(this.g=this.$i(this.i+(this.i/8|0)+1),e.Oc(this.g))}function _j(e,n){var t,i;for(Nn(n),i=n.vc().Jc();i.Ob();)t=u(i.Pb(),45),e.yc(t.jd(),t.kd())}function D7n(e,n,t){var i;for(i=t.Jc();i.Ob();)if(!VR(e,n,i.Pb()))return!1;return!0}function Ij(e,n,t){var i;for(i=e.b[t&e.f];i;i=i.b)if(t==i.a&&X1(n,i.g))return i;return null}function Lj(e,n,t){var i;for(i=e.c[t&e.f];i;i=i.d)if(t==i.f&&X1(n,i.i))return i;return null}function _7n(e,n){var t;for(Tt(n);e.Ob();)if(t=e.Pb(),!c1e(u(t,9)))return!1;return!0}function I7n(e,n,t,i,r){var c;return t&&(c=Fi(n.Ah(),e.c),r=t.Oh(n,-1-(c==-1?i:c),null,r)),r}function L7n(e,n,t,i,r){var c;return t&&(c=Fi(n.Ah(),e.c),r=t.Qh(n,-1-(c==-1?i:c),null,r)),r}function XBe(e){var n;if(e.b==-2){if(e.e==0)n=-1;else for(n=0;e.a[n]==0;n++);e.b=n}return e.b}function P7n(e){var n,t,i;return e.j==(Ne(),Un)&&(n=Vqe(e),t=ls(n,Wn),i=ls(n,Xn),i||i&&t)}function $7n(e){var n,t,i;for(i=0,t=new L(e.b);t.ar&&n.ac&&n.br?t=r:Kn(n,t+1),e.a=gf(e.a,0,n)+(""+i)+Gfe(e.a,t)}function VBe(e,n,t,i){X(e.Cb,184)&&(u(e.Cb,184).tb=null),xo(e,t),n&&$Cn(e,n),i&&e.el(!0)}function z7n(e,n){var t,i;for(i=new L(n.b);i.a1||e.Ob())return++e.a,e.g=0,n=e.i,e.Ob(),n;throw $(new hu)}function V7n(e,n){var t,i;for(i=new L(n);i.a>22),r=e.h+n.h+(i>>22),Io(t&zs,i&zs,r&ld)}function kze(e,n){var t,i,r;return t=e.l-n.l,i=e.m-n.m+(t>>22),r=e.h-n.h+(i>>22),Io(t&zs,i&zs,r&ld)}function WQ(e){var n,t,i,r;for(r=new Te,i=e.Jc();i.Ob();)t=u(i.Pb(),26),n=wm(t),Ar(r,n);return r}function dkn(e){var n;n0(e,!0),n=t0,bi(e,(Oe(),q7))&&(n+=u(T(e,q7),15).a),ae(e,q7,me(n))}function Eze(e,n,t){var i;Ju(e.a),Ao(t.i,new qje(e)),i=new B$(u(Rn(e.a,n.b),68)),vHe(e,i,n),t.f=i}function s1e(e){var n,t;return t=(H0(),n=new yo,n),e&&Et((!e.a&&(e.a=new we($i,e,6,6)),e.a),t),t}function oy(e,n){var t,i;if(i=0,e<64&&e<=n)for(n=n<64?n:63,t=e;t<=n;t++)i=jh(i,i1(1,t));return i}function bkn(e,n){var t,i;for(IR(n,"predicate"),i=0;e.Ob();i++)if(t=e.Pb(),n.Lb(t))return i;return-1}function l1e(e,n){if(n===0){!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),e.o.c.$b();return}mW(e,n)}function jze(e){switch(e.g){case 1:return Lb;case 2:return k1;case 3:return GD;default:return qD}}function f1e(e){yn();var n,t,i;for(i=0,t=e.Jc();t.Ob();)n=t.Pb(),i=i+(n!=null?Ni(n):0),i=i|0;return i}function gkn(e){var n;return n=new Dn,n.a=e,n.b=kkn(e),n.c=oe(Be,Ae,2,2,6,1),n.c[0]=RBe(e),n.c[1]=RBe(e),n}function zB(){zB=Y,Rte=new g$(xa,0),qH=new g$(mYe,1),UH=new g$(vYe,2),iD=new g$("BOTH",3)}function g8(){g8=Y,D2=new d$("Q1",0),_m=new d$("Q4",1),Dm=new d$("Q2",2),Kv=new d$("Q3",3)}function ib(){ib=Y,sD=new eV("ONLY_WITHIN_GROUP",0),Rve=new eV(nee,1),Rm=new eV("ENFORCED",2)}function jg(){jg=Y,rie=new WX(xa,0),$7=new WX("INCOMING_ONLY",1),e4=new WX("OUTGOING_ONLY",2)}function sy(){sy=Y,tfn=new Hx,nfn=new tL}function ZQ(){ZQ=Y,cte={boolean:Ngn,number:Jbn,string:Gbn,object:rqe,function:rqe,undefined:Ebn}}function Sze(){Sze=Y,zun=Ot((db(),z(B(R5e,1),ye,243,0,[NJ,yD,kD,L5e,P5e,I5e,$5e,DJ,V7,DM])))}function Mze(){Mze=Y,Fin=Ot((Dc(),z(B(aie,1),ye,261,0,[tJ,rf,dM,iJ,z7,n4,bM,R7,B7,rJ])))}function wkn(e,n,t,i){return new ise(z(B(Fg,1),cF,45,0,[(UY(e,n),new Bw(e,n)),(UY(t,i),new Bw(t,i))]))}function pkn(e,n){var t,i;return t=u(u(Rn(e.g,n.a),49).a,68),i=u(u(Rn(e.g,n.b),49).a,68),bVe(t,i)}function a1e(e,n,t){var i;if(i=e.gc(),n>i)throw $(new Bp(n,i));return e.Qi()&&(t=PIe(e,t)),e.Ci(n,t)}function Aze(e){var n,t,i;return t=e.n,i=e.o,n=e.d,new Ff(t.a-n.b,t.b-n.d,i.a+(n.b+n.c),i.b+(n.d+n.a))}function mkn(e,n){return!e||!n||e==n?!1:s2(e.b.c,n.b.c+n.b.b)<0&&s2(n.b.c,e.b.c+e.b.b)<0}function eY(e,n,t){return e>=128?!1:e<64?WE(zr(i1(1,e),t),0):WE(zr(i1(1,e-64),n),0)}function AO(e,n,t){switch(t.g){case 2:e.b=n;break;case 1:e.c=n;break;case 4:e.d=n;break;case 3:e.a=n}}function xO(e,n,t){return t==null?(!e.q&&(e.q=new wt),ny(e.q,n)):(!e.q&&(e.q=new wt),Zt(e.q,n,t)),e}function ae(e,n,t){return t==null?(!e.q&&(e.q=new wt),ny(e.q,n)):(!e.q&&(e.q=new wt),Zt(e.q,n,t)),e}function xze(e){var n,t;return t=new nB,$u(t,e),ae(t,(nb(),Hy),e),n=new wt,hLn(e,t,n),J$n(e,t,n),t}function vkn(e){F8();var n,t,i;for(t=oe($r,Ae,8,2,0,1),i=0,n=0;n<2;n++)i+=.5,t[n]=WSn(i,e);return t}function Tze(e,n){var t,i,r,c;for(t=!1,i=e.a[n].length,c=0;ce.f,t=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d,n||t}function h1e(e){var n;return(!e.c||(e.Bb&1)==0&&(e.c.Db&64)!=0)&&(n=mf(e),X(n,88)&&(e.c=u(n,29))),e.c}function d1e(e){var n;if(e<0)return Kr;if(e==0)return 0;for(n=ES;(n&e)==0;n>>=1);return n}function kkn(e){var n;return e==0?"Etc/GMT":(e<0?(e=-e,n="Etc/GMT-"):n="Etc/GMT+",n+mRe(e))}function Oze(e){var n,t;return t=YO(e.h),t==32?(n=YO(e.m),n==32?YO(e.l)+32:n+20-10):t-12}function nY(e){var n,t,i;n=~e.l+1&zs,t=~e.m+(n==0?1:0)&zs,i=~e.h+(n==0&&t==0?1:0)&ld,e.l=n,e.m=t,e.h=i}function $j(e){var n;return n=e.a[e.b],n==null?null:(cr(e.a,e.b,null),e.b=e.b+1&e.a.length-1,n)}function b1e(){this.o=null,this.k=null,this.j=null,this.d=null,this.b=null,this.n=null,this.a=null}function g1e(e,n){this.c=e,this.d=n,this.b=this.d/this.c.c.Pd().gc()|0,this.a=this.d%this.c.c.Pd().gc()}function Nze(e,n){this.b=e,nv.call(this,(u(V(ge((V0(),$n).o),10),19),n.i),n.g),this.a=(JQ(),Hce)}function w1e(e,n,t){this.q=new k.Date,this.q.setFullYear(e+pb,n,t),this.q.setHours(0,0,0,0),gS(this,0)}function Dze(e,n,t){var i,r;return i=new mQ(n,t),r=new ai,e.b=YUe(e,e.b,i,r),r.b||++e.c,e.b.b=!1,r.d}function p1e(e,n){yn();var t,i,r,c,o;for(o=!1,i=n,r=0,c=i.length;ro||i+r>c)throw $(new ooe)}function _ze(e,n,t){var i,r,c,o;for(o=Jj(n,t),c=0,r=o.Jc();r.Ob();)i=u(r.Pb(),12),Zt(e.c,i,me(c++))}function rb(e){var n,t;for(t=new L(e.a.b);t.a=0,"Negative initial capacity"),RC(n>=0,"Non-positive load factor"),Ju(this)}function Rze(e,n){var t;for(t=0;t1||n>=0&&e.b<3)}function Okn(){fi();var e;return Vce||(e=x2n(bb("M",!0)),e=wR(bb("M",!1),e),Vce=e,Vce)}function Fze(e){if(e.g===0)return new W6;throw $(new Jn(HF+(e.f!=null?e.f:""+e.g)))}function Hze(e){if(e.g===0)return new nL;throw $(new Jn(HF+(e.f!=null?e.f:""+e.g)))}function E1e(e,n,t){if(n===0){!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),IB(e.o,t);return}kW(e,n,t)}function iY(e,n,t){this.g=e,this.e=new Yr,this.f=new Yr,this.d=new Mi,this.b=new Mi,this.a=n,this.c=t}function rY(e,n,t,i){this.b=new Te,this.n=new Te,this.i=i,this.j=t,this.s=e,this.t=n,this.r=0,this.d=0}function Jze(e,n,t,i){this.b=new wt,this.g=new wt,this.d=(Fj(),CJ),this.c=e,this.e=n,this.d=t,this.a=i}function m8(e,n){if(!e.Ji()&&n==null)throw $(new Jn("The 'no null' constraint is violated"));return n}function j1e(e){switch(e.g){case 1:return zYe;default:case 2:return 0;case 3:return FYe;case 4:return B2e}}function Nkn(e){return xe(e.c,(sy(),tfn)),Mhe(e.a,te(re(Ie((MY(),xJ)))))?new eT:new Yje(e)}function Dkn(e){for(;!e.d||!e.d.Ob();)if(e.b&&!CE(e.b))e.d=u(U5(e.b),50);else return null;return e.d}function Vd(e){var n,t;for(n=0,t=0;ti?1:0}function Gze(e,n){var t,i,r;for(r=e.b;r;){if(t=e.a.Le(n,r.d),t==0)return r;i=t<0?0:1,r=r.a[i]}return null}function cY(e,n){var t;return n===e?!0:X(n,229)?(t=u(n,229),di(e.Zb(),t.Zb())):!1}function S1e(e,n){return LUe(e,n)?(gn(e.b,u(T(n,(pe(),dd)),22),n),Vt(e.a,n),!0):!1}function Lkn(e,n){return bi(e,(pe(),Oi))&&bi(n,Oi)?u(T(n,Oi),15).a-u(T(e,Oi),15).a:0}function Pkn(e,n){return bi(e,(pe(),Oi))&&bi(n,Oi)?u(T(e,Oi),15).a-u(T(n,Oi),15).a:0}function qze(e){return ih?oe(hnn,xQe,567,0,0,1):u(Xa(e.a,oe(hnn,xQe,567,e.a.c.length,0,1)),840)}function Zs(e){return Br(e)?Be:_p(e)?wr:Dp(e)?Yi:Tfe(e)||jfe(e)?e.Pm:e.Pm||Array.isArray(e)&&B(Gen,1)||Gen}function Ev(e,n,t){var i,r;return r=(i=new kX,i),Fc(r,n,t),Et((!e.q&&(e.q=new we(Tf,e,11,10)),e.q),r),r}function uY(e){var n,t,i,r;for(r=Xgn(jan,e),t=r.length,i=oe(Be,Ae,2,t,6,1),n=0;n=e.b.c.length||(M1e(e,2*n+1),t=2*n+2,t0&&(n.Ad(t),t.i&&fSn(t))}function A1e(e,n,t){var i;for(i=t-1;i>=0&&e[i]===n[i];i--);return i<0?0:GX(zr(e[i],_c),zr(n[i],_c))?-1:1}function Rkn(e,n){var t;return!e||e==n||!bi(n,(pe(),P2))?!1:(t=u(T(n,(pe(),P2)),9),t!=e)}function oY(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.Yl()}}function Uze(e,n,t){return e.d[n.p][t.p]||(DSn(e,n,t),e.d[n.p][t.p]=!0,e.d[t.p][n.p]=!0),e.a[n.p][t.p]}function Xze(e,n,t){var i,r;this.g=e,this.c=n,this.a=this,this.d=this,r=xBe(t),i=oe(Hen,mN,227,r,0,1),this.b=i}function Bkn(e,n){var t,i;for(i=e.Zb().Bc().Jc();i.Ob();)if(t=u(i.Pb(),18),t.Gc(n))return!0;return!1}function Vze(e,n,t){var i,r,c,o;for(Nn(t),o=!1,c=e.dd(n),r=t.Jc();r.Ob();)i=r.Pb(),c.Rb(i),o=!0;return o}function sY(e,n){var t,i;return i=u(qn(e.a,4),129),t=oe(zce,Lne,415,n,0,1),i!=null&&Wu(i,0,t,0,i.length),t}function Kze(e,n){var t;return t=new IW((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,n),e.e!=null||(t.c=e),t}function zkn(e,n){var t;return e===n?!0:X(n,92)?(t=u(n,92),T0e(sg(e),t.vc())):!1}function Qze(e,n,t){var i,r;for(r=t.Jc();r.Ob();)if(i=u(r.Pb(),45),e.ze(n,i.kd()))return!0;return!1}function FB(){FB=Y,Ice=new O$("ELK",0),N8e=new O$("JSON",1),O8e=new O$("DOT",2),D8e=new O$("SVG",3)}function Rj(){Rj=Y,Are=new E$(nee,0),JJ=new E$(GYe,1),Mre=new E$("FAN",2),Sre=new E$("CONSTRAINT",3)}function Bj(){Bj=Y,dye=new fV(xa,0),bre=new fV("MIDDLE_TO_MIDDLE",1),MD=new fV("AVOID_OVERLAP",2)}function TO(){TO=Y,qJ=new aV(xa,0),zye=new aV("RADIAL_COMPACTION",1),Fye=new aV("WEDGE_COMPACTION",2)}function zj(){zj=Y,sre=new cV("STACKED",0),ore=new cV("REVERSE_STACKED",1),ED=new cV("SEQUENCED",2)}function Kl(){Kl=Y,Xme=new qX("CONCURRENT",0),Wo=new qX("IDENTITY_FINISH",1),Vme=new qX("UNORDERED",2)}function rd(){rd=Y,hG=new vV(Ipe,0),b0=new vV("INCLUDE_CHILDREN",1),cA=new vV("SEPARATE_CHILDREN",2)}function HB(){HB=Y,h8e=new Hw(15),Ufn=new Wr((Gt(),y1),h8e),rA=o6,s8e=pfn,l8e=Zg,a8e=y4,f8e=n3}function lY(){lY=Y,Tte=CIe(z(B(iA,1),ye,86,0,[(kr(),Zc),cu])),Cte=CIe(z(B(iA,1),ye,86,0,[cf,sh]))}function Fkn(e){var n,t,i;for(n=0,i=oe($r,Ae,8,e.b,0,1),t=jt(e,0);t.b!=t.d.c;)i[n++]=u(kt(t),8);return i}function fY(e,n,t){var i,r,c;for(i=new Mi,c=jt(t,0);c.b!=c.d.c;)r=u(kt(c),8),Vt(i,new mc(r));Vze(e,n,i)}function Hkn(e,n){var t;t=Ie((MY(),xJ))!=null&&n.Rg()!=null?te(re(n.Rg()))/te(re(Ie(xJ))):1,Zt(e.b,n,t)}function Jkn(e,n){var t,i;return t=u(e.d.Ac(n),18),t?(i=e.e.hc(),i.Fc(t),e.e.d-=t.gc(),t.$b(),i):null}function x1e(e,n){var t,i;if(i=e.c[n],i!=0)for(e.c[n]=0,e.d-=i,t=n+1;t0)return q9(n-1,e.a.c.length),Gd(e.a,n-1);throw $(new KSe)}function Gkn(e,n,t){if(n<0)throw $(new Eo(lWe+n));nn)throw $(new Jn(fF+e+TQe+n));if(e<0||n>t)throw $(new Doe(fF+e+Kge+n+Uge+t))}function Wze(e){if(!e.a||(e.a.i&8)==0)throw $(new Uc("Enumeration class expected for layout option "+e.f))}function Zze(e){IIe.call(this,"The given string does not match the expected format for individual spacings.",e)}function eFe(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e.Zl()}}function Kd(e){switch(e.c){case 0:return uK(),pme;case 1:return new v5(hqe(new T5(e)));default:return new HMe(e)}}function nFe(e){switch(e.gc()){case 0:return uK(),pme;case 1:return new v5(e.Jc().Pb());default:return new rse(e)}}function C1e(e){var n;return n=(!e.a&&(e.a=new we(vd,e,9,5)),e.a),n.i!=0?qgn(u(V(n,0),684)):null}function qkn(e,n){var t;return t=yc(e,n),GX(WK(e,n),0)|I$(WK(e,t),0)?t:yc(pN,WK(fg(t,63),1))}function O1e(e,n,t){var i,r;return Kp(n,e.c.length),i=t.Nc(),r=i.length,r==0?!1:(ofe(e.c,n,i),!0)}function Ukn(e,n){var t,i;for(t=e.a.length-1;n!=e.b;)i=n-1&t,cr(e.a,n,e.a[i]),n=i;cr(e.a,e.b,null),e.b=e.b+1&t}function Xkn(e,n){var t,i;for(t=e.a.length-1,e.c=e.c-1&t;n!=e.c;)i=n+1&t,cr(e.a,n,e.a[i]),n=i;cr(e.a,e.c,null)}function v8(e,n){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),PQ(e,n==null?null:(Nn(n),n)),e.C&&e.fl(null)}function jv(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(Ep(e.a.c,0),Ar(e.a,e.b),Ar(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function cm(e){var n;++e.j,e.i==0?e.g=null:e.ir&&(XJe(n.q,r),i=t!=n.q.d)),i}function fFe(e,n){var t,i,r,c,o,l,f,h;return f=n.i,h=n.j,i=e.f,r=i.i,c=i.j,o=f-r,l=h-c,t=k.Math.sqrt(o*o+l*l),t}function _1e(e,n){var t,i;return i=uz(e),i||(t=(nZ(),aUe(n)),i=new BSe(t),Et(i.Cl(),e)),i}function CO(e,n){var t,i;return t=u(e.c.Ac(n),18),t?(i=e.hc(),i.Fc(t),e.d-=t.gc(),t.$b(),e.mc(i)):e.jc()}function Zkn(e){var n;if(!(e.c.c<0?e.a>=e.c.b:e.a<=e.c.b))throw $(new hu);return n=e.a,e.a+=e.c.c,++e.b,me(n)}function eEn(e){var n,t;if(e==null)return!1;for(n=0,t=e.length;n=i||n=0?n:-n;i>0;)i%2==0?(t*=t,i=i/2|0):(r*=t,i-=1);return n<0?1/r:r}function sEn(e,n){var t,i,r;for(r=1,t=e,i=n>=0?n:-n;i>0;)i%2==0?(t*=t,i=i/2|0):(r*=t,i-=1);return n<0?1/r:r}function ub(e,n){var t,i,r,c;return c=(r=e?uz(e):null,iqe((i=n,r&&r.El(),i))),c==n&&(t=uz(e),t&&t.El()),c}function L1e(e,n,t){var i,r;return r=e.a,e.a=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Lr(e,1,1,r,n),t?t.lj(i):t=i),t}function dFe(e,n,t){var i,r;return r=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Lr(e,1,3,r,n),t?t.lj(i):t=i),t}function bFe(e,n,t){var i,r;return r=e.f,e.f=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Lr(e,1,0,r,n),t?t.lj(i):t=i),t}function gFe(e){var n,t;if(e!=null)for(t=0;t-129&&e<128?(bDe(),n=e+128,t=Dme[n],!t&&(t=Dme[n]=new _n(e)),t):new _n(e)}function me(e){var n,t;return e>-129&&e<128?(oDe(),n=e+128,t=Tme[n],!t&&(t=Tme[n]=new co(e)),t):new co(e)}function bEn(e,n,t,i,r){n==0||i==0||(n==1?r[i]=xde(r,t,i,e[0]):i==1?r[n]=xde(r,e,n,t[0]):iOn(e,t,r,n,i))}function yFe(e,n){var t;e.c.length!=0&&(t=u(Xa(e,oe(m1,i0,9,e.c.length,0,1)),199),Rse(t,new Vh),Aqe(t,n))}function kFe(e,n){var t;e.c.length!=0&&(t=u(Xa(e,oe(m1,i0,9,e.c.length,0,1)),199),Rse(t,new T3),Aqe(t,n))}function EFe(e,n){var t;e.a.c.length>0&&(t=u(Le(e.a,e.a.c.length-1),565),S1e(t,n))||xe(e.a,new IPe(n))}function gEn(e){al();var n,t;n=e.d.c-e.e.c,t=u(e.g,156),Ao(t.b,new NEe(n)),Ao(t.c,new DEe(n)),oc(t.i,new _Ee(n))}function jFe(e){var n;return n=new z0,n.a+="VerticalSegment ",uo(n,e.e),n.a+=" ",Xt(n,ele(new _X,new L(e.k))),n.a}function wEn(e,n){var t;e.c=n,e.a=bjn(n),e.a<54&&(e.f=(t=n.d>1?DLe(n.a[0],n.a[1]):DLe(n.a[0],0),mg(n.e>0?t:Ud(t))))}function bY(e,n){var t,i,r;for(t=0,r=vu(e,n).Jc();r.Ob();)i=u(r.Pb(),12),t+=T(i,(pe(),Ss))!=null?1:0;return t}function Sv(e,n,t){var i,r,c;for(i=0,c=jt(e,0);c.b!=c.d.c&&(r=te(re(kt(c))),!(r>t));)r>=n&&++i;return i}function pEn(e){var n;return n=u(qa(e.c.c,""),233),n||(n=new Y5(T9(x9(new _0,""),"Other")),xg(e.c.c,"",n)),n}function Hj(e){var n;return(e.Db&64)!=0?Vf(e):(n=new df(Vf(e)),n.a+=" (name: ",Bc(n,e.zb),n.a+=")",n.a)}function R1e(e,n,t){var i,r;return r=e.sb,e.sb=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Lr(e,1,4,r,n),t?t.lj(i):t=i),t}function OO(e,n,t){var i;e.Zi(e.i+1),i=e.Xi(n,t),n!=e.i&&Wu(e.g,n,e.g,n+1,e.i-n),cr(e.g,n,i),++e.i,e.Ki(n,t),e.Li()}function B1e(e,n,t){var i,r;return r=e.r,e.r=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Lr(e,1,8,r,e.r),t?t.lj(i):t=i),t}function mEn(e,n,t){var i,r;return i=new ed(e.e,3,13,null,(r=n.c,r||(vn(),hh)),Zd(e,n),!1),t?t.lj(i):t=i,t}function vEn(e,n,t){var i,r;return i=new ed(e.e,4,13,(r=n.c,r||(vn(),hh)),null,Zd(e,n),!1),t?t.lj(i):t=i,t}function yEn(e,n){var t,i,r,c;if(n.cj(e.a),c=u(qn(e.a,8),1997),c!=null)for(t=c,i=0,r=t.length;i>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function kEn(e){return e?(e.i&1)!=0?e==rs?Yi:e==It?Mr:e==b3?T7:e==Gr?wr:e==V2?O2:e==A4?N2:e==ps?$y:nM:e:null}function di(e,n){return Br(e)?bn(e,n):_p(e)?gNe(e,n):Dp(e)?(Nn(e),ue(e)===ue(n)):Tfe(e)?e.Fb(n):jfe(e)?fCe(e,n):Aae(e,n)}function MFe(e){var n;return ao(e,0)<0&&(e=tb(zvn(su(e)?wf(e):e))),n=Lt(fg(e,32)),64-(n!=0?YO(n):YO(Lt(e))+32)}function NO(e,n){var t;return t=new aa,e.a.zd(t)?(P9(),new AX(Nn(sRe(e,t.a,n)))):(K0(e),P9(),P9(),Jme)}function Jj(e,n){switch(n.g){case 2:case 1:return vu(e,n);case 3:case 4:return nl(vu(e,n))}return yn(),yn(),Mc}function EEn(e,n){var t;return n.a&&(t=n.a.a.length,e.a?Xt(e.a,e.b):e.a=new fl(e.d),PLe(e.a,n.a,n.d.length,t)),e}function jEn(e){rF();var n,t,i,r;for(t=IY(),i=0,r=t.length;it)throw $(new Eo(fF+e+Kge+n+", size: "+t));if(e>n)throw $(new Jn(fF+e+TQe+n))}function Ql(e,n,t){if(n<0)G0e(e,t);else{if(!t.pk())throw $(new Jn(kb+t.ve()+HS));u(t,69).uk().Ck(e,e.ei(),n)}}function gY(e,n,t){return k.Math.abs(n-e)PF?e-t>PF:t-e>PF}function F1e(e,n,t,i){switch(n){case 1:return!e.n&&(e.n=new we(ju,e,1,7)),e.n;case 2:return e.k}return Pde(e,n,t,i)}function xFe(e){var n;return(e.Db&64)!=0?Vf(e):(n=new df(Vf(e)),n.a+=" (source: ",Bc(n,e.d),n.a+=")",n.a)}function Yd(e,n){var t;t=(e.Bb&256)!=0,n?e.Bb|=256:e.Bb&=-257,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,2,t,n))}function H1e(e,n){var t;t=(e.Bb&256)!=0,n?e.Bb|=256:e.Bb&=-257,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,8,t,n))}function J1e(e,n){var t;t=(e.Bb&512)!=0,n?e.Bb|=512:e.Bb&=-513,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,9,t,n))}function Wd(e,n){var t;t=(e.Bb&512)!=0,n?e.Bb|=512:e.Bb&=-513,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,3,t,n))}function UB(e,n){var t;t=(e.Bb&256)!=0,n?e.Bb|=256:e.Bb&=-257,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,8,t,n))}function SEn(e,n,t){var i,r;return r=e.a,e.a=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Lr(e,1,5,r,e.a),t?o0e(t,i):t=i),t}function Gj(e,n){var t;return e.b==-1&&e.a&&(t=e.a.nk(),e.b=t?e.c.Eh(e.a.Jj(),t):Fi(e.c.Ah(),e.a)),e.c.vh(e.b,n)}function TFe(e,n){var t,i;for(i=new ot(e);i.e!=i.i.gc();)if(t=u(ft(i),29),ue(n)===ue(t))return!0;return!1}function CFe(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function G1e(e){var n,t;return n=e.k,n==(Bn(),pr)?(t=u(T(e,(pe(),_u)),64),t==(Ne(),Un)||t==bt):!1}function OFe(e){var n;return n=Nae(e),YE(n.a,0)?(Tp(),Tp(),fte):(Tp(),new RV(JX(n.a,0)?Zae(n)/mg(n.a):0))}function MEn(e,n){var t;if(t=tN(e,n),X(t,335))return u(t,38);throw $(new Jn(kb+n+"' is not a valid attribute"))}function qj(e,n,t){var i;if(i=e.gc(),n>i)throw $(new Bp(n,i));if(e.Qi()&&e.Gc(t))throw $(new Jn(HN));e.Ei(n,t)}function NFe(e,n){var t,i;for(i=new ot(e);i.e!=i.i.gc();)if(t=u(ft(i),143),ue(n)===ue(t))return!0;return!1}function AEn(e,n,t){var i,r,c;return c=(r=B8(e.b,n),r),c&&(i=u(Zz(hO(e,c),""),29),i)?bbe(e,i,n,t):null}function wY(e,n,t){var i,r,c;return c=(r=B8(e.b,n),r),c&&(i=u(Zz(hO(e,c),""),29),i)?gbe(e,i,n,t):null}function xEn(e){var n,t,i;for(i=0,t=e.length,n=0;n=0?sb(e):wj(sb(Ud(e))))}function DFe(e,n,t,i,r,c){this.e=new Te,this.f=(Nc(),_M),xe(this.e,e),this.d=n,this.a=t,this.b=i,this.f=r,this.c=c}function ki(e,n){return en?1:e==n?e==0?ki(1/e,1/n):0:isNaN(e)?isNaN(n)?0:1:-1}function TEn(e){var n;return n=e.a[e.c-1&e.a.length-1],n==null?null:(e.c=e.c-1&e.a.length-1,cr(e.a,e.c,null),n)}function _Fe(e){var n,t;for(t=e.p.a.ec().Jc();t.Ob();)if(n=u(t.Pb(),217),n.f&&e.b[n.c]<-1e-10)return n;return null}function CEn(e){var n,t,i;for(n=new Te,i=new L(e.b);i.a=1?cu:sh):t}function LEn(e){var n,t;for(t=hUe(gl(e)).Jc();t.Ob();)if(n=_t(t.Pb()),bS(e,n))return X6n((Txe(),Lan),n);return null}function PEn(e,n,t){var i,r;for(r=e.a.ec().Jc();r.Ob();)if(i=u(r.Pb(),9),MO(t,u(Le(n,i.p),18)))return i;return null}function $En(e,n,t){var i,r;for(r=X(n,103)&&(u(n,19).Bb&Sc)!=0?new MV(n,e):new h8(n,e),i=0;i>10)+EN&Er,n[1]=(e&1023)+56320&Er,Ah(n,0,n.length)}function K1e(e,n){var t;t=(e.Bb&Sc)!=0,n?e.Bb|=Sc:e.Bb&=-65537,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,20,t,n))}function x8(e,n){var t;t=(e.Bb&Nh)!=0,n?e.Bb|=Nh:e.Bb&=-16385,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,16,t,n))}function vY(e,n){var t;t=(e.Bb&Bu)!=0,n?e.Bb|=Bu:e.Bb&=-32769,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,18,t,n))}function Q1e(e,n){var t;t=(e.Bb&Bu)!=0,n?e.Bb|=Bu:e.Bb&=-32769,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Hf(e,1,18,t,n))}function vu(e,n){var t;return e.i||J0e(e),t=u(zc(e.g,n),49),t?new Y0(e.j,u(t.a,15).a,u(t.b,15).a):(yn(),yn(),Mc)}function zEn(e,n,t){var i,r;return i=u(n.mf(e.a),35),r=u(t.mf(e.a),35),i!=null&&r!=null?mO(i,r):i!=null?-1:r!=null?1:0}function Y1e(e,n,t){var i,r;return i=(H0(),r=new Kk,r),vB(i,n),yB(i,t),e&&Et((!e.a&&(e.a=new yr(Tl,e,5)),e.a),i),i}function W1e(e,n,t){var i;return i=0,n&&(iv(e.a)?i+=n.f.a/2:i+=n.f.b/2),t&&(iv(e.a)?i+=t.f.a/2:i+=t.f.b/2),i}function o2(e,n,t){var i;return i=e.a.get(n),e.a.set(n,t===void 0?null:t),i===void 0?(++e.c,++e.b.g):++e.d,i}function yY(e){var n;return(e.Db&64)!=0?Vf(e):(n=new df(Vf(e)),n.a+=" (identifier: ",Bc(n,e.k),n.a+=")",n.a)}function QB(e){var n;switch(e.gc()){case 0:return fR(),nte;case 1:return new qV(Tt(e.Xb(0)));default:return n=e,new ZK(n)}}function FEn(e){switch(u(T(e,(Oe(),gd)),222).g){case 1:return new Cd;case 3:return new V4;default:return new ip}}function HEn(e){var n;return n=hm(e),n>34028234663852886e22?Ki:n<-34028234663852886e22?Ir:n}function yc(e,n){var t;return su(e)&&su(n)&&(t=e+n,kNn){xLe(t);break}}MR(t,n)}function Ye(e,n){var t,i,r,c,o;if(t=n.f,xg(e.c.d,t,n),n.g!=null)for(r=n.g,c=0,o=r.length;cn&&i.Le(e[c-1],e[c])>0;--c)o=e[c],cr(e,c,e[c-1]),cr(e,c-1,o)}function Yl(e,n,t,i){if(n<0)vbe(e,t,i);else{if(!t.pk())throw $(new Jn(kb+t.ve()+HS));u(t,69).uk().Ak(e,e.ei(),n,i)}}function WEn(e,n){var t;if(t=tN(e.Ah(),n),X(t,103))return u(t,19);throw $(new Jn(kb+n+"' is not a valid reference"))}function YB(e,n){if(n==e.d)return e.e;if(n==e.e)return e.d;throw $(new Jn("Node "+n+" not part of edge "+e))}function ede(e,n,t,i){switch(n){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return F1e(e,n,t,i)}function ZEn(e){return e.k!=(Bn(),Wi)?!1:bv(new wn(null,new Gp(new Gn(Vn(Di(e).a.Jc(),new ee)))),new rx)}function el(){el=Y,dD=new dC(xa,0),mM=new dC("FIRST",1),bd=new dC(mYe,2),vM=new dC("LAST",3),qg=new dC(vYe,4)}function Xj(){Xj=Y,aM=new p$("LAYER_SWEEP",0),gve=new p$("MEDIAN_LAYER_SWEEP",1),cD=new p$(uee,2),wve=new p$(xa,3)}function WB(){WB=Y,l6e=new bV("ASPECT_RATIO_DRIVEN",0),Ure=new bV("MAX_SCALE_DRIVEN",1),s6e=new bV("AREA_DRIVEN",2)}function ZB(){ZB=Y,_ce=new C$($2e,0),A8e=new C$("GROUP_DEC",1),T8e=new C$("GROUP_MIXED",2),x8e=new C$("GROUP_INC",3)}function ejn(e,n){return bn(n.b&&n.c?pg(n.b)+"->"+pg(n.c):"e_"+Ni(n),e.b&&e.c?pg(e.b)+"->"+pg(e.c):"e_"+Ni(e))}function njn(e,n){return bn(n.b&&n.c?pg(n.b)+"->"+pg(n.c):"e_"+Ni(n),e.b&&e.c?pg(e.b)+"->"+pg(e.c):"e_"+Ni(e))}function s2(e,n){return Ba(),qf(wb),k.Math.abs(e-n)<=wb||e==n||isNaN(e)&&isNaN(n)?0:en?1:ug(isNaN(e),isNaN(n))}function nde(e){MY(),this.c=Jf(z(B(uzn,1),xn,829,0,[Iun])),this.b=new wt,this.a=e,Zt(this.b,xJ,1),Ao(Lun,new Qje(this))}function Vj(e){var n;this.a=(n=u(e.e&&e.e(),10),new Jl(n,u(zf(n,n.length),10),0)),this.b=oe(Cr,xn,1,this.a.a.length,5,1)}function fu(e){var n;return Array.isArray(e)&&e.Rm===et?ig(Zs(e))+"@"+(n=Ni(e)>>>0,n.toString(16)):e.toString()}function tjn(e){var n;return e==null?!0:(n=e.length,n>0&&(Kn(n-1,e.length),e.charCodeAt(n-1)==58)&&!jY(e,bA,gA))}function jY(e,n,t){var i,r;for(i=0,r=e.length;i=r)return n.c+t;return n.c+n.b.gc()}function HFe(e,n){z9();var t,i,r,c;for(i=I$e(e),r=n,r8(i,0,i.length,r),t=0;t0&&(i+=r,++t);return t>1&&(i+=e.d*(t-1)),i}function ide(e){var n,t,i;for(i=new Ld,i.a+="[",n=0,t=e.gc();n=0;--i)for(n=t[i],r=0;r>5,n=e&31,i=oe(It,ei,30,t+1,15,1),i[t]=1<0&&(n.lengthe.i&&cr(n,e.i,null),n}function ez(e){var n;return(e.Db&64)!=0?Hj(e):(n=new df(Hj(e)),n.a+=" (instanceClassName: ",Bc(n,e.D),n.a+=")",n.a)}function nz(e){var n,t,i,r;for(r=0,t=0,i=e.length;t0?(e.Zj(),i=n==null?0:Ni(n),r=(i&ui)%e.d.length,t=mUe(e,r,i,n),t!=-1):!1}function To(e,n,t){var i,r,c;return e.Nj()?(i=e.i,c=e.Oj(),OO(e,i,n),r=e.Gj(3,null,n,i,c),t?t.lj(r):t=r):OO(e,e.i,n),t}function Ma(e,n){var t,i,r;return e.f>0&&(e.Zj(),i=n==null?0:Ni(n),r=(i&ui)%e.d.length,t=Y0e(e,r,i,n),t)?t.kd():null}function Sjn(e,n,t){var i,r;return i=new ed(e.e,3,10,null,(r=n.c,X(r,88)?u(r,29):(vn(),Of)),Zd(e,n),!1),t?t.lj(i):t=i,t}function Mjn(e,n,t){var i,r;return i=new ed(e.e,4,10,(r=n.c,X(r,88)?u(r,29):(vn(),Of)),null,Zd(e,n),!1),t?t.lj(i):t=i,t}function ZFe(e,n){var t,i,r;return X(n,45)?(t=u(n,45),i=t.jd(),r=um(e.Pc(),i),X1(r,t.kd())&&(r!=null||e.Pc()._b(i))):!1}function hde(e,n){switch(n){case 3:i2(e,0);return;case 4:r2(e,0);return;case 5:Ls(e,0);return;case 6:Ps(e,0);return}$1e(e,n)}function l2(e,n){switch(n.g){case 1:return H5(e.j,(hs(),j3e));case 2:return H5(e.j,(hs(),M3e));default:return yn(),yn(),Mc}}function sb(e){Ch();var n,t;return t=Lt(e),n=Lt(fg(e,32)),n!=0?new sLe(t,n):t>10||t<0?new Y1(1,t):nnn[t]}function eHe(e){fm();var n;return(e.q?e.q:(yn(),yn(),w1))._b((Oe(),z2))?n=u(T(e,z2),203):n=u(T(Pr(e),xM),203),n}function Ajn(e,n,t,i){var r,c;if(c=t-n,c<3)for(;c<3;)e*=10,++c;else{for(r=1;c>3;)r*=10,--c;e=(e+(r>>1))/r|0}return i.i=e,!0}function nHe(e,n,t){uBe(),aMe.call(this),this.a=zp(Snn,[Ae,Wge],[592,216],0,[yH,pte],2),this.c=new L5,this.g=e,this.f=n,this.d=t}function tHe(e){this.e=oe(It,ei,30,e.length,15,1),this.c=oe(rs,Aa,30,e.length,16,1),this.b=oe(rs,Aa,30,e.length,16,1),this.f=0}function xjn(e){var n,t;for(e.j=oe(Gr,Hc,30,e.p.c.length,15,1),t=new L(e.p);t.a>5,n&=31,r=e.d+t+(n==0?0:1),i=oe(It,ei,30,r,15,1),Mxn(i,e.a,t,n),c=new ag(e.e,r,i),Ej(c),c}function T8(e,n,t){var i,r,c;for(r=null,c=e.b;c;){if(i=e.a.Le(n,c.d),t&&i==0)return c;i>=0?c=c.a[1]:(r=c,c=c.a[0])}return r}function $O(e,n,t){var i,r,c;for(r=null,c=e.b;c;){if(i=e.a.Le(n,c.d),t&&i==0)return c;i<=0?c=c.a[0]:(r=c,c=c.a[1])}return r}function CY(e,n){for(var t=0;!n[t]||n[t]=="";)t++;for(var i=n[t++];t0?(k.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):"stack"in new Error}function Djn(e){var n;n=e.a;do n=u(it(new Gn(Vn(Di(n).a.Jc(),new ee))),17).d.i,n.k==(Bn(),br)&&xe(e.e,n);while(n.k==(Bn(),br))}function _jn(e,n){var t,i,r;for(i=new Gn(Vn(Di(e).a.Jc(),new ee));ht(i);)if(t=u(it(i),17),r=t.d.i,r.c==n)return!1;return!0}function sHe(e,n,t){var i,r,c,o;for(r=u(Rn(e.b,t),171),i=0,o=new L(n.j);o.an?1:ug(isNaN(e),isNaN(n)))>0}function wde(e,n){return Ba(),Ba(),qf(wb),(k.Math.abs(e-n)<=wb||e==n||isNaN(e)&&isNaN(n)?0:en?1:ug(isNaN(e),isNaN(n)))<0}function dHe(e,n){return Ba(),Ba(),qf(wb),(k.Math.abs(e-n)<=wb||e==n||isNaN(e)&&isNaN(n)?0:en?1:ug(isNaN(e),isNaN(n)))<=0}function pde(e){switch(e.g){case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:return!0;default:return!1}}function mde(e,n,t,i,r,c){this.a=e,this.c=n,this.b=t,this.f=i,this.d=r,this.e=c,this.c>0&&this.b>0&&(this.g=hR(this.c,this.b,this.a))}function Pjn(e,n){var t=e.a,i;n=String(n),t.hasOwnProperty(n)&&(i=t[n]);var r=(ZQ(),cte)[typeof i],c=r?r(i):z1e(typeof i);return c}function C8(e){var n,t,i;if(i=null,n=$h in e.a,t=!n,t)throw $(new mh("Every element must have an id."));return i=vy(K1(e,$h)),i}function f2(e){var n,t;for(t=zGe(e),n=null;e.c==2;)si(e),n||(n=(fi(),fi(),new tj(2)),Ng(n,t),t=n),t.Hm(zGe(e));return t}function rz(e,n){var t,i,r;return e.Zj(),i=n==null?0:Ni(n),r=(i&ui)%e.d.length,t=Y0e(e,r,i,n),t?(hBe(e,t),t.kd()):null}function Ah(e,n,t){var i,r,c,o;for(c=n+t,Zr(n,c,e.length),o="",r=n;rn.e?1:e.en.d?e.e:e.d=48&&e<48+k.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function $jn(e,n){if(n.c==e)return n.d;if(n.d==e)return n.c;throw $(new Jn("Input edge is not connected to the input port."))}function xh(e,n){if(e.a<0)throw $(new Uc("Did not call before(...) or after(...) before calling add(...)."));return dle(e,e.a,n),e}function vde(e){return HR(),X(e,166)?u(Rn(i_,unn),296).Qg(e):so(i_,Zs(e))?u(Rn(i_,Zs(e)),296).Qg(e):null}function Lo(e){var n,t;return(e.Db&32)==0&&(t=(n=u(qn(e,16),29),dt(n||e.fi())-dt(e.fi())),t!=0&&hy(e,32,oe(Cr,xn,1,t,5,1))),e}function hy(e,n,t){var i;(e.Db&n)!=0?t==null?tOn(e,n):(i=YY(e,n),i==-1?e.Eb=t:cr(cy(e.Eb),i,t)):t!=null&&EDn(e,n,t)}function Rjn(e,n,t,i){var r,c;n.c.length!=0&&(r=wNn(t,i),c=SCn(n),tr(wB(new wn(null,new pn(c,1)),new yI),new R_e(e,t,r,i)))}function Bjn(e,n){var t,i,r,c;return i=e.a.length-1,t=n-e.b&i,c=e.c-n&i,r=e.c-e.b&i,yOe(t=c?(Xkn(e,n),-1):(Ukn(e,n),1)}function zjn(e,n){var t,i;for(t=(Kn(n,e.length),e.charCodeAt(n)),i=n+1;in.e?1:e.fn.f?1:Ni(e)-Ni(n)}function mHe(e,n){var t;return ue(n)===ue(e)?!0:!X(n,22)||(t=u(n,22),t.gc()!=e.gc())?!1:e.Hc(t)}function cz(e,n){return Nn(e),n==null?!1:bn(e,n)?!0:e.length==n.length&&bn(e.toLowerCase(),n.toLowerCase())}function lm(e){var n,t;return ao(e,-129)>0&&ao(e,128)<0?(dDe(),n=Lt(e)+128,t=Cme[n],!t&&(t=Cme[n]=new kn(e)),t):new kn(e)}function dy(){dy=Y,oM=new b$(xa,0),m3e=new b$("INSIDE_PORT_SIDE_GROUPS",1),Nte=new b$("GROUP_MODEL_ORDER",2),Dte=new b$(nee,3)}function uz(e){var n,t,i;if(i=e.Gh(),!i)for(n=0,t=e.Mh();t;t=t.Mh()){if(++n>BZ)return t.Nh();if(i=t.Gh(),i||t==e)break}return i}function Jjn(e){var n;return e.b||kgn(e,(n=kpn(e.e,e.a),!n||!bn(dne,Ma((!n.b&&(n.b=new Qs((vn(),xc),Iu,n)),n.b),"qualified")))),e.c}function Gjn(e){var n,t;for(t=new L(e.a.b);t.a2e3&&(qen=e,dH=k.setTimeout($gn,10))),hH++==0?(m8n((xoe(),vme)),!0):!1}function tSn(e,n,t){var i;(dnn?(gjn(e),!0):bnn||wnn?(I9(),!0):gnn&&(I9(),!1))&&(i=new ANe(n),i.b=t,iTn(e,i))}function DY(e,n){var t;t=!e.A.Gc((tl(),nw))||e.q==(Fr(),to),e.u.Gc((Es(),md))?t?SRn(e,n):kKe(e,n):e.u.Gc(Rb)&&(t?U$n(e,n):PKe(e,n))}function iSn(e,n,t){var i,r;dW(e.e,n,t,(Ne(),Xn)),dW(e.i,n,t,Wn),e.a&&(r=u(T(n,(pe(),pi)),12),i=u(T(t,pi),12),eQ(e.g,r,i))}function jHe(e){var n;ue(ve(e,(Gt(),p4)))===ue((rd(),hG))&&(zi(e)?(n=u(ve(zi(e),p4),347),Ei(e,p4,n)):Ei(e,p4,cA))}function SHe(e,n,t){return new Ff(k.Math.min(e.a,n.a)-t/2,k.Math.min(e.b,n.b)-t/2,k.Math.abs(e.a-n.a)+t,k.Math.abs(e.b-n.b)+t)}function MHe(e){var n;this.d=new Te,this.j=new Yr,this.g=new Yr,n=e.g.b,this.f=u(T(Pr(n),(Oe(),Sl)),86),this.e=te(re(lz(n,Vm)))}function AHe(e){this.d=new Te,this.e=new Z0,this.c=oe(It,ei,30,(Ne(),z(B(Ac,1),qu,64,0,[Eu,Un,Wn,bt,Xn])).length,15,1),this.b=e}function Sde(e,n,t){var i;switch(i=t[e.g][n],e.g){case 1:case 3:return new Ee(0,i);case 2:case 4:return new Ee(i,0);default:return null}}function rSn(e,n){var t;if(t=wv(e.o,n),t==null)throw $(new mh("Node did not exist in input."));return jbe(e,n),RW(e,n),dbe(e,n,t),null}function xHe(e,n){var t,i;for(i=e.a.length,n.lengthi&&cr(n,i,null),n}function Xa(e,n){var t,i;for(i=e.c.length,n.lengthi&&cr(n,i,null),n}function _Y(e,n,t,i){var r;if(r=e.length,n>=r)return r;for(n=n>0?n:0;n0&&(xe(e.b,new GNe(n.a,t)),i=n.a.length,0i&&(n.a+=BCe(oe(sf,Dh,30,-i,15,1))))}function OHe(e,n,t){var i,r,c;if(!t[n.d])for(t[n.d]=!0,r=new L(jv(n));r.a=e.b>>1)for(i=e.c,t=e.b;t>n;--t)i=i.b;else for(i=e.a.a,t=0;t=0?e.Th(r):jW(e,i)):t<0?jW(e,i):u(i,69).uk().zk(e,e.ei(),t)}function IHe(e){var n,t,i;for(i=(!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),e.o),t=i.c.Jc();t.e!=t.i.gc();)n=u(t.Wj(),45),n.kd();return rO(i)}function Ie(e){var n;if(X(e.a,4)){if(n=vde(e.a),n==null)throw $(new Uc(aWe+e.b+"'. "+fWe+(U1(r_),r_.k)+xpe));return n}else return e.a}function gSn(e){var n;if(e==null)return null;if(n=DRn(bo(e,!0)),n==null)throw $(new OX("Invalid base64Binary value: '"+e+"'"));return n}function ft(e){var n;try{return n=e.i.Xb(e.e),e.Vj(),e.g=e.e++,n}catch(t){throw t=lr(t),X(t,99)?(e.Vj(),$(new hu)):$(t)}}function $Y(e){var n;try{return n=e.c.Ti(e.e),e.Vj(),e.g=e.e++,n}catch(t){throw t=lr(t),X(t,99)?(e.Vj(),$(new hu)):$(t)}}function sz(e){var n,t,i,r;for(r=0,t=0,i=e.length;t=64&&n<128&&(r=jh(r,i1(1,n-64)));return r}function lz(e,n){var t,i;return i=null,bi(e,(Gt(),s6))&&(t=u(T(e,s6),105),t.nf(n)&&(i=t.mf(n))),i==null&&Pr(e)&&(i=T(Pr(e),n)),i}function wSn(e,n){var t;return t=u(T(e,(Oe(),Wc)),78),_V(n,Ytn)?t?Ws(t):(t=new Os,ae(e,Wc,t)):t&&ae(e,Wc,null),t}function pSn(e,n){var t,i,r;for(r=new Mo(n.gc()),i=n.Jc();i.Ob();)t=u(i.Pb(),294),t.c==t.f?$8(e,t,t.c):NTn(e,t)||Hn(r.c,t);return r}function LHe(e,n){var t,i,r;for(t=e.o,r=u(u(mi(e.r,n),22),83).Jc();r.Ob();)i=u(r.Pb(),115),i.e.a=vMn(i,t.a),i.e.b=t.b*te(re(i.b.mf(kH)))}function mSn(e,n){var t,i,r,c;return r=e.k,t=te(re(T(e,(pe(),$2)))),c=n.k,i=te(re(T(n,$2))),c!=(Bn(),pr)?-1:r!=pr?1:t==i?0:tt.b)return!0}return!1}function RHe(e){var n;return n=new z0,n.a+="n",e.k!=(Bn(),Wi)&&Xt(Xt((n.a+="(",n),BV(e.k).toLowerCase()),")"),Xt((n.a+="_",n),zO(e)),n.a}function Yj(){Yj=Y,D5e=new bC($2e,0),ere=new bC(uee,1),nre=new bC("LINEAR_SEGMENTS",2),OM=new bC("BRANDES_KOEPF",3),NM=new bC(LYe,4)}function by(e,n,t,i){var r;return t>=0?e.Ph(n,t,i):(e.Mh()&&(i=(r=e.Ch(),r>=0?e.xh(i):e.Mh().Qh(e,-1-r,null,i))),e.zh(n,t,i))}function Mde(e,n){switch(n){case 7:!e.e&&(e.e=new Tn(mr,e,7,4)),yt(e.e);return;case 8:!e.d&&(e.d=new Tn(mr,e,8,5)),yt(e.d);return}hde(e,n)}function Ei(e,n,t){return t==null?(!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),rz(e.o,n)):(!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),JO(e.o,n,t)),e}function Qu(e,n){var t;t=e.dd(n);try{return t.Pb()}catch(i){throw i=lr(i),X(i,112)?$(new Eo("Can't get element "+n)):$(i)}}function BHe(e,n){var t;switch(t=u(zc(e.b,n),127).n,n.g){case 1:e.t>=0&&(t.d=e.t);break;case 3:e.t>=0&&(t.a=e.t)}e.C&&(t.b=e.C.b,t.c=e.C.c)}function MSn(e){var n;n=e.a;do n=u(it(new Gn(Vn(or(n).a.Jc(),new ee))),17).c.i,n.k==(Bn(),br)&&e.b.Ec(n);while(n.k==(Bn(),br));e.b=nl(e.b)}function zHe(e,n){var t,i,r;for(r=e,i=new Gn(Vn(or(n).a.Jc(),new ee));ht(i);)t=u(it(i),17),t.c.i.c&&(r=k.Math.max(r,t.c.i.c.p));return r}function ASn(e,n){var t,i,r;for(r=0,i=u(u(mi(e.r,n),22),83).Jc();i.Ob();)t=u(i.Pb(),115),r+=t.d.d+t.b.Kf().b+t.d.a,i.Ob()&&(r+=e.w);return r}function xSn(e,n){var t,i,r;for(r=0,i=u(u(mi(e.r,n),22),83).Jc();i.Ob();)t=u(i.Pb(),115),r+=t.d.b+t.b.Kf().a+t.d.c,i.Ob()&&(r+=e.w);return r}function FHe(e){var n,t,i,r;if(i=0,r=wm(e),r.c.length==0)return 1;for(t=new L(r);t.a=0?e.Ih(o,t,!0):g2(e,c,t)):u(c,69).uk().wk(e,e.ei(),r,t,i)}function OSn(e,n,t,i){var r,c;c=n.nf((Gt(),v4))?u(n.mf(v4),22):e.j,r=jEn(c),r!=(rF(),mte)&&(t&&!pde(r)||C0e(qOn(e,r,i),n))}function RY(e,n){return Br(e)?!!Ren[n]:e.Qm?!!e.Qm[n]:_p(e)?!!$en[n]:Dp(e)?!!Pen[n]:!1}function NSn(e){switch(e.g){case 1:return u2(),WN;case 3:return u2(),YN;case 2:return u2(),yte;case 4:return u2(),vte;default:return null}}function DSn(e,n,t){if(e.e)switch(e.b){case 1:X4n(e.c,n,t);break;case 0:V4n(e.c,n,t)}else iPe(e.c,n,t);e.a[n.p][t.p]=e.c.i,e.a[t.p][n.p]=e.c.e}function JHe(e){var n,t;if(e==null)return null;for(t=oe(m1,Ae,199,e.length,0,2),n=0;nc?1:0):0}function fm(){fm=Y,OJ=new m$(xa,0),Wie=new m$("PORT_POSITION",1),a4=new m$("NODE_SIZE_WHERE_SPACE_PERMITS",2),f4=new m$("NODE_SIZE",3)}function _Sn(e,n){var t,i,r;for(n.Tg("Untreeify",1),t=u(T(e,(Ci(),vye)),16),r=t.Jc();r.Ob();)i=u(r.Pb(),65),Vt(i.b.d,i),Vt(i.c.b,i);n.Ug()}function s1(){s1=Y,fce=new UE("AUTOMATIC",0),ID=new UE(Cy,1),LD=new UE(Oy,2),uG=new UE("TOP",3),rG=new UE(ewe,4),cG=new UE(i7,5)}function Av(e,n,t){var i,r;if(r=e.gc(),n>=r)throw $(new Bp(n,r));if(e.Qi()&&(i=e.bd(t),i>=0&&i!=n))throw $(new Jn(HN));return e.Vi(n,t)}function Zd(e,n){var t,i,r;if(r=MJe(e,n),r>=0)return r;if(e.ml()){for(i=0;i0||e==(SX(),Yne)||n==(MX(),Wne))throw $(new Jn("Invalid range: "+tPe(e,n)))}function xde(e,n,t,i){H8();var r,c;for(r=0,c=0;c0),(n&-n)==n)return ac(n*Rs(e,31)*4656612873077393e-25);do t=Rs(e,31),i=t%n;while(t-i+(n-1)<0);return ac(i)}function ISn(e,n){var t,i,r;for(t=Jw(new tg,e),r=new L(n);r.a1&&(c=ISn(e,n)),c}function BSn(e){var n,t,i;for(n=0,i=new L(e.c.a);i.a102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function UY(e,n){if(e==null)throw $(new M5("null key in entry: null="+n));if(n==null)throw $(new M5("null value in entry: "+e+"=null"))}function YHe(e,n){var t;return t=z(B(Gr,1),Hc,30,15,[aY(e.a[0],n),aY(e.a[1],n),aY(e.a[2],n)]),e.d&&(t[0]=k.Math.max(t[0],t[2]),t[2]=t[0]),t}function WHe(e,n){var t;return t=z(B(Gr,1),Hc,30,15,[GB(e.a[0],n),GB(e.a[1],n),GB(e.a[2],n)]),e.d&&(t[0]=k.Math.max(t[0],t[2]),t[2]=t[0]),t}function Nde(e,n,t){F5(u(T(n,(Oe(),Zi)),102))||(Uae(e,n,e0(n,t)),Uae(e,n,e0(n,(Ne(),bt))),Uae(e,n,e0(n,Un)),yn(),Nr(n.j,new YEe(e)))}function ZHe(e){var n,t;for(e.c||zPn(e),t=new Os,n=new L(e.a),I(n);n.a0&&(Kn(0,n.length),n.charCodeAt(0)==43)?(Kn(1,n.length+1),n.substr(1)):n))}function tMn(e){var n;return e==null?null:new U0((n=bo(e,!0),n.length>0&&(Kn(0,n.length),n.charCodeAt(0)==43)?(Kn(1,n.length+1),n.substr(1)):n))}function _de(e,n,t,i,r,c,o,l){var f,h;i&&(f=i.a[0],f&&_de(e,n,t,f,r,c,o,l),nW(e,t,i.d,r,c,o,l)&&n.Ec(i),h=i.a[1],h&&_de(e,n,t,h,r,c,o,l))}function Wj(e,n){var t,i,r,c;for(c=e.gc(),n.lengthc&&cr(n,c,null),n}function iMn(e,n){var t,i;if(i=e.gc(),n==null){for(t=0;t0&&(f+=r),h[b]=o,o+=l*(f+i)}function fMn(e){var n;for(n=0;n0?e.c:0),++r;e.b=i,e.d=c}function aJe(e,n){var t;return t=z(B(Gr,1),Hc,30,15,[Tde(e,(Sa(),Nu),n),Tde(e,No,n),Tde(e,Du,n)]),e.f&&(t[0]=k.Math.max(t[0],t[2]),t[2]=t[0]),t}function hJe(e){var n;bi(e,(Oe(),B2))&&(n=u(T(e,B2),22),n.Gc((gm(),ia))?(n.Kc(ia),n.Ec(ra)):n.Gc(ra)&&(n.Kc(ra),n.Ec(ia)))}function dJe(e){var n;bi(e,(Oe(),B2))&&(n=u(T(e,B2),22),n.Gc((gm(),ua))?(n.Kc(ua),n.Ec(Mf)):n.Gc(Mf)&&(n.Kc(Mf),n.Ec(ua)))}function WY(e,n,t,i){var r,c,o,l;return e.a==null&&oTn(e,n),o=n.b.j.c.length,c=t.d.p,l=i.d.p,r=l-1,r<0&&(r=o-1),c<=r?e.a[r]-e.a[c]:e.a[o-1]-e.a[c]+e.a[r]}function aMn(e){var n;for(n=0;n0&&(r.b+=n),r}function mz(e,n){var t,i,r;for(r=new Yr,i=e.Jc();i.Ob();)t=u(i.Pb(),37),J8(t,0,r.b),r.b+=t.f.b+n,r.a=k.Math.max(r.a,t.f.a);return r.a>0&&(r.a+=n),r}function gJe(e,n){var t,i;if(n.length==0)return 0;for(t=CK(e.a,n[0],(Ne(),Xn)),t+=CK(e.a,n[n.length-1],Wn),i=0;i>16==6?e.Cb.Qh(e,5,Ia,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||e.fi()),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function pMn(e){Z9();var n=e.e;if(n&&n.stack){var t=n.stack,i=n+` -`;return t.substring(0,i.length)==i&&(t=t.substring(i.length)),t.split(` -`)}return[]}function mMn(e){var n;return n=(SBe(),Qen),n[e>>>28]|n[e>>24&15]<<4|n[e>>20&15]<<8|n[e>>16&15]<<12|n[e>>12&15]<<16|n[e>>8&15]<<20|n[e>>4&15]<<24|n[e&15]<<28}function pJe(e){var n,t,i;e.b==e.c&&(i=e.a.length,t=d1e(k.Math.max(8,i))<<1,e.b!=0?(n=zf(e.a,t),CBe(e,n,i),e.a=n,e.b=0):Ep(e.a,t),e.c=i)}function vMn(e,n){var t;return t=e.b,t.nf((Gt(),Fs))?t.$f()==(Ne(),Xn)?-t.Kf().a-te(re(t.mf(Fs))):n+te(re(t.mf(Fs))):t.$f()==(Ne(),Xn)?-t.Kf().a:n}function zO(e){var n;return e.b.c.length!=0&&u(Le(e.b,0),70).a?u(Le(e.b,0),70).a:(n=_K(e),n??""+(e.c?pu(e.c.a,e,0):-1))}function vz(e){var n;return e.f.c.length!=0&&u(Le(e.f,0),70).a?u(Le(e.f,0),70).a:(n=_K(e),n??""+(e.i?pu(e.i.j,e,0):-1))}function yMn(e,n){var t,i;if(n<0||n>=e.gc())return null;for(t=n;t0?e.c:0),r=k.Math.max(r,n.d),++i;e.e=c,e.b=r}function kMn(e){var n,t;if(!e.b)for(e.b=qR(u(e.f,125).jh().i),t=new ot(u(e.f,125).jh());t.e!=t.i.gc();)n=u(ft(t),157),xe(e.b,new TX(n));return e.b}function EMn(e,n){var t,i,r;if(n.dc())return z9(),z9(),c_;for(t=new GOe(e,n.gc()),r=new ot(e);r.e!=r.i.gc();)i=ft(r),n.Gc(i)&&Et(t,i);return t}function Pde(e,n,t,i){return n==0?i?(!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),e.o):(!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),rO(e.o)):az(e,n,t,i)}function eW(e){var n,t;if(e.rb)for(n=0,t=e.rb.i;n>22),r+=i>>22,r<0)?!1:(e.l=t&zs,e.m=i&zs,e.h=r&ld,!0)}function nW(e,n,t,i,r,c,o){var l,f;return!(n.Re()&&(f=e.a.Le(t,i),f<0||!r&&f==0)||n.Se()&&(l=e.a.Le(t,c),l>0||!o&&l==0))}function AMn(e,n){p8();var t;if(t=e.j.g-n.j.g,t!=0)return 0;switch(e.j.g){case 2:return EY(n,ave)-EY(e,ave);case 4:return EY(e,fve)-EY(n,fve)}return 0}function xMn(e){switch(e.g){case 0:return cie;case 1:return uie;case 2:return oie;case 3:return sie;case 4:return ZH;case 5:return lie;default:return null}}function Yc(e,n,t){var i,r;return i=(r=new EX,Ag(r,n),xo(r,t),Et((!e.c&&(e.c=new we(G2,e,12,10)),e.c),r),r),Xd(i,0),nm(i,1),Wd(i,!0),Yd(i,!0),i}function gy(e,n){var t,i;if(n>=e.i)throw $(new SV(n,e.i));return++e.j,t=e.g[n],i=e.i-n-1,i>0&&Wu(e.g,n+1,e.g,n,i),cr(e.g,--e.i,null),e.Oi(n,t),e.Li(),t}function mJe(e,n){var t,i;return e.Db>>16==17?e.Cb.Qh(e,21,xf,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||e.fi()),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function TMn(e){var n,t,i,r;for(yn(),Nr(e.c,e.a),r=new L(e.c);r.at.a.c.length))throw $(new Jn("index must be >= 0 and <= layer node count"));e.c&&Xo(e.c.a,e),e.c=t,t&&og(t.a,n,e)}function AJe(e,n){this.c=new wt,this.a=e,this.b=n,this.d=u(T(e,(pe(),c4)),316),ue(T(e,(Oe(),u5e)))===ue((lO(),eJ))?this.e=new gMe:this.e=new bMe}function IMn(e,n){var t,i,r,c;for(c=0,i=new L(e);i.a0?n:0),++t;return new Ee(i,r)}function LMn(e,n){var t,i;for(e.b=0,e.d=new HP,i=new L(n.a);i.a>16==6?e.Cb.Qh(e,6,mr,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(Gu(),vG)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function Hde(e,n){var t,i;return e.Db>>16==7?e.Cb.Qh(e,1,e_,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(Gu(),I8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function Jde(e,n){var t,i;return e.Db>>16==9?e.Cb.Qh(e,9,Bt,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(Gu(),P8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function CJe(e,n){var t,i;return e.Db>>16==5?e.Cb.Qh(e,9,TG,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(vn(),p0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function OJe(e,n){var t,i;return e.Db>>16==7?e.Cb.Qh(e,6,Ia,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(vn(),v0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function Gde(e,n){var t,i;return e.Db>>16==3?e.Cb.Qh(e,0,t_,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(vn(),w0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function qde(e,n){var t,i;return e.Db>>16==3?e.Cb.Qh(e,12,Bt,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(Gu(),_8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function BMn(e,n,t){var i,r,c;for(t<0&&(t=0),c=e.i,r=t;rBZ)return D8(e,i);if(i==e)return!0}}return!1}function FMn(e){switch(U$(),e.q.g){case 5:pqe(e,(Ne(),Un)),pqe(e,bt);break;case 4:jUe(e,(Ne(),Un)),jUe(e,bt);break;default:MKe(e,(Ne(),Un)),MKe(e,bt)}}function HMn(e){switch(U$(),e.q.g){case 5:Pqe(e,(Ne(),Wn)),Pqe(e,Xn);break;case 4:LHe(e,(Ne(),Wn)),LHe(e,Xn);break;default:AKe(e,(Ne(),Wn)),AKe(e,Xn)}}function JMn(e){var n,t;n=u(T(e,(Qf(),mtn)),15),n?(t=n.a,t==0?ae(e,(nb(),MH),new kY):ae(e,(nb(),MH),new WR(t))):ae(e,(nb(),MH),new WR(1))}function GMn(e,n){var t;switch(t=e.i,n.g){case 1:return-(e.n.b+e.o.b);case 2:return e.n.a-t.o.a;case 3:return e.n.b-t.o.b;case 4:return-(e.n.a+e.o.a)}return 0}function qMn(e,n){switch(e.g){case 0:return n==(el(),bd)?qH:UH;case 1:return n==(el(),bd)?qH:iD;case 2:return n==(el(),bd)?iD:UH;default:return iD}}function HO(e,n){var t,i,r;for(Xo(e.a,n),e.e-=n.r+(e.a.c.length==0?0:e.c),r=Uee,i=new L(e.a);i.a>16==11?e.Cb.Qh(e,10,Bt,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(Gu(),L8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function NJe(e,n){var t,i;return e.Db>>16==10?e.Cb.Qh(e,11,xf,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(vn(),m0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function DJe(e,n){var t,i;return e.Db>>16==10?e.Cb.Qh(e,12,Tf,n):(i=Oc(u(jn((t=u(qn(e,16),29),t||(vn(),h3)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function _Je(e,n){var t,i,r,c,o;if(n)for(r=n.a.length,t=new lg(r),o=(t.b-t.a)*t.c<0?(G0(),Jb):new X0(t);o.Ob();)c=u(o.Pb(),15),i=n8(n,c.a),i&&pUe(e,i)}function WMn(){ese();var e,n;for(vBn((V0(),$n)),lBn($n),eW($n),Q8e=(vn(),hh),n=new L(c7e);n.a>19,h=n.h>>19,f!=h?h-f:(r=e.h,l=n.h,r!=l?r-l:(i=e.m,o=n.m,i!=o?i-o:(t=e.l,c=n.l,t-c)))}function IJe(e,n,t){var i,r,c,o,l;for(r=e[t.g],l=new L(n.d);l.a0?e.b:0),++t;n.b=i,n.e=r}function LJe(e){var n,t,i;if(i=e.b,axe(e.i,i.length)){for(t=i.length*2,e.b=oe(Zne,mN,308,t,0,1),e.c=oe(Zne,mN,308,t,0,1),e.f=t-1,e.i=0,n=e.a;n;n=n.c)QO(e,n,n);++e.g}}function nS(e,n){return e.b.a=k.Math.min(e.b.a,n.c),e.b.b=k.Math.min(e.b.b,n.d),e.a.a=k.Math.max(e.a.a,n.c),e.a.b=k.Math.max(e.a.b,n.d),Hn(e.c,n),!0}function eAn(e,n,t){var i;i=n.c.i,i.k==(Bn(),br)?(ae(e,(pe(),Na),u(T(i,Na),12)),ae(e,jf,u(T(i,jf),12))):(ae(e,(pe(),Na),n.c),ae(e,jf,t.d))}function _8(e,n,t){F8();var i,r,c,o,l,f;return o=n/2,c=t/2,i=k.Math.abs(e.a),r=k.Math.abs(e.b),l=1,f=1,i>o&&(l=o/i),r>c&&(f=c/r),q1(e,k.Math.min(l,f)),e}function nAn(){Kz();var e,n;try{if(n=u(i0e((J0(),Cf),k7),2075),n)return n}catch(t){if(t=lr(t),X(t,101))e=t,zfe((Dt(),e));else throw $(t)}return new dU}function tAn(){Kz();var e,n;try{if(n=u(i0e((J0(),Cf),yf),2002),n)return n}catch(t){if(t=lr(t),X(t,101))e=t,zfe((Dt(),e));else throw $(t)}return new Nw}function iAn(){R$e();var e,n;try{if(n=u(i0e((J0(),Cf),zg),2084),n)return n}catch(t){if(t=lr(t),X(t,101))e=t,zfe((Dt(),e));else throw $(t)}return new hT}function rAn(e,n,t){var i,r;return r=e.e,e.e=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Lr(e,1,4,r,n),t?t.lj(i):t=i),r!=n&&(n?t=V8(e,Lz(e,n),t):t=V8(e,e.a,t)),t}function PJe(){o$.call(this),this.e=-1,this.a=!1,this.p=Kr,this.k=-1,this.c=-1,this.b=-1,this.g=!1,this.f=-1,this.j=-1,this.n=-1,this.i=-1,this.d=-1,this.o=Kr}function cAn(e,n){var t,i,r;if(i=e.b.d.d,e.a||(i+=e.b.d.a),r=n.b.d.d,n.a||(r+=n.b.d.a),t=ki(i,r),t==0){if(!e.a&&n.a)return-1;if(!n.a&&e.a)return 1}return t}function uAn(e,n){var t,i,r;if(i=e.b.b.d,e.a||(i+=e.b.b.a),r=n.b.b.d,n.a||(r+=n.b.b.a),t=ki(i,r),t==0){if(!e.a&&n.a)return-1;if(!n.a&&e.a)return 1}return t}function oAn(e,n){var t,i,r;if(i=e.b.g.d,e.a||(i+=e.b.g.a),r=n.b.g.d,n.a||(r+=n.b.g.a),t=ki(i,r),t==0){if(!e.a&&n.a)return-1;if(!n.a&&e.a)return 1}return t}function Vde(){Vde=Y,Ptn=jo(Ht(Ht(Ht(new sr,(Hr(),no),(Vr(),Q3e)),no,Y3e),Pc,W3e),Pc,B3e),Rtn=Ht(Ht(new sr,no,D3e),no,z3e),$tn=jo(new sr,Pc,H3e)}function sAn(e){var n,t,i,r,c;for(n=u(T(e,(pe(),gM)),92),c=e.n,i=n.Bc().Jc();i.Ob();)t=u(i.Pb(),318),r=t.i,r.c+=c.a,r.d+=c.b,t.c?sXe(t):lXe(t);ae(e,gM,null)}function lAn(e,n,t){var i,r;switch(r=e.b,i=r.d,n.g){case 1:return-i.d-t;case 2:return r.o.a+i.c+t;case 3:return r.o.b+i.a+t;case 4:return-i.b-t;default:return-1}}function $Je(e,n){var t,i;for(i=new L(n);i.a0&&(o=(c&ui)%e.d.length,r=Y0e(e,o,c,n),r)?(l=r.ld(t),l):(i=e.ak(c,n,t),e.c.Ec(i),null)}function Yde(e,n){var t,i,r,c;switch(Qd(e,n).Il()){case 3:case 2:{for(t=Iv(n),r=0,c=t.i;r=0;i--)if(bn(e[i].d,n)||bn(e[i].d,t)){e.length>=i+1&&e.splice(0,i+1);break}return e}function GO(e,n){var t;return su(e)&&su(n)&&(t=e/n,kN0&&(e.b+=2,e.a+=i):(e.b+=1,e.a+=k.Math.min(i,r))}function GJe(e,n){var t,i;if(i=!1,Br(n)&&(i=!0,V5(e,new qp(_t(n)))),i||X(n,242)&&(i=!0,V5(e,(t=XV(u(n,242)),new q3(t)))),!i)throw $(new CX(qpe))}function AAn(e,n,t,i){var r,c,o;return r=new ed(e.e,1,10,(o=n.c,X(o,88)?u(o,29):(vn(),Of)),(c=t.c,X(c,88)?u(c,29):(vn(),Of)),Zd(e,n),!1),i?i.lj(r):i=r,i}function e0e(e){var n,t;switch(u(T(Pr(e),(Oe(),W4e)),420).g){case 0:return n=e.n,t=e.o,new Ee(n.a+t.a/2,n.b+t.b/2);case 1:return new mc(e.n);default:return null}}function qO(){qO=Y,nJ=new JE(xa,0),Tve=new JE("LEFTUP",1),Ove=new JE("RIGHTUP",2),xve=new JE("LEFTDOWN",3),Cve=new JE("RIGHTDOWN",4),fie=new JE("BALANCED",5)}function xAn(e,n,t){var i,r,c;if(i=ki(e.a[n.p],e.a[t.p]),i==0){if(r=u(T(n,(pe(),Vy)),16),c=u(T(t,Vy),16),r.Gc(t))return-1;if(c.Gc(n))return 1}return i}function TAn(e){switch(e.g){case 1:return new zI;case 2:return new Fk;case 3:return new r5;case 0:return null;default:throw $(new Jn(Zee+(e.f!=null?e.f:""+e.g)))}}function n0e(e,n,t){switch(n){case 1:!e.n&&(e.n=new we(ju,e,1,7)),yt(e.n),!e.n&&(e.n=new we(ju,e,1,7)),ir(e.n,u(t,18));return;case 2:l8(e,_t(t));return}E1e(e,n,t)}function t0e(e,n,t){switch(n){case 3:i2(e,te(re(t)));return;case 4:r2(e,te(re(t)));return;case 5:Ls(e,te(re(t)));return;case 6:Ps(e,te(re(t)));return}n0e(e,n,t)}function yz(e,n,t){var i,r,c;c=(i=new EX,i),r=Ka(c,n,null),r&&r.mj(),xo(c,t),Et((!e.c&&(e.c=new we(G2,e,12,10)),e.c),c),Xd(c,0),nm(c,1),Wd(c,!0),Yd(c,!0)}function i0e(e,n){var t,i,r;return t=zE(e.i,n),X(t,241)?(r=u(t,241),r.wi()==null,r.ti()):X(t,493)?(i=u(t,1999),r=i.b,r):null}function CAn(e,n,t,i){var r,c;return Tt(n),Tt(t),c=u(sj(e.d,n),15),vRe(!!c,"Row %s not in %s",n,e.e),r=u(sj(e.b,t),15),vRe(!!r,"Column %s not in %s",t,e.c),mze(e,c.a,r.a,i)}function OAn(e){var n,t,i,r,c,o;for(t=null,r=e,c=0,o=r.length;c1||l==-1?(c=u(f,16),r.Wb(djn(e,c))):r.Wb(HW(e,u(f,57)))))}function $An(e,n,t,i){wxe();var r=Kne;function c(){for(var o=0;o0)return!1;return!0}function zAn(e){switch(u(T(e.b,(Oe(),q4e)),381).g){case 1:tr(So(lu(new wn(null,new pn(e.d,16)),new Sw),new oI),new ux);break;case 2:p_n(e);break;case 0:fCn(e)}}function FAn(e,n,t){var i,r,c;for(i=t,!i&&(i=new j5),i.Tg("Layout",e.a.c.length),c=new L(e.a);c.aKee)return t;r>-1e-6&&++t}return t}function Ez(e,n,t){if(X(n,271))return bNn(e,u(n,85),t);if(X(n,276))return UMn(e,u(n,276),t);throw $(new Jn(E7+Qa(new Mu(z(B(Cr,1),xn,1,5,[n,t])))))}function jz(e,n,t){if(X(n,271))return gNn(e,u(n,85),t);if(X(n,276))return XMn(e,u(n,276),t);throw $(new Jn(E7+Qa(new Mu(z(B(Cr,1),xn,1,5,[n,t])))))}function c0e(e,n){var t;n!=e.b?(t=null,e.b&&(t=RR(e.b,e,-4,t)),n&&(t=by(n,e,-4,t)),t=dFe(e,n,t),t&&t.mj()):(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,3,n,n))}function VJe(e,n){var t;n!=e.f?(t=null,e.f&&(t=RR(e.f,e,-1,t)),n&&(t=by(n,e,-1,t)),t=bFe(e,n,t),t&&t.mj()):(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,0,n,n))}function UAn(e,n,t,i){var r,c,o,l;return Vs(e.e)&&(r=n.Jk(),l=n.kd(),c=t.kd(),o=Q0(e,1,r,l,c,r.Hk()?q8(e,r,c,X(r,103)&&(u(r,19).Bb&Sc)!=0):-1,!0),i?i.lj(o):i=o),i}function KJe(e){var n,t,i;if(e==null)return null;if(t=u(e,16),t.dc())return"";for(i=new Ld,n=t.Jc();n.Ob();)Bc(i,(ji(),_t(n.Pb()))),i.a+=" ";return jV(i,i.a.length-1)}function QJe(e){var n,t,i;if(e==null)return null;if(t=u(e,16),t.dc())return"";for(i=new Ld,n=t.Jc();n.Ob();)Bc(i,(ji(),_t(n.Pb()))),i.a+=" ";return jV(i,i.a.length-1)}function XAn(e,n){var t,i,r,c,o;for(c=new L(n.a);c.a0&&uc(e,e.length-1)==33)try{return n=aUe(gf(e,0,e.length-1)),n.e==null}catch(t){if(t=lr(t),!X(t,32))throw $(t)}return!1}function YAn(e,n,t){var i,r,c;switch(i=Pr(n),r=KB(i),c=new Yu,wu(c,n),t.g){case 1:Tr(c,IO(ay(r)));break;case 2:Tr(c,ay(r))}return ae(c,(Oe(),Gm),re(T(e,Gm))),c}function u0e(e){var n,t;return n=u(it(new Gn(Vn(or(e.a).a.Jc(),new ee))),17),t=u(it(new Gn(Vn(Di(e.a).a.Jc(),new ee))),17),Re($e(T(n,(pe(),o0))))||Re($e(T(t,o0)))}function am(){am=Y,rD=new hC("ONE_SIDE",0),KH=new hC("TWO_SIDES_CORNER",1),QH=new hC("TWO_SIDES_OPPOSING",2),VH=new hC("THREE_SIDES",3),XH=new hC("FOUR_SIDES",4)}function ZJe(e,n){var t,i,r,c;for(c=new Te,r=0,i=n.Jc();i.Ob();){for(t=me(u(i.Pb(),15).a+r);t.a=e.f)break;Hn(c.c,t)}return c}function WAn(e){var n,t;for(t=new L(e.e.b);t.a0&&yJe(this,this.c-1,(Ne(),Wn)),this.c0&&e[0].length>0&&(this.c=Re($e(T(Pr(e[0][0]),(pe(),Uve))))),this.a=oe(lon,Ae,2079,e.length,0,2),this.b=oe(fon,Ae,2080,e.length,0,2),this.d=new oFe}function txn(e){return e.c.length==0?!1:(mn(0,e.c.length),u(e.c[0],17)).c.i.k==(Bn(),br)?!0:bv(So(new wn(null,new pn(e,16)),new Ck),new hI)}function tGe(e,n){var t,i,r,c,o,l,f;for(l=wm(n),c=n.f,f=n.g,o=k.Math.sqrt(c*c+f*f),r=0,i=new L(l);i.a=0?(t=GO(e,oF),i=xY(e,oF)):(n=fg(e,1),t=GO(n,5e8),i=xY(n,5e8),i=yc(i1(i,1),zr(e,1))),jh(i1(i,32),zr(t,_c))}function bxn(e,n,t,i){var r,c,o,l,f;for(r=null,c=0,l=new L(n);l.a1;n>>=1)(n&1)!=0&&(i=dv(i,t)),t.d==1?t=dv(t,t):t=new kHe(KXe(t.a,t.d,oe(It,ei,30,t.d<<1,15,1)));return i=dv(i,t),i}function g0e(){g0e=Y;var e,n,t,i;for(Gme=oe(Gr,Hc,30,25,15,1),qme=oe(Gr,Hc,30,33,15,1),i=152587890625e-16,n=32;n>=0;n--)qme[n]=i,i*=.5;for(t=1,e=24;e>=0;e--)Gme[e]=t,t*=.5}function vxn(e){var n,t;if(Re($e(ve(e,(Oe(),Hm))))){for(t=new Gn(Vn(hb(e).a.Jc(),new ee));ht(t);)if(n=u(it(t),85),b2(n)&&Re($e(ve(n,Ug))))return!0}return!1}function cGe(e){var n,t,i,r;for(n=new Mi,t=new Mi,r=jt(e,0);r.b!=r.d.c;)i=u(kt(r),12),i.e.c.length==0?Vi(t,i,t.c.b,t.c):Vi(n,i,n.c.b,n.c);return nl(n).Fc(t),n}function uGe(e,n){var t,i,r;dr(e.f,n)&&(n.b=e,i=n.c,pu(e.j,i,0)!=-1||xe(e.j,i),r=n.d,pu(e.j,r,0)!=-1||xe(e.j,r),t=n.a.b,t.c.length!=0&&(!e.i&&(e.i=new MHe(e)),V7n(e.i,t)))}function yxn(e){var n,t,i,r,c;return t=e.c.d,i=t.j,r=e.d.d,c=r.j,i==c?t.p=0&&bn(e.substr(n,3),"GMT")||n>=0&&bn(e.substr(n,3),"UTC"))&&(t[0]=n+3),Wbe(e,t,i)}function Exn(e,n){var t,i,r,c,o;for(c=e.g.a,o=e.g.b,i=new L(e.d);i.at;c--)e[c]|=n[c-t-1]>>>o,e[c-1]=n[c-t-1]<0&&Wu(e.g,n,e.g,n+i,l),o=t.Jc(),e.i+=i,r=0;r>4&15,c=e[i]&15,o[r++]=$8e[t],o[r++]=$8e[c];return Ah(o,0,o.length)}function Ko(e){var n,t;return e>=Sc?(n=EN+(e-Sc>>10&1023)&Er,t=56320+(e-Sc&1023)&Er,String.fromCharCode(n)+(""+String.fromCharCode(t))):String.fromCharCode(e&Er)}function Dxn(e,n){$p();var t,i,r,c;return r=u(u(mi(e.r,n),22),83),r.gc()>=2?(i=u(r.Jc().Pb(),115),t=e.u.Gc((Es(),lA)),c=e.u.Gc(a6),!i.a&&!t&&(r.gc()==2||c)):!1}function fGe(e,n,t,i,r){var c,o,l;for(c=eXe(e,n,t,i,r),l=!1;!c;)_z(e,r,!0),l=!0,c=eXe(e,n,t,i,r);l&&_z(e,r,!1),o=WQ(r),o.c.length!=0&&(e.d&&e.d.Fg(o),fGe(e,r,t,i,o))}function Az(){Az=Y,Jre=new S$("NODE_SIZE_REORDERER",0),zre=new S$("INTERACTIVE_NODE_REORDERER",1),Hre=new S$("MIN_SIZE_PRE_PROCESSOR",2),Fre=new S$("MIN_SIZE_POST_PROCESSOR",3)}function xz(){xz=Y,Cce=new VE(xa,0),r8e=new VE("DIRECTED",1),u8e=new VE("UNDIRECTED",2),t8e=new VE("ASSOCIATION",3),c8e=new VE("GENERALIZATION",4),i8e=new VE("DEPENDENCY",5)}function _xn(e,n){var t;if(!Ha(e))throw $(new Uc(LWe));switch(t=Ha(e),n.g){case 1:return-(e.j+e.f);case 2:return e.i-t.g;case 3:return e.j-t.f;case 4:return-(e.i+e.g)}return 0}function Ixn(e,n,t){var i,r,c;return i=n.Jk(),c=n.kd(),r=i.Hk()?Q0(e,4,i,c,null,q8(e,i,c,X(i,103)&&(u(i,19).Bb&Sc)!=0),!0):Q0(e,i.rk()?2:1,i,c,i.gk(),-1,!0),t?t.lj(r):t=r,t}function L8(e,n){var t,i;for(Nn(n),i=e.b.c.length,xe(e.b,n);i>0;){if(t=i,i=(i-1)/2|0,e.a.Le(Le(e.b,i),n)<=0)return bl(e.b,t,n),!0;bl(e.b,t,Le(e.b,i))}return bl(e.b,i,n),!0}function m0e(e,n,t,i){var r,c;if(r=0,t)r=GB(e.a[t.g][n.g],i);else for(c=0;c=l)}function aGe(e){switch(e.g){case 0:return new YI;case 1:return new Bx;default:throw $(new Jn("No implementation is available for the width approximator "+(e.f!=null?e.f:""+e.g)))}}function v0e(e,n,t,i){var r;if(r=!1,Br(i)&&(r=!0,G9(n,t,_t(i))),r||Dp(i)&&(r=!0,v0e(e,n,t,i)),r||X(i,242)&&(r=!0,bg(n,t,u(i,242))),!r)throw $(new CX(qpe))}function Pxn(e,n){var t,i,r;if(t=n.ni(e.a),t&&(r=Ma((!t.b&&(t.b=new Qs((vn(),xc),Iu,t)),t.b),vf),r!=null)){for(i=1;i<(ds(),o7e).length;++i)if(bn(o7e[i],r))return i}return 0}function $xn(e,n){var t,i,r;if(t=n.ni(e.a),t&&(r=Ma((!t.b&&(t.b=new Qs((vn(),xc),Iu,t)),t.b),vf),r!=null)){for(i=1;i<(ds(),s7e).length;++i)if(bn(s7e[i],r))return i}return 0}function hGe(e,n){var t,i,r,c;if(Nn(n),c=e.a.gc(),c0?1:0;c.a[r]!=t;)c=c.a[r],r=e.a.Le(t.d,c.d)>0?1:0;c.a[r]=i,i.b=t.b,i.a[0]=t.a[0],i.a[1]=t.a[1],t.a[0]=null,t.a[1]=null}function zxn(e){var n,t,i,r;for(n=new Te,t=oe(rs,Aa,30,e.a.c.length,16,1),Pfe(t,t.length),r=new L(e.a);r.a0&&GXe((mn(0,t.c.length),u(t.c[0],25)),e),t.c.length>1&&GXe(u(Le(t,t.c.length-1),25),e),n.Ug()}function Hxn(e){Es();var n,t;return n=Ti(md,z(B(dG,1),ye,280,0,[Rb])),!(yO(BR(n,e))>1||(t=Ti(lA,z(B(dG,1),ye,280,0,[sA,a6])),yO(BR(t,e))>1))}function k0e(e,n){var t;t=lo((J0(),Cf),e),X(t,493)?Vc(Cf,e,new qTe(this,n)):Vc(Cf,e,this),gW(this,n),n==(C9(),K8e)?(this.wb=u(this,2e3),u(n,2002)):this.wb=(V0(),$n)}function Jxn(e){var n,t,i;if(e==null)return null;for(n=null,t=0;tc}function wGe(e,n){var t,i,r;if(j0e(e,n))return!0;for(i=new L(n);i.a=r||n<0)throw $(new Eo(Cne+n+Rg+r));if(t>=r||t<0)throw $(new Eo(One+t+Rg+r));return n!=t?i=(c=e.Aj(t),e.oj(n,c),c):i=e.vj(t),i}function mGe(e){var n,t,i;if(i=e,e)for(n=0,t=e.Bh();t;t=t.Bh()){if(++n>BZ)return mGe(t);if(i=t,t==e)throw $(new Uc("There is a cycle in the containment hierarchy of "+e))}return i}function Qa(e){var n,t,i;for(i=new Eg(Co,"[","]"),t=e.Jc();t.Ob();)n=t.Pb(),W1(i,ue(n)===ue(e)?"(this Collection)":n==null?Yo:fu(n));return i.a?i.e.length==0?i.a.a:i.a.a+(""+i.e):i.c}function j0e(e,n){var t,i;if(i=!1,n.gc()<2)return!1;for(t=0;t1&&(e.j.b+=e.e)):(e.j.a+=t.a,e.j.b=k.Math.max(e.j.b,t.b),e.d.c.length>1&&(e.j.a+=e.e))}function fb(){fb=Y,Sin=z(B(Ac,1),qu,64,0,[(Ne(),Un),Wn,bt]),jin=z(B(Ac,1),qu,64,0,[Wn,bt,Xn]),Min=z(B(Ac,1),qu,64,0,[bt,Xn,Un]),Ain=z(B(Ac,1),qu,64,0,[Xn,Un,Wn])}function yGe(e){var n,t,i,r,c,o,l,f,h;for(this.a=JHe(e),this.b=new Te,t=e,i=0,r=t.length;iHV(e.d).c?(e.i+=e.g.c,OY(e.d)):HV(e.d).c>HV(e.g).c?(e.e+=e.d.c,OY(e.g)):(e.i+=vDe(e.g),e.e+=vDe(e.d),OY(e.g),OY(e.d))}function Wxn(e,n,t){var i,r,c,o;for(c=n.q,o=n.r,new gg((ka(),Nb),n,c,1),new gg(Nb,c,o,1),r=new L(t);r.al&&(f=l/i),r>c&&(h=c/r),o=k.Math.min(f,h),e.a+=o*(n.a-e.a),e.b+=o*(n.b-e.b)}function tTn(e,n,t,i,r){var c,o;for(o=!1,c=u(Le(t.b,0),26);cLn(e,n,c,i,r)&&(o=!0,HAn(t,c),t.b.c.length!=0);)c=u(Le(t.b,0),26);return t.b.c.length==0&&HO(t.j,t),o&&pz(n.q),o}function M0e(e,n,t,i){var r,c;return t==0?(!e.o&&(e.o=new as((Gu(),S1),g0,e,0)),Y$(e.o,n,i)):(c=u(jn((r=u(qn(e,16),29),r||e.fi()),t),69),c.uk().yk(e,Lo(e),t-dt(e.fi()),n,i))}function gW(e,n){var t;n!=e.sb?(t=null,e.sb&&(t=u(e.sb,52).Qh(e,1,hA,t)),n&&(t=u(n,52).Oh(e,1,hA,t)),t=R1e(e,n,t),t&&t.mj()):(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,4,n,n))}function SGe(e,n){var t,i,r,c;if(n)r=td(n,"x"),t=new oSe(e),pv(t.a,(Nn(r),r)),c=td(n,"y"),i=new sSe(e),mv(i.a,(Nn(c),c));else throw $(new mh("All edge sections need an end point."))}function MGe(e,n){var t,i,r,c;if(n)r=td(n,"x"),t=new rSe(e),vv(t.a,(Nn(r),r)),c=td(n,"y"),i=new cSe(e),yv(i.a,(Nn(c),c));else throw $(new mh("All edge sections need a start point."))}function iTn(e,n){var t,i,r,c,o,l,f;for(i=qze(e),c=0,l=i.length;c>22-n,r=e.h<>22-n):n<44?(t=0,i=e.l<>44-n):(t=0,i=0,r=e.l<=t0?"error":i>=900?"warn":i>=800?"info":"log"),h_e(t,e.a),e.b&&Abe(n,t,e.b,"Exception: ",!0))}function CGe(e,n){var t,i,r,c,o;for(r=n==1?Cte:Tte,i=r.a.ec().Jc();i.Ob();)for(t=u(i.Pb(),86),o=u(mi(e.f.c,t),22).Jc();o.Ob();)c=u(o.Pb(),49),xe(e.b.b,u(c.b,82)),xe(e.b.a,u(c.b,82).d)}function OGe(e,n,t,i){var r,c,o,l,f;switch(f=e.b,c=n.d,o=c.j,l=Sde(o,f.d[o.g],t),r=gi(vc(c.n),c.a),c.j.g){case 3:case 1:l.a+=r.a;break;case 2:l.b+=r.b;break;case 4:l.b+=r.b}Vi(i,l,i.c.b,i.c)}function oTn(e,n){var t,i,r,c;for(c=n.b.j,e.a=oe(It,ei,30,c.c.length,15,1),r=0,i=0;ie)throw $(new Jn("k must be smaller than n"));return n==0||n==e?1:e==0?0:Wde(e)/(Wde(n)*Wde(e-n))}function A0e(e,n){var t,i,r,c;for(t=new TV(e);t.g==null&&!t.c?pae(t):t.g==null||t.i!=0&&u(t.g[t.i-1],50).Ob();)if(c=u(Iz(t),57),X(c,174))for(i=u(c,174),r=0;r>4],n[t*2+1]=_G[c&15];return Ah(n,0,n.length)}function yTn(e){var n,t,i;switch(i=e.c.length,i){case 0:return NK(),Jen;case 1:return n=u(hqe(new L(e)),45),Z2n(n.jd(),n.kd());default:return t=u(Xa(e,oe(Fg,cF,45,e.c.length,0,1)),175),new tse(t)}}function e0(e,n){switch(n.g){case 1:return H5(e.j,(hs(),S3e));case 2:return H5(e.j,(hs(),E3e));case 3:return H5(e.j,(hs(),A3e));case 4:return H5(e.j,(hs(),x3e));default:return yn(),yn(),Mc}}function kTn(e,n){var t,i,r;t=V3n(n,e.e),i=u(Rn(e.g.f,t),15).a,r=e.a.c.length-1,e.a.c.length!=0&&u(Le(e.a,r),295).c==i?(++u(Le(e.a,r),295).a,++u(Le(e.a,r),295).b):xe(e.a,new jOe(i))}function ab(){ab=Y,Qsn=(Gt(),o6),Ysn=d0,Usn=Zg,Xsn=y4,Vsn=Ib,qsn=v4,Vye=zD,Ksn=t3,Ire=(Jbe(),Isn),Lre=Lsn,Qye=Bsn,Pre=Hsn,Yye=zsn,Wye=Fsn,Kye=Psn,UJ=$sn,XJ=Rsn,CD=Jsn,Zye=Gsn,Xye=_sn}function DGe(e,n){var t,i,r,c,o;if(e.e<=n||xyn(e,e.g,n))return e.g;for(c=e.r,i=e.g,o=e.r,r=(c-i)/2+i;i+11&&(e.e.b+=e.a)):(e.e.a+=t.a,e.e.b=k.Math.max(e.e.b,t.b),e.d.c.length>1&&(e.e.a+=e.a))}function STn(e){var n,t,i,r;switch(r=e.i,n=r.b,i=r.j,t=r.g,r.a.g){case 0:t.a=(e.g.b.o.a-i.a)/2;break;case 1:t.a=n.d.n.a+n.d.a.a;break;case 2:t.a=n.d.n.a+n.d.a.a-i.a;break;case 3:t.b=n.d.n.b+n.d.a.b}}function MTn(e,n,t){var i,r,c;for(r=new Gn(Vn(Mh(t).a.Jc(),new ee));ht(r);)i=u(it(r),17),!sc(i)&&!(!sc(i)&&i.c.i.c==i.d.i.c)&&(c=AUe(e,i,t,new dMe),c.c.length>1&&Hn(n.c,c))}function LGe(e,n,t,i,r){if(ii&&(e.a=i),e.br&&(e.b=r),e}function ATn(e){if(X(e,144))return XNn(u(e,144));if(X(e,233))return rjn(u(e,233));if(X(e,21))return cTn(u(e,21));throw $(new Jn(E7+Qa(new Mu(z(B(Cr,1),xn,1,5,[e])))))}function xTn(e,n,t,i,r){var c,o,l;for(c=!0,o=0;o>>r|t[o+i+1]<>>r,++o}return c}function O0e(e,n,t,i){var r,c,o;if(n.k==(Bn(),br)){for(c=new Gn(Vn(or(n).a.Jc(),new ee));ht(c);)if(r=u(it(c),17),o=r.c.i.k,o==br&&e.c.a[r.c.i.c.p]==i&&e.c.a[n.c.p]==t)return!0}return!1}function TTn(e,n){var t,i,r,c;return n&=63,t=e.h&ld,n<22?(c=t>>>n,r=e.m>>n|t<<22-n,i=e.l>>n|e.m<<22-n):n<44?(c=0,r=t>>>n-22,i=e.m>>n-22|e.h<<44-n):(c=0,r=0,i=t>>>n-44),Io(i&zs,r&zs,c&ld)}function PGe(e,n,t,i){var r;this.b=i,this.e=e==(Mg(),LM),r=n[t],this.d=zp(rs,[Ae,Aa],[171,30],16,[r.length,r.length],2),this.a=zp(It,[Ae,ei],[54,30],15,[r.length,r.length],2),this.c=new a0e(n,t)}function CTn(e){var n,t,i;for(e.k=new jae((Ne(),z(B(Ac,1),qu,64,0,[Eu,Un,Wn,bt,Xn])).length,e.j.c.length),i=new L(e.j);i.a=t)return $8(e,n,i.p),!0;return!1}function Ov(e,n,t,i){var r,c,o,l,f,h;for(o=t.length,c=0,r=-1,h=FRe((Kn(n,e.length+1),e.substr(n)),(QV(),Hme)),l=0;lc&&Bvn(h,FRe(t[l],Hme))&&(r=l,c=f);return r>=0&&(i[0]=n+c),r}function DTn(e,n,t){var i,r,c,o,l,f,h,b;c=e.d.p,l=c.e,f=c.r,e.g=new IC(f),o=e.d.o.c.p,i=o>0?l[o-1]:oe(m1,i0,9,0,0,1),r=l[o],h=ot?z0e(e,t,"start index"):n<0||n>t?z0e(n,t,"end index"):hS("end index (%s) must not be less than start index (%s)",z(B(Cr,1),xn,1,5,[me(n),me(e)]))}function FGe(e,n){var t,i,r,c;for(i=0,r=e.length;i0&&HGe(e,c,t));n.p=0}function PTn(e){var n,t,i,r;for(n=hg(Xt(new fl("Predicates."),"and"),40),t=!0,r=new qc(e);r.b=0?e.hi(r):G0e(e,i);else throw $(new Jn(kb+i.ve()+HS));else throw $(new Jn(UWe+n+XWe));else Ql(e,t,i)}function N0e(e){var n,t;if(t=null,n=!1,X(e,210)&&(n=!0,t=u(e,210).a),n||X(e,265)&&(n=!0,t=""+u(e,265).a),n||X(e,479)&&(n=!0,t=""+u(e,479).a),!n)throw $(new CX(qpe));return t}function D0e(e,n,t){var i,r,c,o,l,f;for(f=Po(e.e.Ah(),n),i=0,l=e.i,r=u(e.g,122),o=0;o=e.d.b.c.length&&(n=new Xu(e.d),n.p=i.p-1,xe(e.d.b,n),t=new Xu(e.d),t.p=i.p,xe(e.d.b,t)),Dr(i,u(Le(e.d.b,i.p),25))}function BTn(e){var n,t,i,r;for(t=new Mi,dc(t,e.o),i=new HP;t.b!=0;)n=u(t.b==0?null:(at(t.b!=0),Ul(t,t.a.a)),500),r=DKe(e,n,!0),r&&xe(i.a,n);for(;i.a.c.length!=0;)n=u(T1e(i),500),DKe(e,n,!1)}function Je(e){var n;this.c=new Mi,this.f=e.e,this.e=e.d,this.i=e.g,this.d=e.c,this.b=e.b,this.k=e.j,this.a=e.a,e.i?this.j=e.i:this.j=(n=u(pa(uh),10),new Jl(n,u(zf(n,n.length),10),0)),this.g=e.f}function Og(){Og=Y,u9e=new D5(xS,0),xr=new D5("BOOLEAN",1),gc=new D5("INT",2),c6=new D5("STRING",3),tc=new D5("DOUBLE",4),Bi=new D5("ENUM",5),r6=new D5("ENUMSET",6),oh=new D5("OBJECT",7)}function iS(e,n){var t,i,r,c,o;i=k.Math.min(e.c,n.c),c=k.Math.min(e.d,n.d),r=k.Math.max(e.c+e.b,n.c+n.b),o=k.Math.max(e.d+e.a,n.d+n.a),r=(r/2|0))for(this.e=i?i.c:null,this.d=r;t++0;)jhe(this);this.b=n,this.a=null}function HTn(e,n){var t,i;n.a?aDn(e,n):(t=u(zX(e.b,n.b),60),t&&t==e.a[n.b.f]&&t.a&&t.a!=n.b.a&&t.c.Ec(n.b),i=u(BX(e.b,n.b),60),i&&e.a[i.f]==n.b&&i.a&&i.a!=n.b.a&&n.b.c.Ec(i),IV(e.b,n.b))}function KGe(e,n){var t,i;if(t=u(zc(e.b,n),127),u(u(mi(e.r,n),22),83).dc()){t.n.b=0,t.n.c=0;return}t.n.b=e.C.b,t.n.c=e.C.c,e.A.Gc((tl(),nw))&&MXe(e,n),i=xSn(e,n),DW(e,n)==(Mv(),Pb)&&(i+=2*e.w),t.a.a=i}function QGe(e,n){var t,i;if(t=u(zc(e.b,n),127),u(u(mi(e.r,n),22),83).dc()){t.n.d=0,t.n.a=0;return}t.n.d=e.C.d,t.n.a=e.C.a,e.A.Gc((tl(),nw))&&AXe(e,n),i=ASn(e,n),DW(e,n)==(Mv(),Pb)&&(i+=2*e.w),t.a.b=i}function JTn(e,n){var t,i,r,c;for(c=new Te,i=new L(n);i.ai&&(Kn(n-1,e.length),e.charCodeAt(n-1)<=32);)--n;return i>0||nt.a&&(i.Gc((Cg(),WM))?r=(n.a-t.a)/2:i.Gc(ZM)&&(r=n.a-t.a)),n.b>t.b&&(i.Gc((Cg(),nA))?c=(n.b-t.b)/2:i.Gc(eA)&&(c=n.b-t.b)),y0e(e,r,c)}function nqe(e,n,t,i,r,c,o,l,f,h,b,p,y){X(e.Cb,88)&&bm(Ds(u(e.Cb,88)),4),xo(e,t),e.f=o,M8(e,l),A8(e,f),j8(e,h),S8(e,b),Wd(e,p),x8(e,y),Yd(e,!0),Xd(e,r),e.Xk(c),Ag(e,n),i!=null&&(e.i=null,TB(e,i))}function z0e(e,n,t){if(e<0)return hS(tQe,z(B(Cr,1),xn,1,5,[t,me(e)]));if(n<0)throw $(new Jn(iQe+n));return hS("%s (%s) must not be greater than size (%s)",z(B(Cr,1),xn,1,5,[t,me(e),me(n)]))}function F0e(e,n,t,i,r,c){var o,l,f,h;if(o=i-t,o<7){YEn(n,t,i,c);return}if(f=t+r,l=i+r,h=f+(l-f>>1),F0e(n,e,f,h,-r,c),F0e(n,e,h,l,-r,c),c.Le(e[h-1],e[h])<=0){for(;t=0?e.$h(c,t):vbe(e,r,t);else throw $(new Jn(kb+r.ve()+HS));else throw $(new Jn(UWe+n+XWe));else Yl(e,i,r,t)}function tqe(e){var n,t;if(e.f){for(;e.n>0;){if(n=u(e.k.Xb(e.n-1),75),t=n.Jk(),X(t,103)&&(u(t,19).Bb&Bu)!=0&&(!e.e||t.nk()!=sk||t.Jj()!=0)&&n.kd()!=null)return!0;--e.n}return!1}else return e.n>0}function iqe(e){var n,t,i,r;if(t=u(e,52).Yh(),t)try{if(i=null,n=B8((J0(),Cf),VXe(cjn(t))),n&&(r=n.Zh(),r&&(i=r.Dl(Xbn(t.e)))),i&&i!=e)return iqe(i)}catch(c){if(c=lr(c),!X(c,63))throw $(c)}return e}function cCn(e,n,t){var i,r,c;t.Tg("Remove overlaps",1),t.bh(n,K2e),i=u(ve(n,(lv(),b4)),26),e.f=i,e.a=BY(u(ve(n,(ab(),CD)),303)),r=re(ve(n,(Gt(),d0))),p5(e,(Nn(r),r)),c=wm(i),gKe(e,n,c,t),t.bh(n,BF)}function uCn(e){var n,t,i;if(Re($e(ve(e,(Gt(),RD))))){for(i=new Te,t=new Gn(Vn(hb(e).a.Jc(),new ee));ht(t);)n=u(it(t),85),b2(n)&&Re($e(ve(n,pce)))&&Hn(i.c,n);return i}else return yn(),yn(),Mc}function rqe(e){if(!e)return QMe(),Ven;var n=e.valueOf?e.valueOf():e;if(n!==e){var t=cte[typeof n];return t?t(n):z1e(typeof n)}else return e instanceof Array||e instanceof k.Array?new p9(e):new v9(e)}function cqe(e,n,t){var i,r,c;switch(c=e.o,i=u(zc(e.p,t),253),r=i.i,r.b=cS(i),r.a=rS(i),r.b=k.Math.max(r.b,c.a),r.b>c.a&&!n&&(r.b=c.a),r.c=-(r.b-c.a)/2,t.g){case 1:r.d=-r.a;break;case 3:r.d=c.b}qW(i),UW(i)}function uqe(e,n,t){var i,r,c;switch(c=e.o,i=u(zc(e.p,t),253),r=i.i,r.b=cS(i),r.a=rS(i),r.a=k.Math.max(r.a,c.b),r.a>c.b&&!n&&(r.a=c.b),r.d=-(r.a-c.b)/2,t.g){case 4:r.c=-r.b;break;case 2:r.c=c.a}qW(i),UW(i)}function oCn(e,n){var t,i,r;return X(n.g,9)&&u(n.g,9).k==(Bn(),pr)?Ki:(r=Z5(n),r?k.Math.max(0,e.b/2-.5):(t=hv(n),t?(i=te(re(sm(t,(Oe(),Qg)))),k.Math.max(0,i/2-.5)):Ki))}function sCn(e,n){var t,i,r;return X(n.g,9)&&u(n.g,9).k==(Bn(),pr)?Ki:(r=Z5(n),r?k.Math.max(0,e.b/2-.5):(t=hv(n),t?(i=te(re(sm(t,(Oe(),Qg)))),k.Math.max(0,i/2-.5)):Ki))}function lCn(e,n){var t,i,r,c,o;if(!n.dc()){if(r=u(n.Xb(0),132),n.gc()==1){GUe(e,r,r,1,0,n);return}for(t=1;t0)try{r=vl(n,Kr,ui)}catch(c){throw c=lr(c),X(c,131)?(i=c,$(new aB(i))):$(c)}return t=(!e.a&&(e.a=new bX(e)),e.a),r=0?u(V(t,r),57):null}function hCn(e,n){if(e<0)return hS(tQe,z(B(Cr,1),xn,1,5,["index",me(e)]));if(n<0)throw $(new Jn(iQe+n));return hS("%s (%s) must be less than size (%s)",z(B(Cr,1),xn,1,5,["index",me(e),me(n)]))}function dCn(e){var n,t,i,r,c;if(e==null)return Yo;for(c=new Eg(Co,"[","]"),t=e,i=0,r=t.length;i=0?e.Ih(t,!0,!0):g2(e,r,!0),163)),u(i,219).Xl(n);else throw $(new Jn(kb+n.ve()+HS))}function q0e(e){var n,t;return e>-0x800000000000&&e<0x800000000000?e==0?0:(n=e<0,n&&(e=-e),t=ac(k.Math.floor(k.Math.log(e)/.6931471805599453)),(!n||e!=k.Math.pow(2,t))&&++t,t):MFe(Pu(e))}function SCn(e){var n,t,i,r,c,o,l;for(c=new Zh,t=new L(e);t.a2&&l.e.b+l.j.b<=2&&(r=l,i=o),c.a.yc(r,c),r.q=i);return c}function MCn(e,n,t){t.Tg("Eades radial",1),t.bh(n,BF),e.d=u(ve(n,(lv(),b4)),26),e.c=te(re(ve(n,(ab(),XJ)))),e.e=BY(u(ve(n,CD),303)),e.a=fjn(u(ve(n,Zye),426)),e.b=TAn(u(ve(n,Kye),354)),hAn(e),t.bh(n,BF)}function ACn(e,n){if(n.Tg("Target Width Setter",1),Ea(e,(Ya(),Kre)))Ei(e,(l1(),Wm),re(ve(e,Kre)));else throw $(new Id("A target width has to be set if the TargetWidthWidthApproximator should be used."));n.Ug()}function dqe(e,n){var t,i,r;return i=new Va(e),$u(i,n),ae(i,(pe(),sJ),n),ae(i,(Oe(),Zi),(Fr(),to)),ae(i,zh,(s1(),cG)),If(i,(Bn(),pr)),t=new Yu,wu(t,i),Tr(t,(Ne(),Xn)),r=new Yu,wu(r,i),Tr(r,Wn),i}function bqe(e,n){var t,i,r,c,o;for(e.c[n.p]=!0,xe(e.a,n),o=new L(n.j);o.a=c)o.$b();else for(r=o.Jc(),i=0;i0?Ooe():o<0&&vqe(e,n,-o),!0):!1}function rS(e){var n,t,i,r,c,o,l;if(l=0,e.b==0){for(o=YHe(e,!0),n=0,i=o,r=0,c=i.length;r0&&(l+=t,++n);n>1&&(l+=e.c*(n-1))}else l=iAe(GQ(Up(oi(yK(e.a),new x1),new M0)));return l>0?l+e.n.d+e.n.a:0}function cS(e){var n,t,i,r,c,o,l;if(l=0,e.b==0)l=iAe(GQ(Up(oi(yK(e.a),new S3),new Ub)));else{for(o=WHe(e,!0),n=0,i=o,r=0,c=i.length;r0&&(l+=t,++n);n>1&&(l+=e.c*(n-1))}return l>0?l+e.n.b+e.n.c:0}function DCn(e){var n,t;if(e.c.length!=2)throw $(new Uc("Order only allowed for two paths."));n=(mn(0,e.c.length),u(e.c[0],17)),t=(mn(1,e.c.length),u(e.c[1],17)),n.d.i!=t.c.i&&(e.c.length=0,Hn(e.c,t),Hn(e.c,n))}function yqe(e,n,t){var i;for(Fw(t,n.g,n.f),Fl(t,n.i,n.j),i=0;i<(!n.a&&(n.a=new we(Bt,n,10,11)),n.a).i;i++)yqe(e,u(V((!n.a&&(n.a=new we(Bt,n,10,11)),n.a),i),26),u(V((!t.a&&(t.a=new we(Bt,t,10,11)),t.a),i),26))}function _Cn(e,n){var t,i,r,c;for(c=u(zc(e.b,n),127),t=c.a,r=u(u(mi(e.r,n),22),83).Jc();r.Ob();)i=u(r.Pb(),115),i.c&&(t.a=k.Math.max(t.a,gfe(i.c)));if(t.a>0)switch(n.g){case 2:c.n.c=e.s;break;case 4:c.n.b=e.s}}function ICn(e,n){var t,i,r;return t=u(T(n,(Qf(),Fy)),15).a-u(T(e,Fy),15).a,t==0?(i=_r(vc(u(T(e,(nb(),ZN)),8)),u(T(e,uM),8)),r=_r(vc(u(T(n,ZN),8)),u(T(n,uM),8)),ki(i.a*i.b,r.a*r.b)):t}function LCn(e,n){var t,i,r;return t=u(T(n,(Tu(),HJ)),15).a-u(T(e,HJ),15).a,t==0?(i=_r(vc(u(T(e,(Ci(),AD)),8)),u(T(e,Q7),8)),r=_r(vc(u(T(n,AD),8)),u(T(n,Q7),8)),ki(i.a*i.b,r.a*r.b)):t}function kqe(e){var n,t;return t=new z0,t.a+="e_",n=W7n(e),n!=null&&(t.a+=""+n),e.c&&e.d&&(Xt((t.a+=" ",t),vz(e.c)),Xt(uo((t.a+="[",t),e.c.i),"]"),Xt((t.a+=tee,t),vz(e.d)),Xt(uo((t.a+="[",t),e.d.i),"]")),t.a}function Eqe(e){switch(e.g){case 0:return new IU;case 1:return new hP;case 2:return new LU;case 3:return new CT;default:throw $(new Jn("No implementation is available for the layout phase "+(e.f!=null?e.f:""+e.g)))}}function V0e(e,n,t,i,r){var c;switch(c=0,r.g){case 1:c=k.Math.max(0,n.b+e.b-(t.b+i));break;case 3:c=k.Math.max(0,-e.b-i);break;case 2:c=k.Math.max(0,-e.a-i);break;case 4:c=k.Math.max(0,n.a+e.a-(t.a+i))}return c}function jqe(e,n,t){var i,r,c,o,l;if(t)for(r=t.a.length,i=new lg(r),l=(i.b-i.a)*i.c<0?(G0(),Jb):new X0(i);l.Ob();)o=u(l.Pb(),15),c=n8(t,o.a),zpe in c.a||xne in c.a?B_n(e,c,n):uBn(e,c,n),h2n(u(Rn(e.c,C8(c)),85))}function K0e(e){var n,t;switch(e.b){case-1:return!0;case 0:return t=e.t,t>1||t==-1?(e.b=-1,!0):(n=mf(e),n&&(Cc(),n.jk()==KZe)?(e.b=-1,!0):(e.b=1,!1));default:case 1:return!1}}function Q0e(e,n){var t,i,r,c;if(si(e),e.c!=0||e.a!=123)throw $(new Pt(zt((Dt(),pZe))));if(c=n==112,i=e.d,t=$9(e.i,125,i),t<0)throw $(new Pt(zt((Dt(),mZe))));return r=gf(e.i,i,t),e.d=t+1,D$e(r,c,(e.e&512)==512)}function PCn(e){var n,t,i,r,c,o,l;for(l=e1(e.c.length),r=new L(e);r.a=0&&i=0?e.Ih(t,!0,!0):g2(e,r,!0),163)),u(i,219).Ul(n);throw $(new Jn(kb+n.ve()+mne))}function RCn(){ese();var e;return Kan?u(B8((J0(),Cf),yf),2e3):(ni(Fg,new PL),T$n(),e=u(X(lo((J0(),Cf),yf),548)?lo(Cf,yf):new A_e,548),Kan=!0,xBn(e),_Bn(e),Zt((Zoe(),V8e),e,new H3),Vc(Cf,yf,e),e)}function BCn(e,n){var t,i,r,c;e.j=-1,Vs(e.e)?(t=e.i,c=e.i!=0,nO(e,n),i=new ed(e.e,3,e.c,null,n,t,c),r=n.xl(e.e,e.c,null),r=eGe(e,n,r),r?(r.lj(i),r.mj()):hi(e.e,i)):(nO(e,n),r=n.xl(e.e,e.c,null),r&&r.mj())}function Nz(e,n){var t,i,r;if(r=0,i=n[0],i>=e.length)return-1;for(t=(Kn(i,e.length),e.charCodeAt(i));t>=48&&t<=57&&(r=r*10+(t-48),++i,!(i>=e.length));)t=(Kn(i,e.length),e.charCodeAt(i));return i>n[0]?n[0]=i:r=-1,r}function zCn(e,n,t){var i,r,c,o,l;o=e.c,l=e.d,c=mu(z(B($r,1),Ae,8,0,[o.i.n,o.n,o.a])).b,r=(c+mu(z(B($r,1),Ae,8,0,[l.i.n,l.n,l.a])).b)/2,i=null,o.j==(Ne(),Wn)?i=new Ee(n+o.i.c.c.a+t,r):i=new Ee(n-t,r),R9(e.a,0,i)}function b2(e){var n,t,i,r;for(n=null,i=r1(Xl(z(B(tf,1),xn,20,0,[(!e.b&&(e.b=new Tn(mt,e,4,7)),e.b),(!e.c&&(e.c=new Tn(mt,e,5,8)),e.c)])));ht(i);)if(t=u(it(i),84),r=ru(t),!n)n=r;else if(n!=r)return!1;return!0}function SW(e,n,t){var i;if(++e.j,n>=e.i)throw $(new Eo(Cne+n+Rg+e.i));if(t>=e.i)throw $(new Eo(One+t+Rg+e.i));return i=e.g[t],n!=t&&(n>16),n=i>>16&16,t=16-n,e=e>>n,i=e-256,n=i>>16&8,t+=n,e<<=n,i=e-jm,n=i>>16&4,t+=n,e<<=n,i=e-Nh,n=i>>16&2,t+=n,e<<=n,i=e>>14,n=i&~(i>>1),t+2-n)}function FCn(e,n){var t,i,r;for(r=new Te,i=jt(n.a,0);i.b!=i.d.c;)t=u(kt(i),65),t.c.g==e.g&&ue(T(t.b,(Tu(),Hh)))!==ue(T(t.c,Hh))&&!bv(new wn(null,new pn(r,16)),new Aje(t))&&Hn(r.c,t);return Nr(r,new Lk),r}function Mqe(e,n,t){var i,r,c,o;return X(n,155)&&X(t,155)?(c=u(n,155),o=u(t,155),e.a[c.a][o.a]+e.a[o.a][c.a]):X(n,251)&&X(t,251)&&(i=u(n,251),r=u(t,251),i.a==r.a)?u(T(r.a,(Qf(),Fy)),15).a:0}function Aqe(e,n){var t,i,r,c,o,l,f,h;for(h=te(re(T(n,(Oe(),TM)))),f=e[0].n.a+e[0].o.a+e[0].d.c+h,l=1;l=0?t:(l=mj(_r(new Ee(o.c+o.b/2,o.d+o.a/2),new Ee(c.c+c.b/2,c.d+c.a/2))),-(iVe(c,o)-1)*l)}function JCn(e,n,t){var i;tr(new wn(null,(!t.a&&(t.a=new we($i,t,6,6)),new pn(t.a,16))),new xTe(e,n)),tr(new wn(null,(!t.n&&(t.n=new we(ju,t,1,7)),new pn(t.n,16))),new TTe(e,n)),i=u(ve(t,(Gt(),m4)),78),i&&Whe(i,e,n)}function g2(e,n,t){var i,r,c;if(c=Lv((ds(),ic),e.Ah(),n),c)return Cc(),u(c,69).vk()||(c=W5(Kc(ic,c))),r=(i=e.Fh(c),u(i>=0?e.Ih(i,!0,!0):g2(e,c,!0),163)),u(r,219).Ql(n,t);throw $(new Jn(kb+n.ve()+mne))}function Y0e(e,n,t,i){var r,c,o,l,f;if(r=e.d[n],r){if(c=r.g,f=r.i,i!=null){for(l=0;l=t&&(i=n,h=(f.c+f.a)/2,o=h-t,f.c<=h-t&&(r=new ZV(f.c,o),og(e,i++,r)),l=h+t,l<=f.a&&(c=new ZV(l,f.a),Kp(i,e.c.length),FE(e.c,i,c)))}function Oqe(e,n,t){var i,r,c,o,l,f;if(!n.dc()){for(r=new Mi,f=n.Jc();f.Ob();)for(l=u(f.Pb(),40),Zt(e.a,me(l.g),me(t)),o=(i=jt(new J1(l).a.d,0),new X3(i));nC(o.a);)c=u(kt(o.a),65).c,Vi(r,c,r.c.b,r.c);Oqe(e,r,t+1)}}function W0e(e){var n;if(!e.c&&e.g==null)e.d=e._i(e.f),Et(e,e.d),n=e.d;else{if(e.g==null)return!0;if(e.i==0)return!1;n=u(e.g[e.i-1],50)}return n==e.b&&null.Tm>=null.Sm()?(Iz(e),W0e(e)):n.Ob()}function Nqe(e){if(this.a=e,e.c.i.k==(Bn(),pr))this.c=e.c,this.d=u(T(e.c.i,(pe(),_u)),64);else if(e.d.i.k==pr)this.c=e.d,this.d=u(T(e.d.i,(pe(),_u)),64);else throw $(new Jn("Edge "+e+" is not an external edge."))}function Dqe(e,n){var t,i,r;r=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,3,r,e.b)),n?n!=e&&(xo(e,n.zb),_Q(e,n.d),t=(i=n.c,i??n.zb),LQ(e,t==null||bn(t,n.zb)?null:t)):(xo(e,null),_Q(e,0),LQ(e,null))}function _qe(e){!ite&&(ite=LRn());var n=e.replace(/[\x00-\x1f\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200b-\u200f\u2028-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb"\\]/g,function(t){return C5n(t)});return'"'+n+'"'}function Z0e(e,n,t,i,r,c){var o,l,f,h,b;if(r!=0)for(ue(e)===ue(t)&&(e=e.slice(n,n+r),n=0),f=t,l=n,h=n+r;l=o)throw $(new Bp(n,o));return r=t[n],o==1?i=null:(i=oe(zce,Lne,415,o-1,0,1),Wu(t,0,i,0,n),c=o-n-1,c>0&&Wu(t,n+1,i,n,c)),N8(e,i),eqe(e,n,r),r}function Iqe(e){var n,t;if(e.f){for(;e.n0)for(o=e.c.d,l=e.d.d,r=q1(_r(new Ee(l.a,l.b),o),1/(i+1)),c=new Ee(o.a,o.b),t=new L(e.a);t.a0?c=ay(t):c=IO(ay(t))),Ei(n,G7,c)}function Bqe(e,n){var t,i;if(e.c.length!=0){if(e.c.length==2)jy((mn(0,e.c.length),u(e.c[0],9)),(ml(),k1)),jy((mn(1,e.c.length),u(e.c[1],9)),Lb);else for(i=new L(e);i.a0&&rN(e,t,n),c):i.a!=null?(rN(e,n,t),-1):r.a!=null?(rN(e,t,n),1):0}function zqe(e){XK();var n,t,i,r,c,o,l;for(t=new Z0,r=new L(e.e.b);r.a=0;)i=t[c],o.$l(i.Jk())&&Et(r,i);!$Ke(e,r)&&Vs(e.e)&&S9(e,n.Hk()?Q0(e,6,n,(yn(),Mc),null,-1,!1):Q0(e,n.rk()?2:1,n,null,null,-1,!1))}function ZCn(e,n){var t,i,r,c,o;return e.a==(P8(),hM)?!0:(c=n.a.c,t=n.a.c+n.a.b,!(n.j&&(i=n.A,o=i.c.c.a-i.o.a/2,r=c-(i.n.a+i.o.a),r>o)||n.q&&(i=n.C,o=i.c.c.a-i.o.a/2,r=i.n.a-t,r>o)))}function Hqe(e,n,t){var i,r,c,o,l,f;for(i=0,f=t,n||(i=t*(e.c.length-1),f*=-1),c=new L(e);c.a=0?e.xh(null):e.Mh().Qh(e,-1-n,null,null)),e.yh(u(r,52),t),i&&i.mj(),e.sh()&&e.th()&&t>-1&&hi(e,new Lr(e,9,t,c,r)),r):c}function ibe(e,n){var t,i,r,c,o;for(c=e.b.Ae(n),i=(t=e.a.get(c),t??oe(Cr,xn,1,0,5,1)),o=0;o>5,r>=e.d)return e.e<0;if(t=e.a[r],n=1<<(n&31),e.e<0){if(i=XBe(e),r>16)),16).bd(c),l0&&(!(G1(e.a.c)&&n.n.d)&&!(iv(e.a.c)&&n.n.b)&&(n.g.d+=k.Math.max(0,i/2-.5)),!(G1(e.a.c)&&n.n.a)&&!(iv(e.a.c)&&n.n.c)&&(n.g.a-=i-1))}function nUe(e,n,t){var i,r,c,o,l,f;c=u(Le(n.e,0),17).c,i=c.i,r=i.k,f=u(Le(t.g,0),17).d,o=f.i,l=o.k,r==(Bn(),br)?ae(e,(pe(),Na),u(T(i,Na),12)):ae(e,(pe(),Na),c),l==br?ae(e,(pe(),jf),u(T(o,jf),12)):ae(e,(pe(),jf),f)}function tUe(e,n){var t,i,r,c,o,l;for(c=new L(e.b);c.a>n,c=e.m>>n|t<<22-n,r=e.l>>n|e.m<<22-n):n<44?(o=i?ld:0,c=t>>n-22,r=e.m>>n-22|t<<44-n):(o=i?ld:0,c=i?zs:0,r=t>>n-44),Io(r&zs,c&zs,o&ld)}function iUe(e,n){var t,i,r,c,o,l,f,h,b;if(e.a.f>0&&X(n,45)&&(e.a.Zj(),h=u(n,45),f=h.jd(),c=f==null?0:Ni(f),o=Ole(e.a,c),t=e.a.d[o],t)){for(i=u(t.g,374),b=t.i,l=0;l=2)for(t=r.Jc(),n=re(t.Pb());t.Ob();)c=n,n=re(t.Pb()),i=k.Math.min(i,(Nn(n),n-(Nn(c),c)));return i}function EOn(e,n){var t,i,r;for(r=new Te,i=jt(n.a,0);i.b!=i.d.c;)t=u(kt(i),65),t.b.g==e.g&&!bn(t.b.c,$F)&&ue(T(t.b,(Tu(),Hh)))!==ue(T(t.c,Hh))&&!bv(new wn(null,new pn(r,16)),new xje(t))&&Hn(r.c,t);return Nr(r,new xw),r}function jOn(e,n){var t,i,r;if(ue(n)===ue(Tt(e)))return!0;if(!X(n,16)||(i=u(n,16),r=e.gc(),r!=i.gc()))return!1;if(X(i,59)){for(t=0;t0&&(r=t),o=new L(e.f.e);o.a0?r+=n:r+=1;return r}function NOn(e,n){var t,i,r,c,o,l,f,h,b,p;h=e,f=jj(h,"individualSpacings"),f&&(i=Ea(n,(Gt(),s6)),o=!i,o&&(r=new e9,Ei(n,s6,r)),l=u(ve(n,s6),379),p=f,c=null,p&&(c=(b=FQ(p,oe(Be,Ae,2,0,6,1)),new RX(p,b))),c&&(t=new RTe(p,l),oc(c,t)))}function DOn(e,n){var t,i,r,c,o,l,f,h,b,p,y;return f=null,p=e,b=null,(tZe in p.a||iZe in p.a||UF in p.a)&&(h=null,y=s1e(n),o=jj(p,tZe),t=new aSe(y),qFe(t.a,o),l=jj(p,iZe),i=new ySe(y),UFe(i.a,l),c=n2(p,UF),r=new jSe(y),h=(WJe(r.a,c),c),b=h),f=b,f}function _On(e,n){var t,i,r;if(n===e)return!0;if(X(n,540)){if(r=u(n,833),e.a.d!=r.a.d||fv(e).gc()!=fv(r).gc())return!1;for(i=fv(r).Jc();i.Ob();)if(t=u(i.Pb(),416),nLe(e,t.a.jd())!=u(t.a.kd(),18).gc())return!1;return!0}return!1}function IOn(e,n){var t,i,r,c;for(c=new L(n.a);c.an.c?1:e.bn.b?1:e.a!=n.a?Ni(e.a)-Ni(n.a):e.d==(Aj(),$M)&&n.d==PM?-1:e.d==PM&&n.d==$M?1:0}function xW(e){var n,t,i,r,c,o,l,f;for(r=Ki,i=Ir,t=new L(e.e.b);t.a0&&r0):r<0&&-r0):!1}function POn(e,n,t,i){var r,c,o,l,f,h,b,p;for(r=(n-e.d)/e.c.c.length,c=0,e.a+=t,e.d=n,p=new L(e.c);p.a>24;return o}function ROn(e){if(e.xe()){var n=e.c;n.ye()?e.o="["+n.n:n.xe()?e.o="["+n.ve():e.o="[L"+n.ve()+";",e.b=n.ue()+"[]",e.k=n.we()+"[]";return}var t=e.j,i=e.d;i=i.split("/"),e.o=CY(".",[t,CY("$",i)]),e.b=CY(".",[t,CY(".",i)]),e.k=i[i.length-1]}function BOn(e,n){var t,i,r,c,o;for(o=null,c=new L(e.e.a);c.a0&&hN(n,(mn(i-1,e.c.length),u(e.c[i-1],9)),r)>0;)bl(e,i,(mn(i-1,e.c.length),u(e.c[i-1],9))),--i;mn(i,e.c.length),e.c[i]=r}n.b=new wt,n.g=new wt}function gUe(e,n,t){var i,r,c;for(i=1;i0&&n.Le((mn(r-1,e.c.length),u(e.c[r-1],9)),c)>0;)bl(e,r,(mn(r-1,e.c.length),u(e.c[r-1],9))),--r;mn(r,e.c.length),e.c[r]=c}t.a=new wt,t.b=new wt}function _z(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(c=n.Jc();c.Ob();)r=u(c.Pb(),26),b=r.i+r.g/2,y=r.j+r.f/2,f=e.f,o=f.i+f.g/2,l=f.j+f.f/2,h=b-o,p=y-l,i=k.Math.sqrt(h*h+p*p),h*=e.e/i,p*=e.e/i,t?(b-=h,y-=p):(b+=h,y+=p),Ls(r,b-r.g/2),Ps(r,y-r.f/2)}function Nv(e){var n,t,i;if(!e.c&&e.b!=null){for(n=e.b.length-4;n>=0;n-=2)for(t=0;t<=n;t+=2)(e.b[t]>e.b[t+2]||e.b[t]===e.b[t+2]&&e.b[t+1]>e.b[t+3])&&(i=e.b[t+2],e.b[t+2]=e.b[t],e.b[t]=i,i=e.b[t+3],e.b[t+3]=e.b[t+1],e.b[t+1]=i);e.c=!0}}function Vf(e){var n,t;return t=new fl(ig(e.Pm)),t.a+="@",Xt(t,(n=Ni(e)>>>0,n.toString(16))),e.Sh()?(t.a+=" (eProxyURI: ",uo(t,e.Yh()),e.Hh()&&(t.a+=" eClass: ",uo(t,e.Hh())),t.a+=")"):e.Hh()&&(t.a+=" (eClass: ",uo(t,e.Hh()),t.a+=")"),t.a}function sS(e){var n,t,i,r;if(e.e)throw $(new Uc((U1(wte),XZ+wte.k+VZ)));for(e.d==(kr(),lh)&&eF(e,Zc),t=new L(e.a.a);t.a>24}return t}function qOn(e,n,t){var i,r,c;if(r=u(zc(e.i,n),318),!r)if(r=new BRe(e.d,n,t),X5(e.i,n,r),pde(n))a2n(e.a,n.c,n.b,r);else switch(c=zTn(n),i=u(zc(e.p,c),253),c.g){case 1:case 3:r.j=!0,xX(i,n.b,r);break;case 4:case 2:r.k=!0,xX(i,n.c,r)}return r}function UOn(e,n,t,i){var r,c,o,l,f,h;if(l=new t9,f=Po(e.e.Ah(),n),r=u(e.g,122),Cc(),u(n,69).vk())for(o=0;o=0)return r;for(c=1,l=new L(n.j);l.a=0)return r;for(c=1,l=new L(n.j);l.a=0?(n||(n=new OE,i>0&&Bc(n,(Zr(0,i,e.length),e.substr(0,i)))),n.a+="\\",V9(n,t&Er)):n&&V9(n,t&Er);return n?n.a:e}function VOn(e){var n,t,i;for(t=new L(e.a.a.b);t.a0&&(!(G1(e.a.c)&&n.n.d)&&!(iv(e.a.c)&&n.n.b)&&(n.g.d-=k.Math.max(0,i/2-.5)),!(G1(e.a.c)&&n.n.a)&&!(iv(e.a.c)&&n.n.c)&&(n.g.a+=k.Math.max(0,i-1)))}function kUe(e,n,t){var i,r;if((e.c-e.b&e.a.length-1)==2)n==(Ne(),Un)||n==Wn?(pB(u($j(e),16),(ml(),k1)),pB(u($j(e),16),Lb)):(pB(u($j(e),16),(ml(),Lb)),pB(u($j(e),16),k1));else for(r=new yj(e);r.a!=r.b;)i=u(qB(r),16),pB(i,t)}function KOn(e,n,t){var i,r,c,o,l,f,h,b,p;for(b=-1,p=0,l=n,f=0,h=l.length;f0&&++p;++b}return p}function QOn(e,n){var t,i,r,c,o,l,f;for(r=J9(new ioe(e)),l=new Xr(r,r.c.length),c=J9(new ioe(n)),f=new Xr(c,c.c.length),o=null;l.b>0&&f.b>0&&(t=(at(l.b>0),u(l.a.Xb(l.c=--l.b),26)),i=(at(f.b>0),u(f.a.Xb(f.c=--f.b),26)),t==i);)o=t;return o}function YOn(e,n){var t,i,r,c;for(n.Tg("Self-Loop pre-processing",1),i=new L(e.a);i.afLe(e,t)?(i=vu(t,(Ne(),Wn)),e.d=i.dc()?0:rK(u(i.Xb(0),12)),o=vu(n,Xn),e.b=o.dc()?0:rK(u(o.Xb(0),12))):(r=vu(t,(Ne(),Xn)),e.d=r.dc()?0:rK(u(r.Xb(0),12)),c=vu(n,Wn),e.b=c.dc()?0:rK(u(c.Xb(0),12)))}function WOn(e){var n,t,i,r,c,o,l,f;n=!0,r=null,c=null;e:for(f=new L(e.a);f.ae.c));o++)r.a>=e.s&&(c<0&&(c=o),l=o);return f=(e.s+e.c)/2,c>=0&&(i=$_n(e,n,c,l),f=Hgn((mn(i,n.c.length),u(n.c[i],340))),XCn(n,i,t)),f}function Mt(e,n,t){var i,r,c,o,l,f,h;for(o=(c=new Wb,c),Hhe(o,(Nn(n),n)),h=(!o.b&&(o.b=new Qs((vn(),xc),Iu,o)),o.b),f=1;f=2}function tNn(e,n,t,i,r){var c,o,l,f,h,b;for(c=e.c.d.j,o=u(Qu(t,0),8),b=1;b1||(n=Ti(ia,z(B($c,1),ye,96,0,[pd,ra])),yO(BR(n,e))>1)||(i=Ti(ua,z(B($c,1),ye,96,0,[E1,Mf])),yO(BR(i,e))>1))}function SUe(e){var n,t,i,r,c,o,l;for(n=0,i=new L(e.a);i.a0&&(i.b.n-=i.c,i.b.n<=0&&i.b.u>0&&Vt(n,i.b));for(r=new L(e.i);r.a0&&(i.a.u-=i.c,i.a.u<=0&&i.a.n>0&&Vt(t,i.a))}function Iz(e){var n,t,i,r,c;if(e.g==null&&(e.d=e._i(e.f),Et(e,e.d),e.c))return c=e.f,c;if(n=u(e.g[e.i-1],50),r=n.Pb(),e.e=n,t=e._i(r),t.Ob())e.d=t,Et(e,t);else for(e.d=null;!n.Ob()&&(cr(e.g,--e.i,null),e.i!=0);)i=u(e.g[e.i-1],50),n=i;return r}function rNn(e,n){var t,i,r,c,o,l;if(i=n,r=i.Jk(),od(e.e,r)){if(r.Qi()&&VR(e,r,i.kd()))return!1}else for(l=Po(e.e.Ah(),r),t=u(e.g,122),c=0;c1||t>1)return 2;return n+t==1?2:0}function Rs(e,n){var t,i,r,c,o,l;return c=e.a*JZ+e.b*1502,l=e.b*JZ+11,t=k.Math.floor(l*SN),c+=t,l-=t*qge,c%=qge,e.a=c,e.b=l,n<=24?k.Math.floor(e.a*Gme[n]):(r=e.a*(1<=2147483648&&(i-=4294967296),i)}function xUe(e,n,t){var i,r,c,o,l,f,h;for(c=new Te,h=new Mi,o=new Mi,jLn(e,h,o,n),r$n(e,h,o,n,t),f=new L(e);f.ai.b.g&&Hn(c.c,i);return c}function fNn(e,n,t){var i,r,c,o,l,f;for(l=e.c,o=(t.q?t.q:(yn(),yn(),w1)).vc().Jc();o.Ob();)c=u(o.Pb(),45),i=!O9(oi(new wn(null,new pn(l,16)),new E9(new gTe(n,c)))).zd((rg(),By)),i&&(f=c.kd(),X(f,4)&&(r=vde(f),r!=null&&(f=r)),n.of(u(c.jd(),147),f))}function aNn(e,n){var t,i,r,c;for(n.Tg("Resize child graph to fit parent.",1),i=new L(e.b);i.a1)for(r=new L(e.a);r.a=0?e.Ih(i,!0,!0):g2(e,c,!0),163)),u(r,219).Vl(n,t)}else throw $(new Jn(kb+n.ve()+HS))}function bNn(e,n,t){var i,r,c,o,l,f;if(f=Ele(e,u(Rn(e.e,n),26)),l=null,f)switch(f.g){case 3:i=Use(e,Xp(n)),l=(Nn(t),t+(Nn(i),i));break;case 2:r=Use(e,Xp(n)),o=(Nn(t),t+(Nn(r),r)),c=Use(e,u(Rn(e.e,n),26)),l=o-(Nn(c),c);break;default:l=t}else l=t;return l}function gNn(e,n,t){var i,r,c,o,l,f;if(f=Ele(e,u(Rn(e.e,n),26)),l=null,f)switch(f.g){case 3:i=Xse(e,Xp(n)),l=(Nn(t),t+(Nn(i),i));break;case 2:r=Xse(e,Xp(n)),o=(Nn(t),t+(Nn(r),r)),c=Xse(e,u(Rn(e.e,n),26)),l=o-(Nn(c),c);break;default:l=t}else l=t;return l}function Lz(e,n){var t,i,r,c,o;if(n){for(c=X(e.Cb,88)||X(e.Cb,103),o=!c&&X(e.Cb,335),i=new ot((!n.a&&(n.a=new fj(n,Rc,n)),n.a));i.e!=i.i.gc();)if(t=u(ft(i),87),r=Xz(t),c?X(r,88):o?X(r,159):r)return r;return c?(vn(),Of):(vn(),hh)}else return null}function wNn(e,n){var t,i,r,c,o;for(t=new Te,r=lu(new wn(null,new pn(e,16)),new n5),c=lu(new wn(null,new pn(e,16)),new Ik),o=u8n(x9n(Up(xNn(z(B(GBn,1),xn,832,0,[r,c])),new kI))),i=1;i=2*n&&xe(t,new ZV(o[i-1]+n,o[i]-n));return t}function TUe(e,n,t){var i,r,c,o,l,f,h,b;if(t)for(c=t.a.length,i=new lg(c),l=(i.b-i.a)*i.c<0?(G0(),Jb):new X0(i);l.Ob();)o=u(l.Pb(),15),r=n8(t,o.a),r&&(f=_6n(e,(h=(H0(),b=new moe,b),n&&ybe(h,n),h),r),l8(f,Q1(r,$h)),Mz(r,f),H0e(r,f),tY(e,r,f))}function Pz(e){var n,t,i,r,c,o;if(!e.j){if(o=new AL,n=wA,c=n.a.yc(e,n),c==null){for(i=new ot(iu(e));i.e!=i.i.gc();)t=u(ft(i),29),r=Pz(t),ir(o,r),Et(o,t);n.a.Ac(e)!=null}cm(o),e.j=new nv((u(V(ge((V0(),$n).o),11),19),o.i),o.g),Ds(e).b&=-33}return e.j}function pNn(e){var n,t,i,r;if(e==null)return null;if(i=bo(e,!0),r=VN.length,bn(i.substr(i.length-r,r),VN)){if(t=i.length,t==4){if(n=(Kn(0,i.length),i.charCodeAt(0)),n==43)return b7e;if(n==45)return whn}else if(t==3)return b7e}return new foe(i)}function mNn(e){var n,t,i;return t=e.l,(t&t-1)!=0||(i=e.m,(i&i-1)!=0)||(n=e.h,(n&n-1)!=0)||n==0&&i==0&&t==0?-1:n==0&&i==0&&t!=0?Lhe(t):n==0&&i!=0&&t==0?Lhe(i)+22:n!=0&&i==0&&t==0?Lhe(n)+44:-1}function Dv(e,n){var t,i,r,c,o;for(r=n.a&e.f,c=null,i=e.b[r];;i=i.b){if(i==n){c?c.b=n.b:e.b[r]=n.b;break}c=i}for(o=n.f&e.f,c=null,t=e.c[o];;t=t.d){if(t==n){c?c.d=n.d:e.c[o]=n.d;break}c=t}n.e?n.e.c=n.c:e.a=n.c,n.c?n.c.e=n.e:e.e=n.e,--e.i,++e.g}function vNn(e,n){var t;n.d?n.d.b=n.b:e.a=n.b,n.b?n.b.d=n.d:e.e=n.d,!n.e&&!n.c?(t=u(bf(u(ny(e.b,n.a),262)),262),t.a=0,++e.c):(t=u(bf(u(Rn(e.b,n.a),262)),262),--t.a,n.e?n.e.c=n.c:t.b=u(bf(n.c),497),n.c?n.c.e=n.e:t.c=u(bf(n.e),497)),--e.d}function CW(e,n){var t,i,r,c;for(c=new Xr(e,0),t=(at(c.b0),c.a.Xb(c.c=--c.b),Rp(c,r),at(c.b3&&o1(e,0,n-3))}function kNn(e){var n,t,i,r;return ue(T(e,(Oe(),Fm)))===ue((rd(),b0))?!e.e&&ue(T(e,gD))!==ue((b8(),oD)):(i=u(T(e,Die),302),r=Re($e(T(e,_ie)))||ue(T(e,SM))===ue((Xj(),cD)),n=u(T(e,B4e),15).a,t=e.a.c.length,!r&&i!=(b8(),oD)&&(n==0||n>t))}function ENn(e,n){var t,i,r,c,o,l,f;for(r=e.Jc();r.Ob();)for(i=u(r.Pb(),9),l=new Yu,wu(l,i),Tr(l,(Ne(),Wn)),ae(l,(pe(),lJ),(Ln(),!0)),o=n.Jc();o.Ob();)c=u(o.Pb(),9),f=new Yu,wu(f,c),Tr(f,Xn),ae(f,lJ,!0),t=new Ww,ae(t,lJ,!0),hc(t,l),Ur(t,f)}function jNn(e){var n,t;for(t=0;t0);t++);if(t>0&&t0);n++);return n>0&&t>16!=6&&n){if(D8(e,n))throw $(new Jn(JS+Jqe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Fde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=by(n,e,6,i)),i=Tle(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,6,n,n))}function $z(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=3&&n){if(D8(e,n))throw $(new Jn(JS+_Ve(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?qde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=by(n,e,12,i)),i=xle(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,3,n,n))}function ybe(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=9&&n){if(D8(e,n))throw $(new Jn(JS+OXe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Jde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=by(n,e,9,i)),i=Cle(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,9,n,n))}function z8(e){var n,t,i,r,c;if(i=mf(e),c=e.j,c==null&&i)return e.Hk()?null:i.gk();if(X(i,159)){if(t=i.hk(),t&&(r=t.ti(),r!=e.i)){if(n=u(i,159),n.lk())try{e.g=r.qi(n,c)}catch(o){if(o=lr(o),X(o,80))e.g=null;else throw $(o)}e.i=r}return e.g}return null}function _Ue(e){var n;return n=new Te,xe(n,new O5(new Ee(e.c,e.d),new Ee(e.c+e.b,e.d))),xe(n,new O5(new Ee(e.c,e.d),new Ee(e.c,e.d+e.a))),xe(n,new O5(new Ee(e.c+e.b,e.d+e.a),new Ee(e.c+e.b,e.d))),xe(n,new O5(new Ee(e.c+e.b,e.d+e.a),new Ee(e.c,e.d+e.a))),n}function MNn(e){var n,t,i,r;for(i=e.a.d.j,r=e.c.d.j,t=new L(e.i.d);t.a>>0),t.toString(16)),tSn(nkn(),(I9(),"Exception during lenientFormat for "+i),n),"<"+i+" threw "+ig(n.Pm)+">";throw $(r)}}function xNn(e){var n,t,i,r,c,o,l,f,h;for(i=!1,n=336,t=0,c=new KOe(e.length),l=e,f=0,h=l.length;f1)for(n=Jw((t=new tg,++e.b,t),e.d),l=jt(c,0);l.b!=l.d.c;)o=u(kt(l),124),Kf($f(Pf(Rf(Lf(new af,1),0),n),o))}function Rz(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=11&&n){if(D8(e,n))throw $(new Jn(JS+Fbe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Ude(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=by(n,e,10,i)),i=Jle(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,11,n,n))}function DNn(e,n,t){var i,r,c,o,l,f;if(c=0,o=0,e.c)for(f=new L(e.d.i.j);f.ac.a?-1:r.af){for(b=e.d,e.d=oe(B8e,eme,67,2*f+4,0,1),c=0;c=9223372036854776e3?(u8(),kme):(r=!1,e<0&&(r=!0,e=-e),i=0,e>=_g&&(i=ac(e/_g),e-=i*_g),t=0,e>=Ty&&(t=ac(e/Ty),e-=t*Ty),n=ac(e),c=Io(n,t,i),r&&nY(c),c)}function GNn(e){var n,t,i,r,c;if(c=new Te,Ao(e.b,new Jke(c)),e.b.c.length=0,c.c.length!=0){for(n=(mn(0,c.c.length),u(c.c[0],80)),t=1,i=c.c.length;t>16!=7&&n){if(D8(e,n))throw $(new Jn(JS+RGe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Hde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=u(n,52).Oh(e,1,e_,i)),i=Afe(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,7,n,n))}function PUe(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=3&&n){if(D8(e,n))throw $(new Jn(JS+xFe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Gde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=u(n,52).Oh(e,0,t_,i)),i=xfe(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,3,n,n))}function OW(e,n){H8();var t,i,r,c,o,l,f,h,b;return n.d>e.d&&(l=e,e=n,n=l),n.d<63?IDn(e,n):(o=(e.d&-2)<<4,h=Vae(e,o),b=Vae(n,o),i=QW(e,ey(h,o)),r=QW(n,ey(b,o)),f=OW(h,b),t=OW(i,r),c=OW(QW(h,i),QW(r,b)),c=iZ(iZ(c,f),t),c=ey(c,o),f=ey(f,o<<1),iZ(iZ(f,c),t))}function nN(){nN=Y,Qie=new Y3(LYe,0),A5e=new Y3("LONGEST_PATH",1),x5e=new Y3("LONGEST_PATH_SOURCE",2),Vie=new Y3("COFFMAN_GRAHAM",3),M5e=new Y3(uee,4),T5e=new Y3("STRETCH_WIDTH",5),TJ=new Y3("MIN_WIDTH",6),Xie=new Y3("BF_MODEL_ORDER",7),Kie=new Y3("DF_MODEL_ORDER",8)}function KNn(e,n){var t,i,r,c,o,l;if(!e.tb){for(c=(!e.rb&&(e.rb=new Jp(e,La,e)),e.rb),l=new C5(c.i),r=new ot(c);r.e!=r.i.gc();)i=u(ft(r),143),o=i.ve(),t=u(o==null?Qo(l.f,null,i):o2(l.i,o,i),143),t&&(o==null?Qo(l.f,null,t):o2(l.i,o,t));e.tb=l}return u(lo(e.tb,n),143)}function tN(e,n){var t,i,r,c,o;if((e.i==null&&Oh(e),e.i).length,!e.p){for(o=new C5((3*e.g.i/2|0)+1),r=new R5(e.g);r.e!=r.i.gc();)i=u($Y(r),179),c=i.ve(),t=u(c==null?Qo(o.f,null,i):o2(o.i,c,i),179),t&&(c==null?Qo(o.f,null,t):o2(o.i,c,t));e.p=o}return u(lo(e.p,n),179)}function Abe(e,n,t,i,r){var c,o,l,f,h;for(Ujn(i+$R(t,t.ge()),r),h_e(n,ljn(t)),c=t.f,c&&Abe(e,n,c,"Caused by: ",!1),l=(t.k==null&&(t.k=oe(tte,Ae,80,0,0,1)),t.k),f=0,h=l.length;f=0;c+=t?1:-1)o=o|n.c.jg(f,c,t,i&&!Re($e(T(n.j,(pe(),xb))))&&!Re($e(T(n.j,(pe(),r4))))),o=o|n.q.tg(f,c,t),o=o|jXe(e,f[c],t,i);return dr(e.c,n),o}function zz(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(b=FLe(e.j),p=0,y=b.length;p1&&(e.a=!0),jvn(u(t.b,68),gi(vc(u(n.b,68).c),q1(_r(vc(u(t.b,68).a),u(n.b,68).a),r))),YIe(e,n),RUe(e,t)}function BUe(e){var n,t,i,r,c,o,l;for(c=new L(e.a.a);c.a0&&c>0?o.p=n++:i>0?o.p=t++:c>0?o.p=r++:o.p=t++}yn(),Nr(e.j,new Lq)}function eDn(e){var n,t;t=null,n=u(Le(e.g,0),17);do{if(t=n.d.i,bi(t,(pe(),jf)))return u(T(t,jf),12).i;if(t.k!=(Bn(),Wi)&&ht(new Gn(Vn(Di(t).a.Jc(),new ee))))n=u(it(new Gn(Vn(Di(t).a.Jc(),new ee))),17);else if(t.k!=Wi)return null}while(t&&t.k!=(Bn(),Wi));return t}function nDn(e,n){var t,i,r,c,o,l,f,h,b;for(l=n.j,o=n.g,f=u(Le(l,l.c.length-1),113),b=(mn(0,l.c.length),u(l.c[0],113)),h=WY(e,o,f,b),c=1;ch&&(f=t,b=r,h=i);n.a=b,n.c=f}function w2(e,n,t,i){var r,c;if(r=ue(T(t,(Oe(),EM)))===ue((ib(),Rm)),c=u(T(t,R4e),16),bi(e,(pe(),Oi)))if(r){if(c.Gc(T(e,jM))&&c.Gc(T(n,jM)))return i*u(T(e,jM),15).a+u(T(e,Oi),15).a}else return u(T(e,Oi),15).a;else return-1;return u(T(e,Oi),15).a}function tDn(e,n,t){var i,r,c,o,l,f,h;for(h=new $d(new lje(e)),o=z(B(nin,1),cYe,12,0,[n,t]),l=0,f=o.length;lf-e.b&&lf-e.a&&lt.p?1:0:c.Ob()?1:-1}function fDn(e,n){var t,i,r,c,o,l;n.Tg(cWe,1),r=u(ve(e,(Ya(),XM)),104),c=(!e.a&&(e.a=new we(Bt,e,10,11)),e.a),o=NMn(c),l=k.Math.max(o.a,te(re(ve(e,(l1(),UM))))-(r.b+r.c)),i=k.Math.max(o.b,te(re(ve(e,KJ)))-(r.d+r.a)),t=i-o.b,Ei(e,qM,t),Ei(e,t6,l),Ei(e,W7,i+t),n.Ug()}function Fz(e){var n,t;if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i==0)return s1e(e);for(n=u(V((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170),yt((!n.a&&(n.a=new yr(Tl,n,5)),n.a)),vv(n,0),yv(n,0),pv(n,0),mv(n,0),t=(!e.a&&(e.a=new we($i,e,6,6)),e.a);t.i>1;)pm(t,t.i-1);return n}function Po(e,n){Cc();var t,i,r,c;return n?n==(ji(),bhn)||(n==thn||n==iw||n==nhn)&&e!=h7e?new Mge(e,n):(i=u(n,682),t=i.Yk(),t||(Y9(Kc((ds(),ic),n)),t=i.Yk()),c=(!t.i&&(t.i=new wt),t.i),r=u(bu(Xc(c.f,e)),2003),!r&&Zt(c,e,r=new Mge(e,n)),r):Wan}function aDn(e,n){var t,i;if(i=FC(e.b,n.b),!i)throw $(new Uc("Invalid hitboxes for scanline constraint calculation."));(vze(n.b,u(_gn(e.b,n.b),60))||vze(n.b,u(Dgn(e.b,n.b),60)))&&Rd(),e.a[n.b.f]=u(zX(e.b,n.b),60),t=u(BX(e.b,n.b),60),t&&(e.a[t.f]=n.b)}function hDn(e,n){var t,i,r,c,o,l,f,h,b;for(f=u(T(e,(pe(),pi)),12),h=mu(z(B($r,1),Ae,8,0,[f.i.n,f.n,f.a])).a,b=e.i.n.b,t=Sh(e.e),r=t,c=0,o=r.length;c0?c.a?(l=c.b.Kf().a,t>l&&(r=(t-l)/2,c.d.b=r,c.d.c=r)):c.d.c=e.s+t:dj(e.u)&&(i=p0e(c.b),i.c<0&&(c.d.b=-i.c),i.c+i.b>c.b.Kf().a&&(c.d.c=i.c+i.b-c.b.Kf().a))}function mDn(e,n){var t,i,r,c,o;o=new Te,t=n;do c=u(Rn(e.b,t),132),c.B=t.c,c.D=t.d,Hn(o.c,c),t=u(Rn(e.k,t),17);while(t);return i=(mn(0,o.c.length),u(o.c[0],132)),i.j=!0,i.A=u(i.d.a.ec().Jc().Pb(),17).c.i,r=u(Le(o,o.c.length-1),132),r.q=!0,r.C=u(r.d.a.ec().Jc().Pb(),17).d.i,o}function vDn(e){var n,t;t=u(T(e,(Oe(),ku)),165),n=u(T(e,(pe(),Jg)),315),t==(el(),bd)?(ae(e,ku,dD),ae(e,Jg,(Z1(),t4))):t==qg?(ae(e,ku,dD),ae(e,Jg,(Z1(),Gy))):n==(Z1(),t4)?(ae(e,ku,bd),ae(e,Jg,lD)):n==Gy&&(ae(e,ku,qg),ae(e,Jg,lD))}function Hz(){Hz=Y,SD=new ap,$on=Ht(new sr,(Hr(),eo),(Vr(),NH)),zon=jo(Ht(new sr,eo,BH),Pc,RH),Fon=xh(xh(RE(jo(Ht(new sr,ea,JH),Pc,HH),no),FH),GH),Ron=jo(Ht(Ht(Ht(new sr,p1,_H),no,LH),no,N7),Pc,IH),Bon=jo(Ht(Ht(new sr,no,N7),no,OH),Pc,CH)}function aS(){aS=Y,Gon=Ht(jo(new sr,(Hr(),Pc),(Vr(),F3e)),eo,NH),Von=xh(xh(RE(jo(Ht(new sr,ea,JH),Pc,HH),no),FH),GH),qon=jo(Ht(Ht(Ht(new sr,p1,_H),no,LH),no,N7),Pc,IH),Xon=Ht(Ht(new sr,eo,BH),Pc,RH),Uon=jo(Ht(Ht(new sr,no,N7),no,OH),Pc,CH)}function yDn(e,n,t,i,r){var c,o;(!sc(n)&&n.c.i.c==n.d.i.c||!ABe(mu(z(B($r,1),Ae,8,0,[r.i.n,r.n,r.a])),t))&&!sc(n)&&(n.c==r?R9(n.a,0,new mc(t)):Vt(n.a,new mc(t)),i&&!hf(e.a,t)&&(o=u(T(n,(Oe(),Wc)),78),o||(o=new Os,ae(n,Wc,o)),c=new mc(t),Vi(o,c,o.c.b,o.c),dr(e.a,c)))}function HUe(e,n){var t,i,r,c;for(c=Lt(bc(h1,c1(Lt(bc(n==null?0:Ni(n),d1)),15))),t=c&e.b.length-1,r=null,i=e.b[t];i;r=i,i=i.a)if(i.d==c&&X1(i.i,n))return r?r.a=i.a:e.b[t]=i.a,uAe(u(bf(i.c),593),u(bf(i.f),593)),WT(u(bf(i.b),227),u(bf(i.e),227)),--e.f,++e.e,!0;return!1}function kDn(e){var n,t;for(t=new Gn(Vn(or(e).a.Jc(),new ee));ht(t);)if(n=u(it(t),17),n.c.i.k!=(Bn(),Uu))throw $(new Id(cee+zO(e)+"' has its layer constraint set to FIRST, but has at least one incoming edge that does not come from a FIRST_SEPARATE node. That must not happen."))}function JUe(e,n){var t,i,r,c,o,l,f,h,b,p,y;r=n?new Aw:new fx,c=!1;do for(c=!1,h=n?nl(e.b):e.b,f=h.Jc();f.Ob();)for(l=u(f.Pb(),25),y=wg(l.a),n||nl(y),p=new L(y);p.a=0;o+=r?1:-1){for(l=n[o],f=i==(Ne(),Wn)?r?vu(l,i):nl(vu(l,i)):r?nl(vu(l,i)):vu(l,i),c&&(e.c[l.p]=f.gc()),p=f.Jc();p.Ob();)b=u(p.Pb(),12),e.d[b.p]=h++;Ar(t,f)}}function qUe(e,n,t){var i,r,c,o,l,f,h,b;for(c=te(re(e.b.Jc().Pb())),h=te(re(tkn(n.b))),i=q1(vc(e.a),h-t),r=q1(vc(n.a),t-c),b=gi(i,r),q1(b,1/(h-c)),this.a=b,this.b=new Te,l=!0,o=e.b.Jc(),o.Pb();o.Ob();)f=te(re(o.Pb())),l&&f-t>Kee&&(this.b.Ec(t),l=!1),this.b.Ec(f);l&&this.b.Ec(t)}function jDn(e){var n,t,i,r;if(z_n(e,e.n),e.d.c.length>0){for(TE(e.c);ube(e,u(I(new L(e.e.a)),124))>5,n&=31,i>=e.d)return e.e<0?(Ch(),enn):(Ch(),tM);if(c=e.d-i,r=oe(It,ei,30,c+1,15,1),xTn(r,c,e.a,i,n),e.e<0){for(t=0;t0&&e.a[t]<<32-n!=0){for(t=0;t=0?!1:(t=Lv((ds(),ic),r,n),t?(i=t.Gk(),(i>1||i==-1)&&Qw(Kc(ic,t))!=3):!0)):!1}function CDn(e,n,t,i){var r,c,o,l,f,h,b,p,y,S;if(f=e.c.d,h=e.d.d,f.j!=h.j)for(S=e.b,b=null,l=null,o=Gjn(e),o&&S.i&&(b=e.b.i.i,l=S.i.j),r=f.j,p=null;r!=h.j;)p=n==0?VB(r):U1e(r),c=Sde(r,S.d[r.g],t),y=Sde(p,S.d[p.g],t),o&&b&&l&&(r==b?RFe(c,b,l):p==b&&RFe(y,b,l)),Vt(i,gi(c,y)),r=p}function Cbe(e,n,t){var i,r,c,o,l,f;if(i=vgn(t,e.length),o=e[i],c=aAe(t,o.length),o[c].k==(Bn(),pr))for(f=n.j,r=0;r0&&(t[0]+=e.d,o-=t[0]),t[2]>0&&(t[2]+=e.d,o-=t[2]),c=k.Math.max(0,o),t[1]=k.Math.max(t[1],o),Qae(e,No,r.c+i.b+t[0]-(t[1]-o)/2,t),n==No&&(e.c.b=c,e.c.c=r.c+i.b+(c-o)/2)}function ZUe(){this.c=oe(Gr,Hc,30,(Ne(),z(B(Ac,1),qu,64,0,[Eu,Un,Wn,bt,Xn])).length,15,1),this.b=oe(Gr,Hc,30,z(B(Ac,1),qu,64,0,[Eu,Un,Wn,bt,Xn]).length,15,1),this.a=oe(Gr,Hc,30,z(B(Ac,1),qu,64,0,[Eu,Un,Wn,bt,Xn]).length,15,1),cse(this.c,Ki),cse(this.b,Ir),cse(this.a,Ir)}function LDn(e,n,t,i){var r,c,o,l,f;for(f=n.i,l=t[f.g][e.d[f.g]],r=!1,o=new L(n.d);o.a=r&&(e.c=!1,e.a=!1),e.b[i++]=r,e.b[i]=c,e.c||Nv(e)}}function PDn(e,n,t){var i,r,c,o,l,f,h;for(h=n.d,e.a=new Mo(h.c.length),e.c=new wt,l=new L(h);l.a=0?e.Ih(h,!1,!0):g2(e,t,!1),61));e:for(c=p.Jc();c.Ob();){for(r=u(c.Pb(),57),b=0;be.d[o.p]&&(t+=Hae(e.b,c),W0(e.a,me(c)));for(;!CE(e.a);)Ehe(e.b,u(U5(e.a),15).a)}return t}function tXe(e,n,t){var i,r,c,o;for(c=(!n.a&&(n.a=new we(Bt,n,10,11)),n.a).i,r=new ot((!n.a&&(n.a=new we(Bt,n,10,11)),n.a));r.e!=r.i.gc();)i=u(ft(r),26),(!i.a&&(i.a=new we(Bt,i,10,11)),i.a).i==0||(c+=tXe(e,i,!1));if(t)for(o=zi(n);o;)c+=(!o.a&&(o.a=new we(Bt,o,10,11)),o.a).i,o=zi(o);return c}function pm(e,n){var t,i,r,c;return e.Nj()?(i=null,r=e.Oj(),e.Rj()&&(i=e.Tj(e.Yi(n),null)),t=e.Gj(4,c=gy(e,n),null,n,r),e.Kj()&&c!=null&&(i=e.Mj(c,i)),i?(i.lj(t),i.mj()):e.Hj(t),c):(c=gy(e,n),e.Kj()&&c!=null&&(i=e.Mj(c,null),i&&i.mj()),c)}function JDn(e){var n,t,i,r,c,o,l,f,h,b;for(h=e.a,n=new hr,f=0,i=new L(e.d);i.al.d&&(b=l.d+l.a+h));t.c.d=b,n.a.yc(t,n),f=k.Math.max(f,t.c.d+t.c.a)}return f}function GDn(e,n,t){var i,r,c,o,l,f;for(o=u(T(e,(pe(),mie)),16).Jc();o.Ob();){switch(c=u(o.Pb(),9),u(T(c,(Oe(),ku)),165).g){case 2:Dr(c,n);break;case 4:Dr(c,t)}for(r=new Gn(Vn(Mh(c).a.Jc(),new ee));ht(r);)i=u(it(r),17),!(i.c&&i.d)&&(l=!i.d,f=u(T(i,Qve),12),l?Ur(i,f):hc(i,f))}}function Dc(){Dc=Y,tJ=new Op("COMMENTS",0),rf=new Op("EXTERNAL_PORTS",1),dM=new Op("HYPEREDGES",2),iJ=new Op("HYPERNODES",3),z7=new Op("NON_FREE_PORTS",4),n4=new Op("NORTH_SOUTH_PORTS",5),bM=new Op(jYe,6),R7=new Op("CENTER_LABELS",7),B7=new Op("END_LABELS",8),rJ=new Op("PARTITIONS",9)}function qDn(e,n,t,i,r){return i<0?(i=Ov(e,r,z(B(Be,1),Ae,2,6,[yZ,kZ,EZ,jZ,Ay,SZ,MZ,AZ,xZ,TZ,CZ,OZ]),n),i<0&&(i=Ov(e,r,z(B(Be,1),Ae,2,6,["Jan","Feb","Mar","Apr",Ay,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),n)),i<0?!1:(t.k=i,!0)):i>0?(t.k=i-1,!0):!1}function UDn(e,n,t,i,r){return i<0?(i=Ov(e,r,z(B(Be,1),Ae,2,6,[yZ,kZ,EZ,jZ,Ay,SZ,MZ,AZ,xZ,TZ,CZ,OZ]),n),i<0&&(i=Ov(e,r,z(B(Be,1),Ae,2,6,["Jan","Feb","Mar","Apr",Ay,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),n)),i<0?!1:(t.k=i,!0)):i>0?(t.k=i-1,!0):!1}function XDn(e,n,t,i,r,c){var o,l,f,h;if(l=32,i<0){if(n[0]>=e.length||(l=uc(e,n[0]),l!=43&&l!=45)||(++n[0],i=Nz(e,n),i<0))return!1;l==45&&(i=-i)}return l==32&&n[0]-t==2&&r.b==2&&(f=new o$,h=f.q.getFullYear()-pb+pb-80,o=h%100,c.a=i==o,i+=(h/100|0)*100+(i=0?sb(e):wj(sb(Ud(e)))),iM[n]=I$(i1(e,n),0)?sb(i1(e,n)):wj(sb(Ud(i1(e,n)))),e=bc(e,5);for(;n=h&&(f=i);f&&(b=k.Math.max(b,f.a.o.a)),b>y&&(p=h,y=b)}return p}function WDn(e){var n,t,i,r,c,o,l;for(c=new $d(u(Tt(new x0),51)),l=Ir,t=new L(e.d);t.aZYe?Nr(f,e.b):i<=ZYe&&i>eWe?Nr(f,e.d):i<=eWe&&i>nWe?Nr(f,e.c):i<=nWe&&Nr(f,e.a),c=uXe(e,f,c);return r}function oXe(e,n,t,i){var r,c,o,l,f,h;for(r=(i.c+i.a)/2,Ws(n.j),Vt(n.j,r),Ws(t.e),Vt(t.e,r),h=new lAe,l=new L(e.f);l.a1,l&&(i=new Ee(r,t.b),Vt(n.a,i)),Dj(n.a,z(B($r,1),Ae,8,0,[y,p]))}function Dbe(e,n,t){var i,r;for(n=48;t--)yA[t]=t-48<<24>>24;for(i=70;i>=65;i--)yA[i]=i-65+10<<24>>24;for(r=102;r>=97;r--)yA[r]=r-97+10<<24>>24;for(c=0;c<10;c++)_G[c]=48+c&Er;for(e=10;e<=15;e++)_G[e]=65+e-10&Er}function aXe(e,n){n.Tg("Process graph bounds",1),ae(e,(Ci(),mre),fC(qQ(Up(new wn(null,new pn(e.b,16)),new nU)))),ae(e,vre,fC(qQ(Up(new wn(null,new pn(e.b,16)),new Us)))),ae(e,pye,fC(GQ(Up(new wn(null,new pn(e.b,16)),new Mx)))),ae(e,mye,fC(GQ(Up(new wn(null,new pn(e.b,16)),new Ax)))),n.Ug()}function i_n(e){var n,t,i,r,c;r=u(T(e,(Oe(),Xg)),22),c=u(T(e,SJ),22),t=new Ee(e.f.a+e.d.b+e.d.c,e.f.b+e.d.d+e.d.a),n=new mc(t),r.Gc((tl(),u3))&&(i=u(T(e,J7),8),c.Gc((Bs(),ok))&&(i.a<=0&&(i.a=20),i.b<=0&&(i.b=20)),n.a=k.Math.max(t.a,i.a),n.b=k.Math.max(t.b,i.b)),Re($e(T(e,zie)))||CLn(e,t,n)}function r_n(e){var n,t,i,r,c,o,l;for(n=!1,t=0,r=new L(e.d.b);r.a>19!=0)return"-"+hXe(w8(e));for(t=e,i="";!(t.l==0&&t.m==0&&t.h==0);){if(r=fQ(oF),t=pge(t,r,!0),n=""+xAe(Eb),!(t.l==0&&t.m==0&&t.h==0))for(c=9-n.length;c>0;c--)n="0"+n;i=n+i}return i}function c_n(){if(!Object.create||!Object.getOwnPropertyNames)return!1;var e="__proto__",n=Object.create(null);if(n[e]!==void 0)return!1;var t=Object.getOwnPropertyNames(n);return!(t.length!=0||(n[e]=42,n[e]!==42)||Object.getOwnPropertyNames(n).length==0)}function u_n(e,n,t){var i,r,c,o,l,f,h,b,p;for(i=t.c,r=t.d,l=Ja(n.c),f=Ja(n.d),i==n.c?(l=mbe(e,l,r),f=dGe(n.d)):(l=dGe(n.c),f=mbe(e,f,r)),h=new QP(n.a),Vi(h,l,h.a,h.a.a),Vi(h,f,h.c.b,h.c),o=n.c==i,p=new nMe,c=0;c=e.a||!d0e(n,t))return-1;if(Qp(u(i.Kb(n),20)))return 1;for(r=0,o=u(i.Kb(n),20).Jc();o.Ob();)if(c=u(o.Pb(),17),f=c.c.i==n?c.d.i:c.c.i,l=Lbe(e,f,t,i),l==-1||(r=k.Math.max(r,l),r>e.c-1))return-1;return r+1}function Ya(){Ya=Y,YJ=new Wr((Gt(),Z7),1.3),jln=new Wr(n3,(Ln(),!1)),y6e=new Hw(15),XM=new Wr(y1,y6e),VM=new Wr(d0,15),vln=PD,Eln=Zg,Sln=y4,Mln=Ib,kln=v4,Xre=zD,Aln=t3,S6e=(ege(),wln),j6e=gln,Kre=mln,M6e=pln,v6e=hln,Vre=aln,m6e=fln,E6e=bln,w6e=BD,yln=mce,OD=oln,g6e=uln,ND=sln,k6e=dln,p6e=lln}function dXe(e,n){var t,i,r,c,o,l;if(ue(n)===ue(e))return!0;if(!X(n,16)||(i=u(n,16),l=e.gc(),i.gc()!=l))return!1;if(o=i.Jc(),e.Wi()){for(t=0;t0){if(e.Zj(),n!=null){for(c=0;c>24;case 97:case 98:case 99:case 100:case 101:case 102:return e-97+10<<24>>24;case 65:case 66:case 67:case 68:case 69:case 70:return e-65+10<<24>>24;default:throw $(new vh("Invalid hexadecimal"))}}function gXe(e,n,t,i){var r,c,o,l,f,h;for(f=rW(e,t),h=rW(n,t),r=!1;f&&h&&(i||hMn(f,h,t));)o=rW(f,t),l=rW(h,t),sO(n),sO(e),c=f.c,rZ(f,!1),rZ(h,!1),t?(lb(n,h.p,c),n.p=h.p,lb(e,f.p+1,c),e.p=f.p):(lb(e,f.p,c),e.p=f.p,lb(n,h.p+1,c),n.p=h.p),Dr(f,null),Dr(h,null),f=o,h=l,r=!0;return r}function wXe(e){switch(e.g){case 0:return new lP;case 1:return new fP;case 3:return new Mxe;case 4:return new H6;case 5:return new eNe;case 6:return new ko;case 2:return new aP;case 7:return new AT;case 8:return new MT;default:throw $(new Jn("No implementation is available for the layerer "+(e.f!=null?e.f:""+e.g)))}}function f_n(e,n,t,i){var r,c,o,l,f;for(r=!1,c=!1,l=new L(i.j);l.a=n.length)throw $(new Eo("Greedy SwitchDecider: Free layer not in graph."));this.c=n[e],this.e=new IC(i),BQ(this.e,this.c,(Ne(),Xn)),this.i=new IC(i),BQ(this.i,this.c,Wn),this.f=new MDe(this.c),this.a=!c&&r.i&&!r.s&&this.c[0].k==(Bn(),pr),this.a&&DTn(this,e,n.length)}function mXe(e,n){var t,i,r,c,o,l;c=!e.B.Gc((Bs(),YD)),o=e.B.Gc(Nce),e.a=new nHe(o,c,e.c),e.n&&oae(e.a.n,e.n),xX(e.g,(Sa(),No),e.a),n||(i=new Qj(1,c,e.c),i.n.a=e.k,X5(e.p,(Ne(),Un),i),r=new Qj(1,c,e.c),r.n.d=e.k,X5(e.p,bt,r),l=new Qj(0,c,e.c),l.n.c=e.k,X5(e.p,Xn,l),t=new Qj(0,c,e.c),t.n.b=e.k,X5(e.p,Wn,t))}function h_n(e){var n,t,i;switch(n=u(T(e.d,(Oe(),gd)),222),n.g){case 2:t=eBn(e);break;case 3:t=(i=new Te,tr(oi(So(lu(lu(new wn(null,new pn(e.d.b,16)),new jw),new rI),new xk),new D0),new BEe(i)),i);break;default:throw $(new Uc("Compaction not supported for "+n+" edges."))}SPn(e,t),oc(new tt(e.g),new LEe(e))}function d_n(e,n){var t,i,r,c,o,l,f;if(n.Tg("Process directions",1),t=u(T(e,(Tu(),J2)),86),t!=(kr(),sh))for(r=jt(e.b,0);r.b!=r.d.c;){switch(i=u(kt(r),40),l=u(T(i,(Ci(),xD)),15).a,f=u(T(i,TD),15).a,t.g){case 4:f*=-1;break;case 1:c=l,l=f,f=c;break;case 2:o=l,l=-f,f=o}ae(i,xD,me(l)),ae(i,TD,me(f))}n.Ug()}function b_n(e){var n,t,i,r,c,o,l,f;for(f=new LPe,l=new L(e.a);l.a0&&n=0)return!1;if(n.p=t.b,xe(t.e,n),r==(Bn(),br)||r==wo){for(o=new L(n.j);o.ae.d[l.p]&&(t+=Hae(e.b,c),W0(e.a,me(c)))):++o;for(t+=e.b.d*o;!CE(e.a);)Ehe(e.b,u(U5(e.a),15).a)}return t}function CXe(e){var n,t,i,r,c,o;return c=0,n=mf(e),n.ik()&&(c|=4),(e.Bb&gs)!=0&&(c|=2),X(e,103)?(t=u(e,19),r=Oc(t),(t.Bb&Bu)!=0&&(c|=32),r&&(dt(Vp(r)),c|=8,o=r.t,(o>1||o==-1)&&(c|=16),(r.Bb&Bu)!=0&&(c|=64)),(t.Bb&Sc)!=0&&(c|=gb),c|=Yf):X(n,459)?c|=512:(i=n.ik(),i&&(i.i&1)!=0&&(c|=256)),(e.Bb&512)!=0&&(c|=128),c}function A_n(e,n){var t;return e.f==qce?(t=Qw(Kc((ds(),ic),n)),e.e?t==4&&n!=(yy(),b6)&&n!=(yy(),d6)&&n!=(yy(),Uce)&&n!=(yy(),Xce):t==2):e.d&&(e.d.Gc(n)||e.d.Gc(W5(Kc((ds(),ic),n)))||e.d.Gc(Lv((ds(),ic),e.b,n)))?!0:e.f&&kbe((ds(),e.f),GC(Kc(ic,n)))?(t=Qw(Kc(ic,n)),e.e?t==4:t==2):!1}function x_n(e,n){var t,i,r,c,o,l,f,h;for(c=new Te,n.b.c.length=0,t=u(ys(Eae(new wn(null,new pn(new tt(e.a.b),1))),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),16),r=t.Jc();r.Ob();)if(i=u(r.Pb(),15),o=Lae(e.a,i),o.b!=0)for(l=new Xu(n),Hn(c.c,l),l.p=i.a,h=jt(o,0);h.b!=h.d.c;)f=u(kt(h),9),Dr(f,l);Ar(n.b,c)}function PW(e){var n,t,i,r,c,o,l;for(l=new wt,i=new L(e.a.b);i.aPg&&(r-=Pg),l=u(ve(i,o6),8),h=l.a,p=l.b+e,c=k.Math.atan2(p,h),c<0&&(c+=Pg),c+=n,c>Pg&&(c-=Pg),Ba(),qf(1e-10),k.Math.abs(r-c)<=1e-10||r==c||isNaN(r)&&isNaN(c)?0:rc?1:ug(isNaN(r),isNaN(c))}function zbe(e,n,t,i){var r,c,o;n&&(c=te(re(T(n,(Ci(),a0))))+i,o=t+te(re(T(n,FJ)))/2,ae(n,xD,me(Lt(Pu(k.Math.round(c))))),ae(n,TD,me(Lt(Pu(k.Math.round(o))))),n.d.b==0||zbe(e,u(F$((r=jt(new J1(n).a.d,0),new X3(r))),40),t+te(re(T(n,FJ)))+e.b,i+te(re(T(n,Y7)))),T(n,kre)!=null&&zbe(e,u(T(n,kre),40),t,i))}function N_n(e,n){var t,i,r,c;if(c=u(ve(e,(Gt(),k4)),64).g-u(ve(n,k4),64).g,c!=0)return c;if(t=u(ve(e,jce),15),i=u(ve(n,jce),15),t&&i&&(r=t.a-i.a,r!=0))return r;switch(u(ve(e,k4),64).g){case 1:return ki(e.i,n.i);case 2:return ki(e.j,n.j);case 3:return ki(n.i,e.i);case 4:return ki(n.j,e.j);default:throw $(new Uc(hwe))}}function Fbe(e){var n,t,i;return(e.Db&64)!=0?wW(e):(n=new fl($pe),t=e.k,t?Xt(Xt((n.a+=' "',n),t),'"'):(!e.n&&(e.n=new we(ju,e,1,7)),e.n.i>0&&(i=(!e.n&&(e.n=new we(ju,e,1,7)),u(V(e.n,0),157)).a,!i||Xt(Xt((n.a+=' "',n),i),'"'))),Xt(Rw(Xt(Rw(Xt(Rw(Xt(Rw((n.a+=" (",n),e.i),","),e.j)," | "),e.g),","),e.f),")"),n.a)}function OXe(e){var n,t,i;return(e.Db&64)!=0?wW(e):(n=new fl(Rpe),t=e.k,t?Xt(Xt((n.a+=' "',n),t),'"'):(!e.n&&(e.n=new we(ju,e,1,7)),e.n.i>0&&(i=(!e.n&&(e.n=new we(ju,e,1,7)),u(V(e.n,0),157)).a,!i||Xt(Xt((n.a+=' "',n),i),'"'))),Xt(Rw(Xt(Rw(Xt(Rw(Xt(Rw((n.a+=" (",n),e.i),","),e.j)," | "),e.g),","),e.f),")"),n.a)}function D_n(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;for(S=-1,A=0,b=n,p=0,y=b.length;p0&&++A;++S}return A}function __n(e,n){var t,i,r,c,o;for(n==(zj(),ore)&&VO(u(mi(e.a,(am(),rD)),16)),r=u(mi(e.a,(am(),rD)),16).Jc();r.Ob();)switch(i=u(r.Pb(),107),t=u(Le(i.j,0),113).d.j,c=new vs(i.j),Nr(c,new X4),n.g){case 2:lW(e,c,t,(c2(),Ab),1);break;case 1:case 0:o=jNn(c),lW(e,new Y0(c,0,o),t,(c2(),Ab),0),lW(e,new Y0(c,o,c.c.length),t,Ab,1)}}function I_n(e){var n,t,i,r,c,o,l;for(r=u(T(e,(pe(),P2)),9),i=e.j,t=(mn(0,i.c.length),u(i.c[0],12)),o=new L(r.j);o.ar.p?(Tr(c,bt),c.d&&(l=c.o.b,n=c.a.b,c.a.b=l-n)):c.j==bt&&r.p>e.p&&(Tr(c,Un),c.d&&(l=c.o.b,n=c.a.b,c.a.b=-(l-n)));break}return r}function Hbe(e,n){var t,i,r,c,o,l,f;if(n==null||n.length==0)return null;if(r=u(lo(e.a,n),144),!r){for(i=(l=new ut(e.b).a.vc().Jc(),new Hi(l));i.a.Ob();)if(t=(c=u(i.a.Pb(),45),u(c.kd(),144)),o=t.c,f=n.length,bn(o.substr(o.length-f,f),n)&&(n.length==o.length||uc(o,o.length-n.length-1)==46)){if(r)return null;r=t}r&&Vc(e.a,n,r)}return r}function J8(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(c=new Ee(n,t),b=new L(e.a);b.a1,l&&(i=new Ee(r,t.b),Vt(n.a,i)),Dj(n.a,z(B($r,1),Ae,8,0,[y,p]))}function db(){db=Y,NJ=new Np(xa,0),yD=new Np("NIKOLOV",1),kD=new Np("NIKOLOV_PIXEL",2),L5e=new Np("NIKOLOV_IMPROVED",3),P5e=new Np("NIKOLOV_IMPROVED_PIXEL",4),I5e=new Np("DUMMYNODE_PERCENTAGE",5),$5e=new Np("NODECOUNT_PERCENTAGE",6),DJ=new Np("NO_BOUNDARY",7),V7=new Np("MODEL_ORDER_LEFT_TO_RIGHT",8),DM=new Np("MODEL_ORDER_RIGHT_TO_LEFT",9)}function RW(e,n){var t,i,r,c,o,l,f,h,b,p,y,S;return b=null,y=abe(e,n),i=null,l=u(ve(n,(Gt(),Sfn)),300),l?i=l:i=(Oj(),VD),S=i,S==(Oj(),VD)&&(r=null,h=u(Rn(e.r,y),300),h?r=h:r=Oce,S=r),Zt(e.r,n,S),c=null,f=u(ve(n,jfn),278),f?c=f:c=(E8(),HD),p=c,p==(E8(),HD)&&(o=null,t=u(Rn(e.b,y),278),t?o=t:o=aG,p=o),b=u(Zt(e.b,n,p),278),b}function q_n(e){var n,t,i,r,c;for(i=e.length,n=new OE,c=0;c=40,o&&GIn(e),tPn(e),jDn(e),t=_Fe(e),i=0;t&&i0&&Vt(e.g,c)):(e.d[o]-=h+1,e.d[o]<=0&&e.a[o]>0&&Vt(e.f,c))))}function JXe(e,n,t,i){var r,c,o,l,f,h,b;for(f=new Ee(t,i),_r(f,u(T(n,(Ci(),Q7)),8)),b=jt(n.b,0);b.b!=b.d.c;)h=u(kt(b),40),gi(h.e,f),Vt(e.b,h);for(l=u(ys(vae(new wn(null,new pn(n.a,16))),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),16).Jc();l.Ob();){for(o=u(l.Pb(),65),c=jt(o.a,0);c.b!=c.d.c;)r=u(kt(c),8),r.a+=f.a,r.b+=f.b;Vt(e.a,o)}}function Qbe(e,n){var t,i,r,c;if(0<(X(e,18)?u(e,18).gc():ya(e.Jc()))){if(r=n,1=0&&f1)&&n==1&&u(e.a[e.b],9).k==(Bn(),Uu)?jy(u(e.a[e.b],9),(ml(),k1)):i&&(!t||(e.c-e.b&e.a.length-1)>1)&&n==1&&u(e.a[e.c-1&e.a.length-1],9).k==(Bn(),Uu)?jy(u(e.a[e.c-1&e.a.length-1],9),(ml(),Lb)):(e.c-e.b&e.a.length-1)==2?(jy(u($j(e),9),(ml(),k1)),jy(u($j(e),9),Lb)):HOn(e,r),Bae(e)}function sIn(e){var n,t,i,r,c,o,l,f;for(f=new wt,n=new pX,o=e.Jc();o.Ob();)r=u(o.Pb(),9),l=Jw(uC(new tg,r),n),Qo(f.f,r,l);for(c=e.Jc();c.Ob();)for(r=u(c.Pb(),9),i=new Gn(Vn(Di(r).a.Jc(),new ee));ht(i);)t=u(it(i),17),!sc(t)&&Kf($f(Pf(Lf(Rf(new af,k.Math.max(1,u(T(t,(Oe(),b5e)),15).a)),1),u(Rn(f,t.c.i),124)),u(Rn(f,t.d.i),124)));return n}function UXe(e,n,t,i){var r,c,o,l,f,h,b,p,y,S;if(B8n(e,n,t),c=n[t],S=i?(Ne(),Xn):(Ne(),Wn),l2n(n.length,t,i)){for(r=n[i?t-1:t+1],ihe(e,r,i?(Nc(),Do):(Nc(),Ms)),f=c,b=0,y=f.length;bc*2?(b=new mB(p),h=fs(o)/Ys(o),f=sZ(b,n,new E5,t,i,r,h),gi(ma(b.e),f),p.c.length=0,c=0,Hn(p.c,b),Hn(p.c,o),c=fs(b)*Ys(b)+fs(o)*Ys(o)):(Hn(p.c,o),c+=fs(o)*Ys(o));return p}function fIn(e,n){var t,i,r,c,o,l,f;for(n.Tg("Port order processing",1),f=u(T(e,(Oe(),d5e)),421),i=new L(e.b);i.at?n:t;h<=p;++h)h==t?l=i++:(c=r[h],b=A.$l(c.Jk()),h==n&&(f=h==p&&!b?i-1:i),b&&++i);return y=u(Uj(e,n,t),75),l!=f&&S9(e,new oO(e.e,7,o,me(l),S.kd(),f)),y}}else return u(SW(e,n,t),75);return u(Uj(e,n,t),75)}function Ybe(e,n){var t,i,r,c,o,l,f,h,b,p;for(p=0,c=new uv,W0(c,n);c.b!=c.c;)for(f=u(U5(c),218),h=0,b=u(T(n.j,(Oe(),v1)),269),u(T(n.j,EM),329),o=te(re(T(n.j,bD))),l=te(re(T(n.j,Tie))),b!=(ud(),Ob)&&(h+=o*KOn(n.j,f.e,b),h+=l*D_n(n.j,f.e)),p+=gJe(f.d,f.e)+h,r=new L(f.b);r.a=0&&(l=MMn(e,o),!(l&&(h<22?f.l|=1<>>1,o.m=b>>>1|(p&1)<<21,o.l=y>>>1|(b&1)<<21,--h;return t&&nY(f),c&&(i?(Eb=w8(e),r&&(Eb=kze(Eb,(u8(),Eme)))):Eb=Io(e.l,e.m,e.h)),f}function dIn(e,n){var t,i,r,c,o,l,f,h,b,p;for(h=e.e[n.c.p][n.p]+1,f=n.c.a.c.length+1,l=new L(e.a);l.a0&&(Kn(0,e.length),e.charCodeAt(0)==45||(Kn(0,e.length),e.charCodeAt(0)==43))?1:0,i=o;it)throw $(new vh(k2+e+'"'));return l}function bIn(e){var n,t,i,r,c,o,l;for(o=new Mi,c=new L(e.a);c.a=e.length)return t.o=0,!0;switch(uc(e,n[0])){case 43:r=1;break;case 45:r=-1;break;default:return t.o=0,!0}if(++n[0],c=n[0],o=Nz(e,n),o==0&&n[0]==c)return!1;if(n[0]l&&(l=r,b.c.length=0),r==l&&xe(b,new jc(t.c.i,t)));yn(),Nr(b,e.c),og(e.b,f.p,b)}}function yIn(e,n){var t,i,r,c,o,l,f,h,b;for(o=new L(n.b);o.al&&(l=r,b.c.length=0),r==l&&xe(b,new jc(t.d.i,t)));yn(),Nr(b,e.c),og(e.f,f.p,b)}}function kIn(e){var n,t,i,r,c,o,l;for(c=Ha(e),r=new ot((!e.e&&(e.e=new Tn(mr,e,7,4)),e.e));r.e!=r.i.gc();)if(i=u(ft(r),85),l=ru(u(V((!i.c&&(i.c=new Tn(mt,i,5,8)),i.c),0),84)),!em(l,c))return!0;for(t=new ot((!e.d&&(e.d=new Tn(mr,e,8,5)),e.d));t.e!=t.i.gc();)if(n=u(ft(t),85),o=ru(u(V((!n.b&&(n.b=new Tn(mt,n,4,7)),n.b),0),84)),!em(o,c))return!0;return!1}function EIn(e){var n,t,i,r,c;i=u(T(e,(pe(),pi)),26),c=u(ve(i,(Oe(),Xg)),182).Gc((tl(),nw)),e.e||(r=u(T(e,po),22),n=new Ee(e.f.a+e.d.b+e.d.c,e.f.b+e.d.d+e.d.a),r.Gc((Dc(),rf))?(Ei(i,Zi,(Fr(),to)),m2(i,n.a,n.b,!1,!0)):Re($e(ve(i,zie)))||m2(i,n.a,n.b,!0,!0)),c?Ei(i,Xg,nn(nw)):Ei(i,Xg,(t=u(pa(fA),10),new Jl(t,u(zf(t,t.length),10),0)))}function jIn(e,n){var t,i,r,c,o,l,f,h;if(h=$e(T(n,(Tu(),psn))),h==null||(Nn(h),h)){for(WCn(e,n),r=new Te,f=jt(n.b,0);f.b!=f.d.c;)o=u(kt(f),40),t=L0e(e,o,null),t&&($u(t,n),Hn(r.c,t));if(e.a=null,e.b=null,r.c.length>1)for(i=new L(r);i.a=0&&l!=t&&(c=new Lr(e,1,l,o,null),i?i.lj(c):i=c),t>=0&&(c=new Lr(e,1,t,l==t?o:null,n),i?i.lj(c):i=c)),i}function VXe(e){var n,t,i;if(e.b==null){if(i=new Ld,e.i!=null&&(Bc(i,e.i),i.a+=":"),(e.f&256)!=0){for((e.f&256)!=0&&e.a!=null&&(P4n(e.i)||(i.a+="//"),Bc(i,e.a)),e.d!=null&&(i.a+="/",Bc(i,e.d)),(e.f&16)!=0&&(i.a+="/"),n=0,t=e.j.length;ny?!1:(p=(f=mS(i,y,!1),f.a),b+l+p<=n.b&&(cO(t,c-t.s),t.c=!0,cO(i,c-t.s),RO(i,t.s,t.t+t.d+l),i.k=!0,t1e(t.q,i),S=!0,r&&(SB(n,i),i.j=n,e.c.length>o&&(HO((mn(o,e.c.length),u(e.c[o],186)),i),(mn(o,e.c.length),u(e.c[o],186)).a.c.length==0&&Gd(e,o)))),S)}function OIn(e,n){var t,i,r,c,o,l;if(n.Tg("Partition midprocessing",1),r=new Zw,tr(oi(new wn(null,new pn(e.a,16)),new D6),new vEe(r)),r.d!=0){for(l=u(ys(Eae((c=r.i,new wn(null,(c||(r.i=new sv(r,r.c))).Lc()))),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),16),i=l.Jc(),t=u(i.Pb(),15);i.Ob();)o=u(i.Pb(),15),ENn(u(mi(r,t),22),u(mi(r,o),22)),t=o;n.Ug()}}function bS(e,n){var t,i,r,c,o;if(e.Ab){if(e.Ab){if(o=e.Ab.i,o>0){if(r=u(e.Ab.g,1995),n==null){for(c=0;ct.s&&lf+A&&(N=p.g+y.g,y.a=(y.g*y.a+p.g*p.a)/N,y.g=N,p.f=y,t=!0)),c=l,p=y;return t}function _In(e,n,t){var i,r,c,o,l,f,h,b;for(t.Tg(HYe,1),Ju(e.b),Ju(e.a),l=null,c=jt(n.b,0);!l&&c.b!=c.d.c;)h=u(kt(c),40),Re($e(T(h,(Ci(),_b))))&&(l=h);for(f=new Mi,Vi(f,l,f.c.b,f.c),xKe(e,f),b=jt(n.b,0);b.b!=b.d.c;)h=u(kt(b),40),o=_t(T(h,(Ci(),FM))),r=lo(e.b,o)!=null?u(lo(e.b,o),15).a:0,ae(h,pre,me(r)),i=1+(lo(e.a,o)!=null?u(lo(e.a,o),15).a:0),ae(h,wye,me(i));t.Ug()}function eVe(e){Cp(e,new d2(xp(Sp(Ap(Mp(new Nd,x2),"ELK Box"),"Algorithm for packing of unconnected boxes, i.e. graphs without edges."),new Kx))),Me(e,x2,Am,b9e),Me(e,x2,Mm,15),Me(e,x2,TN,me(0)),Me(e,x2,Tpe,Ie(a9e)),Me(e,x2,zv,Ie(afn)),Me(e,x2,Dy,Ie(hfn)),Me(e,x2,u7,hWe),Me(e,x2,OS,Ie(h9e)),Me(e,x2,_y,Ie(d9e)),Me(e,x2,Cpe,Ie(ace)),Me(e,x2,_F,Ie(ffn))}function nVe(e,n){var t,i,r,c,o,l,f,h,b;if(r=e.i,o=r.o.a,c=r.o.b,o<=0&&c<=0)return Ne(),Eu;switch(h=e.n.a,b=e.n.b,l=e.o.a,t=e.o.b,n.g){case 2:case 1:if(h<0)return Ne(),Xn;if(h+l>o)return Ne(),Wn;break;case 4:case 3:if(b<0)return Ne(),Un;if(b+t>c)return Ne(),bt}return f=(h+l/2)/o,i=(b+t/2)/c,f+i<=1&&f-i<=0?(Ne(),Xn):f+i>=1&&f-i>=0?(Ne(),Wn):i<.5?(Ne(),Un):(Ne(),bt)}function tVe(e,n,t,i,r,c,o){var l,f,h,b,p,y;for(y=new L5,h=n.Jc();h.Ob();)for(l=u(h.Pb(),837),p=new L(l.Pf());p.a0?l.a?(h=l.b.Kf().b,r>h&&(e.v||l.c.d.c.length==1?(o=(r-h)/2,l.d.d=o,l.d.a=o):(t=u(Le(l.c.d,0),187).Kf().b,i=(t-h)/2,l.d.d=k.Math.max(0,i),l.d.a=r-i-h))):l.d.a=e.t+r:dj(e.u)&&(c=p0e(l.b),c.d<0&&(l.d.d=-c.d),c.d+c.a>l.b.Kf().b&&(l.d.a=c.d+c.a-l.b.Kf().b))}function Qf(){Qf=Y,Fy=new Wr((Gt(),FD),me(1)),SH=new Wr(d0,80),ytn=new Wr(G9e,5),ftn=new Wr(Z7,c7),mtn=new Wr(Mce,me(1)),vtn=new Wr(Ace,(Ln(),!0)),r3e=new Hw(50),wtn=new Wr(y1,r3e),n3e=BD,c3e=tA,atn=new Wr(gce,!1),i3e=zD,btn=n3,gtn=Ib,dtn=Zg,htn=v4,ptn=t3,t3e=(x0e(),itn),jte=otn,jH=ttn,Ete=rtn,u3e=utn,jtn=tk,Stn=lG,Etn=r3,ktn=nk,o3e=(fy(),o3),new Wr(l6,o3e)}function PIn(e,n){var t;switch(bO(e)){case 6:return Br(n);case 7:return _p(n);case 8:return Dp(n);case 3:return Array.isArray(n)&&(t=bO(n),!(t>=14&&t<=16));case 11:return n!=null&&typeof n===dZ;case 12:return n!=null&&(typeof n===dN||typeof n==dZ);case 0:return RY(n,e.__elementTypeId$);case 2:return vK(n)&&n.Rm!==et;case 1:return vK(n)&&n.Rm!==et||RY(n,e.__elementTypeId$);default:return!0}}function $In(e){var n,t,i,r;i=e.o,$p(),e.A.dc()||di(e.A,Qme)?r=i.a:(e.D?r=k.Math.max(i.a,cS(e.f)):r=cS(e.f),e.A.Gc((tl(),KD))&&!e.B.Gc((Bs(),aA))&&(r=k.Math.max(r,cS(u(zc(e.p,(Ne(),Un)),253))),r=k.Math.max(r,cS(u(zc(e.p,bt),253)))),n=YBe(e),n&&(r=k.Math.max(r,n.a))),Re($e(e.e.Rf().mf((Gt(),n3))))?i.a=k.Math.max(i.a,r):i.a=r,t=e.f.i,t.c=0,t.b=r,qW(e.f)}function iVe(e,n){var t,i,r,c;return i=k.Math.min(k.Math.abs(e.c-(n.c+n.b)),k.Math.abs(e.c+e.b-n.c)),c=k.Math.min(k.Math.abs(e.d-(n.d+n.a)),k.Math.abs(e.d+e.a-n.d)),t=k.Math.abs(e.c+e.b/2-(n.c+n.b/2)),t>e.b/2+n.b/2||(r=k.Math.abs(e.d+e.a/2-(n.d+n.a/2)),r>e.a/2+n.a/2)?1:t==0&&r==0?0:t==0?c/r+1:r==0?i/t+1:k.Math.min(i/t,c/r)+1}function RIn(e,n){var t,i,r,c,o,l,f;for(c=0,l=0,f=0,r=new L(e.f.e);r.a0&&e.d!=(Tj(),Ate)&&(l+=o*(i.d.a+e.a[n.a][i.a]*(n.d.a-i.d.a)/t)),t>0&&e.d!=(Tj(),Ste)&&(f+=o*(i.d.b+e.a[n.a][i.a]*(n.d.b-i.d.b)/t)));switch(e.d.g){case 1:return new Ee(l/c,n.d.b);case 2:return new Ee(n.d.a,f/c);default:return new Ee(l/c,f/c)}}function rVe(e){var n,t,i,r,c,o;for(t=(!e.a&&(e.a=new yr(Tl,e,5)),e.a).i+2,o=new Mo(t),xe(o,new Ee(e.j,e.k)),tr(new wn(null,(!e.a&&(e.a=new yr(Tl,e,5)),new pn(e.a,16))),new Wje(o)),xe(o,new Ee(e.b,e.c)),n=1;n0&&(AO(f,!1,(kr(),Zc)),AO(f,!0,cu)),Ao(n.g,new Qxe(e,t)),Zt(e.g,n,t)}function ege(){ege=Y,dln=new fn(ope,(Ln(),!1)),me(-1),uln=new fn(spe,me(-1)),me(-1),oln=new fn(lpe,me(-1)),sln=new fn(fpe,!1),lln=new fn(ape,!1),b6e=(eB(),Qre),pln=new fn(hpe,b6e),mln=new fn(dpe,-1),d6e=(WB(),Ure),wln=new fn(bpe,d6e),gln=new fn(gpe,!0),a6e=(lB(),Yre),hln=new fn(wpe,a6e),aln=new fn(ppe,!1),me(1),fln=new fn(mpe,me(1)),h6e=(XB(),Wre),bln=new fn(vpe,h6e)}function oVe(){oVe=Y;var e;for(Ome=z(B(It,1),ei,30,15,[-1,-1,30,19,15,13,11,11,10,9,9,8,8,8,8,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5]),ute=oe(It,ei,30,37,15,1),Yen=z(B(It,1),ei,30,15,[-1,-1,63,40,32,28,25,23,21,20,19,19,18,18,17,17,16,16,16,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13,13,13,13]),Nme=oe(V2,yQe,30,37,14,1),e=2;e<=36;e++)ute[e]=ac(k.Math.pow(e,Ome[e])),Nme[e]=GO(pN,ute[e])}function BIn(e){var n;if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i!=1)throw $(new Jn(PWe+(!e.a&&(e.a=new we($i,e,6,6)),e.a).i));return n=new Os,QQ(u(V((!e.b&&(e.b=new Tn(mt,e,4,7)),e.b),0),84))&&dc(n,qKe(e,QQ(u(V((!e.b&&(e.b=new Tn(mt,e,4,7)),e.b),0),84)),!1)),QQ(u(V((!e.c&&(e.c=new Tn(mt,e,5,8)),e.c),0),84))&&dc(n,qKe(e,QQ(u(V((!e.c&&(e.c=new Tn(mt,e,5,8)),e.c),0),84)),!0)),n}function sVe(e,n){var t,i,r,c,o;for(n.d?r=e.a.c==(Eh(),H2)?or(n.b):Di(n.b):r=e.a.c==(Eh(),f0)?or(n.b):Di(n.b),c=!1,i=new Gn(Vn(r.a.Jc(),new ee));ht(i);)if(t=u(it(i),17),o=Re(e.a.f[e.a.g[n.b.p].p]),!(!o&&!sc(t)&&t.c.i.c==t.d.i.c)&&!(Re(e.a.n[e.a.g[n.b.p].p])||Re(e.a.n[e.a.g[n.b.p].p]))&&(c=!0,hf(e.b,e.a.g[sMn(t,n.b).p])))return n.c=!0,n.a=t,n;return n.c=c,n.a=null,n}function nge(e,n,t){var i,r,c,o,l,f,h;if(i=t.gc(),i==0)return!1;if(e.Nj())if(f=e.Oj(),sde(e,n,t),o=i==1?e.Gj(3,null,t.Jc().Pb(),n,f):e.Gj(5,null,t,n,f),e.Kj()){for(l=i<100?null:new F0(i),c=n+i,r=n;r0){for(o=0;o>16==-15&&e.Cb.Vh()&&SQ(new vQ(e.Cb,9,13,t,e.c,Zd(Is(u(e.Cb,62)),e))):X(e.Cb,88)&&e.Db>>16==-23&&e.Cb.Vh()&&(n=e.c,X(n,88)||(n=(vn(),Of)),X(t,88)||(t=(vn(),Of)),SQ(new vQ(e.Cb,9,10,t,n,Zd(Ku(u(e.Cb,29)),e)))))),e.c}function aVe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A;if(n==t)return!0;if(n=cbe(e,n),t=cbe(e,t),i=qY(n),i){if(b=qY(t),b!=i)return b?(f=i.kk(),A=b.kk(),f==A&&f!=null):!1;if(o=(!n.d&&(n.d=new yr(Rc,n,1)),n.d),c=o.i,y=(!t.d&&(t.d=new yr(Rc,t,1)),t.d),c==y.i){for(h=0;h0,l=YB(n,c),lle(t?l.b:l.g,n),jv(l).c.length==1&&Vi(i,l,i.c.b,i.c),r=new jc(c,n),W0(e.o,r),Xo(e.e.a,c))}function bVe(e,n){var t,i,r,c,o,l,f;return i=k.Math.abs(ER(e.b).a-ER(n.b).a),l=k.Math.abs(ER(e.b).b-ER(n.b).b),r=0,f=0,t=1,o=1,i>e.b.b/2+n.b.b/2&&(r=k.Math.min(k.Math.abs(e.b.c-(n.b.c+n.b.b)),k.Math.abs(e.b.c+e.b.b-n.b.c)),t=1-r/i),l>e.b.a/2+n.b.a/2&&(f=k.Math.min(k.Math.abs(e.b.d-(n.b.d+n.b.a)),k.Math.abs(e.b.d+e.b.a-n.b.d)),o=1-f/l),c=k.Math.min(t,o),(1-c)*k.Math.sqrt(i*i+l*l)}function qIn(e){var n,t,i,r;for(oZ(e,e.e,e.f,(e2(),Db),!0,e.c,e.i),oZ(e,e.e,e.f,Db,!1,e.c,e.i),oZ(e,e.e,e.f,h4,!0,e.c,e.i),oZ(e,e.e,e.f,h4,!1,e.c,e.i),HIn(e,e.c,e.e,e.f,e.i),i=new Xr(e.i,0);i.b=65;t--)dh[t]=t-65<<24>>24;for(i=122;i>=97;i--)dh[i]=i-97+26<<24>>24;for(r=57;r>=48;r--)dh[r]=r-48+52<<24>>24;for(dh[43]=62,dh[47]=63,c=0;c<=25;c++)y0[c]=65+c&Er;for(o=26,f=0;o<=51;++o,f++)y0[o]=97+f&Er;for(e=52,l=0;e<=61;++e,l++)y0[e]=48+l&Er;y0[62]=43,y0[63]=47}function gVe(e,n){var t,i,r,c,o,l;return r=Yhe(e),l=Yhe(n),r==l?e.e==n.e&&e.a<54&&n.a<54?e.fn.f?1:0:(i=e.e-n.e,t=(e.d>0?e.d:k.Math.floor((e.a-1)*kQe)+1)-(n.d>0?n.d:k.Math.floor((n.a-1)*kQe)+1),t>i+1?r:t0&&(o=dv(o,xVe(i))),wHe(c,o))):rh&&(y=0,S+=f+n,f=0),J8(o,y,S),t=k.Math.max(t,y+b.a),f=k.Math.max(f,b.b),y+=b.a+n;return new Ee(t+n,S+f+n)}function cge(e,n){var t,i,r,c,o,l,f;if(!Ha(e))throw $(new Uc(LWe));if(i=Ha(e),c=i.g,r=i.f,c<=0&&r<=0)return Ne(),Eu;switch(l=e.i,f=e.j,n.g){case 2:case 1:if(l<0)return Ne(),Xn;if(l+e.g>c)return Ne(),Wn;break;case 4:case 3:if(f<0)return Ne(),Un;if(f+e.f>r)return Ne(),bt}return o=(l+e.g/2)/c,t=(f+e.f/2)/r,o+t<=1&&o-t<=0?(Ne(),Xn):o+t>=1&&o-t>=0?(Ne(),Wn):t<.5?(Ne(),Un):(Ne(),bt)}function VIn(e,n,t,i,r){var c,o;if(c=yc(zr(n[0],_c),zr(i[0],_c)),e[0]=Lt(c),c=Uw(c,32),t>=r){for(o=1;o0&&(r.b[o++]=0,r.b[o++]=c.b[0]-1),n=1;n0&&(eg(f,f.d-r.d),r.c==(ka(),Nb)&&rX(f,f.a-r.d),f.d<=0&&f.i>0&&Vi(n,f,n.c.b,n.c)));for(c=new L(e.f);c.a0&&(R0(l,l.i-r.d),r.c==(ka(),Nb)&&NP(l,l.b-r.d),l.i<=0&&l.d>0&&Vi(t,l,t.c.b,t.c)))}function YIn(e,n,t,i,r){var c,o,l,f,h,b,p,y,S;for(yn(),Nr(e,new Wx),o=$C(e),S=new Te,y=new Te,l=null,f=0;o.b!=0;)c=u(o.b==0?null:(at(o.b!=0),Ul(o,o.a.a)),167),!l||fs(l)*Ys(l)/21&&(f>fs(l)*Ys(l)/2||o.b==0)&&(p=new mB(y),b=fs(l)/Ys(l),h=sZ(p,n,new E5,t,i,r,b),gi(ma(p.e),h),l=p,Hn(S.c,p),f=0,y.c.length=0));return Ar(S,y),S}function Wu(e,n,t,i,r){Rd();var c,o,l,f,h,b,p;if($fe(e,"src"),$fe(t,"dest"),p=Zs(e),f=Zs(t),lfe((p.i&4)!=0,"srcType is not an array"),lfe((f.i&4)!=0,"destType is not an array"),b=p.c,o=f.c,lfe((b.i&1)!=0?b==o:(o.i&1)==0,"Array types don't match"),Ekn(e,n,t,i,r),(b.i&1)==0&&p!=f)if(h=cy(e),c=cy(t),ue(e)===ue(t)&&ni;)cr(c,l,h[--n]);else for(l=i+r;i0),i.a.Xb(i.c=--i.b),p>y+f&&Ns(i);for(o=new L(S);o.a0),i.a.Xb(i.c=--i.b)}}function ZIn(){fi();var e,n,t,i,r,c;if(Kce)return Kce;for(e=new dl(4),ym(e,bb(Xne,!0)),kS(e,bb("M",!0)),kS(e,bb("C",!0)),c=new dl(4),i=0;i<11;i++)ho(c,i,i);return n=new dl(4),ym(n,bb("M",!0)),ho(n,4448,4607),ho(n,65438,65439),r=new tj(2),Ng(r,e),Ng(r,EA),t=new tj(2),t.Hm(wR(c,bb("L",!0))),t.Hm(n),t=new Yp(3,t),t=new Bfe(r,t),Kce=t,Kce}function vm(e,n){var t,i,r,c,o,l,f,h;for(t=new RegExp(n,"g"),f=oe(Be,Ae,2,0,6,1),i=0,h=e,c=null;;)if(l=t.exec(h),l==null||h==""){f[i]=h;break}else o=l.index,f[i]=(Zr(0,o,h.length),h.substr(0,o)),h=gf(h,o+l[0].length,h.length),t.lastIndex=0,c==h&&(f[i]=(Zr(0,1,h.length),h.substr(0,1)),h=(Kn(1,h.length+1),h.substr(1))),c=h,++i;if(e.length>0){for(r=f.length;r>0&&f[r-1]=="";)--r;rb&&(b=f);for(h=k.Math.pow(4,n),b>h&&(h=b),y=(k.Math.log(h)-k.Math.log(1))/n,c=k.Math.exp(y),r=c,o=0;o0&&(p-=i[0]+e.c,i[0]+=e.c),i[2]>0&&(p-=i[2]+e.c),i[1]=k.Math.max(i[1],p),mR(e.a[1],t.c+n.b+i[0]-(i[1]-p)/2,i[1]);for(c=e.a,l=0,h=c.length;l0?(e.n.c.length-1)*e.i:0,i=new L(e.n);i.a1)for(i=jt(r,0);i.b!=i.d.c;)for(t=u(kt(i),235),c=0,f=new L(t.e);f.a0&&(n[0]+=e.c,p-=n[0]),n[2]>0&&(p-=n[2]+e.c),n[1]=k.Math.max(n[1],p),vR(e.a[1],i.d+t.d+n[0]-(n[1]-p)/2,n[1]);else for(A=i.d+t.d,S=i.a-t.d-t.a,o=e.a,f=0,b=o.length;f=n.o&&t.f<=n.f||n.a*.5<=t.f&&n.a*1.5>=t.f){if(o=u(Le(n.n,n.n.c.length-1),208),o.e+o.d+t.g+r<=i&&(c=u(Le(n.n,n.n.c.length-1),208),c.f-e.f+t.f<=e.b||e.a.c.length==1))return Z1e(n,t),!0;if(n.s+t.g<=i&&n.t+n.d+t.f+r<=e.f+e.b)return xe(n.b,t),l=u(Le(n.n,n.n.c.length-1),208),xe(n.n,new FR(n.s,l.f+l.a+n.i,n.i)),Dde(u(Le(n.n,n.n.c.length-1),208),t),mVe(n,t),!0}return!1}function Vz(e,n,t,i){var r,c,o,l,f;if(f=Po(e.e.Ah(),n),r=u(e.g,122),Cc(),u(n,69).vk()){for(o=0;o0||s2(r.b.d,e.b.d+e.b.a)==0&&i.b<0||s2(r.b.d+r.b.a,e.b.d)==0&&i.b>0){l=0;break}}else l=k.Math.min(l,sqe(e,r,i));l=k.Math.min(l,yVe(e,c,l,i))}return l}function oge(e,n){var t,i,r,c,o,l,f;if(e.b<2)throw $(new Jn("The vector chain must contain at least a source and a target point."));for(r=(at(e.b!=0),u(e.a.a.c,8)),SC(n,r.a,r.b),f=new $5((!n.a&&(n.a=new yr(Tl,n,5)),n.a)),o=jt(e,1);o.a=0&&c!=t))throw $(new Jn(HN));for(r=0,f=0;fte(za(o.g,o.d[0]).a)?(at(f.b>0),f.a.Xb(f.c=--f.b),Rp(f,o),r=!0):l.e&&l.e.gc()>0&&(c=(!l.e&&(l.e=new Te),l.e).Kc(n),h=(!l.e&&(l.e=new Te),l.e).Kc(t),(c||h)&&((!l.e&&(l.e=new Te),l.e).Ec(o),++o.c));r||Hn(i.c,o)}function sLn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R;return p=e.a.i+e.a.g/2,y=e.a.i+e.a.g/2,A=n.i+n.g/2,_=n.j+n.f/2,l=new Ee(A,_),h=u(ve(n,(Gt(),o6)),8),h.a=h.a+p,h.b=h.b+y,c=(l.b-h.b)/(l.a-h.a),i=l.b-c*l.a,N=t.i+t.g/2,R=t.j+t.f/2,f=new Ee(N,R),b=u(ve(t,o6),8),b.a=b.a+p,b.b=b.b+y,o=(f.b-b.b)/(f.a-b.a),r=f.b-o*f.a,S=(i-r)/(o-c),h.a>>0,"0"+n.toString(16)),i="\\x"+gf(t,t.length-2,t.length)):e>=Sc?(t=(n=e>>>0,"0"+n.toString(16)),i="\\v"+gf(t,t.length-6,t.length)):i=""+String.fromCharCode(e&Er)}return i}function MVe(e,n){var t,i,r,c,o,l,f,h,b;for(c=new L(e.b);c.at){n.Ug();return}switch(u(T(e,(Oe(),qie)),350).g){case 2:c=new B6;break;case 0:c=new up;break;default:c=new hx}if(i=c.mg(e,r),!c.ng())switch(u(T(e,AJ),351).g){case 2:i=lqe(r,i);break;case 1:i=ZJe(r,i)}lPn(e,r,i),n.Ug()}function gS(e,n){var t,i,r,c,o,l,f,h;n%=24,e.q.getHours()!=n&&(i=new k.Date(e.q.getTime()),i.setDate(i.getDate()+1),l=e.q.getTimezoneOffset()-i.getTimezoneOffset(),l>0&&(f=l/60|0,h=l%60,r=e.q.getDate(),t=e.q.getHours(),t+f>=24&&++r,c=new k.Date(e.q.getFullYear(),e.q.getMonth(),r,n+f,e.q.getMinutes()+h,e.q.getSeconds(),e.q.getMilliseconds()),e.q.setTime(c.getTime()))),o=e.q.getTime(),e.q.setTime(o+36e5),e.q.getHours()!=n&&e.q.setTime(o)}function gLn(e,n){var t,i,r,c;if(K5n(e.d,e.e),e.c.a.$b(),te(re(T(n.j,(Oe(),bD))))!=0||te(re(T(n.j,bD)))!=0)for(t=Hv,ue(T(n.j,v1))!==ue((ud(),Ob))&&ae(n.j,(pe(),xb),(Ln(),!0)),c=u(T(n.j,CM),15).a,r=0;rr&&++h,xe(o,(mn(l+h,n.c.length),u(n.c[l+h],15))),f+=(mn(l+h,n.c.length),u(n.c[l+h],15)).a-i,++t;t=_&&e.e[f.p]>A*e.b||K>=t*_)&&(Hn(y.c,l),l=new Te,dc(o,c),c.a.$b(),h-=b,S=k.Math.max(S,h*e.b+N),h+=K,U=K,K=0,b=0,N=0);return new jc(S,y)}function XW(e){var n,t,i,r,c,o,l;if(!e.d){if(l=new bU,n=wA,c=n.a.yc(e,n),c==null){for(i=new ot(iu(e));i.e!=i.i.gc();)t=u(ft(i),29),ir(l,XW(t));n.a.Ac(e)!=null,n.a.gc()==0}for(o=l.i,r=(!e.q&&(e.q=new we(Tf,e,11,10)),new ot(e.q));r.e!=r.i.gc();++o)u(ft(r),403);ir(l,(!e.q&&(e.q=new we(Tf,e,11,10)),e.q)),cm(l),e.d=new nv((u(V(ge((V0(),$n).o),9),19),l.i),l.g),e.e=u(l.g,678),e.e==null&&(e.e=Xan),Ds(e).b&=-17}return e.d}function q8(e,n,t,i){var r,c,o,l,f,h;if(h=Po(e.e.Ah(),n),f=0,r=u(e.g,122),Cc(),u(n,69).vk()){for(o=0;o1||A==-1)if(p=u(N,72),y=u(b,72),p.dc())y.$b();else for(o=!!Oc(n),c=0,l=e.a?p.Jc():p.Gi();l.Ob();)h=u(l.Pb(),57),r=u(qa(e,h),57),r?(o?(f=y.bd(r),f==-1?y.Ei(c,r):c!=f&&y.Si(c,r)):y.Ei(c,r),++c):e.b&&!o&&(y.Ei(c,h),++c);else N==null?b.Wb(null):(r=qa(e,N),r==null?e.b&&!Oc(n)&&b.Wb(N):b.Wb(r))}function yLn(e,n){var t,i,r,c,o,l,f,h;for(t=new O6,r=new Gn(Vn(or(n).a.Jc(),new ee));ht(r);)if(i=u(it(r),17),!sc(i)&&(l=i.c.i,d0e(l,TH))){if(h=Lbe(e,l,TH,xH),h==-1)continue;t.b=k.Math.max(t.b,h),!t.a&&(t.a=new Te),xe(t.a,l)}for(o=new Gn(Vn(Di(n).a.Jc(),new ee));ht(o);)if(c=u(it(o),17),!sc(c)&&(f=c.d.i,d0e(f,xH))){if(h=Lbe(e,f,xH,TH),h==-1)continue;t.d=k.Math.max(t.d,h),!t.c&&(t.c=new Te),xe(t.c,f)}return t}function kLn(e,n,t,i){var r,c,o,l,f,h,b;if(t.d.i!=n.i){for(r=new Va(e),If(r,(Bn(),br)),ae(r,(pe(),pi),t),ae(r,(Oe(),Zi),(Fr(),to)),Hn(i.c,r),o=new Yu,wu(o,r),Tr(o,(Ne(),Xn)),l=new Yu,wu(l,r),Tr(l,Wn),b=t.d,Ur(t,o),c=new Ww,$u(c,t),ae(c,Wc,null),hc(c,l),Ur(c,b),h=new Xr(t.b,0);h.b1e6)throw $(new UP("power of ten too big"));if(e<=ui)return ey(WO(Ry[1],n),n);for(i=WO(Ry[1],ui),r=i,t=Pu(e-ui),n=ac(e%ui);ao(t,ui)>0;)r=dv(r,i),t=pf(t,ui);for(r=dv(r,WO(Ry[1],n)),r=ey(r,ui),t=Pu(e-ui);ao(t,ui)>0;)r=ey(r,ui),t=pf(t,ui);return r=ey(r,n),r}function TVe(e){var n,t,i,r,c,o,l,f,h,b;for(f=new L(e.a);f.ah&&i>h)b=l,h=te(n.p[l.p])+te(n.d[l.p])+l.o.b+l.d.a;else{r=!1,t.$g()&&t.ah("bk node placement breaks on "+l+" which should have been after "+b);break}if(!r)break}return t.$g()&&t.ah(n+" is feasible: "+r),r}function fge(e,n,t,i){var r,c,o,l,f,h,b,p,y;if(c=new Va(e),If(c,(Bn(),wo)),ae(c,(Oe(),Zi),(Fr(),to)),r=0,n){for(o=new Yu,ae(o,(pe(),pi),n),ae(c,pi,n.i),Tr(o,(Ne(),Xn)),wu(o,c),y=Sh(n.e),h=y,b=0,p=h.length;b0){if(r<0&&b.a&&(r=f,c=h[0],i=0),r>=0){if(l=b.b,f==r&&(l-=i++,l==0))return 0;if(!OKe(n,h,b,l,o)){f=r-1,h[0]=c;continue}}else if(r=-1,!OKe(n,h,b,0,o))return 0}else{if(r=-1,uc(b.c,0)==32){if(p=h[0],ERe(n,h),h[0]>p)continue}else if(u5n(n,b.c,h[0])){h[0]+=b.c.length;continue}return 0}return bRn(o,t)?h[0]:0}function ALn(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(b=new kR(new Qke(t)),l=oe(rs,Aa,30,e.f.e.c.length,16,1),Pfe(l,l.length),t[n.a]=0,h=new L(e.f.e);h.a=l.a?c.b>=l.b?(i.a=l.a+(c.a-l.a)/2+r,i.b=l.b+(c.b-l.b)/2-r-e.e.b):(i.a=l.a+(c.a-l.a)/2+r,i.b=c.b+(l.b-c.b)/2+r):c.b>=l.b?(i.a=c.a+(l.a-c.a)/2+r,i.b=l.b+(c.b-l.b)/2+r):(i.a=c.a+(l.a-c.a)/2+r,i.b=c.b+(l.b-c.b)/2-r-e.e.b))}function pS(e){var n,t,i,r,c,o,l,f;if(!e.f){if(f=new uT,l=new uT,n=wA,o=n.a.yc(e,n),o==null){for(c=new ot(iu(e));c.e!=c.i.gc();)r=u(ft(c),29),ir(f,pS(r));n.a.Ac(e)!=null,n.a.gc()==0}for(i=(!e.s&&(e.s=new we(is,e,21,17)),new ot(e.s));i.e!=i.i.gc();)t=u(ft(i),179),X(t,103)&&Et(l,u(t,19));cm(l),e.r=new tDe(e,(u(V(ge((V0(),$n).o),6),19),l.i),l.g),ir(f,e.r),cm(f),e.f=new nv((u(V(ge($n.o),5),19),f.i),f.g),Ds(e).b&=-3}return e.f}function Kz(){Kz=Y,$8e=z(B(sf,1),Dh,30,15,[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70]),jan=new RegExp(`[ -\r\f]+`);try{dA=z(B(azn,1),xn,2076,0,[new YT((Pse(),tz("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ",DC((JP(),JP(),eM))))),new YT(tz("yyyy-MM-dd'T'HH:mm:ss'.'SSS",DC(eM))),new YT(tz("yyyy-MM-dd'T'HH:mm:ss",DC(eM))),new YT(tz("yyyy-MM-dd'T'HH:mm",DC(eM))),new YT(tz("yyyy-MM-dd",DC(eM)))])}catch(e){if(e=lr(e),!X(e,80))throw $(e)}}function xLn(e){var n,t,i,r,c,o,l;for(t=null,l=null,i=u(T(e.b,(Oe(),Iie)),348),i==(zj(),ED)&&(t=new Te,l=new Te),o=new L(e.d);o.at);return c}function OVe(e,n){var t,i,r,c;if(r=Rs(e.d,1)!=0,i=Oz(e,n),i==0&&Re($e(T(n.j,(pe(),xb)))))return 0;!Re($e(T(n.j,(pe(),xb))))&&!Re($e(T(n.j,r4)))||ue(T(n.j,(Oe(),v1)))===ue((ud(),Ob))?n.c.kg(n.e,r):r=Re($e(T(n.j,xb))),iN(e,n,r,!0),Re($e(T(n.j,r4)))&&ae(n.j,r4,(Ln(),!1)),Re($e(T(n.j,xb)))&&(ae(n.j,xb,(Ln(),!1)),ae(n.j,r4,!0)),t=Oz(e,n);do{if(Qhe(e),t==0)return 0;r=!r,c=t,iN(e,n,r,!1),t=Oz(e,n)}while(c>t);return c}function CLn(e,n,t){var i,r,c,o,l;if(i=u(T(e,(Oe(),Nie)),22),t.a>n.a&&(i.Gc((Cg(),WM))?e.c.a+=(t.a-n.a)/2:i.Gc(ZM)&&(e.c.a+=t.a-n.a)),t.b>n.b&&(i.Gc((Cg(),nA))?e.c.b+=(t.b-n.b)/2:i.Gc(eA)&&(e.c.b+=t.b-n.b)),u(T(e,(pe(),po)),22).Gc((Dc(),rf))&&(t.a>n.a||t.b>n.b))for(l=new L(e.a);l.an.a&&(i.Gc((Cg(),WM))?e.c.a+=(t.a-n.a)/2:i.Gc(ZM)&&(e.c.a+=t.a-n.a)),t.b>n.b&&(i.Gc((Cg(),nA))?e.c.b+=(t.b-n.b)/2:i.Gc(eA)&&(e.c.b+=t.b-n.b)),u(T(e,(pe(),po)),22).Gc((Dc(),rf))&&(t.a>n.a||t.b>n.b))for(o=new L(e.a);o.a=0&&p<=1&&y>=0&&y<=1?gi(new Ee(e.a,e.b),q1(new Ee(n.a,n.b),p)):null}function mS(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(c=0,o=e.t,r=0,i=0,f=0,y=0,p=0,t&&(e.n.c.length=0,xe(e.n,new FR(e.s,e.t,e.i))),l=0,b=new L(e.b);b.a0?e.i:0)>n&&f>0&&(c=0,o+=f+e.i,r=k.Math.max(r,y),i+=f+e.i,f=0,y=0,t&&(++p,xe(e.n,new FR(e.s,o,e.i))),l=0),y+=h.g+(l>0?e.i:0),f=k.Math.max(f,h.f),t&&Dde(u(Le(e.n,p),208),h),c+=h.g+(l>0?e.i:0),++l;return r=k.Math.max(r,y),i+=f,t&&(e.r=r,e.d=i,Lde(e.j)),new Ff(e.s,e.t,r,i)}function Qz(e){var n,t,i;return t=ue(ve(e,(Oe(),e6)))===ue((ZO(),tie))||ue(ve(e,e6))===ue(Yte)||ue(ve(e,e6))===ue(Wte)||ue(ve(e,e6))===ue(eie)||ue(ve(e,e6))===ue(iie)||ue(ve(e,e6))===ue(uD),i=ue(ve(e,vJ))===ue((nN(),Xie))||ue(ve(e,vJ))===ue(Kie)||ue(ve(e,wD))===ue((db(),V7))||ue(ve(e,wD))===ue((db(),DM)),n=ue(ve(e,v1))!==ue((ud(),Ob))||Re($e(ve(e,H7)))||ue(ve(e,kM))!==ue((dy(),oM))||te(re(ve(e,bD)))!=0||te(re(ve(e,Tie)))!=0,t||i||n}function Iv(e){var n,t,i,r,c,o,l,f;if(!e.a){if(e.o=null,f=new ISe(e),n=new _f,t=wA,l=t.a.yc(e,t),l==null){for(o=new ot(iu(e));o.e!=o.i.gc();)c=u(ft(o),29),ir(f,Iv(c));t.a.Ac(e)!=null,t.a.gc()==0}for(r=(!e.s&&(e.s=new we(is,e,21,17)),new ot(e.s));r.e!=r.i.gc();)i=u(ft(r),179),X(i,335)&&Et(n,u(i,38));cm(n),e.k=new nDe(e,(u(V(ge((V0(),$n).o),7),19),n.i),n.g),ir(f,e.k),cm(f),e.a=new nv((u(V(ge($n.o),4),19),f.i),f.g),Ds(e).b&=-2}return e.a}function DLn(e){var n,t,i,r,c,o,l,f,h,b,p,y;if(l=e.d,p=u(T(e,(pe(),Wy)),16),n=u(T(e,qy),16),!(!p&&!n)){if(c=te(re(sm(e,(Oe(),Fie)))),o=te(re(sm(e,g5e))),y=0,p){for(h=0,r=p.Jc();r.Ob();)i=u(r.Pb(),9),h=k.Math.max(h,i.o.b),y+=i.o.a;y+=c*(p.gc()-1),l.d+=h+o}if(t=0,n){for(h=0,r=n.Jc();r.Ob();)i=u(r.Pb(),9),h=k.Math.max(h,i.o.b),t+=i.o.a;t+=c*(n.gc()-1),l.a+=h+o}f=k.Math.max(y,t),f>e.o.a&&(b=(f-e.o.a)/2,l.b=k.Math.max(l.b,b),l.c=k.Math.max(l.c,b))}}function dge(e,n,t,i){var r,c,o,l,f,h,b;if(b=Po(e.e.Ah(),n),r=0,c=u(e.g,122),f=null,Cc(),u(n,69).vk()){for(l=0;ll?1:-1:A1e(e.a,n.a,c),r==-1)p=-f,b=o==f?dQ(n.a,l,e.a,c):gQ(n.a,l,e.a,c);else if(p=o,o==f){if(r==0)return Ch(),tM;b=dQ(e.a,c,n.a,l)}else b=gQ(e.a,c,n.a,l);return h=new ag(p,b.length,b),Ej(h),h}function LLn(e,n){var t,i,r,c;if(c=wVe(n),!n.c&&(n.c=new we(Hs,n,9,9)),tr(new wn(null,(!n.c&&(n.c=new we(Hs,n,9,9)),new pn(n.c,16))),new eEe(c)),r=u(T(c,(pe(),po)),22),N$n(n,r),r.Gc((Dc(),rf)))for(i=new ot((!n.c&&(n.c=new we(Hs,n,9,9)),n.c));i.e!=i.i.gc();)t=u(ft(i),125),tRn(e,n,c,t);return u(ve(n,(Oe(),Xg)),182).gc()!=0&&iXe(n,c),Re($e(T(c,f5e)))&&r.Ec(rJ),bi(c,pD)&&XMe(new nde(te(re(T(c,pD)))),c),ue(ve(n,Fm))===ue((rd(),b0))?SBn(e,n,c):sRn(e,n,c),c}function bo(e,n){var t,i,r,c,o,l,f;if(e==null)return null;if(c=e.length,c==0)return"";for(f=oe(sf,Dh,30,c,15,1),Zr(0,c,e.length),Zr(0,c,f.length),e_e(e,0,c,f,0),t=null,l=n,r=0,o=0;r0?gf(t.a,0,c-1):""):(Zr(0,c-1,e.length),e.substr(0,c-1)):t?t.a:e}function PLn(e,n,t){var i,r,c;if(bi(n,(Oe(),ku))&&(ue(T(n,ku))===ue((el(),bd))||ue(T(n,ku))===ue(qg))||bi(t,ku)&&(ue(T(t,ku))===ue((el(),bd))||ue(T(t,ku))===ue(qg)))return 0;if(i=Pr(n),r=S_n(e,n,t),r!=0)return r;if(bi(n,(pe(),Oi))&&bi(t,Oi)){if(c=oo(w2(n,t,i,u(T(i,Tb),15).a),w2(t,n,i,u(T(i,Tb),15).a)),ue(T(i,EM))===ue((ib(),sD))&&ue(T(n,jM))!==ue(T(t,jM))&&(c=0),c<0)return rN(e,n,t),c;if(c>0)return rN(e,t,n),c}return YCn(e,n,t)}function NVe(e,n){var t,i,r,c,o,l,f,h,b,p,y;for(i=new Gn(Vn(hb(n).a.Jc(),new ee));ht(i);)t=u(it(i),85),X(V((!t.b&&(t.b=new Tn(mt,t,4,7)),t.b),0),193)||(f=ru(u(V((!t.c&&(t.c=new Tn(mt,t,5,8)),t.c),0),84)),oS(t)||(o=n.i+n.g/2,l=n.j+n.f/2,b=f.i+f.g/2,p=f.j+f.f/2,y=new Yr,y.a=b-o,y.b=p-l,c=new Ee(y.a,y.b),_8(c,n.g,n.f),y.a-=c.a,y.b-=c.b,o=b-y.a,l=p-y.b,h=new Ee(y.a,y.b),_8(h,f.g,f.f),y.a-=h.a,y.b-=h.b,b=o+y.a,p=l+y.b,r=Fz(t),vv(r,o),yv(r,l),pv(r,b),mv(r,p),NVe(e,f)))}function ym(e,n){var t,i,r,c,o;if(o=u(n,137),Nv(e),Nv(o),o.b!=null){if(e.c=!0,e.b==null){e.b=oe(It,ei,30,o.b.length,15,1),Wu(o.b,0,e.b,0,o.b.length);return}for(c=oe(It,ei,30,e.b.length+o.b.length,15,1),t=0,i=0,r=0;t=e.b.length?(c[r++]=o.b[i++],c[r++]=o.b[i++]):i>=o.b.length?(c[r++]=e.b[t++],c[r++]=e.b[t++]):o.b[i]0?e.i:0)),++n;for(X1e(e.n,f),e.d=t,e.r=i,e.g=0,e.f=0,e.e=0,e.o=Ki,e.p=Ki,c=new L(e.b);c.a0&&(r=(!e.n&&(e.n=new we(ju,e,1,7)),u(V(e.n,0),157)).a,!r||Xt(Xt((n.a+=' "',n),r),'"'))),t=(!e.b&&(e.b=new Tn(mt,e,4,7)),!(e.b.i<=1&&(!e.c&&(e.c=new Tn(mt,e,5,8)),e.c.i<=1))),t?n.a+=" [":n.a+=" ",Xt(n,ele(new _X,new ot(e.b))),t&&(n.a+="]"),n.a+=tee,t&&(n.a+="["),Xt(n,ele(new _X,new ot(e.c))),t&&(n.a+="]"),n.a)}function RLn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn;for(de=e.c,fe=n.c,t=pu(de.a,e,0),i=pu(fe.a,n,0),K=u(l2(e,(Nc(),Ms)).Jc().Pb(),12),tn=u(l2(e,Do).Jc().Pb(),12),ie=u(l2(n,Ms).Jc().Pb(),12),Mn=u(l2(n,Do).Jc().Pb(),12),R=Sh(K.e),_e=Sh(tn.g),U=Sh(ie.e),cn=Sh(Mn.g),lb(e,i,fe),o=U,b=0,A=o.length;b0&&f[i]&&(A=cv(e.b,f[i],r)),N=k.Math.max(N,r.c.c.b+A);for(c=new L(b.e);c.ab?new gg((ka(),Ym),t,n,h-b):h>0&&b>0&&(new gg((ka(),Ym),n,t,0),new gg(Ym,t,n,0))),o)}function HLn(e,n,t){var i,r,c;for(e.a=new Te,c=jt(n.b,0);c.b!=c.d.c;){for(r=u(kt(c),40);u(T(r,(Tu(),Hh)),15).a>e.a.c.length-1;)xe(e.a,new jc(Hv,z2e));i=u(T(r,Hh),15).a,t==(kr(),Zc)||t==cu?(r.e.ate(re(u(Le(e.a,i),49).b))&&UT(u(Le(e.a,i),49),r.e.a+r.f.a)):(r.e.bte(re(u(Le(e.a,i),49).b))&&UT(u(Le(e.a,i),49),r.e.b+r.f.b))}}function IVe(e,n,t,i){var r,c,o,l,f,h,b;if(c=KB(i),l=Re($e(T(i,(Oe(),r5e)))),(l||Re($e(T(e,mJ))))&&!tv(u(T(e,Zi),102)))r=ay(c),f=Zbe(e,t,t==(Nc(),Do)?r:IO(r));else switch(f=new Yu,wu(f,e),n?(b=f.n,b.a=n.a-e.n.a,b.b=n.b-e.n.b,LGe(b,0,0,e.o.a,e.o.b),Tr(f,nVe(f,c))):(r=ay(c),Tr(f,t==(Nc(),Do)?r:IO(r))),o=u(T(i,(pe(),po)),22),h=f.j,c.g){case 2:case 1:(h==(Ne(),Un)||h==bt)&&o.Ec((Dc(),n4));break;case 4:case 3:(h==(Ne(),Wn)||h==Xn)&&o.Ec((Dc(),n4))}return f}function LVe(e,n){var t,i,r,c,o,l;for(o=new im(new sn(e.f.b).a);o.b;){if(c=kv(o),r=u(c.jd(),591),n==1){if(r.yf()!=(kr(),cf)&&r.yf()!=sh)continue}else if(r.yf()!=(kr(),Zc)&&r.yf()!=cu)continue;switch(i=u(u(c.kd(),49).b,82),l=u(u(c.kd(),49).a,194),t=l.c,r.yf().g){case 2:i.g.c=e.e.a,i.g.b=k.Math.max(1,i.g.b+t);break;case 1:i.g.c=i.g.c+t,i.g.b=k.Math.max(1,i.g.b-t);break;case 4:i.g.d=e.e.b,i.g.a=k.Math.max(1,i.g.a+t);break;case 3:i.g.d=i.g.d+t,i.g.a=k.Math.max(1,i.g.a-t)}}}function JLn(e,n){var t,i,r,c,o,l,f,h,b,p;for(n.Tg("Simple node placement",1),p=u(T(e,(pe(),c4)),316),l=0,c=new L(e.b);c.a1)throw $(new Jn(XN));f||(c=u1(n,i.Jc().Pb()),o.Ec(c))}return a1e(e,D0e(e,n,t),o)}function Wz(e,n,t){var i,r,c,o,l,f,h,b;if(od(e.e,n))f=(Cc(),u(n,69).vk()?new lR(n,e):new EC(n,e)),Dz(f.c,f.b),ij(f,u(t,18));else{for(b=Po(e.e.Ah(),n),i=u(e.g,122),o=0;o"}f!=null&&(n.a+=""+f)}else e.e?(l=e.e.zb,l!=null&&(n.a+=""+l)):(n.a+="?",e.b?(n.a+=" super ",WW(e.b,n)):e.f&&(n.a+=" extends ",WW(e.f,n)))}function QLn(e){e.b=null,e.a=null,e.o=null,e.q=null,e.v=null,e.w=null,e.B=null,e.p=null,e.Q=null,e.R=null,e.S=null,e.T=null,e.U=null,e.V=null,e.W=null,e.bb=null,e.eb=null,e.ab=null,e.H=null,e.db=null,e.c=null,e.d=null,e.f=null,e.n=null,e.r=null,e.s=null,e.u=null,e.G=null,e.J=null,e.e=null,e.j=null,e.i=null,e.g=null,e.k=null,e.t=null,e.F=null,e.I=null,e.L=null,e.M=null,e.O=null,e.P=null,e.$=null,e.N=null,e.Z=null,e.cb=null,e.K=null,e.D=null,e.A=null,e.C=null,e._=null,e.fb=null,e.X=null,e.Y=null,e.gb=!1,e.hb=!1}function YLn(e){var n,t,i,r;if(i=aZ((!e.c&&(e.c=QC(Pu(e.f))),e.c),0),e.e==0||e.a==0&&e.f!=-1&&e.e<0)return i;if(n=Yhe(e)<0?1:0,t=e.e,r=(i.length+1+k.Math.abs(ac(e.e)),new x5),n==1&&(r.a+="-"),e.e>0)if(t-=i.length-n,t>=0){for(r.a+="0.";t>Hg.length;t-=Hg.length)EDe(r,Hg);VOe(r,Hg,ac(t)),Xt(r,(Kn(n,i.length+1),i.substr(n)))}else t=n-t,Xt(r,gf(i,n,ac(t))),r.a+=".",Xt(r,Gfe(i,ac(t)));else{for(Xt(r,(Kn(n,i.length+1),i.substr(n)));t<-Hg.length;t+=Hg.length)EDe(r,Hg);VOe(r,Hg,ac(-t))}return r.a}function ZW(e){var n,t,i,r,c,o,l,f,h;return!(e.k!=(Bn(),Wi)||e.j.c.length<=1||(c=u(T(e,(Oe(),Zi)),102),c==(Fr(),to))||(r=(fm(),(e.q?e.q:(yn(),yn(),w1))._b(z2)?i=u(T(e,z2),203):i=u(T(Pr(e),xM),203),i),r==OJ)||!(r==a4||r==f4)&&(o=te(re(sm(e,TM))),n=u(T(e,vD),140),!n&&(n=new Ple(o,o,o,o)),h=vu(e,(Ne(),Xn)),f=n.d+n.a+(h.gc()-1)*o,f>e.o.b||(t=vu(e,Wn),l=n.d+n.a+(t.gc()-1)*o,l>e.o.b)))}function WLn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_;n.Tg("Orthogonal edge routing",1),h=te(re(T(e,(Oe(),Km)))),t=te(re(T(e,Xm))),i=te(re(T(e,Cb))),y=new SK(0,t),_=0,o=new Xr(e.b,0),l=null,b=null,f=null,p=null;do b=o.b0?(S=(A-1)*t,l&&(S+=i),b&&(S+=i),S0;for(l=u(T(e.c.i,Jm),15).a,c=u(ys(oi(n.Mc(),new kEe(l)),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),16),o=new Mi,b=new hr,Vt(o,e.c.i),dr(b,e.c.i);o.b!=0;){if(t=u(o.b==0?null:(at(o.b!=0),Ul(o,o.a.a)),9),c.Gc(t))return!0;for(r=new Gn(Vn(Di(t).a.Jc(),new ee));ht(r);)i=u(it(r),17),f=i.d.i,b.a._b(f)||(b.a.yc(f,b),Vi(o,f,o.c.b,o.c))}return!1}function zVe(e,n,t){var i,r,c,o,l,f,h,b,p;for(p=new Te,b=new xae(0,t),c=0,SB(b,new rY(0,0,b,t)),r=0,h=new ot(e);h.e!=h.i.gc();)f=u(ft(h),26),i=u(Le(b.a,b.a.c.length-1),173),l=r+f.g+(u(Le(b.a,0),173).b.c.length==0?0:t),(l>n||Re($e(ve(f,(Ya(),ND)))))&&(r=0,c+=b.b+t,Hn(p.c,b),b=new xae(c,t),i=new rY(0,b.f,b,t),SB(b,i),r=0),i.b.c.length==0||!Re($e(ve(zi(f),(Ya(),Vre))))&&(f.f>=i.o&&f.f<=i.f||i.a*.5<=f.f&&i.a*1.5>=f.f)?Z1e(i,f):(o=new rY(i.s+i.r+t,b.f,b,t),SB(b,o),Z1e(o,f)),r=f.i+f.g;return Hn(p.c,b),p}function vS(e){var n,t,i,r;if(!(e.b==null||e.b.length<=2)&&!e.a){for(n=0,r=0;r=e.b[r+1])r+=2;else if(t0)for(i=new vs(u(mi(e.a,c),22)),yn(),Nr(i,new eoe(n)),r=new Xr(c.b,0);r.b0&&i>=-6?i>=0?MC(c,t-ac(e.e),"."):(XQ(c,n-1,n-1,"0."),MC(c,n+1,Ah(Hg,0,-ac(i)-1))):(t-n>=1&&(MC(c,n,"."),++t),MC(c,t,"E"),i>0&&MC(c,++t,"+"),MC(c,++t,""+hj(Pu(i)))),e.g=c.a,e.g))}function sPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e;i=te(re(T(n,(Oe(),o5e)))),de=u(T(n,CM),15).a,y=4,r=3,fe=20/de,S=!1,f=0,o=ui;do{for(c=f!=1,p=f!=0,_e=0,_=e.a,U=0,ie=_.length;Ude)?(f=2,o=ui):f==0?(f=1,o=_e):(f=0,o=_e)):(S=_e>=o||o-_e=Sc?Bc(t,V1e(i)):V9(t,i&Er),o=new JK(10,null,0),Jvn(e.a,o,l-1)):(t=(o.Km().length+c,new OE),Bc(t,o.Km())),n.e==0?(i=n.Im(),i>=Sc?Bc(t,V1e(i)):V9(t,i&Er)):Bc(t,n.Km()),u(o,517).b=t.a}}function lPn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_;if(!t.dc()){for(l=0,y=0,i=t.Jc(),A=u(i.Pb(),15).a;l0?1:ug(isNaN(i),isNaN(0)))>=0^(qf(Ph),(k.Math.abs(l)<=Ph||l==0||isNaN(l)&&isNaN(0)?0:l<0?-1:l>0?1:ug(isNaN(l),isNaN(0)))>=0)?k.Math.max(l,i):(qf(Ph),(k.Math.abs(i)<=Ph||i==0||isNaN(i)&&isNaN(0)?0:i<0?-1:i>0?1:ug(isNaN(i),isNaN(0)))>0?k.Math.sqrt(l*l+i*i):-k.Math.sqrt(l*l+i*i))}function dPn(e){var n,t,i,r;r=e.o,$p(),e.A.dc()||di(e.A,Qme)?n=r.b:(e.D?n=k.Math.max(r.b,rS(e.f)):n=rS(e.f),e.A.Gc((tl(),KD))&&!e.B.Gc((Bs(),aA))&&(n=k.Math.max(n,rS(u(zc(e.p,(Ne(),Wn)),253))),n=k.Math.max(n,rS(u(zc(e.p,Xn),253)))),t=YBe(e),t&&(n=k.Math.max(n,t.b)),e.A.Gc(QD)&&(e.q==(Fr(),j1)||e.q==to)&&(n=k.Math.max(n,oR(u(zc(e.b,(Ne(),Wn)),127))),n=k.Math.max(n,oR(u(zc(e.b,Xn),127))))),Re($e(e.e.Rf().mf((Gt(),n3))))?r.b=k.Math.max(r.b,n):r.b=n,i=e.f.i,i.d=0,i.a=n,UW(e.f)}function bPn(e,n,t,i,r,c,o,l){var f,h,b,p;switch(f=Jf(z(B(czn,1),xn,238,0,[n,t,i,r])),p=null,e.b.g){case 1:p=Jf(z(B(A6e,1),xn,523,0,[new Jk,new Rx,new Q6]));break;case 0:p=Jf(z(B(A6e,1),xn,523,0,[new Q6,new Rx,new Jk]));break;case 2:p=Jf(z(B(A6e,1),xn,523,0,[new Rx,new Jk,new Q6]))}for(b=new L(p);b.a1&&(f=h.Gg(f,e.a,l));return f.c.length==1?u(Le(f,f.c.length-1),238):f.c.length==2?ePn((mn(0,f.c.length),u(f.c[0],238)),(mn(1,f.c.length),u(f.c[1],238)),o,c):null}function gPn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A;r=new v9(e),c=new Uqe,i=(eO(c.n),eO(c.p),Ju(c.c),eO(c.f),eO(c.o),Ju(c.q),Ju(c.d),Ju(c.g),Ju(c.k),Ju(c.e),Ju(c.i),Ju(c.j),Ju(c.r),Ju(c.b),y=wqe(c,r,null),pUe(c,r),y),n&&(f=new v9(n),o=_Ln(f),A0e(i,z(B(c9e,1),xn,524,0,[o]))),p=!1,b=!1,t&&(f=new v9(t),KF in f.a&&(p=K1(f,KF).oe().a),oZe in f.a&&(b=K1(f,oZe).oe().a)),h=hAe(oBe(new j5,p),b),ETn(new Jx,i,h),KF in r.a&&Gf(r,KF,null),(p||b)&&(l=new S5,fVe(h,l,p,b),Gf(r,KF,l)),S=new wSe(c),Pze(new TV(i),S),A=new pSe(c),Pze(new TV(i),A)}function wPn(e,n,t){var i,r,c,o,l,f,h;for(t.Tg("Find roots",1),e.a.c.length=0,r=jt(n.b,0);r.b!=r.d.c;)i=u(kt(r),40),i.b.b==0&&(ae(i,(Ci(),_b),(Ln(),!0)),xe(e.a,i));switch(e.a.c.length){case 0:c=new iY(0,n,"DUMMY_ROOT"),ae(c,(Ci(),_b),(Ln(),!0)),ae(c,wre,!0),Vt(n.b,c);break;case 1:break;default:for(o=new iY(0,n,$F),f=new L(e.a);f.a=k.Math.abs(i.b)?(i.b=0,c.d+c.a>o.d&&c.do.c&&c.c0){if(n=new Ose(e.i,e.g),t=e.i,c=t<100?null:new F0(t),e.Rj())for(i=0;i0){for(l=e.g,h=e.i,xj(e),c=h<100?null:new F0(h),i=0;i>13|(e.m&15)<<9,r=e.m>>4&8191,c=e.m>>17|(e.h&255)<<5,o=(e.h&1048320)>>8,l=n.l&8191,f=n.l>>13|(n.m&15)<<9,h=n.m>>4&8191,b=n.m>>17|(n.h&255)<<5,p=(n.h&1048320)>>8,cn=t*l,tn=i*l,Mn=r*l,Cn=c*l,st=o*l,f!=0&&(tn+=t*f,Mn+=i*f,Cn+=r*f,st+=c*f),h!=0&&(Mn+=t*h,Cn+=i*h,st+=r*h),b!=0&&(Cn+=t*b,st+=i*b),p!=0&&(st+=t*p),S=cn&zs,A=(tn&511)<<13,y=S+A,_=cn>>22,R=tn>>9,U=(Mn&262143)<<4,K=(Cn&31)<<17,N=_+R+U+K,de=Mn>>18,fe=Cn>>5,_e=(st&4095)<<8,ie=de+fe+_e,N+=y>>22,y&=zs,ie+=N>>22,N&=zs,ie&=ld,Io(y,N,ie)}function GVe(e){var n,t,i,r,c,o,l;if(l=u(Le(e.j,0),12),l.g.c.length!=0&&l.e.c.length!=0)throw $(new Uc("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges."));if(l.g.c.length!=0){for(c=Ki,t=new L(l.g);t.a0&&HGe(e,l,p);for(r=new L(p);r.a4)if(e.dk(n)){if(e.$k()){if(r=u(n,52),i=r.Bh(),f=i==e.e&&(e.kl()?r.vh(r.Ch(),e.gl())==e.hl():-1-r.Ch()==e.Jj()),e.ll()&&!f&&!i&&r.Gh()){for(c=0;ce.d[o.p]&&(t+=Hae(e.b,c)*u(f.b,15).a,W0(e.a,me(c)));for(;!CE(e.a);)Ehe(e.b,u(U5(e.a),15).a)}return t}function kPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_;for(n.Tg($Ye,1),S=new Te,b=k.Math.max(e.a.c.length,u(T(e,(pe(),Tb)),15).a),t=b*u(T(e,fD),15).a,l=ue(T(e,(Oe(),Zy)))===ue((ib(),Rm)),N=new L(e.a);N.a0&&(h=e.n.a/c);break;case 2:case 4:r=e.i.o.b,r>0&&(h=e.n.b/r)}ae(e,(pe(),$2),h)}if(f=e.o,o=e.a,i)o.a=i.a,o.b=i.b,e.d=!0;else if(n!=fh&&n!=$b&&l!=Eu)switch(l.g){case 1:o.a=f.a/2;break;case 2:o.a=f.a,o.b=f.b/2;break;case 3:o.a=f.a/2,o.b=f.b;break;case 4:o.b=f.b/2}else o.a=f.a/2,o.b=f.b/2}function yS(e){var n,t,i,r,c,o,l,f,h,b;if(e.Nj())if(b=e.Cj(),f=e.Oj(),b>0)if(n=new n1e(e.nj()),t=b,c=t<100?null:new F0(t),OC(e,t,n.g),r=t==1?e.Gj(4,V(n,0),null,0,f):e.Gj(6,n,null,-1,f),e.Kj()){for(i=new ot(n);i.e!=i.i.gc();)c=e.Mj(ft(i),c);c?(c.lj(r),c.mj()):e.Hj(r)}else c?(c.lj(r),c.mj()):e.Hj(r);else OC(e,e.Cj(),e.Dj()),e.Hj(e.Gj(6,(yn(),Mc),null,-1,f));else if(e.Kj())if(b=e.Cj(),b>0){for(l=e.Dj(),h=b,OC(e,b,l),c=h<100?null:new F0(h),i=0;i1&&fs(o)*Ys(o)/2>l[0]){for(c=0;cl[c];)++c;A=new Y0(N,0,c+1),p=new mB(A),b=fs(o)/Ys(o),f=sZ(p,n,new E5,t,i,r,b),gi(ma(p.e),f),J5(L8(y,p),n7),S=new Y0(N,c+1,N.c.length),Bde(y,S),N.c.length=0,h=0,ADe(l,l.length,0)}else _=y.b.c.length==0?null:Le(y.b,0),_!=null&&RQ(y,0),h>0&&(l[h]=l[h-1]),l[h]+=fs(o)*Ys(o),++h,Hn(N.c,o);return N}function OPn(e,n){var t,i,r,c;t=n.b,c=new vs(t.j),r=0,i=t.j,i.c.length=0,Xw(u(kg(e.b,(Ne(),Un),(c2(),I2)),16),t),r=BO(c,r,new $6,i),Xw(u(kg(e.b,Un,Ab),16),t),r=BO(c,r,new xd,i),Xw(u(kg(e.b,Un,_2),16),t),Xw(u(kg(e.b,Wn,I2),16),t),Xw(u(kg(e.b,Wn,Ab),16),t),r=BO(c,r,new Td,i),Xw(u(kg(e.b,Wn,_2),16),t),Xw(u(kg(e.b,bt,I2),16),t),r=BO(c,r,new tp,i),Xw(u(kg(e.b,bt,Ab),16),t),r=BO(c,r,new Kb,i),Xw(u(kg(e.b,bt,_2),16),t),Xw(u(kg(e.b,Xn,I2),16),t),r=BO(c,r,new Ad,i),Xw(u(kg(e.b,Xn,Ab),16),t),Xw(u(kg(e.b,Xn,_2),16),t)}function NPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N;for(n.Tg("Layer size calculation",1),b=Ki,h=Ir,r=!1,l=new L(e.b);l.a.5?R-=o*2*(A-.5):A<.5&&(R+=c*2*(.5-A)),r=l.d.b,R_.a-N-b&&(R=_.a-N-b),l.n.a=n+R}}function _Pn(e){var n,t,i,r,c;if(i=u(T(e,(Oe(),ku)),165),i==(el(),bd)){for(t=new Gn(Vn(or(e).a.Jc(),new ee));ht(t);)if(n=u(it(t),17),!FPe(n))throw $(new Id(cee+zO(e)+"' has its layer constraint set to FIRST_SEPARATE, but has at least one incoming edge. FIRST_SEPARATE nodes must not have incoming edges."))}else if(i==qg){for(c=new Gn(Vn(Di(e).a.Jc(),new ee));ht(c);)if(r=u(it(c),17),!FPe(r))throw $(new Id(cee+zO(e)+"' has its layer constraint set to LAST_SEPARATE, but has at least one outgoing edge. LAST_SEPARATE nodes must not have outgoing edges."))}}function lN(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;if(e.e&&e.c.c>19!=0&&(n=w8(n),f=!f),o=mNn(n),c=!1,r=!1,i=!1,e.h==yN&&e.m==0&&e.l==0)if(r=!0,c=!0,o==-1)e=aCe((u8(),kme)),i=!0,f=!f;else return l=sbe(e,o),f&&nY(l),t&&(Eb=Io(0,0,0)),l;else e.h>>19!=0&&(c=!0,e=w8(e),i=!0,f=!f);return o!=-1?Tkn(e,o,f,c,t):Xde(e,n)<0?(t&&(c?Eb=w8(e):Eb=Io(e.l,e.m,e.h)),Io(0,0,0)):hIn(i?e:Io(e.l,e.m,e.h),n,f,c,r,t)}function iZ(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;if(o=e.e,f=n.e,o==0)return n;if(f==0)return e;if(c=e.d,l=n.d,c+l==2)return t=zr(e.a[0],_c),i=zr(n.a[0],_c),o==f?(b=yc(t,i),A=Lt(b),S=Lt(fg(b,32)),S==0?new Y1(o,A):new ag(o,2,z(B(It,1),ei,30,15,[A,S]))):(Ch(),I$(o<0?pf(i,t):pf(t,i),0)?sb(o<0?pf(i,t):pf(t,i)):wj(sb(Ud(o<0?pf(i,t):pf(t,i)))));if(o==f)y=o,p=c>=l?gQ(e.a,c,n.a,l):gQ(n.a,l,e.a,c);else{if(r=c!=l?c>l?1:-1:A1e(e.a,n.a,c),r==0)return Ch(),tM;r==1?(y=o,p=dQ(e.a,c,n.a,l)):(y=f,p=dQ(n.a,l,e.a,c))}return h=new ag(y,p.length,p),Ej(h),h}function LPn(e,n){var t,i,r,c,o,l,f;if(!(e.g>n.f||n.g>e.f)){for(t=0,i=0,o=e.w.a.ec().Jc();o.Ob();)r=u(o.Pb(),12),gY(mu(z(B($r,1),Ae,8,0,[r.i.n,r.n,r.a])).b,n.g,n.f)&&++t;for(l=e.r.a.ec().Jc();l.Ob();)r=u(l.Pb(),12),gY(mu(z(B($r,1),Ae,8,0,[r.i.n,r.n,r.a])).b,n.g,n.f)&&--t;for(f=n.w.a.ec().Jc();f.Ob();)r=u(f.Pb(),12),gY(mu(z(B($r,1),Ae,8,0,[r.i.n,r.n,r.a])).b,e.g,e.f)&&++i;for(c=n.r.a.ec().Jc();c.Ob();)r=u(c.Pb(),12),gY(mu(z(B($r,1),Ae,8,0,[r.i.n,r.n,r.a])).b,e.g,e.f)&&--i;t=0)return t;switch(Qw(Kc(e,t))){case 2:{if(bn("",Qd(e,t.ok()).ve())){if(f=GC(Kc(e,t)),l=Y9(Kc(e,t)),b=bbe(e,n,f,l),b)return b;for(r=Gbe(e,n),o=0,p=r.gc();o1)throw $(new Jn(XN));for(b=Po(e.e.Ah(),n),i=u(e.g,122),o=0;o1,h=new Ga(y.b);gu(h.a)||gu(h.b);)f=u(gu(h.a)?I(h.a):I(h.b),17),p=f.c==y?f.d:f.c,k.Math.abs(mu(z(B($r,1),Ae,8,0,[p.i.n,p.n,p.a])).b-o.b)>1&&yDn(e,f,o,c,y)}}function zPn(e){var n,t,i,r,c,o;if(r=new Xr(e.e,0),i=new Xr(e.a,0),e.d)for(t=0;tKee;){for(c=n,o=0;k.Math.abs(n-c)0),r.a.Xb(r.c=--r.b),WIn(e,e.b-o,c,i,r),at(r.b0),i.a.Xb(i.c=--i.b)}if(!e.d)for(t=0;t0?(e.f[b.p]=S/(b.e.c.length+b.g.c.length),e.c=k.Math.min(e.c,e.f[b.p]),e.b=k.Math.max(e.b,e.f[b.p])):l&&(e.f[b.p]=S)}}function HPn(e){e.b=null,e.bb=null,e.fb=null,e.qb=null,e.a=null,e.c=null,e.d=null,e.e=null,e.f=null,e.n=null,e.M=null,e.L=null,e.Q=null,e.R=null,e.K=null,e.db=null,e.eb=null,e.g=null,e.i=null,e.j=null,e.k=null,e.gb=null,e.o=null,e.p=null,e.q=null,e.r=null,e.$=null,e.ib=null,e.S=null,e.T=null,e.t=null,e.s=null,e.u=null,e.v=null,e.w=null,e.B=null,e.A=null,e.C=null,e.D=null,e.F=null,e.G=null,e.H=null,e.I=null,e.J=null,e.P=null,e.Z=null,e.U=null,e.V=null,e.W=null,e.X=null,e.Y=null,e._=null,e.ab=null,e.cb=null,e.hb=null,e.nb=null,e.lb=null,e.mb=null,e.ob=null,e.pb=null,e.jb=null,e.kb=null,e.N=!1,e.O=!1}function JPn(e,n,t){var i,r,c,o;for(t.Tg("Graph transformation ("+e.a+")",1),o=wg(n.a),c=new L(n.b);c.a=l.b.c)&&(l.b=n),(!l.c||n.c<=l.c.c)&&(l.d=l.c,l.c=n),(!l.e||n.d>=l.e.d)&&(l.e=n),(!l.f||n.d<=l.f.d)&&(l.f=n);return i=new fz((g8(),D2)),WC(e,Vtn,new Mu(z(B(eD,1),xn,377,0,[i]))),o=new fz(_m),WC(e,Xtn,new Mu(z(B(eD,1),xn,377,0,[o]))),r=new fz(Dm),WC(e,Utn,new Mu(z(B(eD,1),xn,377,0,[r]))),c=new fz(Kv),WC(e,qtn,new Mu(z(B(eD,1),xn,377,0,[c]))),CW(i.c,D2),CW(r.c,Dm),CW(c.c,Kv),CW(o.c,_m),l.a.c.length=0,Ar(l.a,i.c),Ar(l.a,nl(r.c)),Ar(l.a,c.c),Ar(l.a,nl(o.c)),l}function UPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;for(n.Tg(cWe,1),S=te(re(ve(e,(l1(),Wm)))),o=te(re(ve(e,(Ya(),VM)))),l=u(ve(e,XM),104),Khe((!e.a&&(e.a=new we(Bt,e,10,11)),e.a)),b=zVe((!e.a&&(e.a=new we(Bt,e,10,11)),e.a),S,o),!e.a&&(e.a=new we(Bt,e,10,11)),h=new L(b);h.a0&&(e.a=f+(S-1)*c,n.c.b+=e.a,n.f.b+=e.a)),A.a.gc()!=0&&(y=new SK(1,c),S=kge(y,n,A,N,n.f.b+f-n.c.b),S>0&&(n.f.b+=f+(S-1)*c))}function XVe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie;for(b=te(re(T(e,(Oe(),Kg)))),i=te(re(T(e,p5e))),y=new e9,ae(y,Kg,b+i),h=n,R=h.d,N=h.c.i,U=h.d.i,_=Bse(N.c),K=Bse(U.c),r=new Te,p=_;p<=K;p++)l=new Va(e),If(l,(Bn(),br)),ae(l,(pe(),pi),h),ae(l,Zi,(Fr(),to)),ae(l,MJ,y),S=u(Le(e.b,p),25),p==_?lb(l,S.a.c.length-t,S):Dr(l,S),ie=te(re(T(h,s0))),ie<0&&(ie=0,ae(h,s0,ie)),l.o.b=ie,A=k.Math.floor(ie/2),o=new Yu,Tr(o,(Ne(),Xn)),wu(o,l),o.n.b=A,f=new Yu,Tr(f,Wn),wu(f,l),f.n.b=A,Ur(h,o),c=new Ww,$u(c,h),ae(c,Wc,null),hc(c,f),Ur(c,R),eAn(l,h,c),Hn(r.c,c),h=c;return r}function VPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K;if(N=n.b.c.length,!(N<3)){for(S=oe(It,ei,30,N,15,1),p=0,b=new L(n.b);b.ao)&&dr(e.b,u(_.b,17));++l}c=o}}}function rZ(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K;for(f=u(e0(e,(Ne(),Xn)).Jc().Pb(),12).e,S=u(e0(e,Wn).Jc().Pb(),12).g,l=f.c.length,K=Ja(u(Le(e.j,0),12));l-- >0;){for(N=(mn(0,f.c.length),u(f.c[0],17)),r=(mn(0,S.c.length),u(S.c[0],17)),U=r.d.e,c=pu(U,r,0),c6n(N,r.d,c),hc(r,null),Ur(r,null),A=N.a,n&&Vt(A,new mc(K)),i=jt(r.a,0);i.b!=i.d.c;)t=u(kt(i),8),Vt(A,new mc(t));for(R=N.b,y=new L(r.b);y.a-2;default:return!1}switch(n=e.Pj(),e.p){case 0:return n!=null&&Re($e(n))!=WE(e.k,0);case 1:return n!=null&&u(n,221).a!=Lt(e.k)<<24>>24;case 2:return n!=null&&u(n,180).a!=(Lt(e.k)&Er);case 6:return n!=null&&WE(u(n,190).a,e.k);case 5:return n!=null&&u(n,15).a!=Lt(e.k);case 7:return n!=null&&u(n,191).a!=Lt(e.k)<<16>>16;case 3:return n!=null&&te(re(n))!=e.j;case 4:return n!=null&&u(n,164).a!=e.j;default:return n==null?e.n!=null:!di(n,e.n)}}function fN(e,n,t){var i,r,c,o;return e.ml()&&e.ll()&&(o=pK(e,u(t,57)),ue(o)!==ue(t))?(e.vj(n),e.Bj(n,L$e(e,n,o)),e.$k()&&(c=(r=u(t,52),e.kl()?e.il()?r.Qh(e.b,Oc(u(jn(Uo(e.b),e.Jj()),19)).n,u(jn(Uo(e.b),e.Jj()).Fk(),29).ik(),null):r.Qh(e.b,Fi(r.Ah(),Oc(u(jn(Uo(e.b),e.Jj()),19))),null,null):r.Qh(e.b,-1-e.Jj(),null,null)),!u(o,52).Mh()&&(c=(i=u(o,52),e.kl()?e.il()?i.Oh(e.b,Oc(u(jn(Uo(e.b),e.Jj()),19)).n,u(jn(Uo(e.b),e.Jj()).Fk(),29).ik(),c):i.Oh(e.b,Fi(i.Ah(),Oc(u(jn(Uo(e.b),e.Jj()),19))),null,c):i.Oh(e.b,-1-e.Jj(),null,c))),c&&c.mj()),Vs(e.b)&&e.Hj(e.Gj(9,t,o,n,!1)),o):t}function VVe(e){var n,t,i,r,c,o,l,f,h,b;for(i=new Te,o=new L(e.e.a);o.a0&&(o=k.Math.max(o,FBe(e.C.b+i.d.b,r))),b=i,p=r,y=c;e.C&&e.C.c>0&&(S=y+e.C.c,h&&(S+=b.d.c),o=k.Math.max(o,(Ba(),qf(Za),k.Math.abs(p-1)<=Za||p==1||isNaN(p)&&isNaN(1)?0:S/(1-p)))),t.n.b=0,t.a.a=o}function QVe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S;if(t=u(zc(e.b,n),127),f=u(u(mi(e.r,n),22),83),f.dc()){t.n.d=0,t.n.a=0;return}for(h=e.u.Gc((Es(),md)),o=0,e.A.Gc((tl(),nw))&&AXe(e,n),l=f.Jc(),b=null,y=0,p=0;l.Ob();)i=u(l.Pb(),115),c=te(re(i.b.mf((U$(),kH)))),r=i.b.Kf().b,b?(S=p+b.d.a+e.w+i.d.d,o=k.Math.max(o,(Ba(),qf(Za),k.Math.abs(y-c)<=Za||y==c||isNaN(y)&&isNaN(c)?0:S/(c-y)))):e.C&&e.C.d>0&&(o=k.Math.max(o,FBe(e.C.d+i.d.d,c))),b=i,y=c,p=r;e.C&&e.C.a>0&&(S=p+e.C.a,h&&(S+=b.d.a),o=k.Math.max(o,(Ba(),qf(Za),k.Math.abs(y-1)<=Za||y==1||isNaN(y)&&isNaN(1)?0:S/(1-y)))),t.n.d=0,t.a.b=o}function YVe(e,n,t){var i,r,c,o,l,f;for(this.g=e,l=n.d.length,f=t.d.length,this.d=oe(m1,i0,9,l+f,0,1),o=0;o0?DQ(this,this.f/this.a):za(n.g,n.d[0]).a!=null&&za(t.g,t.d[0]).a!=null?DQ(this,(te(za(n.g,n.d[0]).a)+te(za(t.g,t.d[0]).a))/2):za(n.g,n.d[0]).a!=null?DQ(this,za(n.g,n.d[0]).a):za(t.g,t.d[0]).a!=null&&DQ(this,za(t.g,t.d[0]).a)}function QPn(e,n,t,i,r,c,o,l){var f,h,b,p,y,S,A,N,_,R;if(A=!1,h=Ebe(t.q,n.f+n.b-t.q.f),S=i.f>n.b&&l,R=r-(t.q.e+h-o),p=(f=mS(i,R,!1),f.a),S&&p>i.f)return!1;if(S){for(y=0,_=new L(n.d);_.a<_.c.c.length;)N=u(I(_),319),y+=Ebe(N,i.f)+o;R=r-y}return R=(mn(c,e.c.length),u(e.c[c],186)).e,!S&&p>n.b&&!b)?!1:((b||S||p<=n.b)&&(b&&p>n.b?(t.d=p,cO(t,DGe(t,p))):(XJe(t.q,h),t.c=!0),cO(i,r-(t.s+t.r)),RO(i,t.q.e+t.q.d,n.f),SB(n,i),e.c.length>c&&(HO((mn(c,e.c.length),u(e.c[c],186)),i),(mn(c,e.c.length),u(e.c[c],186)).a.c.length==0&&Gd(e,c)),A=!0),A)}function YPn(e,n){var t,i,r,c,o,l,f,h,b,p;for(e.a=new g_e(jkn(iA)),i=new L(n.a);i.a0&&(Kn(0,t.length),t.charCodeAt(0)!=47)))throw $(new Jn("invalid opaquePart: "+t));if(e&&!(n!=null&&DE(xG,n.toLowerCase()))&&!(t==null||!jY(t,bA,gA)))throw $(new Jn($Ze+t));if(e&&n!=null&&DE(xG,n.toLowerCase())&&!QAn(t))throw $(new Jn($Ze+t));if(!tjn(i))throw $(new Jn("invalid device: "+i));if(!eEn(r))throw o=r==null?"invalid segments: null":"invalid segment: "+Vkn(r),$(new Jn(o));if(!(c==null||yh(c,Ko(35))==-1))throw $(new Jn("invalid query: "+c))}function ZVe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R;if(y=new mc(e.o),R=n.a/y.a,l=n.b/y.b,N=n.a-y.a,c=n.b-y.b,t)for(r=ue(T(e,(Oe(),Zi)))===ue((Fr(),to)),A=new L(e.j);A.a=1&&(_-o>0&&p>=0?(f.n.a+=N,f.n.b+=c*o):_-o<0&&b>=0&&(f.n.a+=N*_,f.n.b+=c));e.o.a=n.a,e.o.b=n.b,ae(e,(Oe(),Xg),(tl(),i=u(pa(fA),10),new Jl(i,u(zf(i,i.length),10),0)))}function n$n(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R;if(t.Tg("Network simplex layering",1),e.b=n,R=u(T(n,(Oe(),CM)),15).a*4,_=e.b.a,_.c.length<1){t.Ug();return}for(c=V_n(e,_),N=null,r=jt(c,0);r.b!=r.d.c;){for(i=u(kt(r),16),l=R*ac(k.Math.sqrt(i.gc())),o=sIn(i),FW(_oe(sgn(Ioe(YV(o),l),N),!0),t.dh(1)),y=e.b.b,A=new L(o.a);A.a1)for(N=oe(It,ei,30,e.b.b.c.length,15,1),p=0,h=new L(e.b.b);h.a0){oz(e,t,0),t.a+=String.fromCharCode(i),r=zjn(n,c),oz(e,t,r),c+=r-1;continue}i==39?c+10&&A.a<=0){f.c.length=0,Hn(f.c,A);break}S=A.i-A.d,S>=l&&(S>l&&(f.c.length=0,l=S),Hn(f.c,A))}f.c.length!=0&&(o=u(Le(f,dz(r,f.c.length)),116),K.a.Ac(o)!=null,o.g=b++,uge(o,n,t,i),f.c.length=0)}for(_=e.c.length+1,y=new L(e);y.aIr||n.o==Yg&&b=l&&r<=f)l<=r&&c<=f?(t[b++]=r,t[b++]=c,i+=2):l<=r?(t[b++]=r,t[b++]=f,e.b[i]=f+1,o+=2):c<=f?(t[b++]=l,t[b++]=c,i+=2):(t[b++]=l,t[b++]=f,e.b[i]=f+1);else if(fwb)&&l<10);Loe(e.c,new ww),eKe(e),Qvn(e.c),GPn(e.f)}function d$n(e,n){var t,i,r,c,o,l,f,h,b,p,y;switch(e.k.g){case 1:if(i=u(T(e,(pe(),pi)),17),t=u(T(i,Xve),78),t?Re($e(T(i,o0)))&&(t=y1e(t)):t=new Os,h=u(T(e,Na),12),h){if(b=mu(z(B($r,1),Ae,8,0,[h.i.n,h.n,h.a])),n<=b.a)return b.b;Vi(t,b,t.a,t.a.a)}if(p=u(T(e,jf),12),p){if(y=mu(z(B($r,1),Ae,8,0,[p.i.n,p.n,p.a])),y.a<=n)return y.b;Vi(t,y,t.c.b,t.c)}if(t.b>=2){for(f=jt(t,0),o=u(kt(f),8),l=u(kt(f),8);l.a0&&AO(h,!0,(kr(),cu)),l.k==(Bn(),pr)&&O_e(h),Zt(e.f,l,n)}}function tKe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U;for(h=Ki,b=Ki,l=Ir,f=Ir,y=new L(n.i);y.a=e.j?(++e.j,xe(e.b,me(1)),xe(e.c,b)):(i=e.d[n.p][1],bl(e.b,h,me(u(Le(e.b,h),15).a+1-i)),bl(e.c,h,te(re(Le(e.c,h)))+b-i*e.f)),(e.r==(db(),yD)&&(u(Le(e.b,h),15).a>e.k||u(Le(e.b,h-1),15).a>e.k)||e.r==kD&&(te(re(Le(e.c,h)))>e.n||te(re(Le(e.c,h-1)))>e.n))&&(f=!1),o=new Gn(Vn(or(n).a.Jc(),new ee));ht(o);)c=u(it(o),17),l=c.c.i,e.g[l.p]==h&&(p=iKe(e,l),r=r+u(p.a,15).a,f=f&&Re($e(p.b)));return e.g[n.p]=h,r=r+e.d[n.p][0],new jc(me(r),(Ln(),!!f))}function g$n(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe;return y=e.c[n],S=e.c[t],A=u(T(y,(pe(),Vy)),16),!!A&&A.gc()!=0&&A.Gc(S)||(N=y.k!=(Bn(),br)&&S.k!=br,_=u(T(y,P2),9),R=u(T(S,P2),9),U=_!=R,K=!!_&&_!=y||!!R&&R!=S,ie=XY(y,(Ne(),Un)),de=XY(S,bt),K=K|(XY(y,bt)||XY(S,Un)),fe=K&&U||ie||de,N&&fe)||y.k==(Bn(),wo)&&S.k==Wi||S.k==(Bn(),wo)&&y.k==Wi?!1:(b=e.c[n],c=e.c[t],r=BJe(e.e,b,c,(Ne(),Xn)),f=BJe(e.i,b,c,Wn),HNn(e.f,b,c),h=Uze(e.b,b,c)+u(r.a,15).a+u(f.a,15).a+e.f.d,l=Uze(e.b,c,b)+u(r.b,15).a+u(f.b,15).a+e.f.b,e.a&&(p=u(T(b,pi),12),o=u(T(c,pi),12),i=jJe(e.g,p,o),h+=u(i.a,15).a,l+=u(i.b,15).a),h>l)}function rKe(e,n){var t,i,r,c,o;t=te(re(T(n,(Oe(),na)))),t<2&&ae(n,na,2),i=u(T(n,Sl),86),i==(kr(),lh)&&ae(n,Sl,KB(n)),r=u(T(n,Tun),15),r.a==0?ae(n,(pe(),Qy),new kY):ae(n,(pe(),Qy),new WR(r.a)),c=$e(T(n,AM)),c==null&&ae(n,AM,(Ln(),ue(T(n,gd))===ue((cd(),ck)))),tr(new wn(null,new pn(n.a,16)),new Wue(e)),tr(lu(new wn(null,new pn(n.b,16)),new _l),new Zue(e)),o=new WVe(n),ae(n,(pe(),c4),o),JC(e.a),va(e.a,(Hr(),ea),u(T(n,e6),188)),va(e.a,p1,u(T(n,vJ),188)),va(e.a,eo,u(T(n,SM),188)),va(e.a,no,u(T(n,jJ),188)),va(e.a,Pc,U7n(u(T(n,gd),222))),zse(e.a,fBn(n)),ae(n,Eie,lN(e.a,n))}function kge(e,n,t,i,r){var c,o,l,f,h,b,p,y,S,A,N,_,R;for(p=new wt,o=new Te,WGe(e,t,e.d.zg(),o,p),WGe(e,i,e.d.Ag(),o,p),e.b=.2*(N=cUe(lu(new wn(null,new pn(o,16)),new Ex)),_=cUe(lu(new wn(null,new pn(o,16)),new jx)),k.Math.min(N,_)),c=0,l=0;l=2&&(R=xUe(o,!0,y),!e.e&&(e.e=new jje(e)),Rjn(e.e,R,o,e.b)),rGe(o,y),k$n(o),S=-1,b=new L(o);b.a0&&(t+=f.n.a+f.o.a/2,++p),A=new L(f.j);A.a0&&(t/=p),R=oe(Gr,Hc,30,i.a.c.length,15,1),l=0,h=new L(i.a);h.a-1){for(r=jt(l,0);r.b!=r.d.c;)i=u(kt(r),132),i.v=o;for(;l.b!=0;)for(i=u(tW(l,0),132),t=new L(i.i);t.a-1){for(c=new L(l);c.a0)&&(Lw(f,k.Math.min(f.o,r.o-1)),R0(f,f.i-1),f.i==0&&Hn(l.c,f))}}function oKe(e,n,t,i,r){var c,o,l,f;return f=Ki,o=!1,l=hge(e,_r(new Ee(n.a,n.b),e),gi(new Ee(t.a,t.b),r),_r(new Ee(i.a,i.b),t)),c=!!l&&!(k.Math.abs(l.a-e.a)<=A2&&k.Math.abs(l.b-e.b)<=A2||k.Math.abs(l.a-n.a)<=A2&&k.Math.abs(l.b-n.b)<=A2),l=hge(e,_r(new Ee(n.a,n.b),e),t,r),l&&((k.Math.abs(l.a-e.a)<=A2&&k.Math.abs(l.b-e.b)<=A2)==(k.Math.abs(l.a-n.a)<=A2&&k.Math.abs(l.b-n.b)<=A2)||c?f=k.Math.min(f,mj(_r(l,t))):o=!0),l=hge(e,_r(new Ee(n.a,n.b),e),i,r),l&&(o||(k.Math.abs(l.a-e.a)<=A2&&k.Math.abs(l.b-e.b)<=A2)==(k.Math.abs(l.a-n.a)<=A2&&k.Math.abs(l.b-n.b)<=A2)||c)&&(f=k.Math.min(f,mj(_r(l,i)))),f}function sKe(e){Cp(e,new d2(KP(xp(Sp(Ap(Mp(new Nd,mb),nYe),"Minimizes the stress within a layout using stress majorization. Stress exists if the euclidean distance between a pair of nodes doesn't match their graph theoretic distance, that is, the shortest path between the two nodes. The method allows to specify individual edge lengths."),new I4),$o))),Me(e,mb,OS,Ie(h3e)),Me(e,mb,bF,(Ln(),!0)),Me(e,mb,zv,Ie(Ntn)),Me(e,mb,_y,Ie(Dtn)),Me(e,mb,Dy,Ie(_tn)),Me(e,mb,s7,Ie(Otn)),Me(e,mb,NS,Ie(b3e)),Me(e,mb,l7,Ie(Itn)),Me(e,mb,owe,Ie(a3e)),Me(e,mb,lwe,Ie(l3e)),Me(e,mb,fwe,Ie(f3e)),Me(e,mb,awe,Ie(d3e)),Me(e,mb,swe,Ie(AH))}function E$n(e){var n,t,i,r,c,o,l,f;for(n=null,i=new L(e);i.a0&&t.c==0&&(!n&&(n=new Te),Hn(n.c,t));if(n)for(;n.c.length!=0;){if(t=u(Gd(n,0),239),t.b&&t.b.c.length>0){for(c=(!t.b&&(t.b=new Te),new L(t.b));c.apu(e,t,0))return new jc(r,t)}else if(te(za(r.g,r.d[0]).a)>te(za(t.g,t.d[0]).a))return new jc(r,t)}for(l=(!t.e&&(t.e=new Te),t.e).Jc();l.Ob();)o=u(l.Pb(),239),f=(!o.b&&(o.b=new Te),o.b),Kp(0,f.c.length),FE(f.c,0,t),o.c==f.c.length&&Hn(n.c,o)}return null}function kS(e,n){var t,i,r,c,o,l,f,h,b;if(n.e==5){nKe(e,n);return}if(h=n,!(h.b==null||e.b==null)){for(Nv(e),vS(e),Nv(h),vS(h),t=oe(It,ei,30,e.b.length+h.b.length,15,1),b=0,i=0,o=0;i=l&&r<=f)l<=r&&c<=f?i+=2:l<=r?(e.b[i]=f+1,o+=2):c<=f?(t[b++]=r,t[b++]=l-1,i+=2):(t[b++]=r,t[b++]=l-1,e.b[i]=f+1,o+=2);else if(f0),u(b.a.Xb(b.c=--b.b),17));c!=i&&b.b>0;)e.a[c.p]=!0,e.a[i.p]=!0,c=(at(b.b>0),u(b.a.Xb(b.c=--b.b),17));b.b>0&&Ns(b)}}function lKe(e,n,t){var i,r,c,o,l,f,h,b,p,y;if(t)for(i=-1,b=new Xr(n,0);b.b0?r-=864e5:r+=864e5,f=new kle(yc(Pu(n.q.getTime()),r))),b=new x5,h=e.a.length,c=0;c=97&&i<=122||i>=65&&i<=90){for(o=c+1;o=h)throw $(new Jn("Missing trailing '"));o+1=14&&b<=16))?n.a._b(i)?(t.a?Xt(t.a,t.b):t.a=new fl(t.d),ej(t.a,"[...]")):(l=cy(i),h=new Fp(n),W1(t,aKe(l,h))):X(i,171)?W1(t,wCn(u(i,171))):X(i,195)?W1(t,rxn(u(i,195))):X(i,201)?W1(t,fTn(u(i,201))):X(i,2073)?W1(t,cxn(u(i,2073))):X(i,54)?W1(t,gCn(u(i,54))):X(i,584)?W1(t,CCn(u(i,584))):X(i,830)?W1(t,bCn(u(i,830))):X(i,108)&&W1(t,dCn(u(i,108))):W1(t,i==null?Yo:fu(i));return t.a?t.e.length==0?t.a.a:t.a.a+(""+t.e):t.c}function X8(e,n){var t,i,r,c;c=e.F,n==null?(e.F=null,v8(e,null)):(e.F=(Nn(n),n),i=yh(n,Ko(60)),i!=-1?(r=(Zr(0,i,n.length),n.substr(0,i)),yh(n,Ko(46))==-1&&!bn(r,Sy)&&!bn(r,US)&&!bn(r,WF)&&!bn(r,XS)&&!bn(r,VS)&&!bn(r,KS)&&!bn(r,QS)&&!bn(r,YS)&&(r=QZe),t=J$(n,Ko(62)),t!=-1&&(r+=""+(Kn(t+1,n.length+1),n.substr(t+1))),v8(e,r)):(r=n,yh(n,Ko(46))==-1&&(i=yh(n,Ko(91)),i!=-1&&(r=(Zr(0,i,n.length),n.substr(0,i))),!bn(r,Sy)&&!bn(r,US)&&!bn(r,WF)&&!bn(r,XS)&&!bn(r,VS)&&!bn(r,KS)&&!bn(r,QS)&&!bn(r,YS)?(r=QZe,i!=-1&&(r+=""+(Kn(i,n.length+1),n.substr(i)))):r=n),v8(e,r),r==n&&(e.F=e.D))),(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lr(e,1,5,c,n))}function C$n(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;if(e.c=e.e,A=$e(T(n,(Oe(),Cun))),S=A==null||(Nn(A),A),c=u(T(n,(pe(),po)),22).Gc((Dc(),rf)),r=u(T(n,Zi),102),t=!(r==(Fr(),ew)||r==j1||r==to),S&&(t||!c)){for(p=new L(n.a);p.a=0)return r=WEn(e,(Zr(1,o,n.length),n.substr(1,o-1))),b=(Zr(o+1,f,n.length),n.substr(o+1,f-(o+1))),nBn(e,b,r)}else{if(t=-1,Ame==null&&(Ame=new RegExp("\\d")),Ame.test(String.fromCharCode(l))&&(t=Hle(n,Ko(46),f-1),t>=0)){i=u(hQ(e,qRe(e,(Zr(1,t,n.length),n.substr(1,t-1))),!1),61),h=0;try{h=vl((Kn(t+1,n.length+1),n.substr(t+1)),Kr,ui)}catch(y){throw y=lr(y),X(y,131)?(c=y,$(new aB(c))):$(y)}if(h>16==-10?t=u(e.Cb,293).Wk(n,t):e.Db>>16==-15&&(!n&&(n=(vn(),hh)),!h&&(h=(vn(),hh)),e.Cb.Vh()&&(f=new ed(e.Cb,1,13,h,n,Zd(Is(u(e.Cb,62)),e),!1),t?t.lj(f):t=f));else if(X(e.Cb,88))e.Db>>16==-23&&(X(n,88)||(n=(vn(),Of)),X(h,88)||(h=(vn(),Of)),e.Cb.Vh()&&(f=new ed(e.Cb,1,10,h,n,Zd(Ku(u(e.Cb,29)),e),!1),t?t.lj(f):t=f));else if(X(e.Cb,446))for(l=u(e.Cb,834),o=(!l.b&&(l.b=new LP(new jX)),l.b),c=(i=new im(new sn(o.a).a),new PP(i));c.a.b;)r=u(kv(c.a).jd(),87),t=V8(r,Lz(r,l),t)}return t}function N$n(e,n){var t,i,r,c,o,l,f,h,b,p,y;for(o=Re($e(ve(e,(Oe(),Hm)))),y=u(ve(e,qm),22),f=!1,h=!1,p=new ot((!e.c&&(e.c=new we(Hs,e,9,9)),e.c));p.e!=p.i.gc()&&(!f||!h);){for(c=u(ft(p),125),l=0,r=r1(Xl(z(B(tf,1),xn,20,0,[(!c.d&&(c.d=new Tn(mr,c,8,5)),c.d),(!c.e&&(c.e=new Tn(mr,c,7,4)),c.e)])));ht(r)&&(i=u(it(r),85),b=o&&b2(i)&&Re($e(ve(i,Ug))),t=qVe((!i.b&&(i.b=new Tn(mt,i,4,7)),i.b),c)?e==zi(ru(u(V((!i.c&&(i.c=new Tn(mt,i,5,8)),i.c),0),84))):e==zi(ru(u(V((!i.b&&(i.b=new Tn(mt,i,4,7)),i.b),0),84))),!((b||t)&&(++l,l>1))););(l>0||y.Gc((Es(),md))&&(!c.n&&(c.n=new we(ju,c,1,7)),c.n).i>0)&&(f=!0),l>1&&(h=!0)}f&&n.Ec((Dc(),rf)),h&&n.Ec((Dc(),dM))}function dKe(e){var n,t,i,r,c,o,l,f,h,b,p,y;if(y=u(ve(e,(Gt(),Zg)),22),y.dc())return null;if(l=0,o=0,y.Gc((tl(),QD))){for(b=u(ve(e,tA),102),i=2,t=2,r=2,c=2,n=zi(e)?u(ve(zi(e),Wg),86):u(ve(e,Wg),86),h=new ot((!e.c&&(e.c=new we(Hs,e,9,9)),e.c));h.e!=h.i.gc();)if(f=u(ft(h),125),p=u(ve(f,k4),64),p==(Ne(),Eu)&&(p=cge(f,n),Ei(f,k4,p)),b==(Fr(),to))switch(p.g){case 1:i=k.Math.max(i,f.i+f.g);break;case 2:t=k.Math.max(t,f.j+f.f);break;case 3:r=k.Math.max(r,f.i+f.g);break;case 4:c=k.Math.max(c,f.j+f.f)}else switch(p.g){case 1:i+=f.g+2;break;case 2:t+=f.f+2;break;case 3:r+=f.g+2;break;case 4:c+=f.f+2}l=k.Math.max(i,r),o=k.Math.max(t,c)}return m2(e,l,o,!0,!0)}function D$n(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N;for(r=null,i=new L(n.a);i.a1)for(r=e.e.b,Vt(e.e,f),l=f.a.ec().Jc();l.Ob();)o=u(l.Pb(),9),Zt(e.c,o,me(r))}}function _$n(e,n,t,i){var r,c,o,l,f,h,b,p,y,S;for(c=new Nqe(n),p=u_n(e,n,c),S=k.Math.max(te(re(T(n,(Oe(),s0)))),1),b=new L(p.a);b.a=0){for(f=null,l=new Xr(b.a,h+1);l.b0,h?h&&(y=R.p,o?++y:--y,p=u(Le(R.c.a,y),9),i=Aze(p),S=!(IUe(i,fe,t[0])||GDe(i,fe,t[0]))):S=!0),A=!1,de=n.D.i,de&&de.c&&l.e&&(b=o&&de.p>0||!o&&de.p=0&&No?1:ug(isNaN(0),isNaN(o)))<0&&(qf(Ph),(k.Math.abs(o-1)<=Ph||o==1||isNaN(o)&&isNaN(1)?0:o<1?-1:o>1?1:ug(isNaN(o),isNaN(1)))<0)&&(qf(Ph),(k.Math.abs(0-l)<=Ph||l==0||isNaN(0)&&isNaN(l)?0:0l?1:ug(isNaN(0),isNaN(l)))<0)&&(qf(Ph),(k.Math.abs(l-1)<=Ph||l==1||isNaN(l)&&isNaN(1)?0:l<1?-1:l>1?1:ug(isNaN(l),isNaN(1)))<0)),c)}function F$n(e){var n,t,i,r,c,o,l,f,h,b,p;for(e.j=oe(It,ei,30,e.g,15,1),e.o=new Te,tr(lu(new wn(null,new pn(e.e.b,16)),new P3),new mje(e)),e.a=oe(rs,Aa,30,e.b,16,1),NO(new wn(null,new pn(e.e.b,16)),new yje(e)),i=(p=new Te,tr(oi(lu(new wn(null,new pn(e.e.b,16)),new e5),new vje(e)),new rTe(e,p)),p),f=new L(i);f.a=h.c.c.length?b=Rae((Bn(),Wi),br):b=Rae((Bn(),br),br),b*=2,c=t.a.g,t.a.g=k.Math.max(c,c+(b-c)),o=t.b.g,t.b.g=k.Math.max(o,o+(b-o)),r=n}}function eF(e,n){var t;if(e.e)throw $(new Uc((U1(wte),XZ+wte.k+VZ)));if(!ewn(e.a,n))throw $(new du(_Qe+n+IQe));if(n==e.d)return e;switch(t=e.d,e.d=n,t.g){case 0:switch(n.g){case 2:a2(e);break;case 1:cb(e),a2(e);break;case 4:Tv(e),a2(e);break;case 3:Tv(e),cb(e),a2(e)}break;case 2:switch(n.g){case 1:cb(e),PW(e);break;case 4:Tv(e),a2(e);break;case 3:Tv(e),cb(e),a2(e)}break;case 1:switch(n.g){case 2:cb(e),PW(e);break;case 4:cb(e),Tv(e),a2(e);break;case 3:cb(e),Tv(e),cb(e),a2(e)}break;case 4:switch(n.g){case 2:Tv(e),a2(e);break;case 1:Tv(e),cb(e),a2(e);break;case 3:cb(e),PW(e)}break;case 3:switch(n.g){case 2:cb(e),Tv(e),a2(e);break;case 1:cb(e),Tv(e),cb(e),a2(e);break;case 4:cb(e),PW(e)}}return e}function Pv(e,n){var t;if(e.d)throw $(new Uc((U1(Ote),XZ+Ote.k+VZ)));if(!Zgn(e.a,n))throw $(new du(_Qe+n+IQe));if(n==e.c)return e;switch(t=e.c,e.c=n,t.g){case 0:switch(n.g){case 2:Sg(e);break;case 1:rb(e),Sg(e);break;case 4:Cv(e),Sg(e);break;case 3:Cv(e),rb(e),Sg(e)}break;case 2:switch(n.g){case 1:rb(e),$W(e);break;case 4:Cv(e),Sg(e);break;case 3:Cv(e),rb(e),Sg(e)}break;case 1:switch(n.g){case 2:rb(e),$W(e);break;case 4:rb(e),Cv(e),Sg(e);break;case 3:rb(e),Cv(e),rb(e),Sg(e)}break;case 4:switch(n.g){case 2:Cv(e),Sg(e);break;case 1:Cv(e),rb(e),Sg(e);break;case 3:rb(e),$W(e)}break;case 3:switch(n.g){case 2:rb(e),Cv(e),Sg(e);break;case 1:rb(e),Cv(e),rb(e),Sg(e);break;case 4:rb(e),$W(e)}}return e}function H$n(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K;for(p=e.b,b=new Xr(p,0),Rp(b,new Xu(e)),U=!1,o=1;b.b0&&(n.a+=Co),nF(u(ft(l),174),n);for(n.a+=tee,f=new $5((!i.c&&(i.c=new Tn(mt,i,5,8)),i.c));f.e!=f.i.gc();)f.e>0&&(n.a+=Co),nF(u(ft(f),174),n);n.a+=")"}}function J$n(e,n,t){var i,r,c,o,l,f,h,b;for(f=new ot((!e.a&&(e.a=new we(Bt,e,10,11)),e.a));f.e!=f.i.gc();)for(l=u(ft(f),26),r=new Gn(Vn(hb(l).a.Jc(),new ee));ht(r);){if(i=u(it(r),85),!i.b&&(i.b=new Tn(mt,i,4,7)),!(i.b.i<=1&&(!i.c&&(i.c=new Tn(mt,i,5,8)),i.c.i<=1)))throw $(new A5("Graph must not contain hyperedges."));if(!oS(i)&&l!=ru(u(V((!i.c&&(i.c=new Tn(mt,i,5,8)),i.c),0),84)))for(h=new YOe,$u(h,i),ae(h,(nb(),Hy),i),TP(h,u(bu(Xc(t.f,l)),155)),tX(h,u(Rn(t,ru(u(V((!i.c&&(i.c=new Tn(mt,i,5,8)),i.c),0),84))),155)),xe(n.c,h),o=new ot((!i.n&&(i.n=new we(ju,i,1,7)),i.n));o.e!=o.i.gc();)c=u(ft(o),157),b=new cPe(h,c.a),$u(b,c),ae(b,Hy,c),b.e.a=k.Math.max(c.g,1),b.e.b=k.Math.max(c.f,1),age(b),xe(n.d,b)}}function G$n(e,n,t){var i,r,c,o,l,f,h,b,p,y;switch(t.Tg("Node promotion heuristic",1),e.i=n,e.r=u(T(n,(Oe(),wD)),243),e.r!=(db(),V7)&&e.r!=DM?wRn(e):HDn(e),b=u(T(e.i,t5e),15).a,c=new Dq,e.r.g){case 2:case 1:U8(e,c);break;case 3:for(e.r=DJ,U8(e,c),f=0,l=new L(e.b);l.ae.k&&(e.r=yD,U8(e,c));break;case 4:for(e.r=DJ,U8(e,c),h=0,r=new L(e.c);r.ae.n&&(e.r=kD,U8(e,c));break;case 6:y=ac(k.Math.ceil(e.g.length*b/100)),U8(e,new pEe(y));break;case 5:p=ac(k.Math.ceil(e.e*b/100)),U8(e,new mEe(p));break;case 8:KKe(e,!0);break;case 9:KKe(e,!1);break;default:U8(e,c)}e.r!=V7&&e.r!=DM?sDn(e,n):x_n(e,n),t.Ug()}function q$n(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K;for(p=new Age(e),_5n(p,!(n==(kr(),cf)||n==sh)),b=p.a,y=new E5,r=(Sa(),z(B(Nm,1),ye,237,0,[Nu,No,Du])),o=0,f=r.length;o0&&(y.d+=b.n.d,y.d+=b.d),y.a>0&&(y.a+=b.n.a,y.a+=b.d),y.b>0&&(y.b+=b.n.b,y.b+=b.d),y.c>0&&(y.c+=b.n.c,y.c+=b.d),y}function wKe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A;for(y=t.d,p=t.c,c=new Ee(t.f.a+t.d.b+t.d.c,t.f.b+t.d.d+t.d.a),o=c.b,h=new L(e.a);h.a0&&(e.c[n.c.p][n.p].d+=Rs(e.i,24)*SN*.07000000029802322-.03500000014901161,e.c[n.c.p][n.p].a=e.c[n.c.p][n.p].d/e.c[n.c.p][n.p].b)}}function X$n(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_;for(A=new L(e);A.ai.d,i.d=k.Math.max(i.d,n),l&&t&&(i.d=k.Math.max(i.d,i.a),i.a=i.d+r);break;case 3:t=n>i.a,i.a=k.Math.max(i.a,n),l&&t&&(i.a=k.Math.max(i.a,i.d),i.d=i.a+r);break;case 2:t=n>i.c,i.c=k.Math.max(i.c,n),l&&t&&(i.c=k.Math.max(i.b,i.c),i.b=i.c+r);break;case 4:t=n>i.b,i.b=k.Math.max(i.b,n),l&&t&&(i.b=k.Math.max(i.b,i.c),i.c=i.b+r)}}}function mKe(e,n){var t,i,r,c,o,l,f,h,b;return h="",n.length==0?e.le(Fge,mZ,-1,-1):(b=dm(n),bn(b.substr(0,3),"at ")&&(b=(Kn(3,b.length+1),b.substr(3))),b=b.replace(/\[.*?\]/g,""),o=b.indexOf("("),o==-1?(o=b.indexOf("@"),o==-1?(h=b,b=""):(h=dm((Kn(o+1,b.length+1),b.substr(o+1))),b=dm((Zr(0,o,b.length),b.substr(0,o))))):(t=b.indexOf(")",o),h=(Zr(o+1,t,b.length),b.substr(o+1,t-(o+1))),b=dm((Zr(0,o,b.length),b.substr(0,o)))),o=yh(b,Ko(46)),o!=-1&&(b=(Kn(o+1,b.length+1),b.substr(o+1))),(b.length==0||bn(b,"Anonymous function"))&&(b=mZ),l=J$(h,Ko(58)),r=Hle(h,Ko(58),l-1),f=-1,i=-1,c=Fge,l!=-1&&r!=-1&&(c=(Zr(0,r,h.length),h.substr(0,r)),f=wOe((Zr(r+1,l,h.length),h.substr(r+1,l-(r+1)))),i=wOe((Kn(l+1,h.length+1),h.substr(l+1)))),e.le(c,b,f,i))}function K$n(e){var n,t,i,r,c,o,l,f,h,b,p;for(h=new L(e);h.a0||b.j==Xn&&b.e.c.length-b.g.c.length<0)){n=!1;break}for(r=new L(b.g);r.a=h&&de>=_&&(y+=A.n.b+N.n.b+N.a.b-ie,++l));if(t)for(o=new L(U.e);o.a=h&&de>=_&&(y+=A.n.b+N.n.b+N.a.b-ie,++l))}l>0&&(fe+=y/l,++S)}S>0?(n.a=r*fe/S,n.g=S):(n.a=0,n.g=0)}function Sge(e,n,t,i){var r,c,o,l,f;return l=new Age(n),qNn(l,i),r=!0,e&&e.nf((Gt(),Wg))&&(c=u(e.mf((Gt(),Wg)),86),r=c==(kr(),lh)||c==Zc||c==cu),mXe(l,!1),Ao(l.e.Pf(),new Xle(l,!1,r)),GK(l,l.f,(Sa(),Nu),(Ne(),Un)),GK(l,l.f,Du,bt),GK(l,l.g,Nu,Xn),GK(l,l.g,Du,Wn),BHe(l,Un),BHe(l,bt),I_e(l,Wn),I_e(l,Xn),$p(),o=l.A.Gc((tl(),u3))&&l.B.Gc((Bs(),WD))?WFe(l):null,o&&fgn(l.a,o),V$n(l),gMn(l),wMn(l),S$n(l),$In(l),FMn(l),DY(l,Un),DY(l,bt),M_n(l),dPn(l),t&&(ojn(l),HMn(l),DY(l,Wn),DY(l,Xn),f=l.B.Gc((Bs(),aA)),cqe(l,f,Un),cqe(l,f,bt),uqe(l,f,Wn),uqe(l,f,Xn),tr(new wn(null,new pn(new ut(l.i),0)),new aw),tr(oi(new wn(null,Ffe(l.r).a.oc()),new hw),new Xb),exn(l),l.e.Nf(l.o),tr(new wn(null,Ffe(l.r).a.oc()),new T1)),l.o}function Y$n(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N;for(h=Ki,i=new L(e.a.b);i.a1)for(S=new gge(A,K,i),oc(K,new uTe(e,S)),Hn(o.c,S),p=K.a.ec().Jc();p.Ob();)b=u(p.Pb(),49),Xo(c,b.b);if(l.a.gc()>1)for(S=new gge(A,l,i),oc(l,new oTe(e,S)),Hn(o.c,S),p=l.a.ec().Jc();p.Ob();)b=u(p.Pb(),49),Xo(c,b.b)}}function nRn(e,n){var t,i,r,c,o,l;if(u(T(n,(pe(),po)),22).Gc((Dc(),rf))){for(l=new L(n.a);l.a=0&&o0&&(u(zc(e.b,n),127).a.b=t)}function sRn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R;for(S=0,i=new hr,c=new ot((!n.a&&(n.a=new we(Bt,n,10,11)),n.a));c.e!=c.i.gc();)r=u(ft(c),26),Re($e(ve(r,(Oe(),Vg))))||(p=zi(r),Qz(p)&&!Re($e(ve(r,bJ)))&&(Ei(r,(pe(),Oi),me(S)),++S,Ea(r,zm)&&dr(i,u(ve(r,zm),15))),yKe(e,r,t));for(ae(t,(pe(),Tb),me(S)),ae(t,fD,me(i.a.gc())),S=0,b=new ot((!n.b&&(n.b=new we(mr,n,12,3)),n.b));b.e!=b.i.gc();)f=u(ft(b),85),Qz(n)&&(Ei(f,Oi,me(S)),++S),_=bW(f),R=pGe(f),y=Re($e(ve(_,(Oe(),Hm)))),N=!Re($e(ve(f,Vg))),A=y&&b2(f)&&Re($e(ve(f,Ug))),o=zi(_)==n&&zi(_)==zi(R),l=(zi(_)==n&&R==n)^(zi(R)==n&&_==n),N&&!A&&(l||o)&&Nge(e,f,n,t);if(zi(n))for(h=new ot(F_e(zi(n)));h.e!=h.i.gc();)f=u(ft(h),85),_=bW(f),_==n&&b2(f)&&(A=Re($e(ve(_,(Oe(),Hm))))&&Re($e(ve(f,Ug))),A&&Nge(e,f,n,t))}function lRn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn,Cn;for(fe=new Te,A=new L(e.b);A.a=n.length)return{done:!0};var r=n[i++];return{value:[r,t.get(r)],done:!1}}}},c_n()||(e.prototype.createObject=function(){return{}},e.prototype.get=function(n){return this.obj[":"+n]},e.prototype.set=function(n,t){this.obj[":"+n]=t},e.prototype[HZ]=function(n){delete this.obj[":"+n]},e.prototype.keys=function(){var n=[];for(var t in this.obj)t.charCodeAt(0)==58&&n.push(t.substring(1));return n}),e}function Ci(){Ci=Y,HM=new yi(uwe),new Pi("DEPTH",me(0)),pre=new Pi("FAN",me(0)),wye=new Pi(GYe,me(0)),_b=new Pi("ROOT",(Ln(),!1)),yre=new Pi("LEFTNEIGHBOR",null),esn=new Pi("RIGHTNEIGHBOR",null),zJ=new Pi("LEFTSIBLING",null),kre=new Pi("RIGHTSIBLING",null),wre=new Pi("DUMMY",!1),new Pi("LEVEL",me(0)),vye=new Pi("REMOVABLE_EDGES",new Mi),xD=new Pi("XCOOR",me(0)),TD=new Pi("YCOOR",me(0)),FJ=new Pi("LEVELHEIGHT",0),Da=new Pi("LEVELMIN",0),ta=new Pi("LEVELMAX",0),mre=new Pi("GRAPH_XMIN",0),vre=new Pi("GRAPH_YMIN",0),pye=new Pi("GRAPH_XMAX",0),mye=new Pi("GRAPH_YMAX",0),gye=new Pi("COMPACT_LEVEL_ASCENSION",!1),gre=new Pi("COMPACT_CONSTRAINTS",new Te),FM=new Pi("ID",""),JM=new Pi("POSITION",me(0)),a0=new Pi("PRELIM",0),Y7=new Pi("MODIFIER",0),Q7=new yi(ZQe),AD=new yi(eYe)}function dRn(e){rge();var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_;if(e==null)return null;if(p=e.length*8,p==0)return"";for(l=p%24,S=p/24|0,y=l!=0?S+1:S,c=null,c=oe(sf,Dh,30,y*4,15,1),h=0,b=0,n=0,t=0,i=0,o=0,r=0,f=0;f>24,h=(n&3)<<24>>24,A=(n&-128)==0?n>>2<<24>>24:(n>>2^192)<<24>>24,N=(t&-128)==0?t>>4<<24>>24:(t>>4^240)<<24>>24,_=(i&-128)==0?i>>6<<24>>24:(i>>6^252)<<24>>24,c[o++]=y0[A],c[o++]=y0[N|h<<4],c[o++]=y0[b<<2|_],c[o++]=y0[i&63];return l==8?(n=e[r],h=(n&3)<<24>>24,A=(n&-128)==0?n>>2<<24>>24:(n>>2^192)<<24>>24,c[o++]=y0[A],c[o++]=y0[h<<4],c[o++]=61,c[o++]=61):l==16&&(n=e[r],t=e[r+1],b=(t&15)<<24>>24,h=(n&3)<<24>>24,A=(n&-128)==0?n>>2<<24>>24:(n>>2^192)<<24>>24,N=(t&-128)==0?t>>4<<24>>24:(t>>4^240)<<24>>24,c[o++]=y0[A],c[o++]=y0[N|h<<4],c[o++]=y0[b<<2],c[o++]=61),Ah(c,0,c.length)}function bRn(e,n){var t,i,r,c,o,l,f;if(e.e==0&&e.p>0&&(e.p=-(e.p-1)),e.p>Kr&&zae(n,e.p-pb),o=n.q.getDate(),KC(n,1),e.k>=0&&G5n(n,e.k),e.c>=0?KC(n,e.c):e.k>=0?(f=new w1e(n.q.getFullYear()-pb,n.q.getMonth(),35),i=35-f.q.getDate(),KC(n,k.Math.min(i,o))):KC(n,o),e.f<0&&(e.f=n.q.getHours()),e.b>0&&e.f<12&&(e.f+=12),e2n(n,e.f==24&&e.g?0:e.f),e.j>=0&&E9n(n,e.j),e.n>=0&&L9n(n,e.n),e.i>=0&&ZTe(n,yc(bc(GO(Pu(n.q.getTime()),t0),t0),e.i)),e.a&&(r=new o$,zae(r,r.q.getFullYear()-pb-80),GX(Pu(n.q.getTime()),Pu(r.q.getTime()))&&zae(n,r.q.getFullYear()-pb+100)),e.d>=0){if(e.c==-1)t=(7+e.d-n.q.getDay())%7,t>3&&(t-=7),l=n.q.getMonth(),KC(n,n.q.getDate()+t),n.q.getMonth()!=l&&KC(n,n.q.getDate()+(t>0?-7:7));else if(n.q.getDay()!=e.d)return!1}return e.o>Kr&&(c=n.q.getTimezoneOffset(),ZTe(n,yc(Pu(n.q.getTime()),(e.o-c)*60*t0))),!0}function SKe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie;if(r=T(n,(pe(),pi)),!!X(r,206)){for(A=u(r,26),N=n.e,y=new mc(n.c),c=n.d,y.a+=c.b,y.b+=c.d,ie=u(ve(A,(Oe(),SJ)),182),ls(ie,(Bs(),bG))&&(S=u(ve(A,s5e),104),ZU(S,c.a),iX(S,c.d),eX(S,c.b),nX(S,c.c)),t=new Te,b=new L(n.a);b.ai.c.length-1;)xe(i,new jc(Hv,z2e));t=u(T(r,Hh),15).a,G1(u(T(e,J2),86))?(r.e.ate(re((mn(t,i.c.length),u(i.c[t],49)).b))&&UT((mn(t,i.c.length),u(i.c[t],49)),r.e.a+r.f.a)):(r.e.bte(re((mn(t,i.c.length),u(i.c[t],49)).b))&&UT((mn(t,i.c.length),u(i.c[t],49)),r.e.b+r.f.b))}for(c=jt(e.b,0);c.b!=c.d.c;)r=u(kt(c),40),t=u(T(r,(Tu(),Hh)),15).a,ae(r,(Ci(),Da),re((mn(t,i.c.length),u(i.c[t],49)).a)),ae(r,ta,re((mn(t,i.c.length),u(i.c[t],49)).b));n.Ug()}function wRn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N;for(e.o=te(re(T(e.i,(Oe(),Qg)))),e.f=te(re(T(e.i,Cb))),e.j=e.i.b.c.length,l=e.j-1,y=0,e.k=0,e.n=0,e.b=Jf(oe(Mr,Ae,15,e.j,0,1)),e.c=Jf(oe(wr,Ae,346,e.j,7,1)),o=new L(e.i.b);o.a0&&xe(e.q,b),xe(e.p,b);n-=i,S=f+n,h+=n*e.f,bl(e.b,l,me(S)),bl(e.c,l,h),e.k=k.Math.max(e.k,S),e.n=k.Math.max(e.n,h),e.e+=n,n+=N}}function xKe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K;if(n.b!=0){for(S=new Mi,l=null,A=null,i=ac(k.Math.floor(k.Math.log(n.b)*k.Math.LOG10E)+1),f=0,K=jt(n,0);K.b!=K.d.c;)for(R=u(kt(K),40),ue(A)!==ue(T(R,(Ci(),FM)))&&(A=_t(T(R,FM)),f=0),A!=null?l=A+lLe(f++,i):l=lLe(f++,i),ae(R,FM,l),_=(r=jt(new J1(R).a.d,0),new X3(r));nC(_.a);)N=u(kt(_.a),65).c,Vi(S,N,S.c.b,S.c),ae(N,FM,l);for(y=new wt,o=0;o0&&(K-=S),wge(o,K),b=0,y=new L(o.a);y.a0),l.a.Xb(l.c=--l.b)),f=.4*i*b,!c&&l.b0&&(f=(Kn(0,n.length),n.charCodeAt(0)),f!=64)){if(f==37&&(p=n.lastIndexOf("%"),h=!1,p!=0&&(p==y-1||(h=(Kn(p+1,n.length),n.charCodeAt(p+1)==46))))){if(o=(Zr(1,p,n.length),n.substr(1,p-1)),K=bn("%",o)?null:Tge(o),i=0,h)try{i=vl((Kn(p+2,n.length+1),n.substr(p+2)),Kr,ui)}catch(ie){throw ie=lr(ie),X(ie,131)?(l=ie,$(new aB(l))):$(ie)}for(_=qhe(e.Dh());_.Ob();)if(A=LB(_),X(A,504)&&(r=u(A,587),U=r.d,(K==null?U==null:bn(K,U))&&i--==0))return r;return null}if(b=n.lastIndexOf("."),S=b==-1?n:(Zr(0,b,n.length),n.substr(0,b)),t=0,b!=-1)try{t=vl((Kn(b+1,n.length+1),n.substr(b+1)),Kr,ui)}catch(ie){if(ie=lr(ie),X(ie,131))S=n;else throw $(ie)}for(S=bn("%",S)?null:Tge(S),N=qhe(e.Dh());N.Ob();)if(A=LB(N),X(A,197)&&(c=u(A,197),R=c.ve(),(S==null?R==null:bn(S,R))&&t--==0))return c;return null}return hKe(e,n)}function jRn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U;for(b=new wt,f=new Zw,i=new L(e.a.a.b);i.an.d.c){if(S=e.c[n.a.d],_=e.c[p.a.d],S==_)continue;Kf($f(Pf(Rf(Lf(new af,1),100),S),_))}}}}}function SRn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe;if(y=u(u(mi(e.r,n),22),83),n==(Ne(),Wn)||n==Xn){kKe(e,n);return}for(c=n==Un?(u2(),YN):(u2(),WN),ie=n==Un?(Vo(),Oa):(Vo(),Zf),t=u(zc(e.b,n),127),i=t.i,r=i.c+gv(z(B(Gr,1),Hc,30,15,[t.n.b,e.C.b,e.k])),R=i.c+i.b-gv(z(B(Gr,1),Hc,30,15,[t.n.c,e.C.c,e.k])),o=Poe(Vle(c),e.t),U=n==Un?Ir:Ki,p=y.Jc();p.Ob();)h=u(p.Pb(),115),!(!h.c||h.c.d.c.length<=0)&&(_=h.b.Kf(),N=h.e,S=h.c,A=S.i,A.b=(f=S.n,S.e.a+f.b+f.c),A.a=(l=S.n,S.e.b+l.d+l.a),UC(ie,Zge),S.f=ie,ja(S,(ks(),Wf)),A.c=N.a-(A.b-_.a)/2,de=k.Math.min(r,N.a),fe=k.Math.max(R,N.a+_.a),A.cfe&&(A.c=fe-A.b),xe(o.d,new hK(A,q1e(o,A))),U=n==Un?k.Math.max(U,N.b+h.b.Kf().b):k.Math.min(U,N.b));for(U+=n==Un?e.t:-e.t,K=fde((o.e=U,o)),K>0&&(u(zc(e.b,n),127).a.b=K),b=y.Jc();b.Ob();)h=u(b.Pb(),115),!(!h.c||h.c.d.c.length<=0)&&(A=h.c.i,A.c-=h.e.a,A.d-=h.e.b)}function MRn(e,n){KW();var t,i,r,c,o,l,f,h,b,p,y,S,A,N;if(f=ao(e,0)<0,f&&(e=Ud(e)),ao(e,0)==0)switch(n){case 0:return"0";case 1:return e7;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return S=new z0,n<0?S.a+="0E+":S.a+="0E",S.a+=n==Kr?"2147483648":""+-n,S.a}b=18,p=oe(sf,Dh,30,b+1,15,1),t=b,N=e;do h=N,N=GO(N,10),p[--t]=Lt(yc(48,pf(h,bc(N,10))))&Er;while(ao(N,0)!=0);if(r=pf(pf(pf(b,t),n),1),n==0)return f&&(p[--t]=45),Ah(p,t,b-t);if(n>0&&ao(r,-6)>=0){if(ao(r,0)>=0){for(c=t+Lt(r),l=b-1;l>=c;l--)p[l+1]=p[l];return p[++c]=46,f&&(p[--t]=45),Ah(p,t,b-t+1)}for(o=2;GX(o,yc(Ud(r),1));o++)p[--t]=48;return p[--t]=46,p[--t]=48,f&&(p[--t]=45),Ah(p,t,b-t)}return A=t+1,i=b,y=new x5,f&&(y.a+="-"),i-A>=1?(hg(y,p[t]),y.a+=".",y.a+=Ah(p,t+1,b-t-1)):y.a+=Ah(p,t,b-t),y.a+="E",ao(r,0)>0&&(y.a+="+"),y.a+=""+hj(r),y.a}function TKe(e){Cp(e,new d2(KP(xp(Sp(Ap(Mp(new Nd,Zl),"ELK Radial"),'A radial layout provider which is based on the algorithm of Peter Eades published in "Drawing free trees.", published by International Institute for Advanced Study of Social Information Science, Fujitsu Limited in 1991. The radial layouter takes a tree and places the nodes in radial order around the root. The nodes of the same tree level are placed on the same radius.'),new Lx),Zl))),Me(e,Zl,IF,Ie(Qsn)),Me(e,Zl,Mm,Ie(Ysn)),Me(e,Zl,zv,Ie(Usn)),Me(e,Zl,_y,Ie(Xsn)),Me(e,Zl,Dy,Ie(Vsn)),Me(e,Zl,s7,Ie(qsn)),Me(e,Zl,NS,Ie(Vye)),Me(e,Zl,l7,Ie(Ksn)),Me(e,Zl,nne,Ie(Ire)),Me(e,Zl,ene,Ie(Lre)),Me(e,Zl,zF,Ie(Qye)),Me(e,Zl,tne,Ie(Pre)),Me(e,Zl,ine,Ie(Yye)),Me(e,Zl,rpe,Ie(Wye)),Me(e,Zl,ipe,Ie(Kye)),Me(e,Zl,Z2e,Ie(UJ)),Me(e,Zl,epe,Ie(XJ)),Me(e,Zl,npe,Ie(CD)),Me(e,Zl,tpe,Ie(Zye)),Me(e,Zl,W2e,Ie(Xye))}function m2(e,n,t,i,r){var c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe;if(_=new Ee(e.g,e.f),N=$0e(e),N.a=k.Math.max(N.a,n),N.b=k.Math.max(N.b,t),fe=N.a/_.a,b=N.b/_.b,ie=N.a-_.a,f=N.b-_.b,i)for(o=zi(e)?u(ve(zi(e),(Gt(),Wg)),86):u(ve(e,(Gt(),Wg)),86),l=ue(ve(e,(Gt(),tA)))===ue((Fr(),to)),U=new ot((!e.c&&(e.c=new we(Hs,e,9,9)),e.c));U.e!=U.i.gc();)switch(R=u(ft(U),125),K=u(ve(R,k4),64),K==(Ne(),Eu)&&(K=cge(R,o),Ei(R,k4,K)),K.g){case 1:l||Ls(R,R.i*fe);break;case 2:Ls(R,R.i+ie),l||Ps(R,R.j*b);break;case 3:l||Ls(R,R.i*fe),Ps(R,R.j+f);break;case 4:l||Ps(R,R.j*b)}if(Fw(e,N.a,N.b),r)for(y=new ot((!e.n&&(e.n=new we(ju,e,1,7)),e.n));y.e!=y.i.gc();)p=u(ft(y),157),S=p.i+p.g/2,A=p.j+p.f/2,de=S/_.a,h=A/_.b,de+h>=1&&(de-h>0&&A>=0?(Ls(p,p.i+ie),Ps(p,p.j+f*h)):de-h<0&&S>=0&&(Ls(p,p.i+ie*de),Ps(p,p.j+f)));return Ei(e,(Gt(),Zg),(tl(),c=u(pa(fA),10),new Jl(c,u(zf(c,c.length),10),0))),new Ee(fe,b)}function tF(e){var n,t,i,r,c,o,l,f,h,b,p;if(e==null)throw $(new vh(Yo));if(h=e,c=e.length,f=!1,c>0&&(n=(Kn(0,e.length),e.charCodeAt(0)),(n==45||n==43)&&(e=(Kn(1,e.length+1),e.substr(1)),--c,f=n==45)),c==0)throw $(new vh(k2+h+'"'));for(;e.length>0&&(Kn(0,e.length),e.charCodeAt(0)==48);)e=(Kn(1,e.length+1),e.substr(1)),--c;if(c>(oVe(),Yen)[10])throw $(new vh(k2+h+'"'));for(r=0;r0&&(p=-parseInt((Zr(0,i,e.length),e.substr(0,i)),10),e=(Kn(i,e.length+1),e.substr(i)),c-=i,t=!1);c>=o;){if(i=parseInt((Zr(0,o,e.length),e.substr(0,o)),10),e=(Kn(o,e.length+1),e.substr(o)),c-=o,t)t=!1;else{if(ao(p,l)<0)throw $(new vh(k2+h+'"'));p=bc(p,b)}p=pf(p,i)}if(ao(p,0)>0)throw $(new vh(k2+h+'"'));if(!f&&(p=Ud(p),ao(p,0)<0))throw $(new vh(k2+h+'"'));return p}function Tge(e){nZ();var n,t,i,r,c,o,l,f;if(e==null)return null;if(r=yh(e,Ko(37)),r<0)return e;for(f=new fl((Zr(0,r,e.length),e.substr(0,r))),n=oe(ps,qv,30,4,15,1),l=0,i=0,o=e.length;rr+2&&eY((Kn(r+1,e.length),e.charCodeAt(r+1)),J8e,G8e)&&eY((Kn(r+2,e.length),e.charCodeAt(r+2)),J8e,G8e))if(t=Q3n((Kn(r+1,e.length),e.charCodeAt(r+1)),(Kn(r+2,e.length),e.charCodeAt(r+2))),r+=2,i>0?(t&192)==128?n[l++]=t<<24>>24:i=0:t>=128&&((t&224)==192?(n[l++]=t<<24>>24,i=2):(t&240)==224?(n[l++]=t<<24>>24,i=3):(t&248)==240&&(n[l++]=t<<24>>24,i=4)),i>0){if(l==i){switch(l){case 2:{hg(f,((n[0]&31)<<6|n[1]&63)&Er);break}case 3:{hg(f,((n[0]&15)<<12|(n[1]&63)<<6|n[2]&63)&Er);break}}l=0,i=0}}else{for(c=0;c=2){if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i==0)t=(H0(),r=new yo,r),Et((!e.a&&(e.a=new we($i,e,6,6)),e.a),t);else if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i>1)for(y=new $5((!e.a&&(e.a=new we($i,e,6,6)),e.a));y.e!=y.i.gc();)tS(y);oge(n,u(V((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170))}if(p)for(i=new ot((!e.a&&(e.a=new we($i,e,6,6)),e.a));i.e!=i.i.gc();)for(t=u(ft(i),170),h=new ot((!t.a&&(t.a=new yr(Tl,t,5)),t.a));h.e!=h.i.gc();)f=u(ft(h),372),l.a=k.Math.max(l.a,f.a),l.b=k.Math.max(l.b,f.b);for(o=new ot((!e.n&&(e.n=new we(ju,e,1,7)),e.n));o.e!=o.i.gc();)c=u(ft(o),157),b=u(ve(c,rA),8),b&&Fl(c,b.a,b.b),p&&(l.a=k.Math.max(l.a,c.i+c.g),l.b=k.Math.max(l.b,c.j+c.f));return l}function OKe(e,n,t,i,r){var c,o,l;if(ERe(e,n),o=n[0],c=uc(t.c,0),l=-1,k1e(t))if(i>0){if(o+i>e.length)return!1;l=Nz((Zr(0,o+i,e.length),e.substr(0,o+i)),n)}else l=Nz(e,n);switch(c){case 71:return l=Ov(e,o,z(B(Be,1),Ae,2,6,[bQe,gQe]),n),r.e=l,!0;case 77:return qDn(e,n,r,l,o);case 76:return UDn(e,n,r,l,o);case 69:return VTn(e,n,o,r);case 99:return KTn(e,n,o,r);case 97:return l=Ov(e,o,z(B(Be,1),Ae,2,6,["AM","PM"]),n),r.b=l,!0;case 121:return XDn(e,n,o,l,t,r);case 100:return l<=0?!1:(r.c=l,!0);case 83:return l<0?!1:Ajn(l,o,n[0],r);case 104:l==12&&(l=0);case 75:case 72:return l<0?!1:(r.f=l,r.g=!1,!0);case 107:return l<0?!1:(r.f=l,r.g=!0,!0);case 109:return l<0?!1:(r.j=l,!0);case 115:return l<0?!1:(r.n=l,!0);case 90:if(ocn[f]&&(_=f),p=new L(e.a.b);p.a=l){at(U.b>0),U.a.Xb(U.c=--U.b);break}else _.a>f&&(i?(Ar(i.b,_.b),i.a=k.Math.max(i.a,_.a),Ns(U)):(xe(_.b,b),_.c=k.Math.min(_.c,f),_.a=k.Math.max(_.a,l),i=_));i||(i=new oMe,i.c=f,i.a=l,Rp(U,i),xe(i.b,b))}for(o=e.b,h=0,R=new L(t);R.a1;){if(r=RNn(n),p=c.g,A=u(ve(n,XM),104),N=te(re(ve(n,YJ))),(!n.a&&(n.a=new we(Bt,n,10,11)),n.a).i>1&&te(re(ve(n,(l1(),qre))))!=Ki&&(c.c+(A.b+A.c))/(c.b+(A.d+A.a))1&&te(re(ve(n,(l1(),Gre))))!=Ki&&(c.c+(A.b+A.c))/(c.b+(A.d+A.a))>N&&Ei(r,(l1(),Wm),k.Math.max(te(re(ve(n,UM))),te(re(ve(r,Wm)))-te(re(ve(n,Gre))))),S=new Cse(i,b),f=XKe(S,r,y),h=f.g,h>=p&&h==h){for(o=0;o<(!r.a&&(r.a=new we(Bt,r,10,11)),r.a).i;o++)yqe(e,u(V((!r.a&&(r.a=new we(Bt,r,10,11)),r.a),o),26),u(V((!n.a&&(n.a=new we(Bt,n,10,11)),n.a),o),26));XRe(n,S),N5n(c,f.c),O5n(c,f.b)}--l}Ei(n,(l1(),W7),c.b),Ei(n,t6,c.c),t.Ug()}function ORn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn;for(n.Tg("Compound graph postprocessor",1),t=Re($e(T(e,(Oe(),Gie)))),l=u(T(e,(pe(),Gve)),229),b=new hr,R=l.ec().Jc();R.Ob();){for(_=u(R.Pb(),17),o=new vs(l.cc(_)),yn(),Nr(o,new eoe(e)),de=C7n((mn(0,o.c.length),u(o.c[0],250))),_e=HBe(u(Le(o,o.c.length-1),250)),K=de.i,a8(_e.i,K)?U=K.e:U=Pr(K),p=wSn(_,o),Ws(_.a),y=null,c=new L(o);c.aIh,tn=k.Math.abs(y.b-A.b)>Ih,(!t&&cn&&tn||t&&(cn||tn))&&Vt(_.a,ie)),dc(_.a,i),i.b==0?y=ie:y=(at(i.b!=0),u(i.c.b.c,8)),ukn(S,p,N),HBe(r)==_e&&(Pr(_e.i)!=r.a&&(N=new Yr,I0e(N,Pr(_e.i),U)),ae(_,Sie,N)),hTn(S,_,U),b.a.yc(S,b);hc(_,de),Ur(_,_e)}for(h=b.a.ec().Jc();h.Ob();)f=u(h.Pb(),17),hc(f,null),Ur(f,null);n.Ug()}function NRn(e,n){var t,i,r,c,o,l,f,h,b,p,y;for(r=u(T(e,(Tu(),J2)),86),b=r==(kr(),Zc)||r==cu?sh:cu,t=u(ys(oi(new wn(null,new pn(e.b,16)),new R3),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),16),f=u(ys(So(t.Mc(),new Nje(n)),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[Wo]))),16),f.Fc(u(ys(So(t.Mc(),new Dje(n)),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[Wo]))),18)),f.gd(new _je(b)),y=new $d(new Ije(r)),i=new wt,l=f.Jc();l.Ob();)o=u(l.Pb(),240),h=u(o.a,40),Re($e(o.c))?(y.a.yc(h,(Ln(),jb))==null,new k9(y.a.Xc(h,!1)).a.gc()>0&&Zt(i,h,u(new k9(y.a.Xc(h,!1)).a.Tc(),40)),new k9(y.a.$c(h,!0)).a.gc()>1&&Zt(i,YFe(y,h),h)):(new k9(y.a.Xc(h,!1)).a.gc()>0&&(c=u(new k9(y.a.Xc(h,!1)).a.Tc(),40),ue(c)===ue(bu(Xc(i.f,h)))&&u(T(h,(Ci(),gre)),16).Ec(c)),new k9(y.a.$c(h,!0)).a.gc()>1&&(p=YFe(y,h),ue(bu(Xc(i.f,p)))===ue(h)&&u(T(p,(Ci(),gre)),16).Ec(h)),y.a.Ac(h)!=null)}function NKe(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie;if(e.gc()==1)return u(e.Xb(0),235);if(e.gc()<=0)return new nB;for(r=e.Jc();r.Ob();){for(t=u(r.Pb(),235),A=0,b=ui,p=ui,f=Kr,h=Kr,S=new L(t.e);S.al&&(K=0,ie+=o+R,o=0),cIn(N,t,K,ie),n=k.Math.max(n,K+_.a),o=k.Math.max(o,_.b),K+=_.a+R;return N}function DRn(e){rge();var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_;if(e==null||(c=hB(e),A=xEn(c),A%4!=0))return null;if(N=A/4|0,N==0)return oe(ps,qv,30,0,15,1);for(p=null,n=0,t=0,i=0,r=0,o=0,l=0,f=0,h=0,S=0,y=0,b=0,p=oe(ps,qv,30,N*3,15,1);S>4)<<24>>24,p[y++]=((t&15)<<4|i>>2&15)<<24>>24,p[y++]=(i<<6|r)<<24>>24}return!rC(o=c[b++])||!rC(l=c[b++])?null:(n=dh[o],t=dh[l],f=c[b++],h=c[b++],dh[f]==-1||dh[h]==-1?f==61&&h==61?(t&15)!=0?null:(_=oe(ps,qv,30,S*3+1,15,1),Wu(p,0,_,0,S*3),_[y]=(n<<2|t>>4)<<24>>24,_):f!=61&&h==61?(i=dh[f],(i&3)!=0?null:(_=oe(ps,qv,30,S*3+2,15,1),Wu(p,0,_,0,S*3),_[y++]=(n<<2|t>>4)<<24>>24,_[y]=((t&15)<<4|i>>2&15)<<24>>24,_)):null:(i=dh[f],r=dh[h],p[y++]=(n<<2|t>>4)<<24>>24,p[y++]=((t&15)<<4|i>>2&15)<<24>>24,p[y++]=(i<<6|r)<<24>>24,p))}function _Rn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de;for(n.Tg(yYe,1),A=u(T(e,(Oe(),gd)),222),r=new L(e.b);r.a=2){for(N=!0,y=new L(c.j),t=u(I(y),12),S=null;y.a0)if(i=p.gc(),h=ac(k.Math.floor((i+1)/2))-1,r=ac(k.Math.ceil((i+1)/2))-1,n.o==ch)for(b=r;b>=h;b--)n.a[ie.p]==ie&&(N=u(p.Xb(b),49),A=u(N.a,9),!hf(t,N.b)&&S>e.b.e[A.p]&&(n.a[A.p]=ie,n.g[ie.p]=n.g[A.p],n.a[ie.p]=n.g[ie.p],n.f[n.g[ie.p].p]=(Ln(),!!(Re(n.f[n.g[ie.p].p])&ie.k==(Bn(),br))),S=e.b.e[A.p]));else for(b=h;b<=r;b++)n.a[ie.p]==ie&&(R=u(p.Xb(b),49),_=u(R.a,9),!hf(t,R.b)&&S0&&(r=u(Le(_.c.a,fe-1),9),o=e.i[r.p],cn=k.Math.ceil(cv(e.n,r,_)),c=de.a.e-_.d.d-(o.a.e+r.o.b+r.d.a)-cn),h=Ki,fe<_.c.a.c.length-1&&(f=u(Le(_.c.a,fe+1),9),b=e.i[f.p],cn=k.Math.ceil(cv(e.n,f,_)),h=b.a.e-f.d.d-(de.a.e+_.o.b+_.d.a)-cn),t&&(Ba(),qf(Ph),k.Math.abs(c-h)<=Ph||c==h||isNaN(c)&&isNaN(h))?!0:(i=jK(K.a),l=-jK(K.b),p=-jK(_e.a),U=jK(_e.b),N=K.a.e.e-K.a.a-(K.b.e.e-K.b.a)>0&&_e.a.e.e-_e.a.a-(_e.b.e.e-_e.b.a)<0,A=K.a.e.e-K.a.a-(K.b.e.e-K.b.a)<0&&_e.a.e.e-_e.a.a-(_e.b.e.e-_e.b.a)>0,S=K.a.e.e+K.b.a<_e.b.e.e+_e.a.a,y=K.a.e.e+K.b.a>_e.b.e.e+_e.a.a,ie=0,!N&&!A&&(y?c+p>0?ie=p:h-i>0&&(ie=i):S&&(c+l>0?ie=l:h-U>0&&(ie=U))),de.a.e+=ie,de.b&&(de.d.e+=ie),!1))}function _Ke(e,n,t){var i,r,c,o,l,f,h,b,p,y;if(i=new Ff(n.Jf().a,n.Jf().b,n.Kf().a,n.Kf().b),r=new L5,e.c)for(o=new L(n.Pf());o.a0&&Dr(S,(mn(t,n.c.length),u(n.c[t],25))),c=0,y=!0,R=nl(wg(or(S))),f=R.Jc();f.Ob();){for(l=u(f.Pb(),17),y=!1,p=l,h=0;h(mn(h,n.c.length),u(n.c[h],25)).a.c.length?Dr(r,(mn(h,n.c.length),u(n.c[h],25))):lb(r,i+c,(mn(h,n.c.length),u(n.c[h],25))),p=NW(p,r);t>0&&(c+=1)}if(y){for(h=0;h(mn(h,n.c.length),u(n.c[h],25)).a.c.length?Dr(r,(mn(h,n.c.length),u(n.c[h],25))):lb(r,i+c,(mn(h,n.c.length),u(n.c[h],25)));t>0&&(c+=1)}for(o=!1,N=new Gn(Vn(Di(S).a.Jc(),new ee));ht(N);){for(A=u(it(N),17),p=A,b=t+1;b(mn(h,n.c.length),u(n.c[h],25)).a.c.length?Dr(_,(mn(h,n.c.length),u(n.c[h],25))):lb(_,i+1,(mn(h,n.c.length),u(n.c[h],25))));o&&(c+=1),o=!0}return c>0?c-1:0}function bb(e,n){fi();var t,i,r,c,o,l,f,h,b,p,y,S,A;if(_E(fk)==0){for(p=oe(hzn,Ae,121,mhn.length,0,1),o=0;oh&&(i.a+=BCe(oe(sf,Dh,30,-h,15,1))),i.a+="Is",yh(f,Ko(32))>=0)for(r=0;r=i.o.b/2}else U=!p;U?(R=u(T(i,(pe(),Wy)),16),R?y?c=R:(r=u(T(i,qy),16),r?R.gc()<=r.gc()?c=R:c=r:(c=new Te,ae(i,qy,c))):(c=new Te,ae(i,Wy,c))):(r=u(T(i,(pe(),qy)),16),r?p?c=r:(R=u(T(i,Wy),16),R?r.gc()<=R.gc()?c=r:c=R:(c=new Te,ae(i,Wy,c))):(c=new Te,ae(i,qy,c))),c.Ec(e),ae(e,(pe(),cJ),t),n.d==t?(Ur(n,null),t.e.c.length+t.g.c.length==0&&wu(t,null),_kn(t)):(hc(n,null),t.e.c.length+t.g.c.length==0&&wu(t,null)),Ws(n.a)}function RRn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn,Cn,st,Qt,qi;for(t.Tg("MinWidth layering",1),S=n.b,_e=n.a,qi=u(T(n,(Oe(),e5e)),15).a,l=u(T(n,n5e),15).a,e.b=te(re(T(n,na))),e.d=Ki,ie=new L(_e);ie.aS&&(c&&(pc(fe,y),pc(cn,me(h.b-1))),Qt=t.b,qi+=y+n,y=0,b=k.Math.max(b,t.b+t.c+st)),Ls(l,Qt),Ps(l,qi),b=k.Math.max(b,Qt+st+t.c),y=k.Math.max(y,p),Qt+=st+n;if(b=k.Math.max(b,i),Cn=qi+y+t.a,Cn0?(h=0,_&&(h+=l),h+=(tn-1)*o,K&&(h+=l),cn&&K&&(h=k.Math.max(h,rDn(K,o,U,_e))),h=e.a&&(i=yLn(e,U),b=k.Math.max(b,i.b),ie=k.Math.max(ie,i.d),xe(l,new jc(U,i)));for(cn=new Te,h=0;h0),_.a.Xb(_.c=--_.b),tn=new Xu(e.b),Rp(_,tn),at(_.b<_.d.gc()),_.d.Xb(_.c=_.b++),tn));for(o=new L(l);o.a0){for(y=b<100?null:new F0(b),h=new n1e(n),A=h.g,R=oe(It,ei,30,b,15,1),i=0,ie=new t2(b),r=0;r=0;)if(S!=null?di(S,A[f]):ue(S)===ue(A[f])){R.length<=i&&(_=R,R=oe(It,ei,30,2*R.length,15,1),Wu(_,0,R,0,i)),R[i++]=r,Et(ie,A[f]);break e}if(S=S,ue(S)===ue(l))break}}if(h=ie,A=ie.g,b=i,i>R.length&&(_=R,R=oe(It,ei,30,i,15,1),Wu(_,0,R,0,i)),i>0){for(K=!0,c=0;c=0;)gy(e,R[o]);if(i!=b){for(r=b;--r>=i;)gy(h,r);_=R,R=oe(It,ei,30,i,15,1),Wu(_,0,R,0,i)}n=h}}}else for(n=EMn(e,n),r=e.i;--r>=0;)n.Gc(e.g[r])&&(gy(e,r),K=!0);if(K){if(R!=null){for(t=n.gc(),p=t==1?kj(e,4,n.Jc().Pb(),null,R[0],N):kj(e,6,n,R,R[0],N),y=t<100?null:new F0(t),r=n.Jc();r.Ob();)S=r.Pb(),y=Gle(e,u(S,75),y);y?(y.lj(p),y.mj()):hi(e.e,p)}else{for(y=Npn(n.gc()),r=n.Jc();r.Ob();)S=r.Pb(),y=Gle(e,u(S,75),y);y&&y.mj()}return!0}else return!1}function JRn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K;for(t=new HHe(n),t.a||wIn(n),h=b_n(n),f=new Zw,_=new ZUe,N=new L(n.a);N.a0||t.o==ch&&r=t}function qRn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn;for(K=e.a,ie=0,de=K.length;ie0?(p=u(Le(y.c.a,o-1),9),cn=cv(e.b,y,p),_=y.n.b-y.d.d-(p.n.b+p.o.b+p.d.a+cn)):_=y.n.b-y.d.d,h=k.Math.min(_,h),o1&&(o=k.Math.min(o,k.Math.abs(u(Qu(l.a,1),8).b-b.b)))));else for(N=new L(n.j);N.ar&&(c=y.a-r,o=ui,i.c.length=0,r=y.a),y.a>=r&&(Hn(i.c,l),l.a.b>1&&(o=k.Math.min(o,k.Math.abs(u(Qu(l.a,l.a.b-2),8).b-y.b)))));if(i.c.length!=0&&c>n.o.a/2&&o>n.o.b/2){for(S=new Yu,wu(S,n),Tr(S,(Ne(),Un)),S.n.a=n.o.a/2,R=new Yu,wu(R,n),Tr(R,bt),R.n.a=n.o.a/2,R.n.b=n.o.b,f=new L(i);f.a=h.b?hc(l,R):hc(l,S)):(h=u(B3n(l.a),8),_=l.a.b==0?Ja(l.c):u(Bf(l.a),8),_.b>=h.b?Ur(l,R):Ur(l,S)),p=u(T(l,(Oe(),Wc)),78),p&&om(p,h,!0);n.n.a=r-n.o.a/2}}function VRn(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(l=jt(e.b,0);l.b!=l.d.c;)if(o=u(kt(l),40),!bn(o.c,$F))for(h=EOn(o,e),n==(kr(),Zc)||n==cu?Nr(h,new xI):Nr(h,new rU),f=h.c.length,i=0;i=0?S=ay(l):S=IO(ay(l)),e.of(G7,S)),h=new Yr,y=!1,e.nf(F2)?(gle(h,u(e.mf(F2),8)),y=!0):f2n(h,o.a/2,o.b/2),S.g){case 4:ae(b,ku,(el(),bd)),ae(b,oJ,(jg(),e4)),b.o.b=o.b,N<0&&(b.o.a=-N),Tr(p,(Ne(),Wn)),y||(h.a=o.a),h.a-=o.a;break;case 2:ae(b,ku,(el(),qg)),ae(b,oJ,(jg(),$7)),b.o.b=o.b,N<0&&(b.o.a=-N),Tr(p,(Ne(),Xn)),y||(h.a=0);break;case 1:ae(b,Jg,(Z1(),t4)),b.o.a=o.a,N<0&&(b.o.b=-N),Tr(p,(Ne(),bt)),y||(h.b=o.b),h.b-=o.b;break;case 3:ae(b,Jg,(Z1(),Gy)),b.o.a=o.a,N<0&&(b.o.b=-N),Tr(p,(Ne(),Un)),y||(h.b=0)}if(gle(p.n,h),ae(b,F2,h),n==ew||n==j1||n==to){if(A=0,n==ew&&e.nf(l0))switch(S.g){case 1:case 2:A=u(e.mf(l0),15).a;break;case 3:case 4:A=-u(e.mf(l0),15).a}else switch(S.g){case 4:case 2:A=c.b,n==j1&&(A/=r.b);break;case 1:case 3:A=c.a,n==j1&&(A/=r.a)}ae(b,$2,A)}return ae(b,_u,S),b}function KRn(){Boe();function e(i){var r=this;this.dispatch=function(c){var o=c.data;switch(o.cmd){case"algorithms":var l=lde((yn(),new qr(new ut(tw.b))));i.postMessage({id:o.id,data:l});break;case"categories":var f=lde((yn(),new qr(new ut(tw.c))));i.postMessage({id:o.id,data:f});break;case"options":var h=lde((yn(),new qr(new ut(tw.d))));i.postMessage({id:o.id,data:h});break;case"register":EPn(o.algorithms),i.postMessage({id:o.id});break;case"layout":gPn(o.graph,o.layoutOptions||{},o.options||{}),i.postMessage({id:o.id,data:o.graph});break}},this.saveDispatch=function(c){try{r.dispatch(c)}catch(o){i.postMessage({id:c.data.id,error:o})}}}function n(i){var r=this;this.dispatcher=new e({postMessage:function(c){r.onmessage({data:c})}}),this.postMessage=function(c){setTimeout(function(){r.dispatcher.saveDispatch({data:c})},0)}}if(typeof document===UZ&&typeof self!==UZ){var t=new e(self);self.onmessage=t.saveDispatch}else typeof x!==UZ&&x.exports&&(Object.defineProperty(O,"__esModule",{value:!0}),x.exports={default:n,Worker:n})}function sZ(e,n,t,i,r,c,o){var l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn,Cn,st,Qt,qi;for(N=0,Mn=0,h=new L(e.b);h.aN&&(c&&(pc(fe,S),pc(cn,me(b.b-1)),xe(e.d,A),l.c.length=0),Qt=t.b,qi+=S+n,S=0,p=k.Math.max(p,t.b+t.c+st)),Hn(l.c,f),PHe(f,Qt,qi),p=k.Math.max(p,Qt+st+t.c),S=k.Math.max(S,y),Qt+=st+n,A=f;if(Ar(e.a,l),xe(e.d,u(Le(l,l.c.length-1),167)),p=k.Math.max(p,i),Cn=qi+S+t.a,Cnr.d.d+r.d.a?b.f.d=!0:(b.f.d=!0,b.f.a=!0))),i.b!=i.d.c&&(n=t);b&&(c=u(Rn(e.f,o.d.i),60),n.bc.d.d+c.d.a?b.f.d=!0:(b.f.d=!0,b.f.a=!0))}for(l=new Gn(Vn(or(S).a.Jc(),new ee));ht(l);)o=u(it(l),17),o.a.b!=0&&(n=u(Bf(o.a),8),o.d.j==(Ne(),Un)&&(_=new wS(n,new Ee(n.a,r.d.d),r,o),_.f.a=!0,_.a=o.d,Hn(N.c,_)),o.d.j==bt&&(_=new wS(n,new Ee(n.a,r.d.d+r.d.a),r,o),_.f.d=!0,_.a=o.d,Hn(N.c,_)))}return N}function nBn(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(f=new Te,p=n.length,o=h1e(t),h=0;h=A&&(U>A&&(S.c.length=0,A=U),Hn(S.c,o));S.c.length!=0&&(y=u(Le(S,dz(n,S.c.length)),132),Cn.a.Ac(y)!=null,y.s=N++,pbe(y,tn,fe),S.c.length=0)}for(ie=e.c.length+1,l=new L(e);l.aMn.s&&(Ns(t),Xo(Mn.i,i),i.c>0&&(i.a=Mn,xe(Mn.t,i),i.b=_e,xe(_e.i,i)))}function BKe(e,n,t,i,r){var c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn,Cn;for(N=new Mo(n.b),ie=new Mo(n.b),y=new Mo(n.b),cn=new Mo(n.b),_=new Mo(n.b),_e=jt(n,0);_e.b!=_e.d.c;)for(de=u(kt(_e),12),l=new L(de.g);l.a0,R=de.g.c.length>0,h&&R?Hn(y.c,de):h?Hn(N.c,de):R&&Hn(ie.c,de);for(A=new L(N);A.aU.mh()-h.b&&(y=U.mh()-h.b),S>U.nh()-h.d&&(S=U.nh()-h.d),b0){for(K=jt(e.f,0);K.b!=K.d.c;)U=u(kt(K),9),U.p+=y-e.e;_0e(e),Ws(e.f),Dbe(e,i,S)}else{for(Vt(e.f,S),S.p=i,e.e=k.Math.max(e.e,i),c=new Gn(Vn(or(S).a.Jc(),new ee));ht(c);)r=u(it(c),17),!r.c.i.c&&r.c.i.k==(Bn(),Uu)&&(Vt(e.f,r.c.i),r.c.i.p=i-1);e.c=i}else _0e(e),Ws(e.f),i=0,ht(new Gn(Vn(or(S).a.Jc(),new ee)))?(y=0,y=zHe(y,S),i=y+2,Dbe(e,i,S)):(Vt(e.f,S),S.p=0,e.e=k.Math.max(e.e,0),e.b=u(Le(e.d.b,0),25),e.c=0);for(e.f.b==0||_0e(e),e.d.a.c.length=0,R=new Te,h=new L(e.d.b);h.a=48&&n<=57){for(i=n-48;r=48&&n<=57;)if(i=i*10+n-48,i<0)throw $(new Pt(zt((Dt(),Wpe))))}else throw $(new Pt(zt((Dt(),TZe))));if(t=i,n==44){if(r>=e.j)throw $(new Pt(zt((Dt(),OZe))));if((n=uc(e.i,r++))>=48&&n<=57){for(t=n-48;r=48&&n<=57;)if(t=t*10+n-48,t<0)throw $(new Pt(zt((Dt(),Wpe))));if(i>t)throw $(new Pt(zt((Dt(),NZe))))}else t=-1}if(n!=125)throw $(new Pt(zt((Dt(),CZe))));e._l(r)?(c=(fi(),fi(),new Yp(9,c)),e.d=r+1):(c=(fi(),fi(),new Yp(3,c)),e.d=r),c.Mm(i),c.Lm(t),si(e)}}return c}function oBn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de;for(r=1,S=new Te,i=0;i=u(Le(e.b,i),25).a.c.length/4)continue}if(u(Le(e.b,i),25).a.c.length>n){for(ie=new Te,xe(ie,u(Le(e.b,i),25)),o=0;o1)for(A=new $5((!e.a&&(e.a=new we($i,e,6,6)),e.a));A.e!=A.i.gc();)tS(A);for(o=u(V((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170),_=Qt,Qt>de+ie?_=de+ie:Qtfe+N?R=fe+N:qide-ie&&_fe-N&&RQt+st?cn=Qt+st:deqi+_e?tn=qi+_e:feQt-st&&cnqi-_e&&tnt&&(y=t-1),S=k0+Rs(n,24)*SN*p-p/2,S<0?S=1:S>i&&(S=i-1),r=(H0(),f=new Kk,f),vB(r,y),yB(r,S),Et((!o.a&&(o.a=new yr(Tl,o,5)),o.a),r)}function aZ(e,n){KW();var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e;if(K=e.e,b=e.d,r=e.a,K==0)switch(n){case 0:return"0";case 1:return e7;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return R=new z0,R.a+="0E",R.a+=-n,R.a}if(N=b*10+1+7,_=oe(sf,Dh,30,N+1,15,1),t=N,b==1)if(c=r[0],c<0){_e=zr(c,_c);do p=_e,_e=GO(_e,10),_[--t]=48+Lt(pf(p,bc(_e,10)))&Er;while(ao(_e,0)!=0)}else{_e=c;do p=_e,_e=_e/10|0,_[--t]=48+(p-_e*10)&Er;while(_e!=0)}else{ie=oe(It,ei,30,b,15,1),fe=b,Wu(r,0,ie,0,fe);e:for(;;){for(U=0,l=fe-1;l>=0;l--)de=yc(i1(U,32),zr(ie[l],_c)),S=dxn(de),ie[l]=Lt(S),U=Lt(Uw(S,32));A=Lt(U),y=t;do _[--t]=48+A%10&Er;while((A=A/10|0)!=0&&t!=0);for(i=9-y+t,o=0;o0;o++)_[--t]=48;for(f=fe-1;ie[f]==0;f--)if(f==0)break e;fe=f+1}for(;_[t]==48;)++t}return h=K<0,h&&(_[--t]=45),Ah(_,t,N-t)}function JKe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe;switch(e.c=n,e.g=new wt,t=(cg(),new B0(e.c)),i=new _P(t),ude(i),K=_t(ve(e.c,(UO(),G6e))),f=u(ve(e.c,uce),330),de=u(ve(e.c,oce),427),o=u(ve(e.c,F6e),477),ie=u(ve(e.c,cce),428),e.j=te(re(ve(e.c,zln))),l=e.a,f.g){case 0:l=e.a;break;case 1:l=e.b;break;case 2:l=e.i;break;case 3:l=e.e;break;case 4:l=e.f;break;default:throw $(new Jn(HF+(f.f!=null?f.f:""+f.g)))}if(e.d=new AIe(l,de,o),ae(e.d,(d8(),cM),$e(ve(e.c,Rln))),e.d.c=Re($e(ve(e.c,H6e))),_R(e.c).i==0)return e.d;for(p=new ot(_R(e.c));p.e!=p.i.gc();){for(b=u(ft(p),26),S=b.g/2,y=b.f/2,fe=new Ee(b.i+S,b.j+y);so(e.g,fe);)Pp(fe,(k.Math.random()-.5)*Ih,(k.Math.random()-.5)*Ih);N=u(ve(b,(Gt(),ek)),140),_=new HIe(fe,new Ff(fe.a-S-e.j/2-N.b,fe.b-y-e.j/2-N.d,b.g+e.j+(N.b+N.c),b.f+e.j+(N.d+N.a))),xe(e.d.i,_),Zt(e.g,fe,new jc(_,b))}switch(ie.g){case 0:if(K==null)e.d.d=u(Le(e.d.i,0),68);else for(U=new L(e.d.i);U.a0?st+1:1);for(o=new L(fe.g);o.a0?st+1:1)}e.d[h]==0?Vt(e.f,N):e.a[h]==0&&Vt(e.g,N),++h}for(A=-1,S=1,p=new Te,e.e=u(T(n,(pe(),Qy)),234);Cl>0;){for(;e.f.b!=0;)qi=u(tK(e.f),9),e.c[qi.p]=A--,Kbe(e,qi),--Cl;for(;e.g.b!=0;)Ts=u(tK(e.g),9),e.c[Ts.p]=S++,Kbe(e,Ts),--Cl;if(Cl>0){for(y=Kr,U=new L(K);U.a=y&&(ie>y&&(p.c.length=0,y=ie),Hn(p.c,N)));b=e.qg(p),e.c[b.p]=S++,Kbe(e,b),--Cl}}for(Qt=K.c.length+1,h=0;he.c[eu]&&(n0(i,!0),ae(n,Uy,(Ln(),!0)));e.a=null,e.d=null,e.c=null,Ws(e.g),Ws(e.f),t.Ug()}function qKe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe;for(de=u(V((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170),b=new Os,ie=new wt,fe=rVe(de),Qo(ie.f,de,fe),y=new wt,i=new Mi,A=r1(Xl(z(B(tf,1),xn,20,0,[(!n.d&&(n.d=new Tn(mr,n,8,5)),n.d),(!n.e&&(n.e=new Tn(mr,n,7,4)),n.e)])));ht(A);){if(S=u(it(A),85),(!e.a&&(e.a=new we($i,e,6,6)),e.a).i!=1)throw $(new Jn(PWe+(!e.a&&(e.a=new we($i,e,6,6)),e.a).i));S!=e&&(_=u(V((!S.a&&(S.a=new we($i,S,6,6)),S.a),0),170),Vi(i,_,i.c.b,i.c),N=u(bu(Xc(ie.f,_)),13),N||(N=rVe(_),Qo(ie.f,_,N)),p=t?_r(new mc(u(Le(fe,fe.c.length-1),8)),u(Le(N,N.c.length-1),8)):_r(new mc((mn(0,fe.c.length),u(fe.c[0],8))),(mn(0,N.c.length),u(N.c[0],8))),Qo(y.f,_,p))}if(i.b!=0)for(R=u(Le(fe,t?fe.c.length-1:0),8),h=1;h1&&Vi(b,R,b.c.b,b.c),NQ(r)));R=U}return b}function UKe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn;for(t.Tg(XYe,1),Mn=u(ys(oi(new wn(null,new pn(n,16)),new CI),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),16),b=u(ys(oi(new wn(null,new pn(n,16)),new Pje(n)),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[Wo]))),16),A=u(ys(oi(new wn(null,new pn(n,16)),new Lje(n)),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[Wo]))),16),N=oe(BJ,RF,40,n.gc(),0,1),o=0;o=0&&tn=0&&!N[S]){N[S]=r,b.ed(l),--l;break}if(S=tn-y,S=0&&!N[S]){N[S]=r,b.ed(l),--l;break}}for(A.gd(new _x),f=N.length-1;f>=0;f--)!N[f]&&!A.dc()&&(N[f]=u(A.Xb(0),40),A.ed(0));for(h=0;hy&&HO((mn(y,n.c.length),u(n.c[y],186)),b),b=null;n.c.length>y&&(mn(y,n.c.length),u(n.c[y],186)).a.c.length==0;)Xo(n,(mn(y,n.c.length),n.c[y]));if(!b){--o;continue}if(!Re($e(u(Le(b.b,0),26).mf((Ya(),ND))))&&CIn(n,A,c,b,_,t,y,i)){N=!0;continue}if(_){if(S=A.b,p=b.f,!Re($e(u(Le(b.b,0),26).mf(ND)))&&QPn(n,A,c,b,t,y,i,r)){if(N=!0,S=e.j){e.a=-1,e.c=1;return}if(n=uc(e.i,e.d++),e.a=n,e.b==1){switch(n){case 92:if(i=10,e.d>=e.j)throw $(new Pt(zt((Dt(),QF))));e.a=uc(e.i,e.d++);break;case 45:(e.e&512)==512&&e.d=e.j||uc(e.i,e.d)!=63)break;if(++e.d>=e.j)throw $(new Pt(zt((Dt(),Dne))));switch(n=uc(e.i,e.d++),n){case 58:i=13;break;case 61:i=14;break;case 33:i=15;break;case 91:i=19;break;case 62:i=18;break;case 60:if(e.d>=e.j)throw $(new Pt(zt((Dt(),Dne))));if(n=uc(e.i,e.d++),n==61)i=16;else if(n==33)i=17;else throw $(new Pt(zt((Dt(),fZe))));break;case 35:for(;e.d=e.j)throw $(new Pt(zt((Dt(),QF))));e.a=uc(e.i,e.d++);break;default:i=0}e.c=i}function pBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_;if(t.Tg("Process compaction",1),!!Re($e(T(n,(Tu(),jye))))){for(r=u(T(n,J2),86),S=te(re(T(n,jre))),HLn(e,n,r),NRn(n,S/2/2),A=n.b,yg(A,new Tje(r)),h=jt(A,0);h.b!=h.d.c;)if(f=u(kt(h),40),!Re($e(T(f,(Ci(),_b))))){if(i=g_n(f,r),N=fLn(f,n),p=0,y=0,i)switch(_=i.e,r.g){case 2:p=_.a-S-f.f.a,N.e.a-S-f.f.ap&&(p=N.e.a+N.f.a+S),y=p+f.f.a;break;case 4:p=_.b-S-f.f.b,N.e.b-S-f.f.bp&&(p=N.e.b+N.f.b+S),y=p+f.f.b}else if(N)switch(r.g){case 2:p=N.e.a-S-f.f.a,y=p+f.f.a;break;case 1:p=N.e.a+N.f.a+S,y=p+f.f.a;break;case 4:p=N.e.b-S-f.f.b,y=p+f.f.b;break;case 3:p=N.e.b+N.f.b+S,y=p+f.f.b}ue(T(n,Ere))===ue((Bj(),MD))?(c=p,o=y,l=id(oi(new wn(null,new pn(e.a,16)),new fTe(c,o))),l.a!=null?r==(kr(),Zc)||r==cu?f.e.a=p:f.e.b=p:(r==(kr(),Zc)||r==cf?l=id(oi(QRe(new wn(null,new pn(e.a,16))),new Cje(c))):l=id(oi(QRe(new wn(null,new pn(e.a,16))),new Oje(c))),l.a!=null&&(r==Zc||r==cu?f.e.a=te(re((at(l.a!=null),u(l.a,49)).a)):f.e.b=te(re((at(l.a!=null),u(l.a,49)).a)))),l.a!=null&&(b=pu(e.a,(at(l.a!=null),l.a),0),b>0&&b!=u(T(f,Hh),15).a&&(ae(f,gye,(Ln(),!0)),ae(f,Hh,me(b))))):r==(kr(),Zc)||r==cu?f.e.a=p:f.e.b=p}t.Ug()}}function mBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de;if(t.Tg("Coffman-Graham Layering",1),n.a.c.length==0){t.Ug();return}for(de=u(T(n,(Oe(),Z4e)),15).a,f=0,o=0,y=new L(n.a);y.a=de||!_jn(R,i))&&(i=__e(n,b)),Dr(R,i),c=new Gn(Vn(or(R).a.Jc(),new ee));ht(c);)r=u(it(c),17),!e.a[r.p]&&(N=r.c.i,--e.e[N.p],e.e[N.p]==0&&J5(L8(S,N),n7));for(h=b.c.length-1;h>=0;--h)xe(n.b,(mn(h,b.c.length),u(b.c[h],25)));n.a.c.length=0,t.Ug()}function VKe(e){var n,t,i,r,c,o,l,f,h;for(e.b=1,si(e),n=null,e.c==0&&e.a==94?(si(e),n=(fi(),fi(),new dl(4)),ho(n,0,M7),l=new dl(4)):l=(fi(),fi(),new dl(4)),r=!0;(h=e.c)!=1;){if(h==0&&e.a==93&&!r){n&&(kS(n,l),l=n);break}if(t=e.a,i=!1,h==10)switch(t){case 100:case 68:case 119:case 87:case 115:case 83:ym(l,G8(t)),i=!0;break;case 105:case 73:case 99:case 67:t=(ym(l,G8(t)),-1),t<0&&(i=!0);break;case 112:case 80:if(f=Q0e(e,t),!f)throw $(new Pt(zt((Dt(),_ne))));ym(l,f),i=!0;break;default:t=Ibe(e)}else if(h==24&&!r){if(n&&(kS(n,l),l=n),c=VKe(e),kS(l,c),e.c!=0||e.a!=93)throw $(new Pt(zt((Dt(),yZe))));break}if(si(e),!i){if(h==0){if(t==91)throw $(new Pt(zt((Dt(),Qpe))));if(t==93)throw $(new Pt(zt((Dt(),Ype))));if(t==45&&!r&&e.a!=93)throw $(new Pt(zt((Dt(),Ine))))}if(e.c!=0||e.a!=45||t==45&&r)ho(l,t,t);else{if(si(e),(h=e.c)==1)throw $(new Pt(zt((Dt(),YF))));if(h==0&&e.a==93)ho(l,t,t),ho(l,45,45);else{if(h==0&&e.a==93||h==24)throw $(new Pt(zt((Dt(),Ine))));if(o=e.a,h==0){if(o==91)throw $(new Pt(zt((Dt(),Qpe))));if(o==93)throw $(new Pt(zt((Dt(),Ype))));if(o==45)throw $(new Pt(zt((Dt(),Ine))))}else h==10&&(o=Ibe(e));if(si(e),t>o)throw $(new Pt(zt((Dt(),jZe))));ho(l,t,o)}}}r=!1}if(e.c==1)throw $(new Pt(zt((Dt(),YF))));return Nv(l),vS(l),e.b=0,si(e),l}function KKe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie;ie=!1;do for(ie=!1,c=n?new tt(e.a.b).a.gc()-2:1;n?c>=0:cu(T(_,Oi),15).a)&&(K=!1);if(K){for(f=n?c+1:c-1,l=Lae(e.a,me(f)),o=!1,U=!0,i=!1,b=jt(l,0);b.b!=b.d.c;)h=u(kt(b),9),bi(h,Oi)?h.p!=p.p&&(o=o|(n?u(T(h,Oi),15).au(T(p,Oi),15).a),U=!1):!o&&U&&h.k==(Bn(),Uu)&&(i=!0,n?y=u(it(new Gn(Vn(or(h).a.Jc(),new ee))),17).c.i:y=u(it(new Gn(Vn(Di(h).a.Jc(),new ee))),17).d.i,y==p&&(n?t=u(it(new Gn(Vn(Di(h).a.Jc(),new ee))),17).d.i:t=u(it(new Gn(Vn(or(h).a.Jc(),new ee))),17).c.i,(n?u(Lp(e.a,t),15).a-u(Lp(e.a,y),15).a:u(Lp(e.a,y),15).a-u(Lp(e.a,t),15).a)<=2&&(U=!1)));if(i&&U&&(n?t=u(it(new Gn(Vn(Di(p).a.Jc(),new ee))),17).d.i:t=u(it(new Gn(Vn(or(p).a.Jc(),new ee))),17).c.i,(n?u(Lp(e.a,t),15).a-u(Lp(e.a,p),15).a:u(Lp(e.a,p),15).a-u(Lp(e.a,t),15).a)<=2&&t.k==(Bn(),Wi)&&(U=!1)),o||U){for(N=OUe(e,p,n);N.a.gc()!=0;)A=u(N.a.ec().Jc().Pb(),9),N.a.Ac(A)!=null,dc(N,OUe(e,A,n));--S,ie=!0}}}while(ie)}function vBn(e){Mt(e.c,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#decimal"])),Mt(e.d,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#integer"])),Mt(e.e,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#boolean"])),Mt(e.f,Jt,z(B(Be,1),Ae,2,6,[fc,"EBoolean",ci,"EBoolean:Object"])),Mt(e.i,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#byte"])),Mt(e.g,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#hexBinary"])),Mt(e.j,Jt,z(B(Be,1),Ae,2,6,[fc,"EByte",ci,"EByte:Object"])),Mt(e.n,Jt,z(B(Be,1),Ae,2,6,[fc,"EChar",ci,"EChar:Object"])),Mt(e.t,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#double"])),Mt(e.u,Jt,z(B(Be,1),Ae,2,6,[fc,"EDouble",ci,"EDouble:Object"])),Mt(e.F,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#float"])),Mt(e.G,Jt,z(B(Be,1),Ae,2,6,[fc,"EFloat",ci,"EFloat:Object"])),Mt(e.I,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#int"])),Mt(e.J,Jt,z(B(Be,1),Ae,2,6,[fc,"EInt",ci,"EInt:Object"])),Mt(e.N,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#long"])),Mt(e.O,Jt,z(B(Be,1),Ae,2,6,[fc,"ELong",ci,"ELong:Object"])),Mt(e.Z,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#short"])),Mt(e.$,Jt,z(B(Be,1),Ae,2,6,[fc,"EShort",ci,"EShort:Object"])),Mt(e._,Jt,z(B(Be,1),Ae,2,6,[fc,"http://www.w3.org/2001/XMLSchema#string"]))}function Oe(){Oe=Y,Fie=(Gt(),Cfn),g5e=Ofn,mD=Nfn,na=Dfn,l4=G9e,Kg=q9e,Vm=U9e,U7=X9e,X7=V9e,Hie=sG,Qg=d0,Jie=_fn,TM=Y9e,MJ=s6,pD=(Dge(),Rcn),Xm=Bcn,Cb=zcn,Km=Fcn,xun=new Wr(FD,me(0)),q7=Lcn,b5e=Pcn,n6=$cn,S5e=lun,p5e=Gcn,m5e=Xcn,qie=eun,v5e=Qcn,y5e=Wcn,AJ=dun,Uie=fun,E5e=cun,k5e=iun,j5e=oun,i5e=pcn,$ie=dcn,yJ=hcn,Rie=gcn,z2=Ccn,xM=Ocn,Lie=Frn,U4e=Jrn,Dun=tk,_un=lG,Nun=r3,Oun=nk,w5e=(fy(),o3),new Wr(l6,w5e),l5e=new Hw(12),s5e=new Wr(y1,l5e),J4e=(cd(),ck),gd=new Wr(k9e,J4e),Gm=new Wr(Fs,0),Tun=new Wr(Mce,me(1)),aJ=new Wr(Z7,c7),Vg=oG,Zi=tA,G7=k4,yun=$D,zh=wfn,Fm=p4,Cun=new Wr(Ace,(Ln(),!0)),Hm=RD,Ug=pce,Xg=Zg,SJ=Ib,zie=n3,H4e=(kr(),lh),Sl=new Wr(Wg,H4e),B2=v4,EJ=C9e,qm=t3,Aun=Sce,h5e=H9e,a5e=(Mv(),UD),new Wr($9e,a5e),jun=yce,Sun=kce,Mun=Ece,Eun=vce,Gie=Jcn,vJ=acn,wD=fcn,CM=Hcn,ku=icn,e6=_rn,SM=Drn,H7=prn,B4e=mrn,Die=Ern,gD=vrn,_ie=Orn,r5e=mcn,c5e=vcn,W4e=Yrn,jJ=_cn,Bie=Ecn,Pie=Urn,o5e=xcn,q4e=Brn,Iie=zrn,Nie=PD,u5e=ycn,dJ=Zin,L4e=Win,hJ=Yin,K4e=Krn,V4e=Vrn,Q4e=Qrn,J7=y4,Wc=m4,s0=yfn,Fh=wce,s4=gce,z4e=Srn,l0=jce,yM=vfn,mJ=Efn,F2=B9e,f5e=Mfn,Jm=Afn,e5e=ccn,n5e=ocn,Um=o6,xie=Qin,t5e=lcn,pJ=Prn,wJ=Lrn,kJ=ek,Z4e=ecn,AM=Scn,vD=K9e,F4e=Irn,d5e=Icn,G4e=$rn,pun=Arn,mun=xrn,kun=tcn,vun=Trn,Y4e=mce,MM=rcn,gJ=Crn,v1=wrn,Cie=drn,bD=nrn,Tie=trn,bJ=brn,kM=ern,Oie=grn,zm=hrn,jM=arn,wun=frn,Zy=irn,EM=lrn,R4e=srn,P4e=rrn,$4e=urn,X4e=Xrn}function yBn(e,n,t,i,r,c,o){var l,f,h,b,p,y,S,A;return y=u(i.a,15).a,S=u(i.b,15).a,p=e.b,A=e.c,l=0,b=0,n==(kr(),Zc)||n==cu?(b=fC(OFe(Up(So(new wn(null,new pn(t.b,16)),new II),new Ox))),p.e.b+p.f.b/2>b?(h=++S,l=te(re(Ks(Hp(So(new wn(null,new pn(t.b,16)),new dTe(r,h)),new Tw))))):(f=++y,l=te(re(Ks(q5(So(new wn(null,new pn(t.b,16)),new bTe(r,f)),new zk)))))):(b=fC(OFe(Up(So(new wn(null,new pn(t.b,16)),new AI),new K6))),p.e.a+p.f.a/2>b?(h=++S,l=te(re(Ks(Hp(So(new wn(null,new pn(t.b,16)),new hTe(r,h)),new Nx))))):(f=++y,l=te(re(Ks(q5(So(new wn(null,new pn(t.b,16)),new aTe(r,f)),new Dx)))))),n==Zc?(pc(e.a,new Ee(te(re(T(p,(Ci(),Da))))-r,l)),pc(e.a,new Ee(A.e.a+A.f.a+r+c,l)),pc(e.a,new Ee(A.e.a+A.f.a+r+c,A.e.b+A.f.b/2)),pc(e.a,new Ee(A.e.a+A.f.a,A.e.b+A.f.b/2))):n==cu?(pc(e.a,new Ee(te(re(T(p,(Ci(),ta))))+r,p.e.b+p.f.b/2)),pc(e.a,new Ee(p.e.a+p.f.a+r,l)),pc(e.a,new Ee(A.e.a-r-c,l)),pc(e.a,new Ee(A.e.a-r-c,A.e.b+A.f.b/2)),pc(e.a,new Ee(A.e.a,A.e.b+A.f.b/2))):n==cf?(pc(e.a,new Ee(l,te(re(T(p,(Ci(),Da))))-r)),pc(e.a,new Ee(l,A.e.b+A.f.b+r+c)),pc(e.a,new Ee(A.e.a+A.f.a/2,A.e.b+A.f.b+r+c)),pc(e.a,new Ee(A.e.a+A.f.a/2,A.e.b+A.f.b+r))):(e.a.b==0||(u(Bf(e.a),8).b=te(re(T(p,(Ci(),ta))))+r*u(o.b,15).a),pc(e.a,new Ee(l,te(re(T(p,(Ci(),ta))))+r*u(o.b,15).a)),pc(e.a,new Ee(l,A.e.b-r*u(o.a,15).a-c))),new jc(me(y),me(S))}function kBn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S;if(o=!0,p=null,i=null,r=null,n=!1,S=Dan,h=null,c=null,l=0,f=_Y(e,l,q8e,U8e),f=0&&bn(e.substr(l,2),"//")?(l+=2,f=_Y(e,l,bA,gA),i=(Zr(l,f,e.length),e.substr(l,f-l)),l=f):p!=null&&(l==e.length||(Kn(l,e.length),e.charCodeAt(l)!=47))&&(o=!1,f=ile(e,Ko(35),l),f==-1&&(f=e.length),i=(Zr(l,f,e.length),e.substr(l,f-l)),l=f);if(!t&&l0&&uc(b,b.length-1)==58&&(r=b,l=f)),lo?(il(e,n,t),1):(il(e,t,n),-1)}for(U=e.f,K=0,ie=U.length;K0?il(e,n,t):il(e,t,n),i;if(!bi(n,(pe(),Oi))||!bi(t,Oi))return c=uW(e,n),l=uW(e,t),c>l?(il(e,n,t),1):(il(e,t,n),-1)}if(!y&&!A&&(i=YKe(e,n,t),i!=0))return i>0?il(e,n,t):il(e,t,n),i}return bi(n,(pe(),Oi))&&bi(t,Oi)?(c=w2(n,t,e.c,u(T(e.c,Tb),15).a),l=w2(t,n,e.c,u(T(e.c,Tb),15).a),c>l?(il(e,n,t),1):(il(e,t,n),-1)):(il(e,t,n),-1)}function QKe(){QKe=Y,fZ(),Yt=new Zw,gn(Yt,(Ne(),oa),ah),gn(Yt,Af,ah),gn(Yt,As,ah),gn(Yt,sa,ah),gn(Yt,ts,ah),gn(Yt,xs,ah),gn(Yt,sa,oa),gn(Yt,ah,uf),gn(Yt,oa,uf),gn(Yt,Af,uf),gn(Yt,As,uf),gn(Yt,ns,uf),gn(Yt,sa,uf),gn(Yt,ts,uf),gn(Yt,xs,uf),gn(Yt,zo,uf),gn(Yt,ah,Al),gn(Yt,oa,Al),gn(Yt,uf,Al),gn(Yt,Af,Al),gn(Yt,As,Al),gn(Yt,ns,Al),gn(Yt,sa,Al),gn(Yt,zo,Al),gn(Yt,xl,Al),gn(Yt,ts,Al),gn(Yt,ws,Al),gn(Yt,xs,Al),gn(Yt,oa,Af),gn(Yt,As,Af),gn(Yt,sa,Af),gn(Yt,xs,Af),gn(Yt,oa,As),gn(Yt,Af,As),gn(Yt,sa,As),gn(Yt,As,As),gn(Yt,ts,As),gn(Yt,ah,of),gn(Yt,oa,of),gn(Yt,uf,of),gn(Yt,Al,of),gn(Yt,Af,of),gn(Yt,As,of),gn(Yt,ns,of),gn(Yt,sa,of),gn(Yt,xl,of),gn(Yt,zo,of),gn(Yt,xs,of),gn(Yt,ts,of),gn(Yt,mo,of),gn(Yt,ah,xl),gn(Yt,oa,xl),gn(Yt,uf,xl),gn(Yt,Af,xl),gn(Yt,As,xl),gn(Yt,ns,xl),gn(Yt,sa,xl),gn(Yt,zo,xl),gn(Yt,xs,xl),gn(Yt,ws,xl),gn(Yt,mo,xl),gn(Yt,oa,zo),gn(Yt,Af,zo),gn(Yt,As,zo),gn(Yt,sa,zo),gn(Yt,xl,zo),gn(Yt,xs,zo),gn(Yt,ts,zo),gn(Yt,ah,es),gn(Yt,oa,es),gn(Yt,uf,es),gn(Yt,Af,es),gn(Yt,As,es),gn(Yt,ns,es),gn(Yt,sa,es),gn(Yt,zo,es),gn(Yt,xs,es),gn(Yt,oa,ts),gn(Yt,uf,ts),gn(Yt,Al,ts),gn(Yt,As,ts),gn(Yt,ah,ws),gn(Yt,oa,ws),gn(Yt,Al,ws),gn(Yt,Af,ws),gn(Yt,As,ws),gn(Yt,ns,ws),gn(Yt,sa,ws),gn(Yt,sa,mo),gn(Yt,As,mo),gn(Yt,zo,ah),gn(Yt,zo,Af),gn(Yt,zo,uf),gn(Yt,ns,ah),gn(Yt,ns,oa),gn(Yt,ns,Al)}function EBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe;switch(t.Tg("Brandes & Koepf node placement",1),e.a=n,e.c=nLn(n),i=u(T(n,(Oe(),Bie)),282),S=Re($e(T(n,AM))),e.d=i==(qO(),nJ)&&!S||i==fie,VPn(e,n),de=null,fe=null,R=null,U=null,_=(wl(4,Em),new Mo(4)),u(T(n,Bie),282).g){case 3:R=new _v(n,e.c.d,(Fa(),Yg),(Eh(),f0)),Hn(_.c,R);break;case 1:U=new _v(n,e.c.d,(Fa(),ch),(Eh(),f0)),Hn(_.c,U);break;case 4:de=new _v(n,e.c.d,(Fa(),Yg),(Eh(),H2)),Hn(_.c,de);break;case 2:fe=new _v(n,e.c.d,(Fa(),ch),(Eh(),H2)),Hn(_.c,fe);break;default:R=new _v(n,e.c.d,(Fa(),Yg),(Eh(),f0)),U=new _v(n,e.c.d,ch,f0),de=new _v(n,e.c.d,Yg,H2),fe=new _v(n,e.c.d,ch,H2),Hn(_.c,de),Hn(_.c,fe),Hn(_.c,R),Hn(_.c,U)}for(r=new cTe(n,e.c),l=new L(_);l.axW(c))&&(p=c);for(!p&&(p=(mn(0,_.c.length),u(_.c[0],185))),N=new L(n.b);N.a0?(il(e,t,n),1):(il(e,n,t),-1);if(b&&K)return il(e,t,n),1;if(p&&U)return il(e,n,t),-1;if(p&&K)return 0}else for(tn=new L(h.j);tn.ap&&(Cn=0,st+=b+_e,b=0),JXe(de,o,Cn,st),n=k.Math.max(n,Cn+fe.a),b=k.Math.max(b,fe.b),Cn+=fe.a+_e;for(ie=new wt,t=new wt,tn=new L(e);tn.a=-1900?1:0,t>=4?Xt(e,z(B(Be,1),Ae,2,6,[bQe,gQe])[l]):Xt(e,z(B(Be,1),Ae,2,6,["BC","AD"])[l]);break;case 121:lSn(e,t,i);break;case 77:rIn(e,t,i);break;case 107:f=r.q.getHours(),f==0?o1(e,24,t):o1(e,f,t);break;case 83:yNn(e,t,r);break;case 69:b=i.q.getDay(),t==5?Xt(e,z(B(Be,1),Ae,2,6,["S","M","T","W","T","F","S"])[b]):t==4?Xt(e,z(B(Be,1),Ae,2,6,[NZ,DZ,_Z,IZ,LZ,PZ,$Z])[b]):Xt(e,z(B(Be,1),Ae,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[b]);break;case 97:r.q.getHours()>=12&&r.q.getHours()<24?Xt(e,z(B(Be,1),Ae,2,6,["AM","PM"])[1]):Xt(e,z(B(Be,1),Ae,2,6,["AM","PM"])[0]);break;case 104:p=r.q.getHours()%12,p==0?o1(e,12,t):o1(e,p,t);break;case 75:y=r.q.getHours()%12,o1(e,y,t);break;case 72:S=r.q.getHours(),o1(e,S,t);break;case 99:A=i.q.getDay(),t==5?Xt(e,z(B(Be,1),Ae,2,6,["S","M","T","W","T","F","S"])[A]):t==4?Xt(e,z(B(Be,1),Ae,2,6,[NZ,DZ,_Z,IZ,LZ,PZ,$Z])[A]):t==3?Xt(e,z(B(Be,1),Ae,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[A]):o1(e,A,1);break;case 76:N=i.q.getMonth(),t==5?Xt(e,z(B(Be,1),Ae,2,6,["J","F","M","A","M","J","J","A","S","O","N","D"])[N]):t==4?Xt(e,z(B(Be,1),Ae,2,6,[yZ,kZ,EZ,jZ,Ay,SZ,MZ,AZ,xZ,TZ,CZ,OZ])[N]):t==3?Xt(e,z(B(Be,1),Ae,2,6,["Jan","Feb","Mar","Apr",Ay,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"])[N]):o1(e,N+1,t);break;case 81:_=i.q.getMonth()/3|0,t<4?Xt(e,z(B(Be,1),Ae,2,6,["Q1","Q2","Q3","Q4"])[_]):Xt(e,z(B(Be,1),Ae,2,6,["1st quarter","2nd quarter","3rd quarter","4th quarter"])[_]);break;case 100:R=i.q.getDate(),o1(e,R,t);break;case 109:h=r.q.getMinutes(),o1(e,h,t);break;case 115:o=r.q.getSeconds(),o1(e,o,t);break;case 122:t<4?Xt(e,c.c[0]):Xt(e,c.c[1]);break;case 118:Xt(e,c.b);break;case 90:t<3?Xt(e,jCn(c)):t==3?Xt(e,xCn(c)):Xt(e,TCn(c.a));break;default:return!1}return!0}function Nge(e,n,t,i){var r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn,Cn,st,Qt;if(NXe(n),f=u(V((!n.b&&(n.b=new Tn(mt,n,4,7)),n.b),0),84),b=u(V((!n.c&&(n.c=new Tn(mt,n,5,8)),n.c),0),84),l=ru(f),h=ru(b),o=(!n.a&&(n.a=new we($i,n,6,6)),n.a).i==0?null:u(V((!n.a&&(n.a=new we($i,n,6,6)),n.a),0),170),_e=u(Rn(e.a,l),9),Cn=u(Rn(e.a,h),9),cn=null,st=null,X(f,193)&&(fe=u(Rn(e.a,f),246),X(fe,12)?cn=u(fe,12):X(fe,9)&&(_e=u(fe,9),cn=u(Le(_e.j,0),12))),X(b,193)&&(Mn=u(Rn(e.a,b),246),X(Mn,12)?st=u(Mn,12):X(Mn,9)&&(Cn=u(Mn,9),st=u(Le(Cn.j,0),12))),!_e||!Cn)throw $(new A5("The source or the target of edge "+n+" could not be found. This usually happens when an edge connects a node laid out by ELK Layered to a node in another level of hierarchy laid out by either another instance of ELK Layered or another layout algorithm alltogether. The former can be solved by setting the hierarchyHandling option to INCLUDE_CHILDREN."));for(N=new Ww,$u(N,n),ae(N,(pe(),pi),n),ae(N,(Oe(),Wc),null),S=u(T(i,po),22),_e==Cn&&S.Ec((Dc(),bM)),cn||(de=(Nc(),Do),tn=null,o&&tv(u(T(_e,Zi),102))&&(tn=new Ee(o.j,o.k),uPe(tn,Xp(n)),_Pe(tn,t),em(h,l)&&(de=Ms,gi(tn,_e.n))),cn=IVe(_e,tn,de,i)),st||(de=(Nc(),Ms),Qt=null,o&&tv(u(T(Cn,Zi),102))&&(Qt=new Ee(o.b,o.c),uPe(Qt,Xp(n)),_Pe(Qt,t)),st=IVe(Cn,Qt,de,Pr(Cn))),hc(N,cn),Ur(N,st),(cn.e.c.length>1||cn.g.c.length>1||st.e.c.length>1||st.g.c.length>1)&&S.Ec((Dc(),dM)),y=new ot((!n.n&&(n.n=new we(ju,n,1,7)),n.n));y.e!=y.i.gc();)if(p=u(ft(y),157),!Re($e(ve(p,Vg)))&&p.a)switch(_=hY(p),xe(N.b,_),u(T(_,Fh),279).g){case 1:case 2:S.Ec((Dc(),B7));break;case 0:S.Ec((Dc(),R7)),ae(_,Fh,(Ua(),ik))}if(c=u(T(i,SM),301),R=u(T(i,jJ),328),r=c==(Xj(),cD)||R==(Yj(),ere),o&&(!o.a&&(o.a=new yr(Tl,o,5)),o.a).i!=0&&r){for(U=jTn(o),A=new Os,ie=jt(U,0);ie.b!=ie.d.c;)K=u(kt(ie),8),Vt(A,new mc(K));ae(N,Xve,A)}return N}function ABn(e,n,t,i){var r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn,Cn,st,Qt,qi;for(tn=0,Mn=0,_e=new wt,de=u(Ks(Hp(So(new wn(null,new pn(e.b,16)),new MI),new Bk)),15).a+1,cn=oe(It,ei,30,de,15,1),_=oe(It,ei,30,de,15,1),N=0;N1)for(l=st+1;lh.b.e.b*(1-R)+h.c.e.b*R));A++);if(fe.gc()>0&&(Qt=h.a.b==0?vc(h.b.e):u(Bf(h.a),8),K=gi(vc(u(fe.Xb(fe.gc()-1),40).e),u(fe.Xb(fe.gc()-1),40).f),y=gi(vc(u(fe.Xb(0),40).e),u(fe.Xb(0),40).f),A>=fe.gc()-1&&Qt.b>K.b&&h.c.e.b>K.b||A<=0&&Qt.bh.b.e.a*(1-R)+h.c.e.a*R));A++);if(fe.gc()>0&&(Qt=h.a.b==0?vc(h.b.e):u(Bf(h.a),8),K=gi(vc(u(fe.Xb(fe.gc()-1),40).e),u(fe.Xb(fe.gc()-1),40).f),y=gi(vc(u(fe.Xb(0),40).e),u(fe.Xb(0),40).f),A>=fe.gc()-1&&Qt.a>K.a&&h.c.e.a>K.a||A<=0&&Qt.a=te(re(T(e,(Ci(),mye))))&&++Mn):(S.f&&S.d.e.a<=te(re(T(e,(Ci(),mre))))&&++tn,S.g&&S.c.e.a+S.c.f.a>=te(re(T(e,(Ci(),pye))))&&++Mn)}else ie==0?X0e(h):ie<0&&(++cn[st],++_[qi],Cn=yBn(h,n,e,new jc(me(tn),me(Mn)),t,i,new jc(me(_[qi]),me(cn[st]))),tn=u(Cn.a,15).a,Mn=u(Cn.b,15).a)}function xBn(e){e.gb||(e.gb=!0,e.b=xu(e,0),Qi(e.b,18),Ii(e.b,19),e.a=xu(e,1),Qi(e.a,1),Ii(e.a,2),Ii(e.a,3),Ii(e.a,4),Ii(e.a,5),e.o=xu(e,2),Qi(e.o,8),Qi(e.o,9),Ii(e.o,10),Ii(e.o,11),Ii(e.o,12),Ii(e.o,13),Ii(e.o,14),Ii(e.o,15),Ii(e.o,16),Ii(e.o,17),Ii(e.o,18),Ii(e.o,19),Ii(e.o,20),Ii(e.o,21),Ii(e.o,22),Ii(e.o,23),Qc(e.o),Qc(e.o),Qc(e.o),Qc(e.o),Qc(e.o),Qc(e.o),Qc(e.o),Qc(e.o),Qc(e.o),Qc(e.o),e.p=xu(e,3),Qi(e.p,2),Qi(e.p,3),Qi(e.p,4),Qi(e.p,5),Ii(e.p,6),Ii(e.p,7),Qc(e.p),Qc(e.p),e.q=xu(e,4),Qi(e.q,8),e.v=xu(e,5),Ii(e.v,9),Qc(e.v),Qc(e.v),Qc(e.v),e.w=xu(e,6),Qi(e.w,2),Qi(e.w,3),Qi(e.w,4),Ii(e.w,5),e.B=xu(e,7),Ii(e.B,1),Qc(e.B),Qc(e.B),Qc(e.B),e.Q=xu(e,8),Ii(e.Q,0),Qc(e.Q),e.R=xu(e,9),Qi(e.R,1),e.S=xu(e,10),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),Qc(e.S),e.T=xu(e,11),Ii(e.T,10),Ii(e.T,11),Ii(e.T,12),Ii(e.T,13),Ii(e.T,14),Qc(e.T),Qc(e.T),e.U=xu(e,12),Qi(e.U,2),Qi(e.U,3),Ii(e.U,4),Ii(e.U,5),Ii(e.U,6),Ii(e.U,7),Qc(e.U),e.V=xu(e,13),Ii(e.V,10),e.W=xu(e,14),Qi(e.W,18),Qi(e.W,19),Qi(e.W,20),Ii(e.W,21),Ii(e.W,22),Ii(e.W,23),e.bb=xu(e,15),Qi(e.bb,10),Qi(e.bb,11),Qi(e.bb,12),Qi(e.bb,13),Qi(e.bb,14),Qi(e.bb,15),Qi(e.bb,16),Ii(e.bb,17),Qc(e.bb),Qc(e.bb),e.eb=xu(e,16),Qi(e.eb,2),Qi(e.eb,3),Qi(e.eb,4),Qi(e.eb,5),Qi(e.eb,6),Qi(e.eb,7),Ii(e.eb,8),Ii(e.eb,9),e.ab=xu(e,17),Qi(e.ab,0),Qi(e.ab,1),e.H=xu(e,18),Ii(e.H,0),Ii(e.H,1),Ii(e.H,2),Ii(e.H,3),Ii(e.H,4),Ii(e.H,5),Qc(e.H),e.db=xu(e,19),Ii(e.db,2),e.c=ri(e,20),e.d=ri(e,21),e.e=ri(e,22),e.f=ri(e,23),e.i=ri(e,24),e.g=ri(e,25),e.j=ri(e,26),e.k=ri(e,27),e.n=ri(e,28),e.r=ri(e,29),e.s=ri(e,30),e.t=ri(e,31),e.u=ri(e,32),e.fb=ri(e,33),e.A=ri(e,34),e.C=ri(e,35),e.D=ri(e,36),e.F=ri(e,37),e.G=ri(e,38),e.I=ri(e,39),e.J=ri(e,40),e.L=ri(e,41),e.M=ri(e,42),e.N=ri(e,43),e.O=ri(e,44),e.P=ri(e,45),e.X=ri(e,46),e.Y=ri(e,47),e.Z=ri(e,48),e.$=ri(e,49),e._=ri(e,50),e.cb=ri(e,51),e.K=ri(e,52))}function TBn(e,n,t,i){var r,c,o,l,f,h,b,p,y,S,A;for(p=jt(e.b,0);p.b!=p.d.c;)if(b=u(kt(p),40),!bn(b.c,$F))for(c=u(ys(new wn(null,new pn(FCn(b,e),16)),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),16),n==(kr(),Zc)||n==cu?c.gd(new NI):c.gd(new DI),A=c.gc(),r=0;r0&&(l=u(Bf(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(Bf(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(f-S)/(k.Math.abs(l-y)/40)>50&&(S>f?pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a+i/5.3,b.e.b+b.f.b*o-i/2)):pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a+i/5.3,b.e.b+b.f.b*o+i/2)))),pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a,b.e.b+b.f.b*o))):n==cu?(h=te(re(T(b,(Ci(),Da)))),b.e.a-i>h?pc(u(c.Xb(r),65).a,new Ee(h-t,b.e.b+b.f.b*o)):u(c.Xb(r),65).a.b>0&&(l=u(Bf(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(Bf(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(f-S)/(k.Math.abs(l-y)/40)>50&&(S>f?pc(u(c.Xb(r),65).a,new Ee(b.e.a-i/5.3,b.e.b+b.f.b*o-i/2)):pc(u(c.Xb(r),65).a,new Ee(b.e.a-i/5.3,b.e.b+b.f.b*o+i/2)))),pc(u(c.Xb(r),65).a,new Ee(b.e.a,b.e.b+b.f.b*o))):n==cf?(h=te(re(T(b,(Ci(),ta)))),b.e.b+b.f.b+i0&&(l=u(Bf(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(Bf(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(l-y)/(k.Math.abs(f-S)/40)>50&&(y>l?pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o-i/2,b.e.b+i/5.3+b.f.b)):pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o+i/2,b.e.b+i/5.3+b.f.b)))),pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o,b.e.b+b.f.b))):(h=te(re(T(b,(Ci(),Da)))),Lze(u(c.Xb(r),65),e)?pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o,u(Bf(u(c.Xb(r),65).a),8).b)):b.e.b-i>h?pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o,h-t)):u(c.Xb(r),65).a.b>0&&(l=u(Bf(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(Bf(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(l-y)/(k.Math.abs(f-S)/40)>50&&(y>l?pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o-i/2,b.e.b-i/5.3)):pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o+i/2,b.e.b-i/5.3)))),pc(u(c.Xb(r),65).a,new Ee(b.e.a+b.f.a*o,b.e.b)))}function ZKe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe;if(o=n,y=t,so(e.a,o)){if(hf(u(Rn(e.a,o),47),y))return 1}else Zt(e.a,o,new hr);if(so(e.a,y)){if(hf(u(Rn(e.a,y),47),o))return-1}else Zt(e.a,y,new hr);if(so(e.e,o)){if(hf(u(Rn(e.e,o),47),y))return-1}else Zt(e.e,o,new hr);if(so(e.e,y)){if(hf(u(Rn(e.a,y),47),o))return 1}else Zt(e.e,y,new hr);if(o.j!=y.j)return de=pwn(o.j,y.j),de>0?Wl(e,o,y,1):Wl(e,y,o,1),de;if(fe=1,o.e.c.length!=0&&y.e.c.length!=0){if((o.j==(Ne(),Xn)&&y.j==Xn||o.j==Un&&y.j==Un||o.j==bt&&y.j==bt)&&(fe=-fe),b=u(Le(o.e,0),17).c,_=u(Le(y.e,0),17).c,f=b.i,A=_.i,f==A)for(K=new L(f.j);K.a0?(Wl(e,o,y,fe),fe):(Wl(e,y,o,fe),-fe);if(i=pFe(u(ys(yK(e.d),_s(new Ui,new Si,new nu,z(B(Zo,1),ye,130,0,[(Kl(),Wo)]))),20),f,A),i!=0)return i>0?(Wl(e,o,y,fe),fe):(Wl(e,y,o,fe),-fe);if(e.c&&(de=XHe(e,o,y),de!=0))return de>0?(Wl(e,o,y,fe),fe):(Wl(e,y,o,fe),-fe)}return o.g.c.length!=0&&y.g.c.length!=0?((o.j==(Ne(),Xn)&&y.j==Xn||o.j==bt&&y.j==bt)&&(fe=-fe),p=u(T(o,(pe(),yie)),9),R=u(T(y,yie),9),e.f==(ud(),ire)&&p&&R&&bi(p,Oi)&&bi(R,Oi)?(l=w2(p,R,e.b,u(T(e.b,Tb),15).a),S=w2(R,p,e.b,u(T(e.b,Tb),15).a),l>S?(Wl(e,o,y,fe),fe):(Wl(e,y,o,fe),-fe)):e.c&&(de=XHe(e,o,y),de!=0)?de>0?(Wl(e,o,y,fe),fe):(Wl(e,y,o,fe),-fe):(h=0,N=0,bi(u(Le(o.g,0),17),Oi)&&(h=w2(u(Le(o.g,0),246),u(Le(y.g,0),246),e.b,o.g.c.length+o.e.c.length)),bi(u(Le(y.g,0),17),Oi)&&(N=w2(u(Le(y.g,0),246),u(Le(o.g,0),246),e.b,y.g.c.length+y.e.c.length)),p&&p==R||e.g&&(e.g._b(p)&&(h=u(e.g.xc(p),15).a),e.g._b(R)&&(N=u(e.g.xc(R),15).a)),h>N?(Wl(e,o,y,fe),fe):(Wl(e,y,o,fe),-fe))):o.e.c.length!=0&&y.g.c.length!=0?(Wl(e,o,y,fe),1):o.g.c.length!=0&&y.e.c.length!=0?(Wl(e,y,o,fe),-1):bi(o,(pe(),Oi))&&bi(y,Oi)?(c=o.i.j.c.length,l=w2(o,y,e.b,c),S=w2(y,o,e.b,c),(o.j==(Ne(),Xn)&&y.j==Xn||o.j==bt&&y.j==bt)&&(fe=-fe),l>S?(Wl(e,o,y,fe),fe):(Wl(e,y,o,fe),-fe)):(Wl(e,y,o,fe),-fe)}function pe(){pe=Y;var e,n;pi=new yi(uwe),Jve=new yi("coordinateOrigin"),Eie=new yi("processors"),Hve=new Pi("compoundNode",(Ln(),!1)),aD=new Pi("insideConnections",!1),Xve=new yi("originalBendpoints"),Vve=new yi("originalDummyNodePosition"),Kve=new yi("originalLabelEdge"),wM=new yi("representedLabels"),gM=new yi("endLabels"),Xy=new yi("endLabel.origin"),Ky=new Pi("labelSide",(ml(),qD)),i4=new Pi("maxEdgeThickness",0),o0=new Pi("reversed",!1),Qy=new yi(WQe),Na=new Pi("longEdgeSource",null),jf=new Pi("longEdgeTarget",null),Bm=new Pi("longEdgeHasLabelDummies",!1),hD=new Pi("longEdgeBeforeLabelDummy",!1),oJ=new Pi("edgeConstraint",(jg(),rie)),P2=new yi("inLayerLayoutUnit"),Jg=new Pi("inLayerConstraint",(Z1(),lD)),Vy=new Pi("inLayerSuccessorConstraint",new Te),Uve=new Pi("inLayerSuccessorConstraintBetweenNonDummies",!1),Ss=new yi("portDummy"),uJ=new Pi("crossingHint",me(0)),po=new Pi("graphProperties",(n=u(pa(aie),10),new Jl(n,u(zf(n,n.length),10),0))),_u=new Pi("externalPortSide",(Ne(),Eu)),qve=new Pi("externalPortSize",new Yr),pie=new yi("externalPortReplacedDummies"),sJ=new yi("externalPortReplacedDummy"),dd=new Pi("externalPortConnections",(e=u(pa(Ac),10),new Jl(e,u(zf(e,e.length),10),0))),$2=new Pi(XQe,0),Fve=new yi("barycenterAssociates"),Wy=new yi("TopSideComments"),qy=new yi("BottomSideComments"),cJ=new yi("CommentConnectionPort"),vie=new Pi("inputCollect",!1),kie=new Pi("outputCollect",!1),Uy=new Pi("cyclic",!1),Gve=new yi("crossHierarchyMap"),Sie=new yi("targetOffset"),new Pi("splineLabelSize",new Yr),c4=new yi("spacings"),lJ=new Pi("partitionConstraint",!1),L2=new yi("breakingPoint.info"),Wve=new yi("splines.survivingEdge"),Gg=new yi("splines.route.start"),u4=new yi("splines.edgeChain"),Yve=new yi("originalPortConstraints"),R2=new yi("selfLoopHolder"),F7=new yi("splines.nsPortY"),Oi=new yi("modelOrder"),Tb=new yi("modelOrder.maximum"),fD=new yi("modelOrderGroups.cb.number"),yie=new yi("longEdgeTargetNode"),xb=new Pi(SYe,!1),r4=new Pi(SYe,!1),mie=new yi("layerConstraints.hiddenNodes"),Qve=new yi("layerConstraints.opposidePort"),jie=new yi("targetNode.modelOrder"),Yy=new Pi("tarjan.lowlink",me(ui)),pM=new Pi("tarjan.id",me(-1)),fJ=new Pi("tarjan.onstack",!1),Xin=new Pi("partOfCycle",!1),o4=new yi("medianHeuristic.weight")}function Gt(){Gt=Y;var e,n;u6=new yi(dWe),i3=new yi(bWe),w9e=(s1(),fce),wfn=new fn(w2e,w9e),Z7=new fn(u7,null),pfn=new yi(Ope),m9e=(Cg(),Ti(dce,z(B(bce,1),ye,299,0,[hce]))),PD=new fn(_F,m9e),$D=new fn(BN,(Ln(),!1)),v9e=(kr(),lh),Wg=new fn(Jee,v9e),E9e=(cd(),xce),k9e=new fn(RN,E9e),kfn=new fn(Tpe,!1),S9e=(rd(),hG),p4=new fn(DF,S9e),L9e=new Hw(12),y1=new fn(Am,L9e),BD=new fn(OS,!1),mce=new fn(LF,!1),zD=new fn(NS,!1),z9e=(Fr(),$b),tA=new fn(eee,z9e),o6=new yi(IF),FD=new yi(TN),Mce=new yi(dF),Ace=new yi(CS),x9e=new Os,m4=new fn(x2e,x9e),vfn=new fn(N2e,!1),Efn=new fn(D2e,!1),new fn(gWe,0),T9e=new SE,ek=new fn(I2e,T9e),oG=new fn(b2e,!1),Tfn=new fn(wWe,1),e3=new yi(pWe),Zm=new yi(mWe),tk=new fn(CN,!1),new fn(vWe,!0),me(0),new fn(yWe,me(100)),new fn(kWe,!1),me(0),new fn(EWe,me(4e3)),me(0),new fn(jWe,me(400)),new fn(SWe,!1),new fn(MWe,!1),new fn(AWe,!0),new fn(xWe,!1),p9e=(ZB(),_ce),mfn=new fn(Cpe,p9e),A9e=(Oj(),VD),Sfn=new fn(TWe,A9e),M9e=(E8(),HD),jfn=new fn(CWe,M9e),Cfn=new fn(t2e,10),Ofn=new fn(i2e,10),Nfn=new fn(r2e,20),Dfn=new fn(c2e,10),G9e=new fn(ZZ,2),q9e=new fn(Hee,10),U9e=new fn(u2e,0),sG=new fn(l2e,5),X9e=new fn(o2e,1),V9e=new fn(s2e,1),d0=new fn(Mm,20),_fn=new fn(f2e,10),Y9e=new fn(a2e,10),s6=new yi(h2e),Q9e=new dCe,K9e=new fn(L2e,Q9e),Afn=new yi(qee),P9e=!1,Mfn=new fn(Gee,P9e),O9e=new Hw(5),C9e=new fn(v2e,O9e),N9e=(gm(),n=u(pa($c),10),new Jl(n,u(zf(n,n.length),10),0)),v4=new fn(s7,N9e),R9e=(Mv(),Pb),$9e=new fn(E2e,R9e),yce=new yi(j2e),kce=new yi(S2e),Ece=new yi(M2e),vce=new yi(A2e),D9e=(e=u(pa(fA),10),new Jl(e,u(zf(e,e.length),10),0)),Zg=new fn(zv,D9e),I9e=nn((Bs(),ok)),Ib=new fn(Dy,I9e),_9e=new Ee(0,0),y4=new fn(_y,_9e),n3=new fn(o7,!1),y9e=(Ua(),ik),wce=new fn(C2e,y9e),gce=new fn(bF,!1),me(1),new fn(OWe,null),B9e=new yi(_2e),jce=new yi(O2e),J9e=(Ne(),Eu),k4=new fn(g2e,J9e),Fs=new yi(d2e),F9e=(Es(),nn(Rb)),t3=new fn(l7,F9e),Sce=new fn(y2e,!1),H9e=new fn(k2e,!0),me(1),Rfn=new fn(bne,me(3)),me(1),zfn=new fn(Npe,me(4)),lG=new fn(ON,1),fG=new fn(gne,null),r3=new fn(NN,150),nk=new fn(DN,1.414),l6=new fn(j2,null),Ifn=new fn(Dpe,1),RD=new fn(p2e,!1),pce=new fn(m2e,!1),yfn=new fn(T2e,1),j9e=(xz(),Cce),new fn(NWe,j9e),xfn=!0,Bfn=(YR(),Dce),Pfn=(fy(),o3),$fn=o3,Lfn=o3}function Vr(){Vr=Y,R3e=new gr("DIRECTION_PREPROCESSOR",0),L3e=new gr("COMMENT_PREPROCESSOR",1),Qv=new gr("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",2),Lte=new gr("INTERACTIVE_EXTERNAL_PORT_POSITIONER",3),ive=new gr("PARTITION_PREPROCESSOR",4),_H=new gr("LABEL_DUMMY_INSERTER",5),JH=new gr("SELF_LOOP_PREPROCESSOR",6),Lm=new gr("LAYER_CONSTRAINT_PREPROCESSOR",7),nve=new gr("PARTITION_MIDPROCESSOR",8),U3e=new gr("HIGH_DEGREE_NODE_LAYER_PROCESSOR",9),Z3e=new gr("NODE_PROMOTION",10),Im=new gr("LAYER_CONSTRAINT_POSTPROCESSOR",11),tve=new gr("PARTITION_POSTPROCESSOR",12),J3e=new gr("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",13),rve=new gr("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",14),C3e=new gr("BREAKING_POINT_INSERTER",15),$H=new gr("LONG_EDGE_SPLITTER",16),Pte=new gr("PORT_SIDE_PROCESSOR",17),NH=new gr("INVERTED_PORT_PROCESSOR",18),zH=new gr("PORT_LIST_SORTER",19),uve=new gr("SORT_BY_INPUT_ORDER_OF_MODEL",20),BH=new gr("NORTH_SOUTH_PORT_PREPROCESSOR",21),O3e=new gr("BREAKING_POINT_PROCESSOR",22),eve=new gr(wYe,23),ove=new gr(pYe,24),FH=new gr("SELF_LOOP_PORT_RESTORER",25),T3e=new gr("ALTERNATING_LAYER_UNZIPPER",26),cve=new gr("SINGLE_EDGE_GRAPH_WRAPPER",27),DH=new gr("IN_LAYER_CONSTRAINT_PROCESSOR",28),z3e=new gr("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",29),Y3e=new gr("LABEL_AND_NODE_SIZE_PROCESSOR",30),Q3e=new gr("INNERMOST_NODE_MARGIN_CALCULATOR",31),GH=new gr("SELF_LOOP_ROUTER",32),_3e=new gr("COMMENT_NODE_MARGIN_CALCULATOR",33),OH=new gr("END_LABEL_PREPROCESSOR",34),LH=new gr("LABEL_DUMMY_SWITCHER",35),D3e=new gr("CENTER_LABEL_MANAGEMENT_PROCESSOR",36),N7=new gr("LABEL_SIDE_SELECTOR",37),V3e=new gr("HYPEREDGE_DUMMY_MERGER",38),G3e=new gr("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",39),W3e=new gr("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",40),lM=new gr("HIERARCHICAL_PORT_POSITION_PROCESSOR",41),P3e=new gr("CONSTRAINTS_POSTPROCESSOR",42),I3e=new gr("COMMENT_POSTPROCESSOR",43),K3e=new gr("HYPERNODE_PROCESSOR",44),q3e=new gr("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",45),PH=new gr("LONG_EDGE_JOINER",46),HH=new gr("SELF_LOOP_POSTPROCESSOR",47),N3e=new gr("BREAKING_POINT_REMOVER",48),RH=new gr("NORTH_SOUTH_PORT_POSTPROCESSOR",49),X3e=new gr("HORIZONTAL_COMPACTOR",50),IH=new gr("LABEL_DUMMY_REMOVER",51),F3e=new gr("FINAL_SPLINE_BENDPOINTS_CALCULATOR",52),B3e=new gr("END_LABEL_SORTER",53),Jy=new gr("REVERSED_EDGE_RESTORER",54),CH=new gr("END_LABEL_POSTPROCESSOR",55),H3e=new gr("HIERARCHICAL_NODE_RESIZER",56),$3e=new gr("DIRECTION_POSTPROCESSOR",57)}function CBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn,Cn,st,Qt,qi,Ts,eu,Cl,x4,k0,la,yd,lf,w6,jA,kd,Pa,E0,rw,cw,p6,uw,ow,Ed,g3,A7e,K2,SA,Qce,m6,MA,w3,AA,Yce,Chn;for(A7e=0,Qt=n,eu=0,k0=Qt.length;eu0&&(e.a[Pa.p]=A7e++)}for(MA=0,qi=t,Cl=0,la=qi.length;Cl0;){for(Pa=(at(p6.b>0),u(p6.a.Xb(p6.c=--p6.b),12)),cw=0,l=new L(Pa.e);l.a0&&(Pa.j==(Ne(),Un)?(e.a[Pa.p]=MA,++MA):(e.a[Pa.p]=MA+yd+w6,++w6))}MA+=w6}for(rw=new wt,A=new Zh,st=n,Ts=0,x4=st.length;Tsh.b&&(h.b=uw)):Pa.i.c==g3&&(uwh.c&&(h.c=uw));for(r8(N,0,N.length,null),m6=oe(It,ei,30,N.length,15,1),i=oe(It,ei,30,MA+1,15,1),R=0;R0;)_e%2>0&&(r+=Yce[_e+1]),_e=(_e-1)/2|0,++Yce[_e];for(tn=oe(pon,xn,370,N.length*2,0,1),ie=0;ie0&&XC(Ts.f),ve(R,fG)!=null&&(!R.a&&(R.a=new we(Bt,R,10,11)),!!R.a)&&(!R.a&&(R.a=new we(Bt,R,10,11)),R.a).i>0?(l=u(ve(R,fG),521),cw=l.Sg(R),Fw(R,k.Math.max(R.g,cw.a+yd.b+yd.c),k.Math.max(R.f,cw.b+yd.d+yd.a))):(!R.a&&(R.a=new we(Bt,R,10,11)),R.a).i!=0&&(cw=new Ee(te(re(ve(R,r3))),te(re(ve(R,r3)))/te(re(ve(R,nk)))),Fw(R,k.Math.max(R.g,cw.a+yd.b+yd.c),k.Math.max(R.f,cw.b+yd.d+yd.a)));if(la=u(ve(n,y1),104),S=n.g-(la.b+la.c),y=n.f-(la.d+la.a),ow.ah("Available Child Area: ("+S+"|"+y+")"),Ei(n,Z7,S/y),THe(n,r,i.dh(x4)),u(ve(n,l6),281)==mG&&(lZ(n),Fw(n,la.b+te(re(ve(n,e3)))+la.c,la.d+te(re(ve(n,Zm)))+la.a)),ow.ah("Executed layout algorithm: "+_t(ve(n,u6))+" on node "+n.k),u(ve(n,l6),281)==o3){if(S<0||y<0)throw $(new Id("The size defined by the parent parallel node is too small for the space provided by the paddings of the child hierarchical node. "+n.k));for(Ea(n,e3)||Ea(n,Zm)||lZ(n),N=te(re(ve(n,e3))),A=te(re(ve(n,Zm))),ow.ah("Desired Child Area: ("+N+"|"+A+")"),w6=S/N,jA=y/A,lf=k.Math.min(w6,k.Math.min(jA,te(re(ve(n,Ifn))))),Ei(n,lG,lf),ow.ah(n.k+" -- Local Scale Factor (X|Y): ("+w6+"|"+jA+")"),ie=u(ve(n,PD),22),c=0,o=0,lf'?":bn(fZe,e)?"'(?<' or '(? toIndex: ",Kge=", toIndex: ",Qge="Index: ",Yge=", Size: ",t7="org.eclipse.elk.alg.common",Kt={51:1},CQe="org.eclipse.elk.alg.common.compaction",OQe="Scanline/EventHandler",b1="org.eclipse.elk.alg.common.compaction.oned",NQe="CNode belongs to another CGroup.",DQe="ISpacingsHandler/1",XZ="The ",VZ=" instance has been finished already.",_Qe="The direction ",IQe=" is not supported by the CGraph instance.",LQe="OneDimensionalCompactor",PQe="OneDimensionalCompactor/lambda$0$Type",$Qe="Quadruplet",RQe="ScanlineConstraintCalculator",BQe="ScanlineConstraintCalculator/ConstraintsScanlineHandler",zQe="ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type",FQe="ScanlineConstraintCalculator/Timestamp",HQe="ScanlineConstraintCalculator/lambda$0$Type",_h={178:1,48:1},AS="org.eclipse.elk.alg.common.networksimplex",Aa={171:1,3:1,4:1},JQe="org.eclipse.elk.alg.common.nodespacing",Ig="org.eclipse.elk.alg.common.nodespacing.cellsystem",i7="CENTER",GQe={216:1,337:1},Wge={3:1,4:1,5:1,592:1},Cy="LEFT",Oy="RIGHT",Zge="Vertical alignment cannot be null",ewe="BOTTOM",aF="org.eclipse.elk.alg.common.nodespacing.internal",xS="UNDEFINED",Za=.01,MN="org.eclipse.elk.alg.common.nodespacing.internal.algorithm",qQe="LabelPlacer/lambda$0$Type",UQe="LabelPlacer/lambda$1$Type",XQe="portRatioOrPosition",r7="org.eclipse.elk.alg.common.overlaps",KZ="DOWN",Ny="org.eclipse.elk.alg.common.spore",Sm={3:1,4:1,5:1,198:1},VQe={3:1,6:1,4:1,5:1,90:1,110:1},QZ="org.eclipse.elk.alg.force",nwe="ComponentsProcessor",KQe="ComponentsProcessor/1",twe="ElkGraphImporter/lambda$0$Type",E2={214:1},Bv="org.eclipse.elk.core",AN="org.eclipse.elk.graph.properties",QQe="IPropertyHolder",xN="org.eclipse.elk.alg.force.graph",YQe="Component Layout",iwe="org.eclipse.elk.alg.force.model",yu="org.eclipse.elk.core.data",hF="org.eclipse.elk.force.model",rwe="org.eclipse.elk.force.iterations",cwe="org.eclipse.elk.force.repulsivePower",YZ="org.eclipse.elk.force.temperature",Ih=.001,WZ="org.eclipse.elk.force.repulsion",eh={148:1},TS="org.eclipse.elk.alg.force.options",c7=1.600000023841858,$o="org.eclipse.elk.force",TN="org.eclipse.elk.priority",Mm="org.eclipse.elk.spacing.nodeNode",ZZ="org.eclipse.elk.spacing.edgeLabel",u7="org.eclipse.elk.aspectRatio",dF="org.eclipse.elk.randomSeed",CS="org.eclipse.elk.separateConnectedComponents",Am="org.eclipse.elk.padding",OS="org.eclipse.elk.interactive",eee="org.eclipse.elk.portConstraints",bF="org.eclipse.elk.edgeLabels.inline",NS="org.eclipse.elk.omitNodeMicroLayout",o7="org.eclipse.elk.nodeSize.fixedGraphSize",Dy="org.eclipse.elk.nodeSize.options",zv="org.eclipse.elk.nodeSize.constraints",s7="org.eclipse.elk.nodeLabels.placement",l7="org.eclipse.elk.portLabels.placement",CN="org.eclipse.elk.topdownLayout",ON="org.eclipse.elk.topdown.scaleFactor",NN="org.eclipse.elk.topdown.hierarchicalNodeWidth",DN="org.eclipse.elk.topdown.hierarchicalNodeAspectRatio",j2="org.eclipse.elk.topdown.nodeType",uwe="origin",WQe="random",ZQe="boundingBox.upLeft",eYe="boundingBox.lowRight",owe="org.eclipse.elk.stress.fixed",swe="org.eclipse.elk.stress.desiredEdgeLength",lwe="org.eclipse.elk.stress.dimension",fwe="org.eclipse.elk.stress.epsilon",awe="org.eclipse.elk.stress.iterationLimit",mb="org.eclipse.elk.stress",nYe="ELK Stress",_y="org.eclipse.elk.nodeSize.minimum",gF="org.eclipse.elk.alg.force.stress",tYe="Layered layout",Iy="org.eclipse.elk.alg.layered",_N="org.eclipse.elk.alg.layered.compaction.components",DS="org.eclipse.elk.alg.layered.compaction.oned",wF="org.eclipse.elk.alg.layered.compaction.oned.algs",Lg="org.eclipse.elk.alg.layered.compaction.recthull",nh="org.eclipse.elk.alg.layered.components",xa="NONE",nee="MODEL_ORDER",qu={3:1,6:1,4:1,10:1,5:1,126:1},iYe={3:1,6:1,4:1,5:1,135:1,90:1,110:1},pF="org.eclipse.elk.alg.layered.compound",xi={43:1},Zu="org.eclipse.elk.alg.layered.graph",tee=" -> ",rYe="Not supported by LGraph",hwe="Port side is undefined",f7={3:1,6:1,4:1,5:1,323:1,135:1,90:1,110:1},i0={3:1,6:1,4:1,5:1,135:1,199:1,209:1,90:1,110:1},cYe={3:1,6:1,4:1,5:1,135:1,2004:1,209:1,90:1,110:1},uYe=`([{"' \r -`,oYe=`)]}"' \r -`,sYe="The given string contains parts that cannot be parsed as numbers.",IN="org.eclipse.elk.core.math",lYe={3:1,4:1,140:1,213:1,414:1},fYe={3:1,4:1,104:1,213:1,414:1},r0="org.eclipse.elk.alg.layered.graph.transform",aYe="ElkGraphImporter",hYe="ElkGraphImporter/lambda$1$Type",dYe="ElkGraphImporter/lambda$2$Type",bYe="ElkGraphImporter/lambda$4$Type",Qn="org.eclipse.elk.alg.layered.intermediate",gYe="Node margin calculation",wYe="ONE_SIDED_GREEDY_SWITCH",pYe="TWO_SIDED_GREEDY_SWITCH",iee="No implementation is available for the layout processor ",ree="IntermediateProcessorStrategy",cee="Node '",mYe="FIRST_SEPARATE",vYe="LAST_SEPARATE",yYe="Odd port side processing",fr="org.eclipse.elk.alg.layered.intermediate.compaction",_S="org.eclipse.elk.alg.layered.intermediate.greedyswitch",g1="org.eclipse.elk.alg.layered.p3order.counting",IS={220:1},Ly="org.eclipse.elk.alg.layered.intermediate.loops",El="org.eclipse.elk.alg.layered.intermediate.loops.ordering",vb="org.eclipse.elk.alg.layered.intermediate.loops.routing",mF="org.eclipse.elk.alg.layered.intermediate.preserveorder",Lh="org.eclipse.elk.alg.layered.intermediate.wrapping",Ou="org.eclipse.elk.alg.layered.options",uee="INTERACTIVE",dwe="GREEDY",kYe="DEPTH_FIRST",EYe="EDGE_LENGTH",jYe="SELF_LOOPS",SYe="firstTryWithInitialOrder",bwe="org.eclipse.elk.layered.directionCongruency",gwe="org.eclipse.elk.layered.feedbackEdges",vF="org.eclipse.elk.layered.interactiveReferencePoint",wwe="org.eclipse.elk.layered.mergeEdges",pwe="org.eclipse.elk.layered.mergeHierarchyEdges",mwe="org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",vwe="org.eclipse.elk.layered.portSortingStrategy",ywe="org.eclipse.elk.layered.thoroughness",kwe="org.eclipse.elk.layered.unnecessaryBendpoints",Ewe="org.eclipse.elk.layered.generatePositionAndLayerIds",LN="org.eclipse.elk.layered.cycleBreaking.strategy",PN="org.eclipse.elk.layered.layering.strategy",jwe="org.eclipse.elk.layered.layering.layerConstraint",Swe="org.eclipse.elk.layered.layering.layerChoiceConstraint",Mwe="org.eclipse.elk.layered.layering.layerId",oee="org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",see="org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",lee="org.eclipse.elk.layered.layering.nodePromotion.strategy",fee="org.eclipse.elk.layered.layering.nodePromotion.maxIterations",aee="org.eclipse.elk.layered.layering.coffmanGraham.layerBound",LS="org.eclipse.elk.layered.crossingMinimization.strategy",Awe="org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",hee="org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",dee="org.eclipse.elk.layered.crossingMinimization.semiInteractive",xwe="org.eclipse.elk.layered.crossingMinimization.inLayerPredOf",Twe="org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf",Cwe="org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",Owe="org.eclipse.elk.layered.crossingMinimization.positionId",Nwe="org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",bee="org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",yF="org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",Fv="org.eclipse.elk.layered.nodePlacement.strategy",kF="org.eclipse.elk.layered.nodePlacement.favorStraightEdges",gee="org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",wee="org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",pee="org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",mee="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility",vee="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",Dwe="org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",_we="org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",EF="org.eclipse.elk.layered.edgeRouting.splines.mode",jF="org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",yee="org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",Iwe="org.eclipse.elk.layered.spacing.baseValue",Lwe="org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",Pwe="org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",$we="org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",Rwe="org.eclipse.elk.layered.priority.direction",Bwe="org.eclipse.elk.layered.priority.shortness",zwe="org.eclipse.elk.layered.priority.straightness",kee="org.eclipse.elk.layered.compaction.connectedComponents",Fwe="org.eclipse.elk.layered.compaction.postCompaction.strategy",Hwe="org.eclipse.elk.layered.compaction.postCompaction.constraints",SF="org.eclipse.elk.layered.highDegreeNodes.treatment",Eee="org.eclipse.elk.layered.highDegreeNodes.threshold",jee="org.eclipse.elk.layered.highDegreeNodes.treeHeight",fd="org.eclipse.elk.layered.wrapping.strategy",MF="org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",AF="org.eclipse.elk.layered.wrapping.correctionFactor",PS="org.eclipse.elk.layered.wrapping.cutting.strategy",See="org.eclipse.elk.layered.wrapping.cutting.cuts",Mee="org.eclipse.elk.layered.wrapping.cutting.msd.freedom",xF="org.eclipse.elk.layered.wrapping.validify.strategy",TF="org.eclipse.elk.layered.wrapping.validify.forbiddenIndices",CF="org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",OF="org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",Aee="org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",xee="org.eclipse.elk.layered.layerUnzipping.strategy",Tee="org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",Cee="org.eclipse.elk.layered.layerUnzipping.layerSplit",Oee="org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",Jwe="org.eclipse.elk.layered.edgeLabels.sideSelection",Gwe="org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",NF="org.eclipse.elk.layered.considerModelOrder.strategy",qwe="org.eclipse.elk.layered.considerModelOrder.portModelOrder",$N="org.eclipse.elk.layered.considerModelOrder.noModelOrder",Nee="org.eclipse.elk.layered.considerModelOrder.components",Uwe="org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",Dee="org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",_ee="org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",Iee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",Lee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",Pee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.componentGroupId",Xwe="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbGroupOrderStrategy",$ee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredSourceId",Ree="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredTargetId",Vwe="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmGroupOrderStrategy",Kwe="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmEnforcedGroupOrders",Bee="layering",MYe="layering.minWidth",AYe="layering.nodePromotion",a7="crossingMinimization",DF="org.eclipse.elk.hierarchyHandling",xYe="crossingMinimization.greedySwitch",TYe="nodePlacement",CYe="nodePlacement.bk",OYe="edgeRouting",RN="org.eclipse.elk.edgeRouting",th="spacing",Qwe="priority",Ywe="compaction",NYe="compaction.postCompaction",DYe="Specifies whether and how post-process compaction is applied.",Wwe="highDegreeNodes",Zwe="wrapping",_Ye="wrapping.cutting",IYe="wrapping.validify",e2e="wrapping.multiEdge",zee="layerUnzipping",Fee="edgeLabels",$S="considerModelOrder",h7="considerModelOrder.groupModelOrder",n2e="Group ID of the Node Type",t2e="org.eclipse.elk.spacing.commentComment",i2e="org.eclipse.elk.spacing.commentNode",r2e="org.eclipse.elk.spacing.componentComponent",c2e="org.eclipse.elk.spacing.edgeEdge",Hee="org.eclipse.elk.spacing.edgeNode",u2e="org.eclipse.elk.spacing.labelLabel",o2e="org.eclipse.elk.spacing.labelPortHorizontal",s2e="org.eclipse.elk.spacing.labelPortVertical",l2e="org.eclipse.elk.spacing.labelNode",f2e="org.eclipse.elk.spacing.nodeSelfLoop",a2e="org.eclipse.elk.spacing.portPort",h2e="org.eclipse.elk.spacing.individual",d2e="org.eclipse.elk.port.borderOffset",b2e="org.eclipse.elk.noLayout",g2e="org.eclipse.elk.port.side",BN="org.eclipse.elk.debugMode",w2e="org.eclipse.elk.alignment",p2e="org.eclipse.elk.insideSelfLoops.activate",m2e="org.eclipse.elk.insideSelfLoops.yo",Jee="org.eclipse.elk.direction",v2e="org.eclipse.elk.nodeLabels.padding",y2e="org.eclipse.elk.portLabels.nextToPortIfPossible",k2e="org.eclipse.elk.portLabels.treatAsGroup",E2e="org.eclipse.elk.portAlignment.default",j2e="org.eclipse.elk.portAlignment.north",S2e="org.eclipse.elk.portAlignment.south",M2e="org.eclipse.elk.portAlignment.west",A2e="org.eclipse.elk.portAlignment.east",_F="org.eclipse.elk.contentAlignment",x2e="org.eclipse.elk.junctionPoints",T2e="org.eclipse.elk.edge.thickness",C2e="org.eclipse.elk.edgeLabels.placement",O2e="org.eclipse.elk.port.index",N2e="org.eclipse.elk.commentBox",D2e="org.eclipse.elk.hypernode",_2e="org.eclipse.elk.port.anchor",Gee="org.eclipse.elk.partitioning.activate",qee="org.eclipse.elk.partitioning.partition",IF="org.eclipse.elk.position",I2e="org.eclipse.elk.margins",L2e="org.eclipse.elk.spacing.portsSurrounding",LF="org.eclipse.elk.interactiveLayout",Ru="org.eclipse.elk.core.util",P2e={3:1,4:1,5:1,590:1},LYe="NETWORK_SIMPLEX",$2e="SIMPLE",lc={95:1,43:1},S2="org.eclipse.elk.alg.layered.p1cycles",PYe="Depth-first cycle removal",$Ye="Model order cycle breaking",ad="org.eclipse.elk.alg.layered.p2layers",R2e={406:1,220:1},RYe={830:1,3:1,4:1},Ro="org.eclipse.elk.alg.layered.p3order",Hv=17976931348623157e292,Uee=5e-324,Lc="org.eclipse.elk.alg.layered.p4nodes",BYe={3:1,4:1,5:1,838:1},Ph=1e-5,yb="org.eclipse.elk.alg.layered.p4nodes.bk",Xee="org.eclipse.elk.alg.layered.p5edges",Ta="org.eclipse.elk.alg.layered.p5edges.orthogonal",Vee="org.eclipse.elk.alg.layered.p5edges.orthogonal.direction",Kee=1e-6,xm="org.eclipse.elk.alg.layered.p5edges.splines",Qee=.09999999999999998,PF=1e-8,zYe=4.71238898038469,FYe=1.5707963267948966,B2e=3.141592653589793,hd="org.eclipse.elk.alg.mrtree",Yee=.10000000149011612,$F="SUPER_ROOT",RS="org.eclipse.elk.alg.mrtree.graph",z2e=-17976931348623157e292,go="org.eclipse.elk.alg.mrtree.intermediate",HYe="Processor compute fanout",RF={3:1,6:1,4:1,5:1,522:1,90:1,110:1},JYe="Set neighbors in level",zN="org.eclipse.elk.alg.mrtree.options",GYe="DESCENDANTS",F2e="org.eclipse.elk.mrtree.compaction",H2e="org.eclipse.elk.mrtree.edgeEndTextureLength",J2e="org.eclipse.elk.mrtree.treeLevel",G2e="org.eclipse.elk.mrtree.positionConstraint",q2e="org.eclipse.elk.mrtree.weighting",U2e="org.eclipse.elk.mrtree.edgeRoutingMode",X2e="org.eclipse.elk.mrtree.searchOrder",qYe="Position Constraint",Bo="org.eclipse.elk.mrtree",UYe="org.eclipse.elk.tree",XYe="Processor arrange level",d7="org.eclipse.elk.alg.mrtree.p2order",rl="org.eclipse.elk.alg.mrtree.p4route",V2e="org.eclipse.elk.alg.radial",Pg=6.283185307179586,K2e="Before",BF="After",Q2e="org.eclipse.elk.alg.radial.intermediate",VYe="COMPACTION",Wee="org.eclipse.elk.alg.radial.intermediate.compaction",KYe={3:1,4:1,5:1,90:1},Y2e="org.eclipse.elk.alg.radial.intermediate.optimization",Zee="No implementation is available for the layout option ",BS="org.eclipse.elk.alg.radial.options",QYe="CompactionStrategy",W2e="org.eclipse.elk.radial.centerOnRoot",Z2e="org.eclipse.elk.radial.orderId",epe="org.eclipse.elk.radial.radius",zF="org.eclipse.elk.radial.rotate",ene="org.eclipse.elk.radial.compactor",nne="org.eclipse.elk.radial.compactionStepSize",npe="org.eclipse.elk.radial.sorter",tpe="org.eclipse.elk.radial.wedgeCriteria",ipe="org.eclipse.elk.radial.optimizationCriteria",tne="org.eclipse.elk.radial.rotation.targetAngle",ine="org.eclipse.elk.radial.rotation.computeAdditionalWedgeSpace",rpe="org.eclipse.elk.radial.rotation.outgoingEdgeAngles",YYe="Compaction",cpe="rotation",Zl="org.eclipse.elk.radial",WYe="org.eclipse.elk.alg.radial.p1position.wedge",upe="org.eclipse.elk.alg.radial.sorting",ZYe=5.497787143782138,eWe=3.9269908169872414,nWe=2.356194490192345,tWe="org.eclipse.elk.alg.rectpacking",zS="org.eclipse.elk.alg.rectpacking.intermediate",rne="org.eclipse.elk.alg.rectpacking.options",ope="org.eclipse.elk.rectpacking.trybox",spe="org.eclipse.elk.rectpacking.currentPosition",lpe="org.eclipse.elk.rectpacking.desiredPosition",fpe="org.eclipse.elk.rectpacking.inNewRow",ape="org.eclipse.elk.rectpacking.orderBySize",hpe="org.eclipse.elk.rectpacking.widthApproximation.strategy",dpe="org.eclipse.elk.rectpacking.widthApproximation.targetWidth",bpe="org.eclipse.elk.rectpacking.widthApproximation.optimizationGoal",gpe="org.eclipse.elk.rectpacking.widthApproximation.lastPlaceShift",wpe="org.eclipse.elk.rectpacking.packing.strategy",ppe="org.eclipse.elk.rectpacking.packing.compaction.rowHeightReevaluation",mpe="org.eclipse.elk.rectpacking.packing.compaction.iterations",vpe="org.eclipse.elk.rectpacking.whiteSpaceElimination.strategy",cne="widthApproximation",iWe="Compaction Strategy",rWe="packing.compaction",js="org.eclipse.elk.rectpacking",b7="org.eclipse.elk.alg.rectpacking.p1widthapproximation",FF="org.eclipse.elk.alg.rectpacking.p2packing",cWe="No Compaction",ype="org.eclipse.elk.alg.rectpacking.p3whitespaceelimination",FN="org.eclipse.elk.alg.rectpacking.util",HF="No implementation available for ",Tm="org.eclipse.elk.alg.spore",Cm="org.eclipse.elk.alg.spore.options",M2="org.eclipse.elk.sporeCompaction",une="org.eclipse.elk.underlyingLayoutAlgorithm",kpe="org.eclipse.elk.processingOrder.treeConstruction",Epe="org.eclipse.elk.processingOrder.spanningTreeCostFunction",one="org.eclipse.elk.processingOrder.preferredRoot",sne="org.eclipse.elk.processingOrder.rootSelection",lne="org.eclipse.elk.structure.structureExtractionStrategy",jpe="org.eclipse.elk.compaction.compactionStrategy",Spe="org.eclipse.elk.compaction.orthogonal",Mpe="org.eclipse.elk.overlapRemoval.maxIterations",Ape="org.eclipse.elk.overlapRemoval.runScanline",fne="processingOrder",uWe="overlapRemoval",g7="org.eclipse.elk.sporeOverlap",oWe="org.eclipse.elk.alg.spore.p1structure",ane="org.eclipse.elk.alg.spore.p2processingorder",hne="org.eclipse.elk.alg.spore.p3execution",sWe="Topdown Layout",lWe="Invalid index: ",w7="org.eclipse.elk.core.alg",Jv={342:1},Om={296:1},fWe="Make sure its type is registered with the ",xpe=" utility class.",p7="true",dne="false",aWe="Couldn't clone property '",A2=.05,Oo="org.eclipse.elk.core.options",hWe=1.2999999523162842,x2="org.eclipse.elk.box",Tpe="org.eclipse.elk.expandNodes",Cpe="org.eclipse.elk.box.packingMode",dWe="org.eclipse.elk.algorithm",bWe="org.eclipse.elk.resolvedAlgorithm",Ope="org.eclipse.elk.bendPoints",IBn="org.eclipse.elk.labelManager",gWe="org.eclipse.elk.softwrappingFuzziness",wWe="org.eclipse.elk.scaleFactor",pWe="org.eclipse.elk.childAreaWidth",mWe="org.eclipse.elk.childAreaHeight",vWe="org.eclipse.elk.animate",yWe="org.eclipse.elk.animTimeFactor",kWe="org.eclipse.elk.layoutAncestors",EWe="org.eclipse.elk.maxAnimTime",jWe="org.eclipse.elk.minAnimTime",SWe="org.eclipse.elk.progressBar",MWe="org.eclipse.elk.validateGraph",AWe="org.eclipse.elk.validateOptions",xWe="org.eclipse.elk.zoomToFit",TWe="org.eclipse.elk.json.shapeCoords",CWe="org.eclipse.elk.json.edgeCoords",LBn="org.eclipse.elk.font.name",OWe="org.eclipse.elk.font.size",bne="org.eclipse.elk.topdown.sizeCategories",Npe="org.eclipse.elk.topdown.sizeCategoriesHierarchicalNodeWeight",gne="org.eclipse.elk.topdown.sizeApproximator",Dpe="org.eclipse.elk.topdown.scaleCap",NWe="org.eclipse.elk.edge.type",DWe="partitioning",_We="nodeLabels",JF="portAlignment",wne="nodeSize",pne="port",_pe="portLabels",m7="topdown",IWe="insideSelfLoops",Ipe="INHERIT",v7="org.eclipse.elk.fixed",GF="org.eclipse.elk.random",qF={3:1,35:1,23:1,521:1,288:1},LWe="port must have a parent node to calculate the port side",PWe="The edge needs to have exactly one edge section. Found: ",FS="org.eclipse.elk.core.util.adapters",ef="org.eclipse.emf.ecore",Gv="org.eclipse.elk.graph",$We="EMapPropertyHolder",RWe="ElkBendPoint",BWe="ElkGraphElement",zWe="ElkConnectableShape",Lpe="ElkEdge",FWe="ElkEdgeSection",HWe="EModelElement",JWe="ENamedElement",Ppe="ElkLabel",$pe="ElkNode",Rpe="ElkPort",GWe={94:1,93:1},Py="org.eclipse.emf.common.notify.impl",kb="The feature '",HS="' is not a valid changeable feature",qWe="Expecting null",mne="' is not a valid feature",UWe="The feature ID",XWe=" is not a valid feature ID",Bu=32768,VWe={109:1,94:1,93:1,57:1,52:1,100:1},zn="org.eclipse.emf.ecore.impl",$g="org.eclipse.elk.graph.impl",JS="Recursive containment not allowed for ",y7="The datatype '",T2="' is not a valid classifier",vne="The value '",qv={195:1,3:1,4:1},yne="The class '",k7="http://www.eclipse.org/elk/ElkGraph",Bpe="property",GS="value",kne="source",KWe="properties",QWe="identifier",Ene="height",jne="width",Sne="parent",Mne="text",Ane="children",YWe="hierarchical",zpe="sources",xne="targets",Tne="sections",UF="bendPoints",Fpe="outgoingShape",Hpe="incomingShape",Jpe="outgoingSections",Gpe="incomingSections",Ec="org.eclipse.emf.common.util",qpe="Severe implementation error in the Json to ElkGraph importer.",$h="id",ec="org.eclipse.elk.graph.json",E7="Unhandled parameter types: ",WWe="startPoint",ZWe="An edge must have at least one source and one target (edge id: '",j7="').",eZe="Referenced edge section does not exist: ",nZe=" (edge id: '",Upe="target",tZe="sourcePoint",iZe="targetPoint",XF="group",ci="name",rZe="connectableShape cannot be null",cZe="edge cannot be null",uZe="Passed edge is not 'simple'.",VF="org.eclipse.elk.graph.util",HN="The 'no duplicates' constraint is violated",Cne="targetIndex=",Rg=", size=",One="sourceIndex=",Rh={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1},Nne={3:1,4:1,20:1,31:1,56:1,18:1,50:1,16:1,59:1,71:1,67:1,61:1,585:1},KF="logging",oZe="measureExecutionTime",sZe="parser.parse.1",lZe="parser.parse.2",QF="parser.next.1",Dne="parser.next.2",fZe="parser.next.3",aZe="parser.next.4",Bg="parser.factor.1",Xpe="parser.factor.2",hZe="parser.factor.3",dZe="parser.factor.4",bZe="parser.factor.5",gZe="parser.factor.6",wZe="parser.atom.1",pZe="parser.atom.2",mZe="parser.atom.3",Vpe="parser.atom.4",_ne="parser.atom.5",Kpe="parser.cc.1",YF="parser.cc.2",vZe="parser.cc.3",yZe="parser.cc.5",Qpe="parser.cc.6",Ype="parser.cc.7",Ine="parser.cc.8",kZe="parser.ope.1",EZe="parser.ope.2",jZe="parser.ope.3",c0="parser.descape.1",SZe="parser.descape.2",MZe="parser.descape.3",AZe="parser.descape.4",xZe="parser.descape.5",nf="parser.process.1",TZe="parser.quantifier.1",CZe="parser.quantifier.2",OZe="parser.quantifier.3",NZe="parser.quantifier.4",Wpe="parser.quantifier.5",DZe="org.eclipse.emf.common.notify",Zpe={415:1,676:1},_Ze={3:1,4:1,20:1,31:1,56:1,18:1,16:1,71:1,61:1},JN={373:1,151:1},qS="index=",Lne={3:1,4:1,5:1,129:1},IZe={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,61:1},eme={3:1,6:1,4:1,5:1,198:1},LZe={3:1,4:1,5:1,175:1,374:1},Yf=1024,PZe=";/?:@&=+$,",$Ze="invalid authority: ",RZe="EAnnotation",BZe="ETypedElement",zZe="EStructuralFeature",FZe="EAttribute",HZe="EClassifier",JZe="EEnumLiteral",GZe="EGenericType",qZe="EOperation",UZe="EParameter",XZe="EReference",VZe="ETypeParameter",Ri="org.eclipse.emf.ecore.util",Pne={77:1},nme={3:1,20:1,18:1,16:1,61:1,586:1,77:1,72:1,98:1},KZe="org.eclipse.emf.ecore.util.FeatureMap$Entry",gs=8192,US="byte",WF="char",XS="double",VS="float",KS="int",QS="long",YS="short",QZe="java.lang.Object",Uv={3:1,4:1,5:1,255:1},tme={3:1,4:1,5:1,678:1},YZe={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,72:1},au={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,77:1,72:1,98:1},GN="mixed",Jt="http:///org/eclipse/emf/ecore/util/ExtendedMetaData",vf="kind",WZe={3:1,4:1,5:1,679:1},ime={3:1,4:1,20:1,31:1,56:1,18:1,16:1,71:1,61:1,77:1,72:1,98:1},ZF={20:1,31:1,56:1,18:1,16:1,61:1,72:1},eH={50:1,128:1,287:1},nH={75:1,344:1},tH="The value of type '",iH="' must be of type '",Xv=1306,yf="http://www.eclipse.org/emf/2002/Ecore",rH=-32768,C2="constraints",fc="baseType",ZZe="getEStructuralFeature",een="getFeatureID",WS="feature",nen="getOperationID",rme="operation",ten="defaultValue",ien="eTypeParameters",ren="isInstance",cen="getEEnumLiteral",uen="eContainingClass",ti={58:1},oen={3:1,4:1,5:1,122:1},sen="org.eclipse.emf.ecore.resource",len={94:1,93:1,588:1,1996:1},$ne="org.eclipse.emf.ecore.resource.impl",cme="unspecified",qN="simple",cH="attribute",fen="attributeWildcard",uH="element",Rne="elementWildcard",Ca="collapse",Bne="itemType",oH="namespace",UN="##targetNamespace",kf="whiteSpace",ume="wildcards",zg="http://www.eclipse.org/emf/2003/XMLType",zne="##any",S7="uninitialized",XN="The multiplicity constraint is violated",sH="org.eclipse.emf.ecore.xml.type",aen="ProcessingInstruction",hen="SimpleAnyType",den="XMLTypeDocumentRoot",jr="org.eclipse.emf.ecore.xml.type.impl",VN="INF",ben="processing",gen="ENTITIES_._base",ome="minLength",sme="ENTITY",lH="NCName",wen="IDREFS_._base",lme="integer",Fne="token",Hne="pattern",pen="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*",fme="\\i\\c*",men="[\\i-[:]][\\c-[:]]*",ven="nonPositiveInteger",KN="maxInclusive",ame="NMTOKEN",yen="NMTOKENS_._base",hme="nonNegativeInteger",QN="minInclusive",ken="normalizedString",Een="unsignedByte",jen="unsignedInt",Sen="18446744073709551615",Men="unsignedShort",Aen="processingInstruction",u0="org.eclipse.emf.ecore.xml.type.internal",M7=1114111,xen="Internal Error: shorthands: \\u",ZS="xml:isDigit",Jne="xml:isWord",Gne="xml:isSpace",qne="xml:isNameChar",Une="xml:isInitialNameChar",Ten="09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩",Cen="AZazÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣",Oen="Private Use",Xne="ASSIGNED",Vne="\0€ÿĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\uFEFF\uFEFF＀￯",dme="UNASSIGNED",A7={3:1,121:1},Nen="org.eclipse.emf.ecore.xml.type.util",fH={3:1,4:1,5:1,376:1},bme="org.eclipse.xtext.xbase.lib",Den="Cannot add elements to a Range",_en="Cannot set elements in a Range",Ien="Cannot remove elements from a Range",Len="user.agent",s,aH,Kne;k.goog=k.goog||{},k.goog.global=k.goog.global||k,aH={},m(1,null,{},q),s.Fb=function(n){return fCe(this,n)},s.Gb=function(){return this.Pm},s.Hb=function(){return Gw(this)},s.Ib=function(){var n;return ig(Zs(this))+"@"+(n=Ni(this)>>>0,n.toString(16))},s.equals=function(e){return this.Fb(e)},s.hashCode=function(){return this.Hb()},s.toString=function(){return this.Ib()};var Pen,$en,Ren;m(298,1,{298:1,2086:1},b1e),s.te=function(n){var t;return t=new b1e,t.i=4,n>1?t.c=BIe(this,n-1):t.c=this,t},s.ue=function(){return U1(this),this.b},s.ve=function(){return ig(this)},s.we=function(){return U1(this),this.k},s.xe=function(){return(this.i&4)!=0},s.ye=function(){return(this.i&1)!=0},s.Ib=function(){return She(this)},s.i=0;var Cr=v(Cu,"Object",1),gme=v(Cu,"Class",298);m(2058,1,bN),v(gN,"Optional",2058),m(1160,2058,bN,F),s.Fb=function(n){return n===this},s.Hb=function(){return 2040732332},s.Ib=function(){return"Optional.absent()"},s.Jb=function(n){return Tt(n),AE(),Qne};var Qne;v(gN,"Absent",1160),m(627,1,{},_X),v(gN,"Joiner",627);var PBn=Ji(gN,"Predicate");m(577,1,{178:1,577:1,3:1,48:1},PT),s.Mb=function(n){return Rze(this,n)},s.Lb=function(n){return Rze(this,n)},s.Fb=function(n){var t;return X(n,577)?(t=u(n,577),fbe(this.a,t.a)):!1},s.Hb=function(){return v1e(this.a)+306654252},s.Ib=function(){return PTn(this.a)},v(gN,"Predicates/AndPredicate",577),m(411,2058,{411:1,3:1},b9),s.Fb=function(n){var t;return X(n,411)?(t=u(n,411),di(this.a,t.a)):!1},s.Hb=function(){return 1502476572+Ni(this.a)},s.Ib=function(){return rQe+this.a+")"},s.Jb=function(n){return new b9(IR(n.Kb(this.a),"the Function passed to Optional.transform() must not return null."))},v(gN,"Present",411),m(204,1,K8),s.Nb=function(n){nc(this,n)},s.Qb=function(){eAe()},v(dn,"UnmodifiableIterator",204),m(2038,204,Q8),s.Qb=function(){eAe()},s.Rb=function(n){throw $(new Nt)},s.Wb=function(n){throw $(new Nt)},v(dn,"UnmodifiableListIterator",2038),m(392,2038,Q8),s.Ob=function(){return this.b0},s.Pb=function(){if(this.b>=this.c)throw $(new hu);return this.Xb(this.b++)},s.Tb=function(){return this.b},s.Ub=function(){if(this.b<=0)throw $(new hu);return this.Xb(--this.b)},s.Vb=function(){return this.b-1},s.b=0,s.c=0,v(dn,"AbstractIndexedListIterator",392),m(702,204,K8),s.Ob=function(){return $Q(this)},s.Pb=function(){return mhe(this)},s.e=1,v(dn,"AbstractIterator",702),m(2046,1,{229:1}),s.Zb=function(){var n;return n=this.f,n||(this.f=this.ac())},s.Fb=function(n){return cY(this,n)},s.Hb=function(){return Ni(this.Zb())},s.dc=function(){return this.gc()==0},s.ec=function(){return G5(this)},s.Ib=function(){return fu(this.Zb())},v(dn,"AbstractMultimap",2046),m(730,2046,Dg),s.$b=function(){jB(this)},s._b=function(n){return pAe(this,n)},s.ac=function(){return new N9(this,this.c)},s.ic=function(n){return this.hc()},s.bc=function(){return new sv(this,this.c)},s.jc=function(){return this.mc(this.hc())},s.kc=function(){return new BMe(this)},s.lc=function(){return hW(this.c.vc().Lc(),new ne,64,this.d)},s.cc=function(n){return mi(this,n)},s.fc=function(n){return CO(this,n)},s.gc=function(){return this.d},s.mc=function(n){return yn(),new qr(n)},s.nc=function(){return new RMe(this)},s.oc=function(){return hW(this.c.Bc().Lc(),new W,64,this.d)},s.pc=function(n,t){return new rB(this,n,t,null)},s.d=0,v(dn,"AbstractMapBasedMultimap",730),m(1661,730,Dg),s.hc=function(){return new Mo(this.a)},s.jc=function(){return yn(),yn(),Mc},s.cc=function(n){return u(mi(this,n),16)},s.fc=function(n){return u(CO(this,n),16)},s.Zb=function(){return Q5(this)},s.Fb=function(n){return cY(this,n)},s.qc=function(n){return u(mi(this,n),16)},s.rc=function(n){return u(CO(this,n),16)},s.mc=function(n){return LR(u(n,16))},s.pc=function(n,t){return VLe(this,n,u(t,16),null)},v(dn,"AbstractListMultimap",1661),m(736,1,Jr),s.Nb=function(n){nc(this,n)},s.Ob=function(){return this.c.Ob()||this.e.Ob()},s.Pb=function(){var n;return this.e.Ob()||(n=u(this.c.Pb(),45),this.b=n.jd(),this.a=u(n.kd(),18),this.e=this.a.Jc()),this.sc(this.b,this.e.Pb())},s.Qb=function(){this.e.Qb(),u(bf(this.a),18).dc()&&this.c.Qb(),--this.d.d},v(dn,"AbstractMapBasedMultimap/Itr",736),m(1098,736,Jr,RMe),s.sc=function(n,t){return t},v(dn,"AbstractMapBasedMultimap/1",1098),m(1099,1,{},W),s.Kb=function(n){return u(n,18).Lc()},v(dn,"AbstractMapBasedMultimap/1methodref$spliterator$Type",1099),m(1100,736,Jr,BMe),s.sc=function(n,t){return new Bw(n,t)},v(dn,"AbstractMapBasedMultimap/2",1100);var wme=Ji(pt,"Map");m(2027,1,y2),s.wc=function(n){vO(this,n)},s.$b=function(){this.vc().$b()},s.tc=function(n){return VY(this,n)},s._b=function(n){return!!s0e(this,n,!1)},s.uc=function(n){var t,i,r;for(i=this.vc().Jc();i.Ob();)if(t=u(i.Pb(),45),r=t.kd(),ue(n)===ue(r)||n!=null&&di(n,r))return!0;return!1},s.Fb=function(n){var t,i,r;if(n===this)return!0;if(!X(n,92)||(r=u(n,92),this.gc()!=r.gc()))return!1;for(i=r.vc().Jc();i.Ob();)if(t=u(i.Pb(),45),!this.tc(t))return!1;return!0},s.xc=function(n){return bu(s0e(this,n,!1))},s.Hb=function(){return f1e(this.vc())},s.dc=function(){return this.gc()==0},s.ec=function(){return new tt(this)},s.yc=function(n,t){throw $(new _d("Put not supported on this map"))},s.zc=function(n){_j(this,n)},s.Ac=function(n){return bu(s0e(this,n,!0))},s.gc=function(){return this.vc().gc()},s.Ib=function(){return iGe(this)},s.Bc=function(){return new ut(this)},v(pt,"AbstractMap",2027),m(2047,2027,y2),s.bc=function(){return new e$(this)},s.vc=function(){return PDe(this)},s.ec=function(){var n;return n=this.g,n||(this.g=this.bc())},s.Bc=function(){var n;return n=this.i,n||(this.i=new sxe(this))},v(dn,"Maps/ViewCachingAbstractMap",2047),m(395,2047,y2,N9),s.xc=function(n){return D8n(this,n)},s.Ac=function(n){return Jkn(this,n)},s.$b=function(){this.d==this.e.c?this.e.$b():aR(new vfe(this))},s._b=function(n){return wFe(this.d,n)},s.Dc=function(){return new mP(this)},s.Cc=function(){return this.Dc()},s.Fb=function(n){return this===n||di(this.d,n)},s.Hb=function(){return Ni(this.d)},s.ec=function(){return this.e.ec()},s.gc=function(){return this.d.gc()},s.Ib=function(){return fu(this.d)},v(dn,"AbstractMapBasedMultimap/AsMap",395);var tf=Ji(Cu,"Iterable");m(31,1,km),s.Ic=function(n){oc(this,n)},s.Lc=function(){return new pn(this,0)},s.Mc=function(){return new wn(null,this.Lc())},s.Ec=function(n){throw $(new _d("Add not supported on this collection"))},s.Fc=function(n){return dc(this,n)},s.$b=function(){iae(this)},s.Gc=function(n){return om(this,n,!1)},s.Hc=function(n){return MO(this,n)},s.dc=function(){return this.gc()==0},s.Kc=function(n){return om(this,n,!0)},s.Nc=function(){return Cfe(this)},s.Oc=function(n){return Wj(this,n)},s.Ib=function(){return Qa(this)},v(pt,"AbstractCollection",31);var Ef=Ji(pt,"Set");m(Wa,31,bs),s.Lc=function(){return new pn(this,1)},s.Fb=function(n){return mHe(this,n)},s.Hb=function(){return f1e(this)},v(pt,"AbstractSet",Wa),m(2030,Wa,bs),v(dn,"Sets/ImprovedAbstractSet",2030),m(2031,2030,bs),s.$b=function(){this.Pc().$b()},s.Gc=function(n){return ZFe(this,n)},s.dc=function(){return this.Pc().dc()},s.Kc=function(n){var t;return this.Gc(n)&&X(n,45)?(t=u(n,45),this.Pc().ec().Kc(t.jd())):!1},s.gc=function(){return this.Pc().gc()},v(dn,"Maps/EntrySet",2031),m(1096,2031,bs,mP),s.Gc=function(n){return P1e(this.a.d.vc(),n)},s.Jc=function(){return new vfe(this.a)},s.Pc=function(){return this.a},s.Kc=function(n){var t;return P1e(this.a.d.vc(),n)?(t=u(bf(u(n,45)),45),w9n(this.a.e,t.jd()),!0):!1},s.Lc=function(){return PC(this.a.d.vc().Lc(),new vP(this.a))},v(dn,"AbstractMapBasedMultimap/AsMap/AsMapEntries",1096),m(1097,1,{},vP),s.Kb=function(n){return NPe(this.a,u(n,45))},v(dn,"AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type",1097),m(734,1,Jr,vfe),s.Nb=function(n){nc(this,n)},s.Pb=function(){var n;return n=u(this.b.Pb(),45),this.a=u(n.kd(),18),NPe(this.c,n)},s.Ob=function(){return this.b.Ob()},s.Qb=function(){F9(!!this.a),this.b.Qb(),this.c.e.d-=this.a.gc(),this.a.$b(),this.a=null},v(dn,"AbstractMapBasedMultimap/AsMap/AsMapIterator",734),m(530,2030,bs,e$),s.$b=function(){this.b.$b()},s.Gc=function(n){return this.b._b(n)},s.Ic=function(n){Tt(n),this.b.wc(new dE(n))},s.dc=function(){return this.b.dc()},s.Jc=function(){return new xE(this.b.vc().Jc())},s.Kc=function(n){return this.b._b(n)?(this.b.Ac(n),!0):!1},s.gc=function(){return this.b.gc()},v(dn,"Maps/KeySet",530),m(332,530,bs,sv),s.$b=function(){var n;aR((n=this.b.vc().Jc(),new qoe(this,n)))},s.Hc=function(n){return this.b.ec().Hc(n)},s.Fb=function(n){return this===n||di(this.b.ec(),n)},s.Hb=function(){return Ni(this.b.ec())},s.Jc=function(){var n;return n=this.b.vc().Jc(),new qoe(this,n)},s.Kc=function(n){var t,i;return i=0,t=u(this.b.Ac(n),18),t&&(i=t.gc(),t.$b(),this.a.d-=i),i>0},s.Lc=function(){return this.b.ec().Lc()},v(dn,"AbstractMapBasedMultimap/KeySet",332),m(735,1,Jr,qoe),s.Nb=function(n){nc(this,n)},s.Ob=function(){return this.c.Ob()},s.Pb=function(){return this.a=u(this.c.Pb(),45),this.a.jd()},s.Qb=function(){var n;F9(!!this.a),n=u(this.a.kd(),18),this.c.Qb(),this.b.a.d-=n.gc(),n.$b(),this.a=null},v(dn,"AbstractMapBasedMultimap/KeySet/1",735),m(489,395,{92:1,134:1},CC),s.bc=function(){return this.Qc()},s.ec=function(){return this.Sc()},s.Qc=function(){return new iC(this.c,this.Uc())},s.Rc=function(){return this.Uc().Rc()},s.Sc=function(){var n;return n=this.b,n||(this.b=this.Qc())},s.Tc=function(){return this.Uc().Tc()},s.Uc=function(){return u(this.d,134)},v(dn,"AbstractMapBasedMultimap/SortedAsMap",489),m(437,489,Pge,oj),s.bc=function(){return new D9(this.a,u(u(this.d,134),138))},s.Qc=function(){return new D9(this.a,u(u(this.d,134),138))},s.ec=function(){var n;return n=this.b,u(n||(this.b=new D9(this.a,u(u(this.d,134),138))),277)},s.Sc=function(){var n;return n=this.b,u(n||(this.b=new D9(this.a,u(u(this.d,134),138))),277)},s.Uc=function(){return u(u(this.d,134),138)},s.Vc=function(n){return u(u(this.d,134),138).Vc(n)},s.Wc=function(n){return u(u(this.d,134),138).Wc(n)},s.Xc=function(n,t){return new oj(this.a,u(u(this.d,134),138).Xc(n,t))},s.Yc=function(n){return u(u(this.d,134),138).Yc(n)},s.Zc=function(n){return u(u(this.d,134),138).Zc(n)},s.$c=function(n,t){return new oj(this.a,u(u(this.d,134),138).$c(n,t))},v(dn,"AbstractMapBasedMultimap/NavigableAsMap",437),m(488,332,cQe,iC),s.Lc=function(){return this.b.ec().Lc()},v(dn,"AbstractMapBasedMultimap/SortedKeySet",488),m(394,488,$ge,D9),v(dn,"AbstractMapBasedMultimap/NavigableKeySet",394),m(539,31,km,rB),s.Ec=function(n){var t,i;return $s(this),i=this.d.dc(),t=this.d.Ec(n),t&&(++this.f.d,i&&_C(this)),t},s.Fc=function(n){var t,i,r;return n.dc()?!1:(r=($s(this),this.d.gc()),t=this.d.Fc(n),t&&(i=this.d.gc(),this.f.d+=i-r,r==0&&_C(this)),t)},s.$b=function(){var n;n=($s(this),this.d.gc()),n!=0&&(this.d.$b(),this.f.d-=n,pR(this))},s.Gc=function(n){return $s(this),this.d.Gc(n)},s.Hc=function(n){return $s(this),this.d.Hc(n)},s.Fb=function(n){return n===this?!0:($s(this),di(this.d,n))},s.Hb=function(){return $s(this),Ni(this.d)},s.Jc=function(){return $s(this),new ife(this)},s.Kc=function(n){var t;return $s(this),t=this.d.Kc(n),t&&(--this.f.d,pR(this)),t},s.gc=function(){return WTe(this)},s.Lc=function(){return $s(this),this.d.Lc()},s.Ib=function(){return $s(this),fu(this.d)},v(dn,"AbstractMapBasedMultimap/WrappedCollection",539);var jl=Ji(pt,"List");m(732,539,{20:1,31:1,18:1,16:1},Ofe),s.gd=function(n){yg(this,n)},s.Lc=function(){return $s(this),this.d.Lc()},s._c=function(n,t){var i;$s(this),i=this.d.dc(),u(this.d,16)._c(n,t),++this.a.d,i&&_C(this)},s.ad=function(n,t){var i,r,c;return t.dc()?!1:(c=($s(this),this.d.gc()),i=u(this.d,16).ad(n,t),i&&(r=this.d.gc(),this.a.d+=r-c,c==0&&_C(this)),i)},s.Xb=function(n){return $s(this),u(this.d,16).Xb(n)},s.bd=function(n){return $s(this),u(this.d,16).bd(n)},s.cd=function(){return $s(this),new CCe(this)},s.dd=function(n){return $s(this),new K_e(this,n)},s.ed=function(n){var t;return $s(this),t=u(this.d,16).ed(n),--this.a.d,pR(this),t},s.fd=function(n,t){return $s(this),u(this.d,16).fd(n,t)},s.hd=function(n,t){return $s(this),VLe(this.a,this.e,u(this.d,16).hd(n,t),this.b?this.b:this)},v(dn,"AbstractMapBasedMultimap/WrappedList",732),m(1095,732,{20:1,31:1,18:1,16:1,59:1},pOe),v(dn,"AbstractMapBasedMultimap/RandomAccessWrappedList",1095),m(619,1,Jr,ife),s.Nb=function(n){nc(this,n)},s.Ob=function(){return W9(this),this.b.Ob()},s.Pb=function(){return W9(this),this.b.Pb()},s.Qb=function(){eOe(this)},v(dn,"AbstractMapBasedMultimap/WrappedCollection/WrappedIterator",619),m(733,619,f1,CCe,K_e),s.Qb=function(){eOe(this)},s.Rb=function(n){var t;t=WTe(this.a)==0,(W9(this),u(this.b,128)).Rb(n),++this.a.a.d,t&&_C(this.a)},s.Sb=function(){return(W9(this),u(this.b,128)).Sb()},s.Tb=function(){return(W9(this),u(this.b,128)).Tb()},s.Ub=function(){return(W9(this),u(this.b,128)).Ub()},s.Vb=function(){return(W9(this),u(this.b,128)).Vb()},s.Wb=function(n){(W9(this),u(this.b,128)).Wb(n)},v(dn,"AbstractMapBasedMultimap/WrappedList/WrappedListIterator",733),m(731,539,cQe,jle),s.Lc=function(){return $s(this),this.d.Lc()},v(dn,"AbstractMapBasedMultimap/WrappedSortedSet",731),m(1094,731,$ge,SCe),v(dn,"AbstractMapBasedMultimap/WrappedNavigableSet",1094),m(1093,539,bs,JOe),s.Lc=function(){return $s(this),this.d.Lc()},v(dn,"AbstractMapBasedMultimap/WrappedSet",1093),m(1102,1,{},ne),s.Kb=function(n){return A9n(u(n,45))},v(dn,"AbstractMapBasedMultimap/lambda$1$Type",1102),m(1101,1,{},g9),s.Kb=function(n){return new Bw(this.a,n)},v(dn,"AbstractMapBasedMultimap/lambda$2$Type",1101);var Fg=Ji(pt,"Map/Entry");m(358,1,bZ),s.Fb=function(n){var t;return X(n,45)?(t=u(n,45),X1(this.jd(),t.jd())&&X1(this.kd(),t.kd())):!1},s.Hb=function(){var n,t;return n=this.jd(),t=this.kd(),(n==null?0:Ni(n))^(t==null?0:Ni(t))},s.ld=function(n){throw $(new Nt)},s.Ib=function(){return this.jd()+"="+this.kd()},v(dn,uQe,358),m(gb,31,km),s.$b=function(){this.md().$b()},s.Gc=function(n){var t;return X(n,45)?(t=u(n,45),Vyn(this.md(),t.jd(),t.kd())):!1},s.Kc=function(n){var t;return X(n,45)?(t=u(n,45),_Le(this.md(),t.jd(),t.kd())):!1},s.gc=function(){return this.md().d},v(dn,"Multimaps/Entries",gb),m(737,gb,km,H1),s.Jc=function(){return this.a.kc()},s.md=function(){return this.a},s.Lc=function(){return this.a.lc()},v(dn,"AbstractMultimap/Entries",737),m(738,737,bs,Soe),s.Lc=function(){return this.a.lc()},s.Fb=function(n){return T0e(this,n)},s.Hb=function(){return $Be(this)},v(dn,"AbstractMultimap/EntrySet",738),m(739,31,km,$T),s.$b=function(){this.a.$b()},s.Gc=function(n){return Bkn(this.a,n)},s.Jc=function(){return this.a.nc()},s.gc=function(){return this.a.d},s.Lc=function(){return this.a.oc()},v(dn,"AbstractMultimap/Values",739),m(2049,31,{833:1,20:1,31:1,18:1}),s.Ic=function(n){Tt(n),fv(this).Ic(new YU(n))},s.Lc=function(){var n;return n=fv(this).Lc(),hW(n,new De,64|n.wd()&1296,this.a.d)},s.Ec=function(n){return Ooe(),!0},s.Fc=function(n){return Tt(this),Tt(n),X(n,540)?t6n(u(n,833)):!n.dc()&&TQ(this,n.Jc())},s.Gc=function(n){var t;return t=u(um(Q5(this.a),n),18),(t?t.gc():0)>0},s.Fb=function(n){return _On(this,n)},s.Hb=function(){return Ni(fv(this))},s.dc=function(){return fv(this).dc()},s.Kc=function(n){return vqe(this,n,1)>0},s.Ib=function(){return fu(fv(this))},v(dn,"AbstractMultiset",2049),m(2051,2030,bs),s.$b=function(){jB(this.a.a)},s.Gc=function(n){var t,i;return X(n,490)?(i=u(n,416),u(i.a.kd(),18).gc()<=0?!1:(t=nLe(this.a,i.a.jd()),t==u(i.a.kd(),18).gc())):!1},s.Kc=function(n){var t,i,r,c;return X(n,490)&&(i=u(n,416),t=i.a.jd(),r=u(i.a.kd(),18).gc(),r!=0)?(c=this.a,NCn(c,t,r)):!1},v(dn,"Multisets/EntrySet",2051),m(1108,2051,bs,hE),s.Jc=function(){return new GMe(PDe(Q5(this.a.a)).Jc())},s.gc=function(){return Q5(this.a.a).gc()},v(dn,"AbstractMultiset/EntrySet",1108),m(618,730,Dg),s.hc=function(){return this.nd()},s.jc=function(){return this.od()},s.cc=function(n){return this.pd(n)},s.fc=function(n){return this.qd(n)},s.Zb=function(){var n;return n=this.f,n||(this.f=this.ac())},s.od=function(){return yn(),yn(),pH},s.Fb=function(n){return cY(this,n)},s.pd=function(n){return u(mi(this,n),22)},s.qd=function(n){return u(CO(this,n),22)},s.mc=function(n){return yn(),new A9(u(n,22))},s.pc=function(n,t){return new JOe(this,n,u(t,22))},v(dn,"AbstractSetMultimap",618),m(1689,618,Dg),s.hc=function(){return new $d(this.b)},s.nd=function(){return new $d(this.b)},s.jc=function(){return qfe(new $d(this.b))},s.od=function(){return qfe(new $d(this.b))},s.cc=function(n){return u(u(mi(this,n),22),83)},s.pd=function(n){return u(u(mi(this,n),22),83)},s.fc=function(n){return u(u(CO(this,n),22),83)},s.qd=function(n){return u(u(CO(this,n),22),83)},s.mc=function(n){return X(n,277)?qfe(u(n,277)):(yn(),new ule(u(n,83)))},s.Zb=function(){var n;return n=this.f,n||(this.f=X(this.c,138)?new oj(this,u(this.c,138)):X(this.c,134)?new CC(this,u(this.c,134)):new N9(this,this.c))},s.pc=function(n,t){return X(t,277)?new SCe(this,n,u(t,277)):new jle(this,n,u(t,83))},v(dn,"AbstractSortedSetMultimap",1689),m(1690,1689,Dg),s.Zb=function(){var n;return n=this.f,u(u(n||(this.f=X(this.c,138)?new oj(this,u(this.c,138)):X(this.c,134)?new CC(this,u(this.c,134)):new N9(this,this.c)),134),138)},s.ec=function(){var n;return n=this.i,u(u(n||(this.i=X(this.c,138)?new D9(this,u(this.c,138)):X(this.c,134)?new iC(this,u(this.c,134)):new sv(this,this.c)),83),277)},s.bc=function(){return X(this.c,138)?new D9(this,u(this.c,138)):X(this.c,134)?new iC(this,u(this.c,134)):new sv(this,this.c)},v(dn,"AbstractSortedKeySortedSetMultimap",1690),m(2071,1,{2008:1}),s.Fb=function(n){return EAn(this,n)},s.Hb=function(){var n;return f1e((n=this.g,n||(this.g=new $0(this))))},s.Ib=function(){var n;return iGe((n=this.f,n||(this.f=new Zse(this))))},v(dn,"AbstractTable",2071),m(669,Wa,bs,$0),s.$b=function(){nAe()},s.Gc=function(n){var t,i;return X(n,468)?(t=u(n,687),i=u(um(u_e(this.a),q0(t.c.e,t.b)),92),!!i&&P1e(i.vc(),new Bw(q0(t.c.c,t.a),ty(t.c,t.b,t.a)))):!1},s.Jc=function(){return n5n(this.a)},s.Kc=function(n){var t,i;return X(n,468)?(t=u(n,687),i=u(um(u_e(this.a),q0(t.c.e,t.b)),92),!!i&&lEn(i.vc(),new Bw(q0(t.c.c,t.a),ty(t.c,t.b,t.a)))):!1},s.gc=function(){return hDe(this.a)},s.Lc=function(){return r6n(this.a)},v(dn,"AbstractTable/CellSet",669),m(1987,31,km,JU),s.$b=function(){nAe()},s.Gc=function(n){return hxn(this.a,n)},s.Jc=function(){return t5n(this.a)},s.gc=function(){return hDe(this.a)},s.Lc=function(){return ALe(this.a)},v(dn,"AbstractTable/Values",1987),m(1662,1661,Dg),v(dn,"ArrayListMultimapGwtSerializationDependencies",1662),m(506,1662,Dg,DX,jae),s.hc=function(){return new Mo(this.a)},s.a=0,v(dn,"ArrayListMultimap",506),m(668,2071,{668:1,2008:1,3:1},mqe),v(dn,"ArrayTable",668),m(1983,392,Q8,YCe),s.Xb=function(n){return new g1e(this.a,n)},v(dn,"ArrayTable/1",1983),m(1984,1,{},GU),s.rd=function(n){return new g1e(this.a,n)},v(dn,"ArrayTable/1methodref$getCell$Type",1984),m(2072,1,{687:1}),s.Fb=function(n){var t;return n===this?!0:X(n,468)?(t=u(n,687),X1(q0(this.c.e,this.b),q0(t.c.e,t.b))&&X1(q0(this.c.c,this.a),q0(t.c.c,t.a))&&X1(ty(this.c,this.b,this.a),ty(t.c,t.b,t.a))):!1},s.Hb=function(){return JB(z(B(Cr,1),xn,1,5,[q0(this.c.e,this.b),q0(this.c.c,this.a),ty(this.c,this.b,this.a)]))},s.Ib=function(){return"("+q0(this.c.e,this.b)+","+q0(this.c.c,this.a)+")="+ty(this.c,this.b,this.a)},v(dn,"Tables/AbstractCell",2072),m(468,2072,{468:1,687:1},g1e),s.a=0,s.b=0,s.d=0,v(dn,"ArrayTable/2",468),m(1986,1,{},d5),s.rd=function(n){return P$e(this.a,n)},v(dn,"ArrayTable/2methodref$getValue$Type",1986),m(1985,392,Q8,WCe),s.Xb=function(n){return P$e(this.a,n)},v(dn,"ArrayTable/3",1985),m(2039,2027,y2),s.$b=function(){aR(this.kc())},s.vc=function(){return new bE(this)},s.lc=function(){return new B_e(this.kc(),this.gc())},v(dn,"Maps/IteratorBasedAbstractMap",2039),m(826,2039,y2),s.$b=function(){throw $(new Nt)},s._b=function(n){return mAe(this.c,n)},s.kc=function(){return new ZCe(this,this.c.b.c.gc())},s.lc=function(){return cK(this.c.b.c.gc(),16,new yP(this))},s.xc=function(n){var t;return t=u(sj(this.c,n),15),t?this.td(t.a):null},s.dc=function(){return this.c.b.c.dc()},s.ec=function(){return bK(this.c)},s.yc=function(n,t){var i;if(i=u(sj(this.c,n),15),!i)throw $(new Jn(this.sd()+" "+n+" not in "+bK(this.c)));return this.ud(i.a,t)},s.Ac=function(n){throw $(new Nt)},s.gc=function(){return this.c.b.c.gc()},v(dn,"ArrayTable/ArrayMap",826),m(1982,1,{},yP),s.rd=function(n){return l_e(this.a,n)},v(dn,"ArrayTable/ArrayMap/0methodref$getEntry$Type",1982),m(1980,358,bZ,UAe),s.jd=function(){return M2n(this.a,this.b)},s.kd=function(){return this.a.td(this.b)},s.ld=function(n){return this.a.ud(this.b,n)},s.b=0,v(dn,"ArrayTable/ArrayMap/1",1980),m(1981,392,Q8,ZCe),s.Xb=function(n){return l_e(this.a,n)},v(dn,"ArrayTable/ArrayMap/2",1981),m(1979,826,y2,YDe),s.sd=function(){return"Column"},s.td=function(n){return ty(this.b,this.a,n)},s.ud=function(n,t){return mze(this.b,this.a,n,t)},s.a=0,v(dn,"ArrayTable/Row",1979),m(827,826,y2,Zse),s.td=function(n){return new YDe(this.a,n)},s.yc=function(n,t){return u(t,92),Vbn()},s.ud=function(n,t){return u(t,92),Kbn()},s.sd=function(){return"Row"},v(dn,"ArrayTable/RowMap",827),m(1126,1,kl,XAe),s.yd=function(n){return(this.a.wd()&-262&n)!=0},s.wd=function(){return this.a.wd()&-262},s.xd=function(){return this.a.xd()},s.Nb=function(n){this.a.Nb(new KAe(n,this.b))},s.zd=function(n){return this.a.zd(new VAe(n,this.b))},v(dn,"CollectSpliterators/1",1126),m(1127,1,rt,VAe),s.Ad=function(n){this.a.Ad(this.b.Kb(n))},v(dn,"CollectSpliterators/1/lambda$0$Type",1127),m(1128,1,rt,KAe),s.Ad=function(n){this.a.Ad(this.b.Kb(n))},v(dn,"CollectSpliterators/1/lambda$1$Type",1128),m(1123,1,kl,mNe),s.yd=function(n){return((16464|this.b)&n)!=0},s.wd=function(){return 16464|this.b},s.xd=function(){return this.a.xd()},s.Nb=function(n){this.a.Oe(new YAe(n,this.c))},s.zd=function(n){return this.a.Pe(new QAe(n,this.c))},s.b=0,v(dn,"CollectSpliterators/1WithCharacteristics",1123),m(1124,1,wN,QAe),s.Bd=function(n){this.a.Ad(this.b.rd(n))},v(dn,"CollectSpliterators/1WithCharacteristics/lambda$0$Type",1124),m(1125,1,wN,YAe),s.Bd=function(n){this.a.Ad(this.b.rd(n))},v(dn,"CollectSpliterators/1WithCharacteristics/lambda$1$Type",1125),m(1119,1,kl),s.yd=function(n){return(this.a&n)!=0},s.wd=function(){return this.a},s.xd=function(){return this.e&&(this.b=Jse(this.b,this.e.xd())),Jse(this.b,0)},s.Nb=function(n){this.e&&(this.e.Nb(n),this.e=null),this.c.Nb(new WAe(this,n)),this.b=0},s.zd=function(n){for(;;){if(this.e&&this.e.zd(n))return WE(this.b,pN)&&(this.b=pf(this.b,1)),!0;if(this.e=null,!this.c.zd(new b5(this)))return!1}},s.a=0,s.b=0,v(dn,"CollectSpliterators/FlatMapSpliterator",1119),m(1121,1,rt,b5),s.Ad=function(n){vpn(this.a,n)},v(dn,"CollectSpliterators/FlatMapSpliterator/lambda$0$Type",1121),m(1122,1,rt,WAe),s.Ad=function(n){N4n(this.a,this.b,n)},v(dn,"CollectSpliterators/FlatMapSpliterator/lambda$1$Type",1122),m(1120,1119,kl,rPe),v(dn,"CollectSpliterators/FlatMapSpliteratorOfObject",1120),m(254,1,gZ),s.Dd=function(n){return this.Cd(u(n,254))},s.Cd=function(n){var t;return n==(MX(),Wne)?1:n==(SX(),Yne)?-1:(t=(cR(),mO(this.a,n.a)),t!=0?t:(Ln(),X(this,513)==X(n,513)?0:X(this,513)?1:-1))},s.Gd=function(){return this.a},s.Fb=function(n){return Ide(this,n)},v(dn,"Cut",254),m(1793,254,gZ,$Me),s.Cd=function(n){return n==this?0:1},s.Ed=function(n){throw $(new soe)},s.Fd=function(n){n.a+="+∞)"},s.Gd=function(){throw $(new Uc(sQe))},s.Hb=function(){return Rd(),kde(this)},s.Hd=function(n){return!1},s.Ib=function(){return"+∞"};var Yne;v(dn,"Cut/AboveAll",1793),m(513,254,{254:1,513:1,3:1,35:1},iOe),s.Ed=function(n){uo((n.a+="(",n),this.a)},s.Fd=function(n){hg(uo(n,this.a),93)},s.Hb=function(){return~Ni(this.a)},s.Hd=function(n){return cR(),mO(this.a,n)<0},s.Ib=function(){return"/"+this.a+"\\"},v(dn,"Cut/AboveValue",513),m(1792,254,gZ,PMe),s.Cd=function(n){return n==this?0:-1},s.Ed=function(n){n.a+="(-∞"},s.Fd=function(n){throw $(new soe)},s.Gd=function(){throw $(new Uc(sQe))},s.Hb=function(){return Rd(),kde(this)},s.Hd=function(n){return!0},s.Ib=function(){return"-∞"};var Wne;v(dn,"Cut/BelowAll",1792),m(1794,254,gZ,rOe),s.Ed=function(n){uo((n.a+="[",n),this.a)},s.Fd=function(n){hg(uo(n,this.a),41)},s.Hb=function(){return Ni(this.a)},s.Hd=function(n){return cR(),mO(this.a,n)<=0},s.Ib=function(){return"\\"+this.a+"/"},v(dn,"Cut/BelowValue",1794),m(535,1,a1),s.Ic=function(n){oc(this,n)},s.Ib=function(){return BEn(u(IR(this,"use Optional.orNull() instead of Optional.or(null)"),20).Jc())},v(dn,"FluentIterable",535),m(433,535,a1,nj),s.Jc=function(){return new Gn(Vn(this.a.Jc(),new ee))},v(dn,"FluentIterable/2",433),m(36,1,{},ee),s.Kb=function(n){return u(n,20).Jc()},s.Fb=function(n){return this===n},v(dn,"FluentIterable/2/0methodref$iterator$Type",36),m(1040,535,a1,mCe),s.Jc=function(){return r1(this)},v(dn,"FluentIterable/3",1040),m(714,392,Q8,ole),s.Xb=function(n){return this.a[n].Jc()},v(dn,"FluentIterable/3/1",714),m(2032,1,{}),s.Ib=function(){return fu(this.Id().b)},v(dn,"ForwardingObject",2032),m(2033,2032,lQe),s.Id=function(){return this.Jd()},s.Ic=function(n){oc(this,n)},s.Lc=function(){return new pn(this,0)},s.Mc=function(){return new wn(null,this.Lc())},s.Ec=function(n){return this.Jd(),EAe()},s.Fc=function(n){return this.Jd(),jAe()},s.$b=function(){this.Jd(),SAe()},s.Gc=function(n){return this.Jd().Gc(n)},s.Hc=function(n){return this.Jd().Hc(n)},s.dc=function(){return this.Jd().b.dc()},s.Jc=function(){return this.Jd().Jc()},s.Kc=function(n){return this.Jd(),MAe()},s.gc=function(){return this.Jd().b.gc()},s.Nc=function(){return this.Jd().Nc()},s.Oc=function(n){return this.Jd().Oc(n)},v(dn,"ForwardingCollection",2033),m(2040,31,Rge),s.Jc=function(){return this.Md()},s.Ec=function(n){throw $(new Nt)},s.Fc=function(n){throw $(new Nt)},s.Kd=function(){var n;return n=this.c,n||(this.c=this.Ld())},s.$b=function(){throw $(new Nt)},s.Gc=function(n){return n!=null&&om(this,n,!1)},s.Ld=function(){switch(this.gc()){case 0:return fR(),nte;case 1:return new qV(Tt(this.Md().Pb()));default:return new rfe(this,this.Nc())}},s.Kc=function(n){throw $(new Nt)},v(dn,"ImmutableCollection",2040),m(1259,2040,Rge,EP),s.Jc=function(){return iy(new cc(this.a.b.Jc()))},s.Gc=function(n){return n!=null&&DE(this.a,n)},s.Hc=function(n){return Xoe(this.a,n)},s.dc=function(){return this.a.b.dc()},s.Md=function(){return iy(new cc(this.a.b.Jc()))},s.gc=function(){return this.a.b.gc()},s.Nc=function(){return this.a.b.Nc()},s.Oc=function(n){return Voe(this.a,n)},s.Ib=function(){return fu(this.a.b)},v(dn,"ForwardingImmutableCollection",1259),m(311,2040,Y8),s.Jc=function(){return this.Md()},s.cd=function(){return this.Nd(0)},s.dd=function(n){return this.Nd(n)},s.gd=function(n){yg(this,n)},s.Lc=function(){return new pn(this,16)},s.hd=function(n,t){return this.Od(n,t)},s._c=function(n,t){throw $(new Nt)},s.ad=function(n,t){throw $(new Nt)},s.Kd=function(){return this},s.Fb=function(n){return jOn(this,n)},s.Hb=function(){return Q7n(this)},s.bd=function(n){return n==null?-1:iMn(this,n)},s.Md=function(){return this.Nd(0)},s.Nd=function(n){return $V(this,n)},s.ed=function(n){throw $(new Nt)},s.fd=function(n,t){throw $(new Nt)},s.Od=function(n,t){var i;return QB((i=new uxe(this),new Y0(i,n,t)))},v(dn,"ImmutableList",311),m(2067,311,Y8),s.Jc=function(){return iy(this.Pd().Jc())},s.hd=function(n,t){return QB(this.Pd().hd(n,t))},s.Gc=function(n){return n!=null&&this.Pd().Gc(n)},s.Hc=function(n){return this.Pd().Hc(n)},s.Fb=function(n){return di(this.Pd(),n)},s.Xb=function(n){return q0(this,n)},s.Hb=function(){return Ni(this.Pd())},s.bd=function(n){return this.Pd().bd(n)},s.dc=function(){return this.Pd().dc()},s.Md=function(){return iy(this.Pd().Jc())},s.gc=function(){return this.Pd().gc()},s.Od=function(n,t){return QB(this.Pd().hd(n,t))},s.Nc=function(){return this.Pd().Oc(oe(Cr,xn,1,this.Pd().gc(),5,1))},s.Oc=function(n){return this.Pd().Oc(n)},s.Ib=function(){return fu(this.Pd())},v(dn,"ForwardingImmutableList",2067),m(717,1,W8),s.vc=function(){return sg(this)},s.wc=function(n){vO(this,n)},s.ec=function(){return bK(this)},s.Bc=function(){return this.Td()},s.$b=function(){throw $(new Nt)},s._b=function(n){return this.xc(n)!=null},s.uc=function(n){return this.Td().Gc(n)},s.Rd=function(){return new XU(this)},s.Sd=function(){return new VU(this)},s.Fb=function(n){return zkn(this,n)},s.Hb=function(){return sg(this).Hb()},s.dc=function(){return this.gc()==0},s.yc=function(n,t){return Qbn()},s.Ac=function(n){throw $(new Nt)},s.Ib=function(){return uTn(this)},s.Td=function(){return this.e?this.e:this.e=this.Sd()},s.c=null,s.d=null,s.e=null,v(dn,"ImmutableMap",717),m(718,717,W8),s._b=function(n){return mAe(this,n)},s.uc=function(n){return dxe(this.b,n)},s.Qd=function(){return nFe(new kP(this))},s.Rd=function(){return nFe(N_e(this.b))},s.Sd=function(){return new EP(D_e(this.b))},s.Fb=function(n){return gxe(this.b,n)},s.xc=function(n){return sj(this,n)},s.Hb=function(){return Ni(this.b.c)},s.dc=function(){return this.b.c.dc()},s.gc=function(){return this.b.c.gc()},s.Ib=function(){return fu(this.b.c)},v(dn,"ForwardingImmutableMap",718),m(2034,2033,wZ),s.Id=function(){return this.Ud()},s.Jd=function(){return this.Ud()},s.Lc=function(){return new pn(this,1)},s.Fb=function(n){return n===this||this.Ud().Fb(n)},s.Hb=function(){return this.Ud().Hb()},v(dn,"ForwardingSet",2034),m(1055,2034,wZ,kP),s.Id=function(){return Q9(this.a.b)},s.Jd=function(){return Q9(this.a.b)},s.Gc=function(n){if(X(n,45)&&u(n,45).jd()==null)return!1;try{return bxe(Q9(this.a.b),n)}catch(t){if(t=lr(t),X(t,211))return!1;throw $(t)}},s.Ud=function(){return Q9(this.a.b)},s.Oc=function(n){var t,i;return t=pIe(Q9(this.a.b),n),Q9(this.a.b).b.gc()=0?"+":"")+(i/60|0),t=$$(k.Math.abs(i)%60),(gGe(),rnn)[this.q.getDay()]+" "+cnn[this.q.getMonth()]+" "+$$(this.q.getDate())+" "+$$(this.q.getHours())+":"+$$(this.q.getMinutes())+":"+$$(this.q.getSeconds())+" GMT"+n+t+" "+this.q.getFullYear()};var bH=v(pt,"Date",205);m(1977,205,mQe,PJe),s.a=!1,s.b=0,s.c=0,s.d=0,s.e=0,s.f=0,s.g=!1,s.i=0,s.j=0,s.k=0,s.n=0,s.o=0,s.p=0,v("com.google.gwt.i18n.shared.impl","DateRecord",1977),m(2026,1,{}),s.ne=function(){return null},s.oe=function(){return null},s.pe=function(){return null},s.qe=function(){return null},s.re=function(){return null},v(xy,"JSONValue",2026),m(139,2026,{139:1},Dd,p9),s.Fb=function(n){return X(n,139)?Aae(this.a,u(n,139).a):!1},s.me=function(){return wbn},s.Hb=function(){return fae(this.a)},s.ne=function(){return this},s.Ib=function(){var n,t,i;for(i=new fl("["),t=0,n=this.a.length;t0&&(i.a+=","),uo(i,Zp(this,t));return i.a+="]",i.a},v(xy,"JSONArray",139),m(479,2026,{479:1},m9),s.me=function(){return pbn},s.oe=function(){return this},s.Ib=function(){return Ln(),""+this.a},s.a=!1;var Uen,Xen;v(xy,"JSONBoolean",479),m(981,63,sd,qMe),v(xy,"JSONException",981),m(1017,2026,{},$t),s.me=function(){return kbn},s.Ib=function(){return Yo};var Ven;v(xy,"JSONNull",1017),m(265,2026,{265:1},q3),s.Fb=function(n){return X(n,265)?this.a==u(n,265).a:!1},s.me=function(){return mbn},s.Hb=function(){return I5(this.a)},s.pe=function(){return this},s.Ib=function(){return this.a+""},s.a=0,v(xy,"JSONNumber",265),m(149,2026,{149:1},S5,v9),s.Fb=function(n){return X(n,149)?Aae(this.a,u(n,149).a):!1},s.me=function(){return vbn},s.Hb=function(){return fae(this.a)},s.qe=function(){return this},s.Ib=function(){var n,t,i,r,c,o,l;for(l=new fl("{"),n=!0,o=FQ(this,oe(Be,Ae,2,0,6,1)),i=o,r=0,c=i.length;r=0?":"+this.c:"")+")"},s.c=0;var _me=v(Cu,"StackTraceElement",324);Ren={3:1,472:1,35:1,2:1};var Be=v(Cu,Bge,2);m(111,418,{472:1},Ld,OE,df),v(Cu,"StringBuffer",111),m(106,418,{472:1},z0,x5,fl),v(Cu,"StringBuilder",106),m(691,99,sF,Noe),v(Cu,"StringIndexOutOfBoundsException",691),m(2107,1,{});var Wen;m(46,63,{3:1,101:1,63:1,80:1,46:1},Nt,_d),v(Cu,"UnsupportedOperationException",46),m(247,242,{3:1,35:1,242:1,247:1},DO,Foe),s.Dd=function(n){return gVe(this,u(n,247))},s.se=function(){return hm(HVe(this))},s.Fb=function(n){var t;return this===n?!0:X(n,247)?(t=u(n,247),this.e==t.e&&gVe(this,t)==0):!1},s.Hb=function(){var n;return this.b!=0?this.b:this.a<54?(n=Pu(this.f),this.b=Lt(zr(n,-1)),this.b=33*this.b+Lt(zr(Uw(n,32),-1)),this.b=17*this.b+ac(this.e),this.b):(this.b=17*hFe(this.c)+ac(this.e),this.b)},s.Ib=function(){return HVe(this)},s.a=0,s.b=0,s.d=0,s.e=0,s.f=0;var Zen,Hg,Ime,Lme,Pme,$me,Rme,Bme,ote=v("java.math","BigDecimal",247);m(91,242,{3:1,35:1,242:1,91:1},Y1,sLe,ag,kHe,U0),s.Dd=function(n){return wHe(this,u(n,91))},s.se=function(){return hm(aZ(this,0))},s.Fb=function(n){return cde(this,n)},s.Hb=function(){return hFe(this)},s.Ib=function(){return aZ(this,0)},s.b=-2,s.c=0,s.d=0,s.e=0;var enn,gH,nnn,ste,wH,tM,Vv=v("java.math","BigInteger",91),tnn,inn,Ry,iM;m(484,2027,y2),s.$b=function(){Ju(this)},s._b=function(n){return so(this,n)},s.uc=function(n){return Qze(this,n,this.i)||Qze(this,n,this.f)},s.vc=function(){return new sn(this)},s.xc=function(n){return Rn(this,n)},s.yc=function(n,t){return Zt(this,n,t)},s.Ac=function(n){return ny(this,n)},s.gc=function(){return _E(this)},s.g=0,v(pt,"AbstractHashMap",484),m(306,Wa,bs,sn),s.$b=function(){this.a.$b()},s.Gc=function(n){return RLe(this,n)},s.Jc=function(){return new im(this.a)},s.Kc=function(n){var t;return RLe(this,n)?(t=u(n,45).jd(),this.a.Ac(t),!0):!1},s.gc=function(){return this.a.gc()},v(pt,"AbstractHashMap/EntrySet",306),m(307,1,Jr,im),s.Nb=function(n){nc(this,n)},s.Pb=function(){return kv(this)},s.Ob=function(){return this.b},s.Qb=function(){aRe(this)},s.b=!1,s.d=0,v(pt,"AbstractHashMap/EntrySetIterator",307),m(417,1,Jr,qc),s.Nb=function(n){nc(this,n)},s.Ob=function(){return HX(this)},s.Pb=function(){return uae(this)},s.Qb=function(){Ns(this)},s.b=0,s.c=-1,v(pt,"AbstractList/IteratorImpl",417),m(97,417,f1,Xr),s.Qb=function(){Ns(this)},s.Rb=function(n){Rp(this,n)},s.Sb=function(){return this.b>0},s.Tb=function(){return this.b},s.Ub=function(){return at(this.b>0),this.a.Xb(this.c=--this.b)},s.Vb=function(){return this.b-1},s.Wb=function(n){Ip(this.c!=-1),this.a.fd(this.c,n)},v(pt,"AbstractList/ListIteratorImpl",97),m(258,56,Z8,Y0),s._c=function(n,t){Kp(n,this.b),this.c._c(this.a+n,t),++this.b},s.Xb=function(n){return mn(n,this.b),this.c.Xb(this.a+n)},s.ed=function(n){var t;return mn(n,this.b),t=this.c.ed(this.a+n),--this.b,t},s.fd=function(n,t){return mn(n,this.b),this.c.fd(this.a+n,t)},s.gc=function(){return this.b},s.a=0,s.b=0,v(pt,"AbstractList/SubList",258),m(232,Wa,bs,tt),s.$b=function(){this.a.$b()},s.Gc=function(n){return this.a._b(n)},s.Jc=function(){var n;return n=this.a.vc().Jc(),new gt(n)},s.Kc=function(n){return this.a._b(n)?(this.a.Ac(n),!0):!1},s.gc=function(){return this.a.gc()},v(pt,"AbstractMap/1",232),m(529,1,Jr,gt),s.Nb=function(n){nc(this,n)},s.Ob=function(){return this.a.Ob()},s.Pb=function(){var n;return n=u(this.a.Pb(),45),n.jd()},s.Qb=function(){this.a.Qb()},v(pt,"AbstractMap/1/1",529),m(230,31,km,ut),s.$b=function(){this.a.$b()},s.Gc=function(n){return this.a.uc(n)},s.Jc=function(){var n;return n=this.a.vc().Jc(),new Hi(n)},s.gc=function(){return this.a.gc()},v(pt,"AbstractMap/2",230),m(304,1,Jr,Hi),s.Nb=function(n){nc(this,n)},s.Ob=function(){return this.a.Ob()},s.Pb=function(){var n;return n=u(this.a.Pb(),45),n.kd()},s.Qb=function(){this.a.Qb()},v(pt,"AbstractMap/2/1",304),m(480,1,{480:1,45:1}),s.Fb=function(n){var t;return X(n,45)?(t=u(n,45),Vu(this.d,t.jd())&&Vu(this.e,t.kd())):!1},s.jd=function(){return this.d},s.kd=function(){return this.e},s.Hb=function(){return rv(this.d)^rv(this.e)},s.ld=function(n){return Nle(this,n)},s.Ib=function(){return this.d+"="+this.e},v(pt,"AbstractMap/AbstractEntry",480),m(390,480,{480:1,390:1,45:1},l$),v(pt,"AbstractMap/SimpleEntry",390),m(2044,1,zZ),s.Fb=function(n){var t;return X(n,45)?(t=u(n,45),Vu(this.jd(),t.jd())&&Vu(this.kd(),t.kd())):!1},s.Hb=function(){return rv(this.jd())^rv(this.kd())},s.Ib=function(){return this.jd()+"="+this.kd()},v(pt,uQe,2044),m(2052,2027,Pge),s.Vc=function(n){return PX(this.Ce(n))},s.tc=function(n){return DPe(this,n)},s._b=function(n){return Dle(this,n)},s.vc=function(){return new Xi(this)},s.Rc=function(){return WDe(this.Ee())},s.Wc=function(n){return PX(this.Fe(n))},s.xc=function(n){var t;return t=n,bu(this.De(t))},s.Yc=function(n){return PX(this.Ge(n))},s.ec=function(){return new Lu(this)},s.Tc=function(){return WDe(this.He())},s.Zc=function(n){return PX(this.Ie(n))},v(pt,"AbstractNavigableMap",2052),m(620,Wa,bs,Xi),s.Gc=function(n){return X(n,45)&&DPe(this.b,u(n,45))},s.Jc=function(){return this.b.Be()},s.Kc=function(n){var t;return X(n,45)?(t=u(n,45),this.b.Je(t)):!1},s.gc=function(){return this.b.gc()},v(pt,"AbstractNavigableMap/EntrySet",620),m(1115,Wa,$ge,Lu),s.Lc=function(){return new h$(this)},s.$b=function(){this.a.$b()},s.Gc=function(n){return Dle(this.a,n)},s.Jc=function(){var n;return n=this.a.vc().b.Be(),new Oke(n)},s.Kc=function(n){return Dle(this.a,n)?(this.a.Ac(n),!0):!1},s.gc=function(){return this.a.gc()},v(pt,"AbstractNavigableMap/NavigableKeySet",1115),m(1116,1,Jr,Oke),s.Nb=function(n){nc(this,n)},s.Ob=function(){return HX(this.a.a)},s.Pb=function(){var n;return n=SOe(this.a),n.jd()},s.Qb=function(){xNe(this.a)},v(pt,"AbstractNavigableMap/NavigableKeySet/1",1116),m(2065,31,km),s.Ec=function(n){return J5(L8(this,n),n7),!0},s.Fc=function(n){return Nn(n),RC(n!=this,"Can't add a queue to itself"),dc(this,n)},s.$b=function(){for(;CQ(this)!=null;);},v(pt,"AbstractQueue",2065),m(314,31,{4:1,20:1,31:1,18:1},uv,CLe),s.Ec=function(n){return Iae(this,n),!0},s.$b=function(){Bae(this)},s.Gc=function(n){return bze(new yj(this),n)},s.dc=function(){return CE(this)},s.Jc=function(){return new yj(this)},s.Kc=function(n){return P5n(new yj(this),n)},s.gc=function(){return this.c-this.b&this.a.length-1},s.Lc=function(){return new pn(this,272)},s.Oc=function(n){var t;return t=this.c-this.b&this.a.length-1,n.lengtht&&cr(n,t,null),n},s.b=0,s.c=0,v(pt,"ArrayDeque",314),m(448,1,Jr,yj),s.Nb=function(n){nc(this,n)},s.Ob=function(){return this.a!=this.b},s.Pb=function(){return qB(this)},s.Qb=function(){bBe(this)},s.a=0,s.b=0,s.c=-1,v(pt,"ArrayDeque/IteratorImpl",448),m(13,56,EQe,Te,Mo,vs),s._c=function(n,t){og(this,n,t)},s.Ec=function(n){return xe(this,n)},s.ad=function(n,t){return O1e(this,n,t)},s.Fc=function(n){return Ar(this,n)},s.$b=function(){Ep(this.c,0)},s.Gc=function(n){return pu(this,n,0)!=-1},s.Ic=function(n){Ao(this,n)},s.Xb=function(n){return Le(this,n)},s.bd=function(n){return pu(this,n,0)},s.dc=function(){return this.c.length==0},s.Jc=function(){return new L(this)},s.ed=function(n){return Gd(this,n)},s.Kc=function(n){return Xo(this,n)},s.ae=function(n,t){eLe(this,n,t)},s.fd=function(n,t){return bl(this,n,t)},s.gc=function(){return this.c.length},s.gd=function(n){Nr(this,n)},s.Nc=function(){return uR(this.c)},s.Oc=function(n){return Xa(this,n)};var $Bn=v(pt,"ArrayList",13);m(7,1,Jr,L),s.Nb=function(n){nc(this,n)},s.Ob=function(){return gu(this)},s.Pb=function(){return I(this)},s.Qb=function(){gj(this)},s.a=0,s.b=-1,v(pt,"ArrayList/1",7),m(2074,k.Function,{},en),s.Ke=function(n,t){return ki(n,t)},m(123,56,jQe,Mu),s.Gc=function(n){return dBe(this,n)!=-1},s.Ic=function(n){var t,i,r,c;for(Nn(n),i=this.a,r=0,c=i.length;r0)throw $(new Jn(Xge+n+" greater than "+this.e));return this.f.Re()?jIe(this.c,this.b,this.a,n,t):WIe(this.c,n,t)},s.yc=function(n,t){if(!nW(this.c,this.f,n,this.b,this.a,this.e,this.d))throw $(new Jn(n+" outside the range "+this.b+" to "+this.e));return Dze(this.c,n,t)},s.Ac=function(n){var t;return t=n,nW(this.c,this.f,t,this.b,this.a,this.e,this.d)?SIe(this.c,t):null},s.Je=function(n){return TR(this,n.jd())&&che(this.c,n)},s.gc=function(){var n,t,i;if(this.f.Re()?this.a?t=T8(this.c,this.b,!0):t=T8(this.c,this.b,!1):t=phe(this.c),!(t&&TR(this,t.d)&&t))return 0;for(n=0,i=new HQ(this.c,this.f,this.b,this.a,this.e,this.d);HX(i.a);i.b=u(uae(i.a),45))++n;return n},s.$c=function(n,t){if(this.f.Re()&&this.c.a.Le(n,this.b)<0)throw $(new Jn(Xge+n+AQe+this.b));return this.f.Se()?jIe(this.c,n,t,this.e,this.d):ZIe(this.c,n,t)},s.a=!1,s.d=!1,v(pt,"TreeMap/SubMap",622),m(309,23,GZ,f$),s.Re=function(){return!1},s.Se=function(){return!1};var ate,hte,dte,bte,mH=vt(pt,"TreeMap/SubMapType",309,At,h6n,Rpn);m(1112,309,GZ,ECe),s.Se=function(){return!0},vt(pt,"TreeMap/SubMapType/1",1112,mH,null,null),m(1113,309,GZ,ICe),s.Re=function(){return!0},s.Se=function(){return!0},vt(pt,"TreeMap/SubMapType/2",1113,mH,null,null),m(1114,309,GZ,jCe),s.Re=function(){return!0},vt(pt,"TreeMap/SubMapType/3",1114,mH,null,null);var ann;m(141,Wa,{3:1,20:1,31:1,18:1,277:1,22:1,83:1,141:1},mX,sle,$d,k9),s.Lc=function(){return new h$(this)},s.Ec=function(n){return FC(this,n)},s.$b=function(){this.a.$b()},s.Gc=function(n){return this.a._b(n)},s.Jc=function(){return this.a.ec().Jc()},s.Kc=function(n){return IV(this,n)},s.gc=function(){return this.a.gc()};var JBn=v(pt,"TreeSet",141);m(1052,1,{},_ke),s.Te=function(n,t){return rpn(this.a,n,t)},v(qZ,"BinaryOperator/lambda$0$Type",1052),m(1053,1,{},Ike),s.Te=function(n,t){return cpn(this.a,n,t)},v(qZ,"BinaryOperator/lambda$1$Type",1053),m(935,1,{},uu),s.Kb=function(n){return n},v(qZ,"Function/lambda$0$Type",935),m(388,1,Rt,E9),s.Mb=function(n){return!this.a.Mb(n)},v(qZ,"Predicate/lambda$2$Type",388),m(567,1,{567:1});var hnn=v(MS,"Handler",567);m(2069,1,bN),s.ve=function(){return"DUMMY"},s.Ib=function(){return this.ve()};var Ume;v(MS,"Level",2069),m(1672,2069,bN,Js),s.ve=function(){return"INFO"},v(MS,"Level/LevelInfo",1672),m(1824,1,{},WSe);var gte;v(MS,"LogManager",1824),m(1866,1,bN,ANe),s.b=null,v(MS,"LogRecord",1866),m(511,1,{511:1},sQ),s.e=!1;var dnn=!1,bnn=!1,ih=!1,gnn=!1,wnn=!1;v(MS,"Logger",511),m(819,567,{567:1},Qr),v(MS,"SimpleConsoleLogHandler",819),m(130,23,{3:1,35:1,23:1,130:1},qX);var Xme,Wo,Vme,Zo=vt(Ic,"Collector/Characteristics",130,At,Q5n,Bpn),pnn;m(746,1,{},Rfe),v(Ic,"CollectorImpl",746),m(1050,1,{},rc),s.Te=function(n,t){return EEn(u(n,212),u(t,212))},v(Ic,"Collectors/10methodref$merge$Type",1050),m(1051,1,{},vr),s.Kb=function(n){return TLe(u(n,212))},v(Ic,"Collectors/11methodref$toString$Type",1051),m(152,1,{},Si),s.Wd=function(n,t){u(n,18).Ec(t)},v(Ic,"Collectors/20methodref$add$Type",152),m(154,1,{},Ui),s.Ve=function(){return new Te},v(Ic,"Collectors/21methodref$ctor$Type",154),m(1049,1,{},Su),s.Wd=function(n,t){W1(u(n,212),u(t,472))},v(Ic,"Collectors/9methodref$add$Type",1049),m(1048,1,{},qNe),s.Ve=function(){return new Eg(this.a,this.b,this.c)},v(Ic,"Collectors/lambda$15$Type",1048),m(153,1,{},nu),s.Te=function(n,t){return Ign(u(n,18),u(t,18))},v(Ic,"Collectors/lambda$45$Type",153),m(538,1,{}),s.Ye=function(){vj(this)},s.d=!1,v(Ic,"TerminatableStream",538),m(768,538,Vge,Sle),s.Ye=function(){vj(this)},v(Ic,"DoubleStreamImpl",768),m(1297,724,kl,UNe),s.Pe=function(n){return KSn(this,u(n,189))},s.a=null,v(Ic,"DoubleStreamImpl/2",1297),m(1298,1,jN,Lke),s.Ne=function(n){xwn(this.a,n)},v(Ic,"DoubleStreamImpl/2/lambda$0$Type",1298),m(1295,1,jN,Pke),s.Ne=function(n){Awn(this.a,n)},v(Ic,"DoubleStreamImpl/lambda$0$Type",1295),m(1296,1,jN,$ke),s.Ne=function(n){rHe(this.a,n)},v(Ic,"DoubleStreamImpl/lambda$2$Type",1296),m(1351,723,kl,RPe),s.Pe=function(n){return n6n(this,u(n,202))},s.a=0,s.b=0,s.c=0,v(Ic,"IntStream/5",1351),m(793,538,Vge,Mle),s.Ye=function(){vj(this)},s.Ze=function(){return K0(this),this.a},v(Ic,"IntStreamImpl",793),m(794,538,Vge,Koe),s.Ye=function(){vj(this)},s.Ze=function(){return K0(this),Kse(),fnn},v(Ic,"IntStreamImpl/Empty",794),m(1651,1,wN,Rke),s.Bd=function(n){QBe(this.a,n)},v(Ic,"IntStreamImpl/lambda$4$Type",1651);var GBn=Ji(Ic,"Stream");m(28,538,{520:1,677:1,832:1},wn),s.Ye=function(){vj(this)};var By;v(Ic,"StreamImpl",28),m(1072,486,kl,pNe),s.zd=function(n){for(;n8n(this);){if(this.a.zd(n))return!0;vj(this.b),this.b=null,this.a=null}return!1},v(Ic,"StreamImpl/1",1072),m(1073,1,rt,Bke),s.Ad=function(n){J3n(this.a,u(n,832))},v(Ic,"StreamImpl/1/lambda$0$Type",1073),m(1074,1,Rt,zke),s.Mb=function(n){return dr(this.a,n)},v(Ic,"StreamImpl/1methodref$add$Type",1074),m(1075,486,kl,Q_e),s.zd=function(n){var t;return this.a||(t=new Te,this.b.a.Nb(new Fke(t)),yn(),Nr(t,this.c),this.a=new pn(t,16)),RRe(this.a,n)},s.a=null,v(Ic,"StreamImpl/5",1075),m(1076,1,rt,Fke),s.Ad=function(n){xe(this.a,n)},v(Ic,"StreamImpl/5/2methodref$add$Type",1076),m(725,486,kl,ghe),s.zd=function(n){for(this.b=!1;!this.b&&this.c.zd(new Lxe(this,n)););return this.b},s.b=!1,v(Ic,"StreamImpl/FilterSpliterator",725),m(1066,1,rt,Lxe),s.Ad=function(n){Lvn(this.a,this.b,n)},v(Ic,"StreamImpl/FilterSpliterator/lambda$0$Type",1066),m(1061,724,kl,VPe),s.Pe=function(n){return Cpn(this,u(n,189))},v(Ic,"StreamImpl/MapToDoubleSpliterator",1061),m(1065,1,rt,Pxe),s.Ad=function(n){Qgn(this.a,this.b,n)},v(Ic,"StreamImpl/MapToDoubleSpliterator/lambda$0$Type",1065),m(1060,723,kl,KPe),s.Pe=function(n){return Opn(this,u(n,202))},v(Ic,"StreamImpl/MapToIntSpliterator",1060),m(1064,1,rt,$xe),s.Ad=function(n){Ygn(this.a,this.b,n)},v(Ic,"StreamImpl/MapToIntSpliterator/lambda$0$Type",1064),m(722,486,kl,nhe),s.zd=function(n){return vNe(this,n)},v(Ic,"StreamImpl/MapToObjSpliterator",722),m(1063,1,rt,Rxe),s.Ad=function(n){Wgn(this.a,this.b,n)},v(Ic,"StreamImpl/MapToObjSpliterator/lambda$0$Type",1063),m(1062,486,kl,gBe),s.zd=function(n){for(;JX(this.b,0);){if(!this.a.zd(new bh))return!1;this.b=pf(this.b,1)}return this.a.zd(n)},s.b=0,v(Ic,"StreamImpl/SkipSpliterator",1062),m(1067,1,rt,bh),s.Ad=function(n){},v(Ic,"StreamImpl/SkipSpliterator/lambda$0$Type",1067),m(617,1,rt,aa),s.Ad=function(n){xP(this,n)},v(Ic,"StreamImpl/ValueConsumer",617),m(1068,1,rt,fa),s.Ad=function(n){rg()},v(Ic,"StreamImpl/lambda$0$Type",1068),m(1069,1,rt,cl),s.Ad=function(n){rg()},v(Ic,"StreamImpl/lambda$1$Type",1069),m(1070,1,{},Hke),s.Te=function(n,t){return Ppn(this.a,n,t)},v(Ic,"StreamImpl/lambda$4$Type",1070),m(1071,1,rt,Bxe),s.Ad=function(n){apn(this.b,this.a,n)},v(Ic,"StreamImpl/lambda$5$Type",1071),m(1077,1,rt,Jke),s.Ad=function(n){Z7n(this.a,u(n,375))},v(Ic,"TerminatableStream/lambda$0$Type",1077),m(2104,1,{}),m(1976,1,{},S0),v("javaemul.internal","ConsoleLogger",1976);var qBn=0;m(2096,1,{}),m(1800,1,rt,Dl),s.Ad=function(n){u(n,321)},v(t7,"BowyerWatsonTriangulation/lambda$0$Type",1800),m(1801,1,rt,Gke),s.Ad=function(n){dc(this.a,u(n,321).e)},v(t7,"BowyerWatsonTriangulation/lambda$1$Type",1801),m(1802,1,rt,fw),s.Ad=function(n){u(n,177)},v(t7,"BowyerWatsonTriangulation/lambda$2$Type",1802),m(1797,1,Kt,qke),s.Le=function(n,t){return z6n(this.a,u(n,177),u(t,177))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(t7,"NaiveMinST/lambda$0$Type",1797),m(440,1,{},yE),v(t7,"NodeMicroLayout",440),m(177,1,{177:1},O5),s.Fb=function(n){var t;return X(n,177)?(t=u(n,177),Vu(this.a,t.a)&&Vu(this.b,t.b)||Vu(this.a,t.b)&&Vu(this.b,t.a)):!1},s.Hb=function(){return rv(this.a)+rv(this.b)};var UBn=v(t7,"TEdge",177);m(321,1,{321:1},sge),s.Fb=function(n){var t;return X(n,321)?(t=u(n,321),fB(this,t.a)&&fB(this,t.b)&&fB(this,t.c)):!1},s.Hb=function(){return rv(this.a)+rv(this.b)+rv(this.c)},v(t7,"TTriangle",321),m(225,1,{225:1},B$),v(t7,"Tree",225),m(1183,1,{},zIe),v(CQe,"Scanline",1183);var mnn=Ji(CQe,OQe);m(1728,1,{},zRe),v(b1,"CGraph",1728),m(320,1,{320:1},_Ie),s.b=0,s.c=0,s.d=0,s.g=0,s.i=0,s.k=Ir,v(b1,"CGroup",320),m(814,1,{},hoe),v(b1,"CGroup/CGroupBuilder",814),m(60,1,{60:1},ZOe),s.Ib=function(){var n;return this.j?_t(this.j.Kb(this)):(U1(vH),vH.o+"@"+(n=Gw(this)>>>0,n.toString(16)))},s.f=0,s.i=Ir;var vH=v(b1,"CNode",60);m(813,1,{},doe),v(b1,"CNode/CNodeBuilder",813);var vnn;m(1551,1,{},A1),s.df=function(n,t){return 0},s.ef=function(n,t){return 0},v(b1,DQe,1551),m(1830,1,{},qb),s.af=function(n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_;for(b=Ki,r=new L(n.a.b);r.ar.d.c||r.d.c==o.d.c&&r.d.b0?n+this.n.d+this.n.a:0},s.gf=function(){var n,t,i,r,c;if(c=0,this.e)this.b?c=this.b.a:this.a[1][1]&&(c=this.a[1][1].gf());else if(this.g)c=tde(this,iW(this,null,!0));else for(t=(Sa(),z(B(Nm,1),ye,237,0,[Nu,No,Du])),i=0,r=t.length;i0?c+this.n.b+this.n.c:0},s.hf=function(){var n,t,i,r,c;if(this.g)for(n=iW(this,null,!1),i=(Sa(),z(B(Nm,1),ye,237,0,[Nu,No,Du])),r=0,c=i.length;r0&&(r[0]+=this.d,i-=r[0]),r[2]>0&&(r[2]+=this.d,i-=r[2]),this.c.a=k.Math.max(0,i),this.c.d=t.d+n.d+(this.c.a-i)/2,r[1]=k.Math.max(r[1],i),Yae(this,No,t.d+n.d+r[0]-(r[1]-i)/2,r)},s.b=null,s.d=0,s.e=!1,s.f=!1,s.g=!1;var pte=0,yH=0;v(Ig,"GridContainerCell",1499),m(461,23,{3:1,35:1,23:1,461:1},XX);var Sb,Bh,Wf,Ann=vt(Ig,"HorizontalLabelAlignment",461,At,hyn,zpn),xnn;m(318,216,{216:1,318:1},MIe,BRe,mIe),s.ff=function(){return iDe(this)},s.gf=function(){return gfe(this)},s.a=0,s.c=!1;var XBn=v(Ig,"LabelCell",318);m(253,337,{216:1,337:1,253:1},Qj),s.ff=function(){return rS(this)},s.gf=function(){return cS(this)},s.hf=function(){qW(this)},s.jf=function(){UW(this)},s.b=0,s.c=0,s.d=!1,v(Ig,"StripContainerCell",253),m(1655,1,Rt,S3),s.Mb=function(n){return qbn(u(n,216))},v(Ig,"StripContainerCell/lambda$0$Type",1655),m(1656,1,{},Ub),s.We=function(n){return u(n,216).gf()},v(Ig,"StripContainerCell/lambda$1$Type",1656),m(1657,1,Rt,x1),s.Mb=function(n){return Ubn(u(n,216))},v(Ig,"StripContainerCell/lambda$2$Type",1657),m(1658,1,{},M0),s.We=function(n){return u(n,216).ff()},v(Ig,"StripContainerCell/lambda$3$Type",1658),m(462,23,{3:1,35:1,23:1,462:1},VX);var Zf,Mb,Oa,Tnn=vt(Ig,"VerticalLabelAlignment",462,At,dyn,Fpn),Cnn;m(787,1,{},Age),s.c=0,s.d=0,s.k=0,s.s=0,s.t=0,s.v=!1,s.w=0,s.D=!1,s.F=!1,v(aF,"NodeContext",787),m(1497,1,Kt,M6),s.Le=function(n,t){return bCe(u(n,64),u(t,64))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(aF,"NodeContext/0methodref$comparePortSides$Type",1497),m(1498,1,Kt,A6),s.Le=function(n,t){return Cxn(u(n,115),u(t,115))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(aF,"NodeContext/1methodref$comparePortContexts$Type",1498),m(168,23,{3:1,35:1,23:1,168:1},Vl);var Onn,Nnn,Dnn,_nn,Inn,Lnn,Pnn,$nn,Rnn,Bnn,znn,Fnn,Hnn,Jnn,Gnn,qnn,Unn,Xnn,Vnn,Knn,Qnn,mte,Ynn=vt(aF,"NodeLabelLocation",168,At,IY,Hpn),Wnn;m(115,1,{115:1},Lqe),s.a=!1,v(aF,"PortContext",115),m(1502,1,rt,aw),s.Ad=function(n){CAe(u(n,318))},v(MN,qQe,1502),m(1503,1,Rt,hw),s.Mb=function(n){return!!u(n,115).c},v(MN,UQe,1503),m(1504,1,rt,Xb),s.Ad=function(n){CAe(u(n,115).c)},v(MN,"LabelPlacer/lambda$2$Type",1504);var Qme;m(1501,1,rt,T1),s.Ad=function(n){$p(),Sbn(u(n,115))},v(MN,"NodeLabelAndSizeUtilities/lambda$0$Type",1501),m(788,1,rt,Xle),s.Ad=function(n){Rgn(this.b,this.c,this.a,u(n,187))},s.a=!1,s.c=!1,v(MN,"NodeLabelCellCreator/lambda$0$Type",788),m(1500,1,rt,Vke),s.Ad=function(n){Tbn(this.a,u(n,187))},v(MN,"PortContextCreator/lambda$0$Type",1500);var kH;m(1872,1,{},Nf),v(r7,"GreedyRectangleStripOverlapRemover",1872),m(1873,1,Kt,dw),s.Le=function(n,t){return w2n(u(n,226),u(t,226))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(r7,"GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type",1873),m(1826,1,{},iMe),s.a=5,s.e=0,v(r7,"RectangleStripOverlapRemover",1826),m(1827,1,Kt,A0),s.Le=function(n,t){return p2n(u(n,226),u(t,226))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(r7,"RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type",1827),m(1829,1,Kt,x0),s.Le=function(n,t){return Yvn(u(n,226),u(t,226))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(r7,"RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type",1829),m(409,23,{3:1,35:1,23:1,409:1},a$);var YN,vte,yte,WN,Znn=vt(r7,"RectangleStripOverlapRemover/OverlapRemovalDirection",409,At,f6n,Jpn),etn;m(226,1,{226:1},hK),v(r7,"RectangleStripOverlapRemover/RectangleNode",226),m(1828,1,rt,Kke),s.Ad=function(n){uMn(this.a,u(n,226))},v(r7,"RectangleStripOverlapRemover/lambda$1$Type",1828);var ntn=!1,rM,Yme;m(1798,1,rt,M3),s.Ad=function(n){JVe(u(n,225))},v(Ny,"DepthFirstCompaction/0methodref$compactTree$Type",1798),m(810,1,rt,Yue),s.Ad=function(n){M4n(this.a,u(n,225))},v(Ny,"DepthFirstCompaction/lambda$1$Type",810),m(1799,1,rt,ONe),s.Ad=function(n){Xjn(this.a,this.b,this.c,u(n,225))},v(Ny,"DepthFirstCompaction/lambda$2$Type",1799);var cM,Wme;m(68,1,{68:1},HIe),v(Ny,"Node",68),m(1179,1,{},DCe),v(Ny,"ScanlineOverlapCheck",1179),m(1180,1,{683:1},dIe),s._e=function(n){npn(this,u(n,442))},v(Ny,"ScanlineOverlapCheck/OverlapsScanlineHandler",1180),m(1181,1,Kt,T0),s.Le=function(n,t){return IEn(u(n,68),u(t,68))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ny,"ScanlineOverlapCheck/OverlapsScanlineHandler/lambda$0$Type",1181),m(442,1,{442:1},sse),s.a=!1,v(Ny,"ScanlineOverlapCheck/Timestamp",442),m(1182,1,Kt,Q2),s.Le=function(n,t){return uAn(u(n,442),u(t,442))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ny,"ScanlineOverlapCheck/lambda$0$Type",1182),m(545,1,{},bw),v("org.eclipse.elk.alg.common.utils","SVGImage",545),m(748,1,{},gw),v(QZ,nwe,748),m(1164,1,Kt,gh),s.Le=function(n,t){return ICn(u(n,235),u(t,235))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(QZ,KQe,1164),m(1165,1,rt,zxe),s.Ad=function(n){Ayn(this.b,this.a,u(n,251))},v(QZ,twe,1165),m(214,1,E2),v(Bv,"AbstractLayoutProvider",214),m(726,214,E2,boe),s.kf=function(n,t){MUe(this,n,t)},v(QZ,"ForceLayoutProvider",726);var VBn=Ji(AN,QQe);m(150,1,{3:1,105:1,150:1},cs),s.of=function(n,t){return xO(this,n,t)},s.lf=function(){return mDe(this)},s.mf=function(n){return T(this,n)},s.nf=function(n){return bi(this,n)},v(AN,"MapPropertyHolder",150),m(313,150,{3:1,313:1,105:1,150:1}),v(xN,"FParticle",313),m(251,313,{3:1,251:1,313:1,105:1,150:1},i_e),s.Ib=function(){var n;return this.a?(n=pu(this.a.a,this,0),n>=0?"b"+n+"["+rQ(this.a)+"]":"b["+rQ(this.a)+"]"):"b_"+Gw(this)},v(xN,"FBendpoint",251),m(291,150,{3:1,291:1,105:1,150:1},YOe),s.Ib=function(){return rQ(this)},v(xN,"FEdge",291),m(235,150,{3:1,235:1,105:1,150:1},nB);var KBn=v(xN,"FGraph",235);m(445,313,{3:1,445:1,313:1,105:1,150:1},cPe),s.Ib=function(){return this.b==null||this.b.length==0?"l["+rQ(this.a)+"]":"l_"+this.b},v(xN,"FLabel",445),m(155,313,{3:1,155:1,313:1,105:1,150:1},_Ce),s.Ib=function(){return Mae(this)},s.a=0,v(xN,"FNode",155),m(2062,1,{}),s.qf=function(n){tge(this,n)},s.rf=function(){lJe(this)},s.d=0,v(iwe,"AbstractForceModel",2062),m(631,2062,{631:1},WBe),s.pf=function(n,t){var i,r,c,o,l;return UVe(this.f,n,t),c=_r(vc(t.d),n.d),l=k.Math.sqrt(c.a*c.a+c.b*c.b),r=k.Math.max(0,l-mj(n.e)/2-mj(t.e)/2),i=Mqe(this.e,n,t),i>0?o=-Hvn(r,this.c)*i:o=N2n(r,this.b)*u(T(n,(Qf(),Fy)),15).a,q1(c,o/l),c},s.qf=function(n){tge(this,n),this.a=u(T(n,(Qf(),jH)),15).a,this.c=te(re(T(n,SH))),this.b=te(re(T(n,Ete)))},s.sf=function(n){return n0&&(o-=Fbn(r,this.a)*i),q1(c,o*this.b/l),c},s.qf=function(n){var t,i,r,c,o,l,f;for(tge(this,n),this.b=te(re(T(n,(Qf(),jte)))),this.c=this.b/u(T(n,jH),15).a,r=n.e.c.length,o=0,c=0,f=new L(n.e);f.a0},s.a=0,s.b=0,s.c=0,v(iwe,"FruchtermanReingoldModel",632);var zy=Ji(yu,"ILayoutMetaDataProvider");m(844,1,eh,ET),s.tf=function(n){Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,hF),""),"Force Model"),"Determines the model for force calculation."),Zme),(Og(),Bi)),e3e),nn((Th(),Sn))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,rwe),""),"Iterations"),"The number of iterations on the force model."),me(300)),gc),Mr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,cwe),""),"Repulsive Power"),"Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model"),me(0)),gc),Mr),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,YZ),""),"FR Temperature"),"The temperature is used as a scaling factor for particle displacements."),Ih),tc),wr),nn(Sn)))),Gi(n,YZ,hF,stn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,WZ),""),"Eades Repulsion"),"Factor for repulsive forces in Eades' model."),5),tc),wr),nn(Sn)))),Gi(n,WZ,hF,ctn),IKe((new cP,n))};var ttn,itn,Zme,rtn,ctn,utn,otn,stn;v(TS,"ForceMetaDataProvider",844),m(424,23,{3:1,35:1,23:1,424:1},lse);var kte,EH,e3e=vt(TS,"ForceModelStrategy",424,At,E5n,qpn),ltn;m(984,1,eh,cP),s.tf=function(n){IKe(n)};var ftn,atn,n3e,jH,t3e,htn,dtn,btn,gtn,i3e,wtn,r3e,c3e,ptn,Fy,mtn,Ete,u3e,vtn,ytn,SH,jte,ktn,Etn,jtn,o3e,Stn;v(TS,"ForceOptions",984),m(985,1,{},C1),s.uf=function(){var n;return n=new boe,n},s.vf=function(n){},v(TS,"ForceOptions/ForceFactory",985);var ZN,uM,Hy,MH;m(845,1,eh,uP),s.tf=function(n){Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,owe),""),"Fixed Position"),"Prevent that the node is moved by the layout algorithm."),(Ln(),!1)),(Og(),xr)),Yi),nn((Th(),ar))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,swe),""),"Desired Edge Length"),"Either specified for parent nodes or for individual edges, where the latter takes higher precedence."),100),tc),wr),Ti(Sn,z(B(uh,1),ye,160,0,[_a]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,lwe),""),"Layout Dimension"),"Dimensions that are permitted to be altered during layout."),s3e),Bi),g3e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,fwe),""),"Stress Epsilon"),"Termination criterion for the iterative process."),Ih),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,awe),""),"Iteration Limit"),"Maximum number of performed iterations. Takes higher precedence than 'epsilon'."),me(ui)),gc),Mr),nn(Sn)))),sKe((new xU,n))};var Mtn,Atn,s3e,xtn,Ttn,Ctn;v(TS,"StressMetaDataProvider",845),m(988,1,eh,xU),s.tf=function(n){sKe(n)};var AH,l3e,f3e,a3e,h3e,d3e,Otn,Ntn,Dtn,_tn,b3e,Itn;v(TS,"StressOptions",988),m(989,1,{},I4),s.uf=function(){var n;return n=new WOe,n},s.vf=function(n){},v(TS,"StressOptions/StressFactory",989),m(1080,214,E2,WOe),s.kf=function(n,t){var i,r,c,o,l;for(t.Tg(nYe,1),Re($e(ve(n,(FO(),h3e))))?Re($e(ve(n,b3e)))||VC((i=new yE((cg(),new B0(n))),i)):MUe(new boe,n,t.dh(1)),c=xze(n),r=vVe(this.a,c),l=r.Jc();l.Ob();)o=u(l.Pb(),235),!(o.e.c.length<=1)&&(iPn(this.b,o),COn(this.b),Ao(o.d,new Uh));c=NKe(r),zKe(c),t.Ug()},v(gF,"StressLayoutProvider",1080),m(1081,1,rt,Uh),s.Ad=function(n){age(u(n,445))},v(gF,"StressLayoutProvider/lambda$0$Type",1081),m(986,1,{},YSe),s.c=0,s.e=0,s.g=0,v(gF,"StressMajorization",986),m(384,23,{3:1,35:1,23:1,384:1},KX);var Ste,Mte,Ate,g3e=vt(gF,"StressMajorization/Dimension",384,At,fyn,Upn),Ltn;m(987,1,Kt,Qke),s.Le=function(n,t){return Epn(this.a,u(n,155),u(t,155))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(gF,"StressMajorization/lambda$0$Type",987),m(1161,1,{},hLe),v(Iy,"ElkLayered",1161),m(1162,1,rt,Yke),s.Ad=function(n){pCn(this.a,u(n,37))},v(Iy,"ElkLayered/lambda$0$Type",1162),m(1163,1,rt,Wke),s.Ad=function(n){Tpn(this.a,u(n,37))},v(Iy,"ElkLayered/lambda$1$Type",1163),m(1246,1,{},NCe);var Ptn,$tn,Rtn;v(Iy,"GraphConfigurator",1246),m(757,1,rt,Wue),s.Ad=function(n){AGe(this.a,u(n,9))},v(Iy,"GraphConfigurator/lambda$0$Type",757),m(758,1,{},_l),s.Kb=function(n){return Vde(),new wn(null,new pn(u(n,25).a,16))},v(Iy,"GraphConfigurator/lambda$1$Type",758),m(759,1,rt,Zue),s.Ad=function(n){AGe(this.a,u(n,9))},v(Iy,"GraphConfigurator/lambda$2$Type",759),m(1079,214,E2,ZSe),s.kf=function(n,t){var i;i=LLn(new cMe,n),ue(ve(n,(Oe(),Fm)))===ue((rd(),b0))?GEn(this.a,i,t):MOn(this.a,i,t),t.Zg()||SKe(new ST,i)},v(Iy,"LayeredLayoutProvider",1079),m(363,23,{3:1,35:1,23:1,363:1},aC);var ea,p1,eo,no,Pc,w3e=vt(Iy,"LayeredPhases",363,At,u9n,Xpn),Btn;m(1683,1,{},mBe),s.i=0;var ztn;v(_N,"ComponentsToCGraphTransformer",1683);var Ftn;m(1684,1,{},Jo),s.wf=function(n,t){return k.Math.min(n.a!=null?te(n.a):n.c.i,t.a!=null?te(t.a):t.c.i)},s.xf=function(n,t){return k.Math.min(n.a!=null?te(n.a):n.c.i,t.a!=null?te(t.a):t.c.i)},v(_N,"ComponentsToCGraphTransformer/1",1684),m(82,1,{82:1}),s.i=0,s.k=!0,s.o=Ir;var xte=v(DS,"CNode",82);m(460,82,{460:1,82:1},ale,jde),s.Ib=function(){return""},v(_N,"ComponentsToCGraphTransformer/CRectNode",460),m(1652,1,{},ul);var Tte,Cte;v(_N,"OneDimensionalComponentsCompaction",1652),m(1653,1,{},wh),s.Kb=function(n){return H5n(u(n,49))},s.Fb=function(n){return this===n},v(_N,"OneDimensionalComponentsCompaction/lambda$0$Type",1653),m(1654,1,{},ww),s.Kb=function(n){return KEn(u(n,49))},s.Fb=function(n){return this===n},v(_N,"OneDimensionalComponentsCompaction/lambda$1$Type",1654),m(1686,1,{},g_e),v(DS,"CGraph",1686),m(194,1,{194:1},NY),s.b=0,s.c=0,s.e=0,s.g=!0,s.i=Ir,v(DS,"CGroup",194),m(1685,1,{},Vb),s.wf=function(n,t){return k.Math.max(n.a!=null?te(n.a):n.c.i,t.a!=null?te(t.a):t.c.i)},s.xf=function(n,t){return k.Math.max(n.a!=null?te(n.a):n.c.i,t.a!=null?te(t.a):t.c.i)},v(DS,DQe,1685),m(1687,1,{},xqe),s.d=!1;var Htn,Ote=v(DS,LQe,1687);m(1688,1,{},A3),s.Kb=function(n){return Woe(),Ln(),u(u(n,49).a,82).d.e!=0},s.Fb=function(n){return this===n},v(DS,PQe,1688),m(817,1,{},pfe),s.a=!1,s.b=!1,s.c=!1,s.d=!1,v(DS,$Qe,817),m(1868,1,{},CDe),v(wF,RQe,1868);var eD=Ji(Lg,OQe);m(1869,1,{377:1},hIe),s._e=function(n){DDn(this,u(n,465))},v(wF,BQe,1869),m(1870,1,Kt,Y2),s.Le=function(n,t){return L4n(u(n,82),u(t,82))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(wF,zQe,1870),m(465,1,{465:1},fse),s.a=!1,v(wF,FQe,465),m(1871,1,Kt,C0),s.Le=function(n,t){return oAn(u(n,465),u(t,465))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(wF,HQe,1871),m(146,1,{146:1},L9,ufe),s.Fb=function(n){var t;return n==null||QBn!=Zs(n)?!1:(t=u(n,146),Vu(this.c,t.c)&&Vu(this.d,t.d))},s.Hb=function(){return JB(z(B(Cr,1),xn,1,5,[this.c,this.d]))},s.Ib=function(){return"("+this.c+Co+this.d+(this.a?"cx":"")+this.b+")"},s.a=!0,s.c=0,s.d=0;var QBn=v(Lg,"Point",146);m(408,23,{3:1,35:1,23:1,408:1},d$);var D2,Dm,Kv,_m,Jtn=vt(Lg,"Point/Quadrant",408,At,a6n,Gpn),Gtn;m(1674,1,{},eMe),s.b=null,s.c=null,s.d=null,s.e=null,s.f=null;var qtn,Utn,Xtn,Vtn,Ktn;v(Lg,"RectilinearConvexHull",1674),m(569,1,{377:1},fz),s._e=function(n){Y9n(this,u(n,146))},s.b=0;var p3e;v(Lg,"RectilinearConvexHull/MaximalElementsEventHandler",569),m(1676,1,Kt,O1),s.Le=function(n,t){return _4n(re(n),re(t))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lg,"RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type",1676),m(1675,1,{377:1},SRe),s._e=function(n){VNn(this,u(n,146))},s.a=0,s.b=null,s.c=null,s.d=null,s.e=null,v(Lg,"RectilinearConvexHull/RectangleEventHandler",1675),m(1677,1,Kt,N1),s.Le=function(n,t){return Lyn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lg,"RectilinearConvexHull/lambda$0$Type",1677),m(1678,1,Kt,D1),s.Le=function(n,t){return Pyn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lg,"RectilinearConvexHull/lambda$1$Type",1678),m(1679,1,Kt,O0),s.Le=function(n,t){return Ryn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lg,"RectilinearConvexHull/lambda$2$Type",1679),m(1680,1,Kt,Ra),s.Le=function(n,t){return $yn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lg,"RectilinearConvexHull/lambda$3$Type",1680),m(1681,1,Kt,us),s.Le=function(n,t){return Gxn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lg,"RectilinearConvexHull/lambda$4$Type",1681),m(1682,1,{},FIe),v(Lg,"Scanline",1682),m(2066,1,{}),v(nh,"AbstractGraphPlacer",2066),m(336,1,{336:1},EOe),s.Df=function(n){return this.Ef(n)?(gn(this.b,u(T(n,(pe(),dd)),22),n),!0):!1},s.Ef=function(n){var t,i,r,c;for(t=u(T(n,(pe(),dd)),22),c=u(mi(Ai,t),22),r=c.Jc();r.Ob();)if(i=u(r.Pb(),22),!u(mi(this.b,i),16).dc())return!1;return!0};var Ai;v(nh,"ComponentGroup",336),m(766,2066,{},goe),s.Ff=function(n){var t,i;for(i=new L(this.a);i.ai&&(p=0,y+=f+r,f=0),h=o.c,J8(o,p+h.a,y+h.b),ma(h),c=k.Math.max(c,p+b.a),f=k.Math.max(f,b.b),p+=b.a+r;t.f.a=c,t.f.b=y+f},s.Hf=function(n,t){var i,r,c,o,l;if(ue(T(t,(Oe(),kM)))===ue((dy(),oM))){for(r=n.Jc();r.Ob();){for(i=u(r.Pb(),37),l=0,o=new L(i.a);o.ai&&!u(T(o,(pe(),dd)),22).Gc((Ne(),Un))||h&&u(T(h,(pe(),dd)),22).Gc((Ne(),Wn))||u(T(o,(pe(),dd)),22).Gc((Ne(),Xn)))&&(S=y,A+=f+r,f=0),b=o.c,u(T(o,(pe(),dd)),22).Gc((Ne(),Un))&&(S=c+r),J8(o,S+b.a,A+b.b),c=k.Math.max(c,S+p.a),u(T(o,dd),22).Gc(bt)&&(y=k.Math.max(y,S+p.a+r)),ma(b),f=k.Math.max(f,p.b),S+=p.a+r,h=o;t.f.a=c,t.f.b=A+f},s.Hf=function(n,t){},v(nh,"ModelOrderRowGraphPlacer",1277),m(1275,1,Kt,W2),s.Le=function(n,t){return Y7n(u(n,37),u(t,37))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(nh,"SimpleRowGraphPlacer/1",1275);var Ytn;m(1245,1,_h,mw),s.Lb=function(n){var t;return t=u(T(u(n,250).b,(Oe(),Wc)),78),!!t&&t.b!=0},s.Fb=function(n){return this===n},s.Mb=function(n){var t;return t=u(T(u(n,250).b,(Oe(),Wc)),78),!!t&&t.b!=0},v(pF,"CompoundGraphPostprocessor/1",1245),m(1244,1,xi,uMe),s.If=function(n,t){qHe(this,u(n,37),t)},v(pF,"CompoundGraphPreprocessor",1244),m(444,1,{444:1},DFe),s.c=!1,v(pF,"CompoundGraphPreprocessor/ExternalPort",444),m(250,1,{250:1},nR),s.Ib=function(){return BV(this.c)+":"+kqe(this.b)},v(pF,"CrossHierarchyEdge",250),m(764,1,Kt,eoe),s.Le=function(n,t){return _Mn(this,u(n,250),u(t,250))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(pF,"CrossHierarchyEdgeComparator",764),m(246,150,{3:1,246:1,105:1,150:1}),s.p=0,v(Zu,"LGraphElement",246),m(17,246,{3:1,17:1,246:1,105:1,150:1},Ww),s.Ib=function(){return kqe(this)};var O7=v(Zu,"LEdge",17);m(37,246,{3:1,20:1,37:1,246:1,105:1,150:1},Phe),s.Ic=function(n){oc(this,n)},s.Jc=function(){return new L(this.b)},s.Ib=function(){return this.b.c.length==0?"G-unlayered"+Qa(this.a):this.a.c.length==0?"G-layered"+Qa(this.b):"G[layerless"+Qa(this.a)+", layers"+Qa(this.b)+"]"};var Wtn=v(Zu,"LGraph",37),Ztn;m(655,1,{}),s.Jf=function(){return this.e.n},s.mf=function(n){return T(this.e,n)},s.Kf=function(){return this.e.o},s.Lf=function(){return this.e.p},s.nf=function(n){return bi(this.e,n)},s.Mf=function(n){this.e.n.a=n.a,this.e.n.b=n.b},s.Nf=function(n){this.e.o.a=n.a,this.e.o.b=n.b},s.Of=function(n){this.e.p=n},v(Zu,"LGraphAdapters/AbstractLShapeAdapter",655),m(464,1,{837:1},kE),s.Pf=function(){var n,t;if(!this.b)for(this.b=e1(this.a.b.c.length),t=new L(this.a.b);t.a0&&sFe((Kn(t-1,n.length),n.charCodeAt(t-1)),oYe);)--t;if(o> ",n),vz(i)),Xt(uo((n.a+="[",n),i.i),"]")),n.a},s.c=!0,s.d=!1;var E3e,j3e,S3e,M3e,A3e,x3e,nin=v(Zu,"LPort",12);m(399,1,a1,j9),s.Ic=function(n){oc(this,n)},s.Jc=function(){var n;return n=new L(this.a.e),new Zke(n)},v(Zu,"LPort/1",399),m(1273,1,Jr,Zke),s.Nb=function(n){nc(this,n)},s.Pb=function(){return u(I(this.a),17).c},s.Ob=function(){return gu(this.a)},s.Qb=function(){gj(this.a)},v(Zu,"LPort/1/1",1273),m(365,1,a1,m5),s.Ic=function(n){oc(this,n)},s.Jc=function(){var n;return n=new L(this.a.g),new noe(n)},v(Zu,"LPort/2",365),m(763,1,Jr,noe),s.Nb=function(n){nc(this,n)},s.Pb=function(){return u(I(this.a),17).d},s.Ob=function(){return gu(this.a)},s.Qb=function(){gj(this.a)},v(Zu,"LPort/2/1",763),m(1266,1,a1,Hxe),s.Ic=function(n){oc(this,n)},s.Jc=function(){return new Ga(this)},v(Zu,"LPort/CombineIter",1266),m(207,1,Jr,Ga),s.Nb=function(n){nc(this,n)},s.Qb=function(){kAe()},s.Ob=function(){return uj(this)},s.Pb=function(){return gu(this.a)?I(this.a):I(this.b)},v(Zu,"LPort/CombineIter/1",207),m(1267,1,_h,Z2),s.Lb=function(n){return zDe(n)},s.Fb=function(n){return this===n},s.Mb=function(n){return hs(),u(n,12).g.c.length!=0},v(Zu,"LPort/lambda$0$Type",1267),m(1268,1,_h,Il),s.Lb=function(n){return FDe(n)},s.Fb=function(n){return this===n},s.Mb=function(n){return hs(),u(n,12).e.c.length!=0},v(Zu,"LPort/lambda$1$Type",1268),m(1269,1,_h,Df),s.Lb=function(n){return hs(),u(n,12).j==(Ne(),Un)},s.Fb=function(n){return this===n},s.Mb=function(n){return hs(),u(n,12).j==(Ne(),Un)},v(Zu,"LPort/lambda$2$Type",1269),m(1270,1,_h,P4),s.Lb=function(n){return hs(),u(n,12).j==(Ne(),Wn)},s.Fb=function(n){return this===n},s.Mb=function(n){return hs(),u(n,12).j==(Ne(),Wn)},v(Zu,"LPort/lambda$3$Type",1270),m(1271,1,_h,x6),s.Lb=function(n){return hs(),u(n,12).j==(Ne(),bt)},s.Fb=function(n){return this===n},s.Mb=function(n){return hs(),u(n,12).j==(Ne(),bt)},v(Zu,"LPort/lambda$4$Type",1271),m(1272,1,_h,ep),s.Lb=function(n){return hs(),u(n,12).j==(Ne(),Xn)},s.Fb=function(n){return this===n},s.Mb=function(n){return hs(),u(n,12).j==(Ne(),Xn)},v(Zu,"LPort/lambda$5$Type",1272),m(25,246,{3:1,20:1,246:1,25:1,105:1,150:1},Xu),s.Ic=function(n){oc(this,n)},s.Jc=function(){return new L(this.a)},s.Ib=function(){return"L_"+pu(this.b.b,this,0)+Qa(this.a)},v(Zu,"Layer",25),m(1659,1,{},O$e),s.b=0,v(Zu,"Tarjan",1659),m(1282,1,{},cMe),v(r0,aYe,1282),m(1286,1,{},$4),s.Kb=function(n){return ru(u(n,84))},v(r0,"ElkGraphImporter/0methodref$connectableShapeToNode$Type",1286),m(1289,1,{},yw),s.Kb=function(n){return ru(u(n,84))},v(r0,"ElkGraphImporter/1methodref$connectableShapeToNode$Type",1289),m(1283,1,rt,eEe),s.Ad=function(n){Rqe(this.a,u(n,125))},v(r0,twe,1283),m(1284,1,rt,nEe),s.Ad=function(n){Rqe(this.a,u(n,125))},v(r0,hYe,1284),m(1285,1,{},Ft),s.Kb=function(n){return new wn(null,new pn(nae(u(n,85)),16))},v(r0,dYe,1285),m(1287,1,Rt,tEe),s.Mb=function(n){return Swn(this.a,u(n,26))},v(r0,bYe,1287),m(1288,1,{},nr),s.Kb=function(n){return new wn(null,new pn(O4n(u(n,85)),16))},v(r0,"ElkGraphImporter/lambda$5$Type",1288),m(1290,1,Rt,iEe),s.Mb=function(n){return Mwn(this.a,u(n,26))},v(r0,"ElkGraphImporter/lambda$7$Type",1290),m(1291,1,Rt,Sr),s.Mb=function(n){return q4n(u(n,85))},v(r0,"ElkGraphImporter/lambda$8$Type",1291),m(1261,1,{},ST);var tin;v(r0,"ElkGraphLayoutTransferrer",1261),m(1262,1,Rt,rEe),s.Mb=function(n){return wpn(this.a,u(n,17))},v(r0,"ElkGraphLayoutTransferrer/lambda$0$Type",1262),m(1263,1,rt,cEe),s.Ad=function(n){sC(),xe(this.a,u(n,17))},v(r0,"ElkGraphLayoutTransferrer/lambda$1$Type",1263),m(1264,1,Rt,uEe),s.Mb=function(n){return tpn(this.a,u(n,17))},v(r0,"ElkGraphLayoutTransferrer/lambda$2$Type",1264),m(1265,1,rt,oEe),s.Ad=function(n){sC(),xe(this.a,u(n,17))},v(r0,"ElkGraphLayoutTransferrer/lambda$3$Type",1265),m(806,1,{},Ile),v(Qn,"BiLinkedHashMultiMap",806),m(1511,1,xi,ms),s.If=function(n,t){w7n(u(n,37),t)},v(Qn,"CommentNodeMarginCalculator",1511),m(1512,1,{},N0),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"CommentNodeMarginCalculator/lambda$0$Type",1512),m(1513,1,rt,S_),s.Ad=function(n){DLn(u(n,9))},v(Qn,"CommentNodeMarginCalculator/lambda$1$Type",1513),m(1514,1,xi,Zn),s.If=function(n,t){BDn(u(n,37),t)},v(Qn,"CommentPostprocessor",1514),m(1515,1,xi,M_),s.If=function(n,t){cRn(u(n,37),t)},v(Qn,"CommentPreprocessor",1515),m(1516,1,xi,R4),s.If=function(n,t){WNn(u(n,37),t)},v(Qn,"ConstraintsPostprocessor",1516),m(1517,1,xi,sq),s.If=function(n,t){F7n(u(n,37),t)},v(Qn,"EdgeAndLayerConstraintEdgeReverser",1517),m(1518,1,xi,A_),s.If=function(n,t){wjn(u(n,37),t)},v(Qn,"EndLabelPostprocessor",1518),m(1519,1,{},x_),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"EndLabelPostprocessor/lambda$0$Type",1519),m(1520,1,Rt,PA),s.Mb=function(n){return e9n(u(n,9))},v(Qn,"EndLabelPostprocessor/lambda$1$Type",1520),m(1521,1,rt,lq),s.Ad=function(n){sAn(u(n,9))},v(Qn,"EndLabelPostprocessor/lambda$2$Type",1521),m(1522,1,xi,fq),s.If=function(n,t){GTn(u(n,37),t)},v(Qn,"EndLabelPreprocessor",1522),m(1523,1,{},wk),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"EndLabelPreprocessor/lambda$0$Type",1523),m(1524,1,rt,NNe),s.Ad=function(n){Bgn(this.a,this.b,this.c,u(n,9))},s.a=0,s.b=0,s.c=!1,v(Qn,"EndLabelPreprocessor/lambda$1$Type",1524),m(1525,1,Rt,kw),s.Mb=function(n){return ue(T(u(n,70),(Oe(),Fh)))===ue((Ua(),rk))},v(Qn,"EndLabelPreprocessor/lambda$2$Type",1525),m(1526,1,rt,sEe),s.Ad=function(n){Vt(this.a,u(n,70))},v(Qn,"EndLabelPreprocessor/lambda$3$Type",1526),m(1527,1,Rt,$A),s.Mb=function(n){return ue(T(u(n,70),(Oe(),Fh)))===ue((Ua(),c3))},v(Qn,"EndLabelPreprocessor/lambda$4$Type",1527),m(1528,1,rt,lEe),s.Ad=function(n){Vt(this.a,u(n,70))},v(Qn,"EndLabelPreprocessor/lambda$5$Type",1528),m(1576,1,xi,TU),s.If=function(n,t){NEn(u(n,37),t)};var iin;v(Qn,"EndLabelSorter",1576),m(1577,1,Kt,RA),s.Le=function(n,t){return Wjn(u(n,455),u(t,455))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"EndLabelSorter/1",1577),m(455,1,{455:1},iIe),v(Qn,"EndLabelSorter/LabelGroup",455),m(1578,1,{},B4),s.Kb=function(n){return oC(),new wn(null,new pn(u(n,25).a,16))},v(Qn,"EndLabelSorter/lambda$0$Type",1578),m(1579,1,Rt,z4),s.Mb=function(n){return oC(),u(n,9).k==(Bn(),Wi)},v(Qn,"EndLabelSorter/lambda$1$Type",1579),m(1580,1,rt,T_),s.Ad=function(n){rTn(u(n,9))},v(Qn,"EndLabelSorter/lambda$2$Type",1580),m(1581,1,Rt,BA),s.Mb=function(n){return oC(),ue(T(u(n,70),(Oe(),Fh)))===ue((Ua(),c3))},v(Qn,"EndLabelSorter/lambda$3$Type",1581),m(1582,1,Rt,C_),s.Mb=function(n){return oC(),ue(T(u(n,70),(Oe(),Fh)))===ue((Ua(),rk))},v(Qn,"EndLabelSorter/lambda$4$Type",1582),m(1529,1,xi,T6),s.If=function(n,t){KLn(this,u(n,37))},s.b=0,s.c=0,v(Qn,"FinalSplineBendpointsCalculator",1529),m(1530,1,{},Ew),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"FinalSplineBendpointsCalculator/lambda$0$Type",1530),m(1531,1,{},zA),s.Kb=function(n){return new wn(null,new Gp(new Gn(Vn(Di(u(n,9)).a.Jc(),new ee))))},v(Qn,"FinalSplineBendpointsCalculator/lambda$1$Type",1531),m(1532,1,Rt,C6),s.Mb=function(n){return!sc(u(n,17))},v(Qn,"FinalSplineBendpointsCalculator/lambda$2$Type",1532),m(1533,1,Rt,np),s.Mb=function(n){return bi(u(n,17),(pe(),Gg))},v(Qn,"FinalSplineBendpointsCalculator/lambda$3$Type",1533),m(1534,1,rt,fEe),s.Ad=function(n){iIn(this.a,u(n,132))},v(Qn,"FinalSplineBendpointsCalculator/lambda$4$Type",1534),m(1535,1,rt,FA),s.Ad=function(n){VO(u(n,17).a)},v(Qn,"FinalSplineBendpointsCalculator/lambda$5$Type",1535),m(790,1,xi,toe),s.If=function(n,t){JPn(this,u(n,37),t)},v(Qn,"GraphTransformer",790),m(502,23,{3:1,35:1,23:1,502:1},ase);var Ite,tD,rin=vt(Qn,"GraphTransformer/Mode",502,At,j5n,Qpn),cin;m(1536,1,xi,pk),s.If=function(n,t){aNn(u(n,37),t)},v(Qn,"HierarchicalNodeResizingProcessor",1536),m(1537,1,xi,O_),s.If=function(n,t){i7n(u(n,37),t)},v(Qn,"HierarchicalPortConstraintProcessor",1537),m(1538,1,Kt,mk),s.Le=function(n,t){return mSn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"HierarchicalPortConstraintProcessor/NodeComparator",1538),m(1539,1,xi,vk),s.If=function(n,t){QIn(u(n,37),t)},v(Qn,"HierarchicalPortDummySizeProcessor",1539),m(1540,1,xi,N_),s.If=function(n,t){l_n(this,u(n,37),t)},s.a=0,v(Qn,"HierarchicalPortOrthogonalEdgeRouter",1540),m(1541,1,Kt,Vh),s.Le=function(n,t){return m2n(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"HierarchicalPortOrthogonalEdgeRouter/1",1541),m(1542,1,Kt,T3),s.Le=function(n,t){return t8n(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"HierarchicalPortOrthogonalEdgeRouter/2",1542),m(1543,1,xi,yk),s.If=function(n,t){Fxn(u(n,37),t)},v(Qn,"HierarchicalPortPositionProcessor",1543),m(1544,1,xi,jT),s.If=function(n,t){HRn(this,u(n,37))},s.a=0,s.c=0;var xH,TH;v(Qn,"HighDegreeNodeLayeringProcessor",1544),m(566,1,{566:1},O6),s.b=-1,s.d=-1,v(Qn,"HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation",566),m(1545,1,{},aq),s.Kb=function(n){return LC(),or(u(n,9))},s.Fb=function(n){return this===n},v(Qn,"HighDegreeNodeLayeringProcessor/lambda$0$Type",1545),m(1546,1,{},HA),s.Kb=function(n){return LC(),Di(u(n,9))},s.Fb=function(n){return this===n},v(Qn,"HighDegreeNodeLayeringProcessor/lambda$1$Type",1546),m(1552,1,xi,JA),s.If=function(n,t){FIn(this,u(n,37),t)},v(Qn,"HyperedgeDummyMerger",1552),m(791,1,{},Yle),s.a=!1,s.b=!1,s.c=!1,v(Qn,"HyperedgeDummyMerger/MergeState",791),m(1553,1,{},N6),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"HyperedgeDummyMerger/lambda$0$Type",1553),m(1554,1,{},kk),s.Kb=function(n){return new wn(null,new pn(u(n,9).j,16))},v(Qn,"HyperedgeDummyMerger/lambda$1$Type",1554),m(1555,1,rt,D_),s.Ad=function(n){u(n,12).p=-1},v(Qn,"HyperedgeDummyMerger/lambda$2$Type",1555),m(1556,1,xi,dq),s.If=function(n,t){zIn(u(n,37),t)},v(Qn,"HypernodesProcessor",1556),m(1557,1,xi,bq),s.If=function(n,t){KIn(u(n,37),t)},v(Qn,"InLayerConstraintProcessor",1557),m(1558,1,xi,GA),s.If=function(n,t){N7n(u(n,37),t)},v(Qn,"InnermostNodeMarginCalculator",1558),m(1559,1,xi,gq),s.If=function(n,t){nRn(this,u(n,37))},s.a=Ir,s.b=Ir,s.c=Ki,s.d=Ki;var YBn=v(Qn,"InteractiveExternalPortPositioner",1559);m(1560,1,{},wq),s.Kb=function(n){return u(n,17).d.i},s.Fb=function(n){return this===n},v(Qn,"InteractiveExternalPortPositioner/lambda$0$Type",1560),m(1561,1,{},aEe),s.Kb=function(n){return v2n(this.a,re(n))},s.Fb=function(n){return this===n},v(Qn,"InteractiveExternalPortPositioner/lambda$1$Type",1561),m(1562,1,{},pq),s.Kb=function(n){return u(n,17).c.i},s.Fb=function(n){return this===n},v(Qn,"InteractiveExternalPortPositioner/lambda$2$Type",1562),m(1563,1,{},hEe),s.Kb=function(n){return y2n(this.a,re(n))},s.Fb=function(n){return this===n},v(Qn,"InteractiveExternalPortPositioner/lambda$3$Type",1563),m(1564,1,{},dEe),s.Kb=function(n){return bpn(this.a,re(n))},s.Fb=function(n){return this===n},v(Qn,"InteractiveExternalPortPositioner/lambda$4$Type",1564),m(1565,1,{},bEe),s.Kb=function(n){return gpn(this.a,re(n))},s.Fb=function(n){return this===n},v(Qn,"InteractiveExternalPortPositioner/lambda$5$Type",1565),m(79,23,{3:1,35:1,23:1,79:1,196:1},gr),s.bg=function(){switch(this.g){case 15:return new Mw;case 22:return new op;case 48:return new ax;case 29:case 36:return new Mq;case 33:return new ms;case 43:return new Zn;case 1:return new M_;case 42:return new R4;case 57:return new toe((f8(),tD));case 0:return new toe((f8(),Ite));case 2:return new sq;case 55:return new A_;case 34:return new fq;case 52:return new T6;case 56:return new pk;case 13:return new O_;case 39:return new vk;case 45:return new N_;case 41:return new yk;case 9:return new jT;case 50:return new gOe;case 38:return new JA;case 44:return new dq;case 28:return new bq;case 31:return new GA;case 3:return new gq;case 18:return new hq;case 30:return new mq;case 5:return new CU;case 51:return new kq;case 35:return new h9;case 37:return new Aq;case 53:return new TU;case 11:return new I_;case 7:return new OU;case 40:return new xq;case 46:return new Tq;case 16:return new Cq;case 10:return new pTe;case 49:return new _q;case 21:return new Iq;case 23:return new qP((Mg(),LM));case 8:return new UA;case 12:return new Pq;case 4:return new L_;case 19:return new oP;case 17:return new F_;case 54:return new _6;case 6:return new Jq;case 25:return new sMe;case 26:return new lx;case 47:return new VA;case 32:return new tNe;case 14:return new K_;case 27:return new Yq;case 20:return new P6;case 24:return new qP((Mg(),IJ));default:throw $(new Jn(iee+(this.f!=null?this.f:""+this.g)))}};var T3e,C3e,O3e,N3e,D3e,_3e,I3e,L3e,P3e,$3e,R3e,Qv,CH,OH,B3e,z3e,F3e,H3e,J3e,G3e,q3e,lM,U3e,X3e,V3e,K3e,Q3e,Lte,NH,DH,Y3e,_H,IH,LH,N7,Im,Lm,W3e,PH,$H,Z3e,RH,BH,eve,nve,tve,ive,zH,Pte,Jy,FH,HH,JH,GH,rve,cve,uve,ove,WBn=vt(Qn,ree,79,At,$Ue,Ypn),uin;m(1566,1,xi,hq),s.If=function(n,t){W$n(u(n,37),t)},v(Qn,"InvertedPortProcessor",1566),m(1567,1,xi,mq),s.If=function(n,t){Y_n(u(n,37),t)},v(Qn,"LabelAndNodeSizeProcessor",1567),m(1568,1,Rt,vq),s.Mb=function(n){return u(n,9).k==(Bn(),Wi)},v(Qn,"LabelAndNodeSizeProcessor/lambda$0$Type",1568),m(1569,1,Rt,__),s.Mb=function(n){return u(n,9).k==(Bn(),pr)},v(Qn,"LabelAndNodeSizeProcessor/lambda$1$Type",1569),m(1570,1,rt,INe),s.Ad=function(n){zgn(this.b,this.a,this.c,u(n,9))},s.a=!1,s.c=!1,v(Qn,"LabelAndNodeSizeProcessor/lambda$2$Type",1570),m(1571,1,xi,CU),s.If=function(n,t){O$n(u(n,37),t)};var oin;v(Qn,"LabelDummyInserter",1571),m(1572,1,_h,yq),s.Lb=function(n){return ue(T(u(n,70),(Oe(),Fh)))===ue((Ua(),ik))},s.Fb=function(n){return this===n},s.Mb=function(n){return ue(T(u(n,70),(Oe(),Fh)))===ue((Ua(),ik))},v(Qn,"LabelDummyInserter/1",1572),m(1573,1,xi,kq),s.If=function(n,t){p$n(u(n,37),t)},v(Qn,"LabelDummyRemover",1573),m(1574,1,Rt,Eq),s.Mb=function(n){return Re($e(T(u(n,70),(Oe(),s4))))},v(Qn,"LabelDummyRemover/lambda$0$Type",1574),m(1332,1,xi,h9),s.If=function(n,t){a$n(this,u(n,37),t)},s.a=null;var $te;v(Qn,"LabelDummySwitcher",1332),m(294,1,{294:1},_Xe),s.c=0,s.d=null,s.f=0,v(Qn,"LabelDummySwitcher/LabelDummyInfo",294),m(1333,1,{},jq),s.Kb=function(n){return uy(),new wn(null,new pn(u(n,25).a,16))},v(Qn,"LabelDummySwitcher/lambda$0$Type",1333),m(1334,1,Rt,qA),s.Mb=function(n){return uy(),u(n,9).k==(Bn(),Uu)},v(Qn,"LabelDummySwitcher/lambda$1$Type",1334),m(1335,1,{},gEe),s.Kb=function(n){return ipn(this.a,u(n,9))},v(Qn,"LabelDummySwitcher/lambda$2$Type",1335),m(1336,1,rt,wEe),s.Ad=function(n){c4n(this.a,u(n,294))},v(Qn,"LabelDummySwitcher/lambda$3$Type",1336),m(1337,1,Kt,Sq),s.Le=function(n,t){return Ivn(u(n,294),u(t,294))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"LabelDummySwitcher/lambda$4$Type",1337),m(789,1,xi,Mq),s.If=function(n,t){P9n(u(n,37),t)},v(Qn,"LabelManagementProcessor",789),m(1575,1,xi,Aq),s.If=function(n,t){TDn(u(n,37),t)},v(Qn,"LabelSideSelector",1575),m(1583,1,xi,I_),s.If=function(n,t){dLn(u(n,37),t)},v(Qn,"LayerConstraintPostprocessor",1583),m(1584,1,xi,OU),s.If=function(n,t){aOn(u(n,37),t)};var sve;v(Qn,"LayerConstraintPreprocessor",1584),m(367,23,{3:1,35:1,23:1,367:1},g$);var iD,qH,UH,Rte,sin=vt(Qn,"LayerConstraintPreprocessor/HiddenNodeConnections",367,At,b6n,_mn),lin;m(1585,1,xi,xq),s.If=function(n,t){NPn(u(n,37),t)},v(Qn,"LayerSizeAndGraphHeightCalculator",1585),m(1586,1,xi,Tq),s.If=function(n,t){hNn(u(n,37),t)},v(Qn,"LongEdgeJoiner",1586),m(1587,1,xi,Cq),s.If=function(n,t){oPn(u(n,37),t)},v(Qn,"LongEdgeSplitter",1587),m(1588,1,xi,pTe),s.If=function(n,t){G$n(this,u(n,37),t)},s.e=0,s.f=0,s.j=0,s.k=0,s.n=0,s.o=0;var fin,ain;v(Qn,"NodePromotion",1588),m(1589,1,Kt,Oq),s.Le=function(n,t){return Lkn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"NodePromotion/1",1589),m(1590,1,Kt,Nq),s.Le=function(n,t){return Pkn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"NodePromotion/2",1590),m(1591,1,{},Dq),s.Kb=function(n){return u(n,49),Z$(),Ln(),!0},s.Fb=function(n){return this===n},v(Qn,"NodePromotion/lambda$0$Type",1591),m(1592,1,{},pEe),s.Kb=function(n){return F5n(this.a,u(n,49))},s.Fb=function(n){return this===n},s.a=0,v(Qn,"NodePromotion/lambda$1$Type",1592),m(1593,1,{},mEe),s.Kb=function(n){return z5n(this.a,u(n,49))},s.Fb=function(n){return this===n},s.a=0,v(Qn,"NodePromotion/lambda$2$Type",1593),m(1594,1,xi,_q),s.If=function(n,t){_Rn(u(n,37),t)},v(Qn,"NorthSouthPortPostprocessor",1594),m(1595,1,xi,Iq),s.If=function(n,t){BRn(u(n,37),t)},v(Qn,"NorthSouthPortPreprocessor",1595),m(1596,1,Kt,Lq),s.Le=function(n,t){return ekn(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"NorthSouthPortPreprocessor/lambda$0$Type",1596),m(1597,1,xi,UA),s.If=function(n,t){OIn(u(n,37),t)},v(Qn,"PartitionMidprocessor",1597),m(1598,1,Rt,D6),s.Mb=function(n){return bi(u(n,9),(Oe(),Jm))},v(Qn,"PartitionMidprocessor/lambda$0$Type",1598),m(1599,1,rt,vEe),s.Ad=function(n){G4n(this.a,u(n,9))},v(Qn,"PartitionMidprocessor/lambda$1$Type",1599),m(1600,1,xi,Pq),s.If=function(n,t){_Nn(u(n,37),t)},v(Qn,"PartitionPostprocessor",1600),m(1601,1,xi,L_),s.If=function(n,t){P_n(u(n,37),t)},v(Qn,"PartitionPreprocessor",1601),m(1602,1,Rt,P_),s.Mb=function(n){return bi(u(n,9),(Oe(),Jm))},v(Qn,"PartitionPreprocessor/lambda$0$Type",1602),m(1603,1,Rt,$_),s.Mb=function(n){return bi(u(n,9),(Oe(),Jm))},v(Qn,"PartitionPreprocessor/lambda$1$Type",1603),m(1604,1,{},R_),s.Kb=function(n){return new wn(null,new Gp(new Gn(Vn(Di(u(n,9)).a.Jc(),new ee))))},v(Qn,"PartitionPreprocessor/lambda$2$Type",1604),m(1605,1,Rt,yEe),s.Mb=function(n){return jgn(this.a,u(n,17))},v(Qn,"PartitionPreprocessor/lambda$3$Type",1605),m(1606,1,rt,B_),s.Ad=function(n){dkn(u(n,17))},v(Qn,"PartitionPreprocessor/lambda$4$Type",1606),m(1607,1,Rt,kEe),s.Mb=function(n){return u4n(this.a,u(n,9))},s.a=0,v(Qn,"PartitionPreprocessor/lambda$5$Type",1607),m(1608,1,xi,oP),s.If=function(n,t){fIn(u(n,37),t)};var lve,hin,din,bin,fve,ave;v(Qn,"PortListSorter",1608),m(1609,1,{},F4),s.Kb=function(n){return p8(),u(n,12).e},v(Qn,"PortListSorter/lambda$0$Type",1609),m(1610,1,{},$q),s.Kb=function(n){return p8(),u(n,12).g},v(Qn,"PortListSorter/lambda$1$Type",1610),m(1611,1,Kt,Rq),s.Le=function(n,t){return oPe(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"PortListSorter/lambda$2$Type",1611),m(1612,1,Kt,Bq),s.Le=function(n,t){return AMn(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"PortListSorter/lambda$3$Type",1612),m(1613,1,Kt,z_),s.Le=function(n,t){return cVe(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"PortListSorter/lambda$4$Type",1613),m(1614,1,xi,F_),s.If=function(n,t){mOn(u(n,37),t)},v(Qn,"PortSideProcessor",1614),m(1615,1,xi,_6),s.If=function(n,t){E_n(u(n,37),t)},v(Qn,"ReversedEdgeRestorer",1615),m(1620,1,xi,sMe),s.If=function(n,t){lMn(this,u(n,37),t)},v(Qn,"SelfLoopPortRestorer",1620),m(1621,1,{},I6),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"SelfLoopPortRestorer/lambda$0$Type",1621),m(1622,1,Rt,zq),s.Mb=function(n){return u(n,9).k==(Bn(),Wi)},v(Qn,"SelfLoopPortRestorer/lambda$1$Type",1622),m(1623,1,Rt,Ek),s.Mb=function(n){return bi(u(n,9),(pe(),R2))},v(Qn,"SelfLoopPortRestorer/lambda$2$Type",1623),m(1624,1,{},H_),s.Kb=function(n){return u(T(u(n,9),(pe(),R2)),338)},v(Qn,"SelfLoopPortRestorer/lambda$3$Type",1624),m(1625,1,rt,EEe),s.Ad=function(n){mTn(this.a,u(n,338))},v(Qn,"SelfLoopPortRestorer/lambda$4$Type",1625),m(792,1,rt,XA),s.Ad=function(n){CTn(u(n,107))},v(Qn,"SelfLoopPortRestorer/lambda$5$Type",792),m(1627,1,xi,VA),s.If=function(n,t){kSn(u(n,37),t)},v(Qn,"SelfLoopPostProcessor",1627),m(1628,1,{},KA),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"SelfLoopPostProcessor/lambda$0$Type",1628),m(1629,1,Rt,J_),s.Mb=function(n){return u(n,9).k==(Bn(),Wi)},v(Qn,"SelfLoopPostProcessor/lambda$1$Type",1629),m(1630,1,Rt,G_),s.Mb=function(n){return bi(u(n,9),(pe(),R2))},v(Qn,"SelfLoopPostProcessor/lambda$2$Type",1630),m(1631,1,rt,q_),s.Ad=function(n){MAn(u(n,9))},v(Qn,"SelfLoopPostProcessor/lambda$3$Type",1631),m(1632,1,{},Fq),s.Kb=function(n){return new wn(null,new pn(u(n,107).f,1))},v(Qn,"SelfLoopPostProcessor/lambda$4$Type",1632),m(1633,1,rt,jEe),s.Ad=function(n){s6n(this.a,u(n,341))},v(Qn,"SelfLoopPostProcessor/lambda$5$Type",1633),m(1634,1,Rt,Hq),s.Mb=function(n){return!!u(n,107).i},v(Qn,"SelfLoopPostProcessor/lambda$6$Type",1634),m(1635,1,rt,SEe),s.Ad=function(n){zbn(this.a,u(n,107))},v(Qn,"SelfLoopPostProcessor/lambda$7$Type",1635),m(1616,1,xi,Jq),s.If=function(n,t){YOn(u(n,37),t)},v(Qn,"SelfLoopPreProcessor",1616),m(1617,1,{},Gq),s.Kb=function(n){return new wn(null,new pn(u(n,107).f,1))},v(Qn,"SelfLoopPreProcessor/lambda$0$Type",1617),m(1618,1,{},qq),s.Kb=function(n){return u(n,341).a},v(Qn,"SelfLoopPreProcessor/lambda$1$Type",1618),m(1619,1,rt,I1),s.Ad=function(n){Hwn(u(n,17))},v(Qn,"SelfLoopPreProcessor/lambda$2$Type",1619),m(1636,1,xi,tNe),s.If=function(n,t){nTn(this,u(n,37),t)},v(Qn,"SelfLoopRouter",1636),m(1637,1,{},L6),s.Kb=function(n){return new wn(null,new pn(u(n,25).a,16))},v(Qn,"SelfLoopRouter/lambda$0$Type",1637),m(1638,1,Rt,U_),s.Mb=function(n){return u(n,9).k==(Bn(),Wi)},v(Qn,"SelfLoopRouter/lambda$1$Type",1638),m(1639,1,Rt,X_),s.Mb=function(n){return bi(u(n,9),(pe(),R2))},v(Qn,"SelfLoopRouter/lambda$2$Type",1639),m(1640,1,{},V_),s.Kb=function(n){return u(T(u(n,9),(pe(),R2)),338)},v(Qn,"SelfLoopRouter/lambda$3$Type",1640),m(1641,1,rt,Jxe),s.Ad=function(n){R4n(this.a,this.b,u(n,338))},v(Qn,"SelfLoopRouter/lambda$4$Type",1641),m(1642,1,xi,K_),s.If=function(n,t){gDn(u(n,37),t)},v(Qn,"SemiInteractiveCrossMinProcessor",1642),m(1643,1,Rt,QA),s.Mb=function(n){return u(n,9).k==(Bn(),Wi)},v(Qn,"SemiInteractiveCrossMinProcessor/lambda$0$Type",1643),m(1644,1,Rt,Uq),s.Mb=function(n){return mDe(u(n,9))._b((Oe(),Um))},v(Qn,"SemiInteractiveCrossMinProcessor/lambda$1$Type",1644),m(1645,1,Kt,H4),s.Le=function(n,t){return d7n(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Qn,"SemiInteractiveCrossMinProcessor/lambda$2$Type",1645),m(1646,1,{},YA),s.Te=function(n,t){return J4n(u(n,9),u(t,9))},v(Qn,"SemiInteractiveCrossMinProcessor/lambda$3$Type",1646),m(1648,1,xi,P6),s.If=function(n,t){KPn(u(n,37),t)},v(Qn,"SortByInputModelProcessor",1648),m(1649,1,Rt,WA),s.Mb=function(n){return u(n,12).g.c.length!=0},v(Qn,"SortByInputModelProcessor/lambda$0$Type",1649),m(1650,1,rt,MEe),s.Ad=function(n){ITn(this.a,u(n,12))},v(Qn,"SortByInputModelProcessor/lambda$1$Type",1650),m(1729,804,{},NBe),s.bf=function(n){var t,i,r,c;switch(this.c=n,this.a.g){case 2:t=new Te,tr(oi(new wn(null,new pn(this.c.a.b,16)),new tI),new Vxe(this,t)),KO(this,new C3),Ao(t,new J4),t.c.length=0,tr(oi(new wn(null,new pn(this.c.a.b,16)),new ZA),new xEe(t)),KO(this,new Y_),Ao(t,new O3),t.c.length=0,i=OCe(qQ(Up(new wn(null,new pn(this.c.a.b,16)),new TEe(this))),new W_),tr(new wn(null,new pn(this.c.a.a,16)),new qxe(i,t)),KO(this,new eI),Ao(t,new Xq),t.c.length=0;break;case 3:r=new Te,KO(this,new Q_),c=OCe(qQ(Up(new wn(null,new pn(this.c.a.b,16)),new AEe(this))),new Z_),tr(oi(new wn(null,new pn(this.c.a.b,16)),new Vq),new Xxe(c,r)),KO(this,new Kq),Ao(r,new nI),r.c.length=0;break;default:throw $(new QSe)}},s.b=0,v(fr,"EdgeAwareScanlineConstraintCalculation",1729),m(1730,1,_h,Q_),s.Lb=function(n){return X(u(n,60).g,156)},s.Fb=function(n){return this===n},s.Mb=function(n){return X(u(n,60).g,156)},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$0$Type",1730),m(1731,1,{},AEe),s.We=function(n){return oCn(this.a,u(n,60))},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$1$Type",1731),m(1739,1,uF,Gxe),s.be=function(){eS(this.a,this.b,-1)},s.b=0,v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$10$Type",1739),m(1741,1,_h,C3),s.Lb=function(n){return X(u(n,60).g,156)},s.Fb=function(n){return this===n},s.Mb=function(n){return X(u(n,60).g,156)},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$11$Type",1741),m(1742,1,rt,J4),s.Ad=function(n){u(n,375).be()},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$12$Type",1742),m(1743,1,Rt,ZA),s.Mb=function(n){return X(u(n,60).g,9)},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$13$Type",1743),m(1745,1,rt,xEe),s.Ad=function(n){QEn(this.a,u(n,60))},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$14$Type",1745),m(1744,1,uF,Yxe),s.be=function(){eS(this.b,this.a,-1)},s.a=0,v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$15$Type",1744),m(1746,1,_h,Y_),s.Lb=function(n){return X(u(n,60).g,9)},s.Fb=function(n){return this===n},s.Mb=function(n){return X(u(n,60).g,9)},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$16$Type",1746),m(1747,1,rt,O3),s.Ad=function(n){u(n,375).be()},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$17$Type",1747),m(1748,1,{},TEe),s.We=function(n){return sCn(this.a,u(n,60))},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$18$Type",1748),m(1749,1,{},W_),s.Ue=function(){return 0},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$19$Type",1749),m(1732,1,{},Z_),s.Ue=function(){return 0},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$2$Type",1732),m(1751,1,rt,qxe),s.Ad=function(n){Avn(this.a,this.b,u(n,320))},s.a=0,v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$20$Type",1751),m(1750,1,uF,Uxe),s.be=function(){oUe(this.a,this.b,-1)},s.b=0,v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$21$Type",1750),m(1752,1,_h,eI),s.Lb=function(n){return u(n,60),!0},s.Fb=function(n){return this===n},s.Mb=function(n){return u(n,60),!0},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$22$Type",1752),m(1753,1,rt,Xq),s.Ad=function(n){u(n,375).be()},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$23$Type",1753),m(1733,1,Rt,Vq),s.Mb=function(n){return X(u(n,60).g,9)},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$3$Type",1733),m(1735,1,rt,Xxe),s.Ad=function(n){xvn(this.a,this.b,u(n,60))},s.a=0,v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$4$Type",1735),m(1734,1,uF,Wxe),s.be=function(){eS(this.b,this.a,-1)},s.a=0,v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$5$Type",1734),m(1736,1,_h,Kq),s.Lb=function(n){return u(n,60),!0},s.Fb=function(n){return this===n},s.Mb=function(n){return u(n,60),!0},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$6$Type",1736),m(1737,1,rt,nI),s.Ad=function(n){u(n,375).be()},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$7$Type",1737),m(1738,1,Rt,tI),s.Mb=function(n){return X(u(n,60).g,156)},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$8$Type",1738),m(1740,1,rt,Vxe),s.Ad=function(n){P8n(this.a,this.b,u(n,60))},v(fr,"EdgeAwareScanlineConstraintCalculation/lambda$9$Type",1740),m(1547,1,xi,gOe),s.If=function(n,t){fPn(this,u(n,37),t)};var gin;v(fr,"HorizontalGraphCompactor",1547),m(1548,1,{},CEe),s.df=function(n,t){var i,r,c;return vhe(n,t)||(i=hv(n),r=hv(t),i&&i.k==(Bn(),pr)||r&&r.k==(Bn(),pr))?0:(c=u(T(this.a.a,(pe(),c4)),316),j2n(c,i?i.k:(Bn(),br),r?r.k:(Bn(),br)))},s.ef=function(n,t){var i,r,c;return vhe(n,t)?1:(i=hv(n),r=hv(t),c=u(T(this.a.a,(pe(),c4)),316),fle(c,i?i.k:(Bn(),br),r?r.k:(Bn(),br)))},v(fr,"HorizontalGraphCompactor/1",1548),m(1549,1,{},ex),s.cf=function(n,t){return LE(),n.a.i==0},v(fr,"HorizontalGraphCompactor/lambda$0$Type",1549),m(1550,1,{},OEe),s.cf=function(n,t){return U4n(this.a,n,t)},v(fr,"HorizontalGraphCompactor/lambda$1$Type",1550),m(1696,1,{},lRe);var win,pin;v(fr,"LGraphToCGraphTransformer",1696),m(1704,1,Rt,D0),s.Mb=function(n){return n!=null},v(fr,"LGraphToCGraphTransformer/0methodref$nonNull$Type",1704),m(1697,1,{},jk),s.Kb=function(n){return al(),fu(T(u(u(n,60).g,9),(pe(),pi)))},v(fr,"LGraphToCGraphTransformer/lambda$0$Type",1697),m(1698,1,{},Md),s.Kb=function(n){return al(),jFe(u(u(n,60).g,156))},v(fr,"LGraphToCGraphTransformer/lambda$1$Type",1698),m(1707,1,Rt,G4),s.Mb=function(n){return al(),X(u(n,60).g,9)},v(fr,"LGraphToCGraphTransformer/lambda$10$Type",1707),m(1708,1,rt,nx),s.Ad=function(n){$4n(u(n,60))},v(fr,"LGraphToCGraphTransformer/lambda$11$Type",1708),m(1709,1,Rt,Sk),s.Mb=function(n){return al(),X(u(n,60).g,156)},v(fr,"LGraphToCGraphTransformer/lambda$12$Type",1709),m(1713,1,rt,Mk),s.Ad=function(n){gEn(u(n,60))},v(fr,"LGraphToCGraphTransformer/lambda$13$Type",1713),m(1710,1,rt,NEe),s.Ad=function(n){mwn(this.a,u(n,8))},s.a=0,v(fr,"LGraphToCGraphTransformer/lambda$14$Type",1710),m(1711,1,rt,DEe),s.Ad=function(n){ywn(this.a,u(n,119))},s.a=0,v(fr,"LGraphToCGraphTransformer/lambda$15$Type",1711),m(1712,1,rt,_Ee),s.Ad=function(n){vwn(this.a,u(n,8))},s.a=0,v(fr,"LGraphToCGraphTransformer/lambda$16$Type",1712),m(1714,1,{},tx),s.Kb=function(n){return al(),new wn(null,new Gp(new Gn(Vn(Di(u(n,9)).a.Jc(),new ee))))},v(fr,"LGraphToCGraphTransformer/lambda$17$Type",1714),m(1715,1,Rt,N3),s.Mb=function(n){return al(),sc(u(n,17))},v(fr,"LGraphToCGraphTransformer/lambda$18$Type",1715),m(1716,1,rt,IEe),s.Ad=function(n){h8n(this.a,u(n,17))},v(fr,"LGraphToCGraphTransformer/lambda$19$Type",1716),m(1700,1,rt,LEe),s.Ad=function(n){Fyn(this.a,u(n,156))},v(fr,"LGraphToCGraphTransformer/lambda$2$Type",1700),m(1717,1,{},iI),s.Kb=function(n){return al(),new wn(null,new pn(u(n,25).a,16))},v(fr,"LGraphToCGraphTransformer/lambda$20$Type",1717),m(1718,1,{},Ak),s.Kb=function(n){return al(),new wn(null,new Gp(new Gn(Vn(Di(u(n,9)).a.Jc(),new ee))))},v(fr,"LGraphToCGraphTransformer/lambda$21$Type",1718),m(1719,1,{},q4),s.Kb=function(n){return al(),u(T(u(n,17),(pe(),Gg)),16)},v(fr,"LGraphToCGraphTransformer/lambda$22$Type",1719),m(1720,1,Rt,Qq),s.Mb=function(n){return S2n(u(n,16))},v(fr,"LGraphToCGraphTransformer/lambda$23$Type",1720),m(1721,1,rt,PEe),s.Ad=function(n){lCn(this.a,u(n,16))},v(fr,"LGraphToCGraphTransformer/lambda$24$Type",1721),m(1722,1,{},L1),s.Kb=function(n){return al(),new wn(null,new Gp(new Gn(Vn(Di(u(n,9)).a.Jc(),new ee))))},v(fr,"LGraphToCGraphTransformer/lambda$25$Type",1722),m(1723,1,Rt,ix),s.Mb=function(n){return al(),sc(u(n,17))},v(fr,"LGraphToCGraphTransformer/lambda$26$Type",1723),m(1725,1,rt,$Ee),s.Ad=function(n){c7n(this.a,u(n,17))},v(fr,"LGraphToCGraphTransformer/lambda$27$Type",1725),m(1724,1,rt,REe),s.Ad=function(n){agn(this.a,u(n,70))},s.a=0,v(fr,"LGraphToCGraphTransformer/lambda$28$Type",1724),m(1699,1,rt,Kxe),s.Ad=function(n){F6n(this.a,this.b,u(n,156))},v(fr,"LGraphToCGraphTransformer/lambda$3$Type",1699),m(1701,1,{},jw),s.Kb=function(n){return al(),new wn(null,new pn(u(n,25).a,16))},v(fr,"LGraphToCGraphTransformer/lambda$4$Type",1701),m(1702,1,{},rI),s.Kb=function(n){return al(),new wn(null,new Gp(new Gn(Vn(Di(u(n,9)).a.Jc(),new ee))))},v(fr,"LGraphToCGraphTransformer/lambda$5$Type",1702),m(1703,1,{},xk),s.Kb=function(n){return al(),u(T(u(n,17),(pe(),Gg)),16)},v(fr,"LGraphToCGraphTransformer/lambda$6$Type",1703),m(1705,1,rt,BEe),s.Ad=function(n){yCn(this.a,u(n,16))},v(fr,"LGraphToCGraphTransformer/lambda$8$Type",1705),m(1706,1,rt,Qxe),s.Ad=function(n){Jwn(this.a,this.b,u(n,156))},v(fr,"LGraphToCGraphTransformer/lambda$9$Type",1706),m(1695,1,{},D3),s.af=function(n){var t,i,r,c,o;for(this.a=n,this.d=new pX,this.c=oe(Kme,xn,124,this.a.a.a.c.length,0,1),this.b=0,i=new L(this.a.a.a);i.a=_&&(xe(o,me(p)),K=k.Math.max(K,ie[p-1]-y),f+=N,R+=ie[p-1]-R,y=ie[p-1],N=h[p]),N=k.Math.max(N,h[p]),++p;f+=N}A=k.Math.min(1/K,1/t.b/f),A>r&&(r=A,i=o)}return i},s.ng=function(){return!1},v(Lh,"MSDCutIndexHeuristic",803),m(1647,1,xi,Yq),s.If=function(n,t){bLn(u(n,37),t)},v(Lh,"SingleEdgeGraphWrapper",1647),m(231,23,{3:1,35:1,23:1,231:1},HE);var Wv,I7,L7,$m,fM,Zv,P7=vt(Ou,"CenterEdgeLabelPlacementStrategy",231,At,R9n,tmn),Cin;m(422,23,{3:1,35:1,23:1,422:1},hse);var dve,Kte,bve=vt(Ou,"ConstraintCalculationStrategy",422,At,s5n,imn),Oin;m(301,23,{3:1,35:1,23:1,301:1,188:1,196:1},p$),s.bg=function(){return wUe(this)},s.og=function(){return wUe(this)};var cD,aM,gve,wve,pve=vt(Ou,"CrossingMinimizationStrategy",301,At,g6n,rmn),Nin;m(350,23,{3:1,35:1,23:1,350:1},QX);var mve,Qte,YH,vve=vt(Ou,"CuttingStrategy",350,At,W5n,cmn),Din;m(267,23,{3:1,35:1,23:1,267:1,188:1,196:1},Q3),s.bg=function(){return yXe(this)},s.og=function(){return yXe(this)};var Yte,yve,Wte,Zte,eie,nie,tie,iie,uD,kve=vt(Ou,"CycleBreakingStrategy",267,At,W8n,umn),_in;m(419,23,{3:1,35:1,23:1,419:1},dse);var WH,Eve,jve=vt(Ou,"DirectionCongruency",419,At,l5n,omn),Iin;m(449,23,{3:1,35:1,23:1,449:1},WX);var $7,rie,e4,Lin=vt(Ou,"EdgeConstraint",449,At,Z5n,smn),Pin;m(284,23,{3:1,35:1,23:1,284:1},qE);var cie,uie,oie,sie,ZH,lie,Sve=vt(Ou,"EdgeLabelSideSelection",284,At,B9n,lmn),$in;m(476,23,{3:1,35:1,23:1,476:1},bse);var eJ,Mve,Ave=vt(Ou,"EdgeStraighteningStrategy",476,At,f5n,fmn),Rin;m(282,23,{3:1,35:1,23:1,282:1},JE);var fie,xve,Tve,nJ,Cve,Ove,Nve=vt(Ou,"FixedAlignment",282,At,z9n,amn),Bin;m(283,23,{3:1,35:1,23:1,283:1},GE);var Dve,_ve,Ive,Lve,hM,Pve,$ve=vt(Ou,"GraphCompactionStrategy",283,At,F9n,hmn),zin;m(261,23,{3:1,35:1,23:1,261:1},Op);var R7,tJ,B7,rf,dM,iJ,z7,n4,rJ,bM,aie=vt(Ou,"GraphProperties",261,At,M7n,dmn),Fin;m(302,23,{3:1,35:1,23:1,302:1},ZX);var oD,hie,die,bie=vt(Ou,"GreedySwitchType",302,At,eyn,bmn),Hin;m(329,23,{3:1,35:1,23:1,329:1},eV);var Rm,Rve,sD,gie=vt(Ou,"GroupOrderStrategy",329,At,nyn,gmn),Jin;m(315,23,{3:1,35:1,23:1,315:1},nV);var Gy,lD,t4,Gin=vt(Ou,"InLayerConstraint",315,At,tyn,wmn),qin;m(420,23,{3:1,35:1,23:1,420:1},gse);var wie,Bve,zve=vt(Ou,"InteractiveReferencePoint",420,At,a5n,pmn),Uin,Fve,qy,L2,fD,cJ,Hve,Jve,uJ,Gve,Uy,oJ,gM,Xy,dd,pie,sJ,_u,qve,xb,po,mie,vie,aD,Jg,P2,Vy,Uve,Xin,Ky,hD,Bm,Na,jf,yie,i4,Tb,Oi,pi,Xve,Vve,Kve,Qve,Yve,kie,lJ,Ss,$2,Eie,Qy,wM,o0,r4,R2,c4,u4,F7,Gg,Wve,jie,Sie,pM,Yy,fJ,Wy,o4;m(165,23,{3:1,35:1,23:1,165:1},dC);var mM,bd,vM,qg,dD,Zve=vt(Ou,"LayerConstraint",165,At,f9n,mmn),Vin;m(423,23,{3:1,35:1,23:1,423:1},wse);var Mie,Aie,e4e=vt(Ou,"LayerUnzippingStrategy",423,At,h5n,vmn),Kin;m(843,1,eh,TT),s.tf=function(n){Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,bwe),""),"Direction Congruency"),"Specifies how drawings of the same graph with different layout directions compare to each other: either a natural reading direction is preserved or the drawings are rotated versions of each other."),d4e),(Og(),Bi)),jve),nn((Th(),Sn))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,gwe),""),"Feedback Edges"),"Whether feedback edges should be highlighted by routing around the nodes."),(Ln(),!1)),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,vF),""),"Interactive Reference Point"),"Determines which point of a node is considered by interactive layout phases."),v4e),Bi),zve),nn(Sn)))),Gi(n,vF,LN,Zrn),Gi(n,vF,LS,Wrn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,wwe),""),"Merge Edges"),"Edges that have no ports are merged so they touch the connected nodes at the same points. When this option is disabled, one port is created for each edge directly connected to a node. When it is enabled, all such incoming edges share an input port, and all outgoing edges share an output port."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,pwe),""),"Merge Hierarchy-Crossing Edges"),"If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible. They are broken by the algorithm, with hierarchical ports inserted as required. Usually, one such port is created for each edge at each hierarchy crossing point. With this option set to true, we try to create as few hierarchical ports as possible in the process. In particular, all edges that form a hyperedge can share a port."),!0),xr),Yi),nn(Sn)))),Ye(n,new Je(dgn(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,mwe),""),"Allow Non-Flow Ports To Switch Sides"),"Specifies whether non-flow ports may switch sides if their node's port constraints are either FIXED_SIDE or FIXED_ORDER. A non-flow port is a port on a side that is not part of the currently configured layout flow. For instance, given a left-to-right layout direction, north and south ports would be considered non-flow ports. Further note that the underlying criterium whether to switch sides or not solely relies on the minimization of edge crossings. Hence, edge length and other aesthetics criteria are not addressed."),!1),xr),Yi),nn(h0)),z(B(Be,1),Ae,2,6,["org.eclipse.elk.layered.northOrSouthPort"])))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,vwe),""),"Port Sorting Strategy"),"Only relevant for nodes with FIXED_SIDE port constraints. Determines the way a node's ports are distributed on the sides of a node if their order is not prescribed. The option is set on parent nodes."),O4e),Bi),F5e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,ywe),""),"Thoroughness"),"How much effort should be spent to produce a nice layout."),me(7)),gc),Mr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,kwe),""),"Add Unnecessary Bendpoints"),"Adds bend points even if an edge does not change direction. If true, each long edge dummy will contribute a bend point to its edges and hierarchy-crossing edges will always get a bend point where they cross hierarchy boundaries. By default, bend points are only added where an edge changes direction."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Ewe),""),"Generate Position and Layer IDs"),"If enabled position id and layer id are generated, which are usually only used internally when setting the interactiveLayout option. This option should be specified on the root node."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,LN),"cycleBreaking"),"Cycle Breaking Strategy"),"Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right)."),h4e),Bi),kve),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,PN),Bee),"Node Layering Strategy"),"Strategy for node layering."),E4e),Bi),C5e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,jwe),Bee),"Layer Constraint"),"Determines a constraint on the placement of the node regarding the layering."),y4e),Bi),Zve),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Swe),Bee),"Layer Choice Constraint"),"Allows to set a constraint regarding the layer placement of a node. Let i be the value of teh constraint. Assumed the drawing has n layers and i < n. If set to i, it expresses that the node should be placed in i-th layer. Should i>=n be true then the node is placed in the last layer of the drawing. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),null),gc),Mr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Mwe),Bee),"Layer ID"),"Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),me(-1)),gc),Mr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,oee),MYe),"Upper Bound On Width [MinWidth Layerer]"),"Defines a loose upper bound on the width of the MinWidth layerer. If set to '-1' multiple values are tested and the best result is selected."),me(4)),gc),Mr),nn(Sn)))),Gi(n,oee,PN,ucn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,see),MYe),"Upper Layer Estimation Scaling Factor [MinWidth Layerer]"),"Multiplied with Upper Bound On Width for defining an upper bound on the width of layers which haven't been determined yet, but whose maximum width had been (roughly) estimated by the MinWidth algorithm. Compensates for too high estimations. If set to '-1' multiple values are tested and the best result is selected."),me(2)),gc),Mr),nn(Sn)))),Gi(n,see,PN,scn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,lee),AYe),"Node Promotion Strategy"),"Reduces number of dummy nodes after layering phase (if possible)."),k4e),Bi),R5e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,fee),AYe),"Max Node Promotion Iterations"),"Limits the number of iterations for node promotion."),me(0)),gc),Mr),nn(Sn)))),Gi(n,fee,lee,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,aee),"layering.coffmanGraham"),"Layer Bound"),"The maximum number of nodes allowed per layer."),me(ui)),gc),Mr),nn(Sn)))),Gi(n,aee,PN,ncn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,LS),a7),"Crossing Minimization Strategy"),"Strategy for crossing minimization."),a4e),Bi),pve),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Awe),a7),"Force Node Model Order"),"The node order given by the model does not change to produce a better layout. E.g. if node A is before node B in the model this is not changed during crossing minimization. This assumes that the node model order is already respected before crossing minimization. This can be achieved by setting considerModelOrder.strategy to NODES_AND_EDGES."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,hee),a7),"Hierarchical Sweepiness"),"How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."),.1),tc),wr),nn(Sn)))),Gi(n,hee,DF,Mrn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,dee),a7),"Semi-Interactive Crossing Minimization"),"Preserves the order of nodes within a layer but still minimizes crossings between edges connecting long edge dummies. Derives the desired order from positions specified by the 'org.eclipse.elk.position' layout option. Requires a crossing minimization strategy that is able to process 'in-layer' constraints."),!1),xr),Yi),nn(Sn)))),Gi(n,dee,LS,Nrn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,xwe),a7),"In Layer Predecessor of"),"Allows to set a constraint which specifies of which node the current node is the predecessor. If set to 's' then the node is the predecessor of 's' and is in the same layer"),null),c6),Be),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Twe),a7),"In Layer Successor of"),"Allows to set a constraint which specifies of which node the current node is the successor. If set to 's' then the node is the successor of 's' and is in the same layer"),null),c6),Be),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Cwe),a7),"Position Choice Constraint"),"Allows to set a constraint regarding the position placement of a node in a layer. Assumed the layer in which the node placed includes n other nodes and i < n. If set to i, it expresses that the node should be placed at the i-th position. Should i>=n be true then the node is placed at the last position in the layer. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),null),gc),Mr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Owe),a7),"Position ID"),"Position within a layer that was determined by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),me(-1)),gc),Mr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Nwe),xYe),"Greedy Switch Activation Threshold"),"By default it is decided automatically if the greedy switch is activated or not. The decision is based on whether the size of the input graph (without dummy nodes) is smaller than the value of this option. A '0' enforces the activation."),me(40)),gc),Mr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,bee),xYe),"Greedy Switch Crossing Minimization"),"Greedy Switch strategy for crossing minimization. The greedy switch heuristic is executed after the regular crossing minimization as a post-processor. Note that if 'hierarchyHandling' is set to 'INCLUDE_CHILDREN', the 'greedySwitchHierarchical.type' option must be used."),f4e),Bi),bie),nn(Sn)))),Gi(n,bee,LS,jrn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,yF),"crossingMinimization.greedySwitchHierarchical"),"Greedy Switch Crossing Minimization (hierarchical)"),"Activates the greedy switch heuristic in case hierarchical layout is used. The differences to the non-hierarchical case (see 'greedySwitch.type') are: 1) greedy switch is inactive by default, 3) only the option value set on the node at which hierarchical layout starts is relevant, and 2) if it's activated by the user, it properly addresses hierarchy-crossing edges."),l4e),Bi),bie),nn(Sn)))),Gi(n,yF,LS,yrn),Gi(n,yF,DF,krn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Fv),TYe),"Node Placement Strategy"),"Strategy for node placement."),C4e),Bi),_5e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,kF),TYe),"Favor Straight Edges Over Balancing"),"Favor straight edges over a balanced node placement. The default behavior is determined automatically based on the used 'edgeRouting'. For an orthogonal style it is set to true, for all other styles to false."),xr),Yi),nn(Sn)))),Gi(n,kF,Fv,Mcn),Gi(n,kF,Fv,Acn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,gee),CYe),"BK Edge Straightening"),"Specifies whether the Brandes Koepf node placer tries to increase the number of straight edges at the expense of diagram size. There is a subtle difference to the 'favorStraightEdges' option, which decides whether a balanced placement of the nodes is desired, or not. In bk terms this means combining the four alignments into a single balanced one, or not. This option on the other hand tries to straighten additional edges during the creation of each of the four alignments."),A4e),Bi),Ave),nn(Sn)))),Gi(n,gee,Fv,kcn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,wee),CYe),"BK Fixed Alignment"),"Tells the BK node placer to use a certain alignment (out of its four) instead of the one producing the smallest height, or the combination of all four."),x4e),Bi),Nve),nn(Sn)))),Gi(n,wee,Fv,jcn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,pee),"nodePlacement.linearSegments"),"Linear Segments Deflection Dampening"),"Dampens the movement of nodes to keep the diagram from getting too large."),.3),tc),wr),nn(Sn)))),Gi(n,pee,Fv,Tcn),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,mee),"nodePlacement.networkSimplex"),"Node Flexibility"),"Aims at shorter and straighter edges. Two configurations are possible: (a) allow ports to move freely on the side they are assigned to (the order is always defined beforehand), (b) additionally allow to enlarge a node wherever it helps. If this option is not configured for a node, the 'nodeFlexibility.default' value is used, which is specified for the node's parent."),Bi),Zie),nn(ar)))),Gi(n,mee,Fv,Dcn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,vee),"nodePlacement.networkSimplex.nodeFlexibility"),"Node Flexibility Default"),"Default value of the 'nodeFlexibility' option for the children of a hierarchical node."),T4e),Bi),Zie),nn(Sn)))),Gi(n,vee,Fv,Ncn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Dwe),OYe),"Self-Loop Distribution"),"Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."),w4e),Bi),G5e),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,_we),OYe),"Self-Loop Ordering"),"Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE."),p4e),Bi),q5e),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,EF),"edgeRouting.splines"),"Spline Routing Mode"),"Specifies the way control points are assembled for each individual edge. CONSERVATIVE ensures that edges are properly routed around the nodes but feels rather orthogonal at times. SLOPPY uses fewer control points to obtain curvier edge routes but may result in edges overlapping nodes."),m4e),Bi),X5e),nn(Sn)))),Gi(n,EF,RN,Hrn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,jF),"edgeRouting.splines.sloppy"),"Sloppy Spline Layer Spacing Factor"),"Spacing factor for routing area between layers when using sloppy spline routing."),.2),tc),wr),nn(Sn)))),Gi(n,jF,RN,Grn),Gi(n,jF,EF,qrn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,yee),"edgeRouting.polyline"),"Sloped Edge Zone Width"),"Width of the strip to the left and to the right of each layer where the polyline edge router is allowed to refrain from ensuring that edges are routed horizontally. This prevents awkward bend points for nodes that extent almost to the edge of their layer."),2),tc),wr),nn(Sn)))),Gi(n,yee,RN,Rrn),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,Iwe),th),"Spacing Base Value"),"An optional base value for all other layout options of the 'spacing' group. It can be used to conveniently alter the overall 'spaciousness' of the drawing. Whenever an explicit value is set for the other layout options, this base value will have no effect. The base value is not inherited, i.e. it must be set for each hierarchical node."),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Lwe),th),"Edge Node Between Layers Spacing"),"The spacing to be preserved between nodes and edges that are routed next to the node's layer. For the spacing between nodes and edges that cross the node's layer 'spacing.edgeNode' is used."),10),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Pwe),th),"Edge Edge Between Layer Spacing"),"Spacing to be preserved between pairs of edges that are routed between the same pair of layers. Note that 'spacing.edgeEdge' is used for the spacing between pairs of edges crossing the same layer."),10),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,$we),th),"Node Node Between Layers Spacing"),"The spacing to be preserved between any pair of nodes of two adjacent layers. Note that 'spacing.nodeNode' is used for the spacing between nodes within the layer itself."),20),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Rwe),Qwe),"Direction Priority"),"Defines how important it is to have a certain edge point into the direction of the overall layout. This option is evaluated during the cycle breaking phase."),me(0)),gc),Mr),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Bwe),Qwe),"Shortness Priority"),"Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase."),me(0)),gc),Mr),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,zwe),Qwe),"Straightness Priority"),"Defines how important it is to keep an edge straight, i.e. aligned with one of the two axes. This option is evaluated during node placement."),me(0)),gc),Mr),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,kee),Ywe),"Connected Components Compaction"),"Tries to further compact components (disconnected sub-graphs)."),!1),xr),Yi),nn(Sn)))),Gi(n,kee,CS,!0),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Fwe),NYe),"Post Compaction Strategy"),DYe),t4e),Bi),$ve),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Hwe),NYe),"Post Compaction Constraint Calculation"),DYe),n4e),Bi),bve),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,SF),Wwe),"High Degree Node Treatment"),"Makes room around high degree nodes to place leafs and trees."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Eee),Wwe),"High Degree Node Threshold"),"Whether a node is considered to have a high degree."),me(16)),gc),Mr),nn(Sn)))),Gi(n,Eee,SF,!0),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,jee),Wwe),"High Degree Node Maximum Tree Height"),"Maximum height of a subtree connected to a high degree node to be moved to separate layers."),me(5)),gc),Mr),nn(Sn)))),Gi(n,jee,SF,!0),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,fd),Zwe),"Graph Wrapping Strategy"),"For certain graphs and certain prescribed drawing areas it may be desirable to split the laid out graph into chunks that are placed side by side. The edges that connect different chunks are 'wrapped' around from the end of one chunk to the start of the other chunk. The points between the chunks are referred to as 'cuts'."),_4e),Bi),Y5e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,MF),Zwe),"Additional Wrapped Edges Spacing"),"To visually separate edges that are wrapped from regularly routed edges an additional spacing value can be specified in form of this layout option. The spacing is added to the regular edgeNode spacing."),10),tc),wr),nn(Sn)))),Gi(n,MF,fd,qcn),Gi(n,MF,fd,Ucn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,AF),Zwe),"Correction Factor for Wrapping"),"At times and for certain types of graphs the executed wrapping may produce results that are consistently biased in the same fashion: either wrapping to often or to rarely. This factor can be used to correct the bias. Internally, it is simply multiplied with the 'aspect ratio' layout option."),1),tc),wr),nn(Sn)))),Gi(n,AF,fd,Vcn),Gi(n,AF,fd,Kcn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,PS),_Ye),"Cutting Strategy"),"The strategy by which the layer indexes are determined at which the layering crumbles into chunks."),D4e),Bi),vve),nn(Sn)))),Gi(n,PS,fd,nun),Gi(n,PS,fd,tun),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,See),_Ye),"Manually Specified Cuts"),"Allows the user to specify her own cuts for a certain graph."),oh),jl),nn(Sn)))),Gi(n,See,PS,Ycn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Mee),"wrapping.cutting.msd"),"MSD Freedom"),"The MSD cutting strategy starts with an initial guess on the number of chunks the graph should be split into. The freedom specifies how much the strategy may deviate from this guess. E.g. if an initial number of 3 is computed, a freedom of 1 allows 2, 3, and 4 cuts."),N4e),gc),Mr),nn(Sn)))),Gi(n,Mee,PS,Zcn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,xF),IYe),"Validification Strategy"),"When wrapping graphs, one can specify indices that are not allowed as split points. The validification strategy makes sure every computed split point is allowed."),I4e),Bi),Q5e),nn(Sn)))),Gi(n,xF,fd,bun),Gi(n,xF,fd,gun),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,TF),IYe),"Valid Indices for Wrapping"),null),oh),jl),nn(Sn)))),Gi(n,TF,fd,aun),Gi(n,TF,fd,hun),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,CF),e2e),"Improve Cuts"),"For general graphs it is important that not too many edges wrap backwards. Thus a compromise between evenly-distributed cuts and the total number of cut edges is sought."),!0),xr),Yi),nn(Sn)))),Gi(n,CF,fd,uun),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,OF),e2e),"Distance Penalty When Improving Cuts"),null),2),tc),wr),nn(Sn)))),Gi(n,OF,fd,run),Gi(n,OF,CF,!0),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Aee),e2e),"Improve Wrapped Edges"),"The initial wrapping is performed in a very simple way. As a consequence, edges that wrap from one chunk to another may be unnecessarily long. Activating this option tries to shorten such edges."),!0),xr),Yi),nn(Sn)))),Gi(n,Aee,fd,sun),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,xee),zee),"Layer Unzipping Strategy"),"The strategy to use for unzipping a layer into multiple sublayers while maintaining the existing ordering of nodes and edges after crossing minimization. The default value is 'NONE'."),M4e),Bi),e4e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Tee),zee),"Minimize Edge Length Heuristic"),"Use a heuristic to decide whether or not to actually perform the layer split with the goal of minimizing the total edge length. This option only works when layerSplit is set to 2. The property can be set to the nodes in a layer, which then applies the property for the layer. If any node sets the value to true, then the value is set to true for the entire layer."),!1),xr),Yi),nn(ar)))),Gi(n,Tee,Cee,bcn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Cee),zee),"Unzipping Layer Split"),"Defines the number of sublayers to split a layer into. The property can be set to the nodes in a layer, which then applies the property for the layer. If multiple nodes set the value to different values, then the lowest value is chosen."),j4e),gc),Mr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Oee),zee),"Reset Alternation on Long Edges"),"If set to true, nodes will always be placed in the first sublayer after a long edge when using the ALTERNATING strategy. Otherwise long edge dummies are treated the same as regular nodes. The default value is true. The property can be set to the nodes in a layer, which then applies the property for the layer. If any node sets the value to false, then the value is set to false for the entire layer."),S4e),xr),Yi),nn(ar)))),Gi(n,Oee,xee,wcn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Jwe),Fee),"Edge Label Side Selection"),"Method to decide on edge label sides."),g4e),Bi),Sve),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Gwe),Fee),"Edge Center Label Placement Strategy"),"Determines in which layer center labels of long edges should be placed."),b4e),Bi),P7),Ti(Sn,z(B(uh,1),ye,160,0,[wd]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,NF),$S),"Consider Model Order"),"Preserves the order of nodes and edges in the model file if this does not lead to additional edge crossings. Depending on the strategy this is not always possible since the node and edge order might be conflicting."),s4e),Bi),z5e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,qwe),$S),"Consider Port Order"),"If disabled the port order of output ports is derived from the edge order and input ports are ordered by their incoming connections. If enabled all ports are ordered by the port model order."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,$N),$S),"No Model Order"),"Set on a node to not set a model order for this node even though it is a real node."),!1),xr),Yi),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Nee),$S),"Consider Model Order for Components"),"If set to NONE the usual ordering strategy (by cumulative node priority and size of nodes) is used. INSIDE_PORT_SIDES orders the components with external ports only inside the groups with the same port side. FORCE_MODEL_ORDER enforces the mode order on components. This option might produce bad alignments and sub optimal drawings in terms of used area since the ordering should be respected."),i4e),Bi),v3e),nn(Sn)))),Gi(n,Nee,CS,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Uwe),$S),"Long Edge Ordering Strategy"),"Indicates whether long edges are sorted under, over, or equal to nodes that have no connection to a previous layer in a left-to-right or right-to-left layout. Under and over changes to right and left in a vertical layout."),o4e),Bi),N5e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Dee),$S),"Crossing Counter Node Order Influence"),"Indicates with what percentage (1 for 100%) violations of the node model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal node order. Defaults to no influence (0)."),0),tc),wr),nn(Sn)))),Gi(n,Dee,NF,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,_ee),$S),"Crossing Counter Port Order Influence"),"Indicates with what percentage (1 for 100%) violations of the port model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal port order. Defaults to no influence (0)."),0),tc),wr),nn(Sn)))),Gi(n,_ee,NF,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Iee),h7),n2e),"Used to define partial ordering groups during cycle breaking. A lower group id means that the group is sorted before other groups. A group model order of 0 is the default group."),me(0)),gc),Mr),nn(ar)))),Gi(n,Iee,$N,!1),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Lee),h7),n2e),"Used to define partial ordering groups during crossing minimization. A lower group id means that the group is sorted before other groups. A group model order of 0 is the default group."),me(0)),gc),Mr),Ti(ar,z(B(uh,1),ye,160,0,[_a,h0]))))),Gi(n,Lee,$N,!1),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Pee),h7),n2e),"Used to define partial ordering groups during component packing. A lower group id means that the group is sorted before other groups. A group model order of 0 is the default group."),me(0)),gc),Mr),Ti(ar,z(B(uh,1),ye,160,0,[_a,h0]))))),Gi(n,Pee,$N,!1),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Xwe),h7),"Cycle Breaking Group Ordering Strategy"),"Determines how to count ordering violations during cycle breaking. NONE: They do not count. ENFORCED: A group with a higher model order is before a node with a smaller. MODEL_ORDER: The model order counts instead of the model order group id ordering."),r4e),Bi),gie),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,$ee),h7),"Cycle Breaking Preferred Source Id"),"The model order group id for which should be preferred as a source if possible."),gc),Mr),nn(Sn)))),Gi(n,$ee,LN,crn),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,Ree),h7),"Cycle Breaking Preferred Target Id"),"The model order group id for which should be preferred as a target if possible."),gc),Mr),nn(Sn)))),Gi(n,Ree,LN,orn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Vwe),h7),"Crossing Minimization Group Ordering Strategy"),"Determines how to count ordering violations during crossing minimization. NONE: They do not count. ENFORCED: A group with a lower id is before a group with a higher id. MODEL_ORDER: The model order counts instead of the model order group id ordering."),u4e),Bi),gie),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Kwe),h7),"Crossing Minimization Enforced Group Orders"),"Holds all group ids which are enforcing their order during crossing minimization strategies. E.g. if only groups 2 and -1 (default) enforce their ordering. Other groups e.g. the group of timer nodes can be ordered arbitrarily if it helps and the mentioned groups may not change their order."),c4e),oh),jl),nn(Sn)))),eQe((new DU,n))};var Qin,Yin,Win,n4e,Zin,t4e,ern,i4e,nrn,trn,irn,r4e,rrn,crn,urn,orn,srn,c4e,lrn,u4e,frn,arn,hrn,drn,o4e,brn,grn,wrn,s4e,prn,mrn,vrn,l4e,yrn,krn,Ern,f4e,jrn,Srn,Mrn,Arn,xrn,Trn,Crn,Orn,Nrn,Drn,a4e,_rn,h4e,Irn,d4e,Lrn,b4e,Prn,g4e,$rn,Rrn,Brn,w4e,zrn,p4e,Frn,m4e,Hrn,Jrn,Grn,qrn,Urn,Xrn,Vrn,Krn,Qrn,Yrn,v4e,Wrn,Zrn,ecn,ncn,tcn,icn,y4e,rcn,ccn,ucn,ocn,scn,lcn,fcn,k4e,acn,E4e,hcn,j4e,dcn,bcn,gcn,S4e,wcn,pcn,M4e,mcn,vcn,ycn,A4e,kcn,Ecn,x4e,jcn,Scn,Mcn,Acn,xcn,Tcn,Ccn,Ocn,T4e,Ncn,Dcn,_cn,C4e,Icn,O4e,Lcn,Pcn,$cn,Rcn,Bcn,zcn,Fcn,Hcn,Jcn,Gcn,qcn,Ucn,Xcn,Vcn,Kcn,Qcn,Ycn,Wcn,N4e,Zcn,eun,D4e,nun,tun,iun,run,cun,uun,oun,sun,lun,_4e,fun,aun,hun,dun,I4e,bun,gun;v(Ou,"LayeredMetaDataProvider",843),m(982,1,eh,DU),s.tf=function(n){eQe(n)};var zh,xie,aJ,yM,hJ,L4e,dJ,kM,bD,Tie,Zy,P4e,$4e,R4e,EM,wun,jM,zm,Cie,bJ,Oie,v1,Nie,H7,B4e,gD,Die,z4e,pun,mun,vun,gJ,_ie,SM,e6,yun,Sl,F4e,H4e,wJ,s4,Fh,pJ,gd,J4e,G4e,q4e,Iie,Lie,U4e,s0,Pie,X4e,Fm,V4e,K4e,Q4e,mJ,Hm,Ug,Y4e,W4e,Wc,Z4e,kun,ku,MM,e5e,n5e,t5e,wD,vJ,yJ,$ie,Rie,i5e,kJ,r5e,c5e,EJ,B2,u5e,Bie,AM,o5e,z2,xM,jJ,Xg,zie,J7,SJ,Vg,s5e,l5e,f5e,Jm,a5e,Eun,jun,Sun,Mun,F2,Gm,Zi,l0,Aun,qm,h5e,G7,d5e,Um,xun,q7,b5e,n6,Tun,Cun,pD,Fie,g5e,mD,na,Xm,l4,Kg,Cb,MJ,Vm,Hie,U7,X7,Qg,Km,Jie,vD,TM,CM,Oun,Nun,Dun,w5e,_un,Gie,p5e,m5e,v5e,y5e,qie,k5e,E5e,j5e,S5e,Uie,AJ;v(Ou,"LayeredOptions",982),m(983,1,{},Wq),s.uf=function(){var n;return n=new ZSe,n},s.vf=function(n){},v(Ou,"LayeredOptions/LayeredFactory",983),m(1345,1,{}),s.a=0;var Iun;v(Ru,"ElkSpacings/AbstractSpacingsBuilder",1345),m(778,1345,{},nde);var xJ,Lun;v(Ou,"LayeredSpacings/LayeredSpacingsBuilder",778),m(268,23,{3:1,35:1,23:1,268:1,188:1,196:1},Y3),s.bg=function(){return wXe(this)},s.og=function(){return wXe(this)};var Xie,Vie,Kie,M5e,A5e,x5e,TJ,Qie,T5e,C5e=vt(Ou,"LayeringStrategy",268,At,Z8n,ymn),Pun;m(352,23,{3:1,35:1,23:1,352:1},tV);var Yie,O5e,CJ,N5e=vt(Ou,"LongEdgeOrderingStrategy",352,At,iyn,kmn),$un;m(203,23,{3:1,35:1,23:1,203:1},m$);var f4,a4,OJ,Wie,Zie=vt(Ou,"NodeFlexibility",203,At,w6n,Emn),Run;m(328,23,{3:1,35:1,23:1,328:1,188:1,196:1},bC),s.bg=function(){return rUe(this)},s.og=function(){return rUe(this)};var OM,ere,nre,NM,D5e,_5e=vt(Ou,"NodePlacementStrategy",328,At,l9n,jmn),Bun;m(243,23,{3:1,35:1,23:1,243:1},Np);var I5e,V7,DM,yD,L5e,P5e,kD,$5e,NJ,DJ,R5e=vt(Ou,"NodePromotionStrategy",243,At,S7n,Smn),zun;m(269,23,{3:1,35:1,23:1,269:1},v$);var B5e,Ob,tre,ire,z5e=vt(Ou,"OrderingStrategy",269,At,p6n,Mmn),Fun;m(421,23,{3:1,35:1,23:1,421:1},pse);var rre,cre,F5e=vt(Ou,"PortSortingStrategy",421,At,d5n,Amn),Hun;m(452,23,{3:1,35:1,23:1,452:1},iV);var Ms,Do,_M,Jun=vt(Ou,"PortType",452,At,ryn,xmn),Gun;m(381,23,{3:1,35:1,23:1,381:1},rV);var H5e,ure,J5e,G5e=vt(Ou,"SelfLoopDistributionStrategy",381,At,cyn,Tmn),qun;m(348,23,{3:1,35:1,23:1,348:1},cV);var ore,ED,sre,q5e=vt(Ou,"SelfLoopOrderingStrategy",348,At,uyn,Cmn),Uun;m(316,1,{316:1},WVe),v(Ou,"Spacings",316),m(349,23,{3:1,35:1,23:1,349:1},uV);var lre,U5e,IM,X5e=vt(Ou,"SplineRoutingMode",349,At,oyn,Omn),Xun;m(351,23,{3:1,35:1,23:1,351:1},oV);var fre,V5e,K5e,Q5e=vt(Ou,"ValidifyStrategy",351,At,syn,Nmn),Vun;m(382,23,{3:1,35:1,23:1,382:1},sV);var Qm,are,K7,Y5e=vt(Ou,"WrappingStrategy",382,At,lyn,Dmn),Kun;m(1361,1,lc,xT),s.pg=function(n){return u(n,37),Qun},s.If=function(n,t){WPn(this,u(n,37),t)};var Qun;v(S2,"BFSNodeOrderCycleBreaker",1361),m(1359,1,lc,sP),s.pg=function(n){return u(n,37),Yun},s.If=function(n,t){XLn(this,u(n,37),t)};var Yun;v(S2,"DFSNodeOrderCycleBreaker",1359),m(1360,1,rt,_Ne),s.Ad=function(n){K_n(this.a,this.c,this.b,u(n,17))},s.b=!1,v(S2,"DFSNodeOrderCycleBreaker/lambda$0$Type",1360),m(1353,1,lc,d9),s.pg=function(n){return u(n,37),Wun},s.If=function(n,t){ULn(this,u(n,37),t)};var Wun;v(S2,"DepthFirstCycleBreaker",1353),m(779,1,lc,Mfe),s.pg=function(n){return u(n,37),Zun},s.If=function(n,t){dBn(this,u(n,37),t)},s.qg=function(n){return u(Le(n,dz(this.e,n.c.length)),9)};var Zun;v(S2,"GreedyCycleBreaker",779),m(1356,779,lc,yTe),s.qg=function(n){var t,i,r,c,o,l,f,h,b;for(b=null,r=ui,h=k.Math.max(this.b.a.c.length,u(T(this.b,(pe(),Tb)),15).a),t=h*u(T(this.b,fD),15).a,c=new z6,i=ue(T(this.b,(Oe(),Zy)))===ue((ib(),Rm)),f=new L(n);f.ao&&(r=o,b=l));return b||u(Le(n,dz(this.e,n.c.length)),9)},v(S2,"GreedyModelOrderCycleBreaker",1356),m(505,1,{},z6),s.a=0,s.b=0,v(S2,"GroupModelOrderCalculator",505),m(1354,1,lc,lE),s.pg=function(n){return u(n,37),eon},s.If=function(n,t){vPn(this,u(n,37),t)};var eon;v(S2,"InteractiveCycleBreaker",1354),m(1355,1,lc,sE),s.pg=function(n){return u(n,37),non},s.If=function(n,t){kPn(u(n,37),t)};var non;v(S2,"ModelOrderCycleBreaker",1355),m(780,1,lc),s.pg=function(n){return u(n,37),ton},s.If=function(n,t){lLn(this,u(n,37),t)},s.rg=function(n,t){var i,r,c,o,l,f,h,b,p,y;for(l=0;lb&&(h=S,y=b),pya(new Gn(Vn(Di(f).a.Jc(),new ee))))for(c=new Gn(Vn(or(h).a.Jc(),new ee));ht(c);)r=u(it(c),17),u(Qu(this.d,l),22).Gc(r.c.i)&&xe(this.c,r);else for(c=new Gn(Vn(Di(f).a.Jc(),new ee));ht(c);)r=u(it(c),17),u(Qu(this.d,l),22).Gc(r.d.i)&&xe(this.c,r)}},v(S2,"SCCNodeTypeCycleBreaker",1358),m(1357,780,lc,ETe),s.rg=function(n,t){var i,r,c,o,l,f,h,b,p,y,S,A;for(l=0;lb&&(h=S,y=b),pya(new Gn(Vn(Di(f).a.Jc(),new ee))))for(c=new Gn(Vn(or(h).a.Jc(),new ee));ht(c);)r=u(it(c),17),u(Qu(this.d,l),22).Gc(r.c.i)&&xe(this.c,r);else for(c=new Gn(Vn(Di(f).a.Jc(),new ee));ht(c);)r=u(it(c),17),u(Qu(this.d,l),22).Gc(r.d.i)&&xe(this.c,r)}},v(S2,"SCConnectivity",1357),m(1373,1,lc,AT),s.pg=function(n){return u(n,37),ion},s.If=function(n,t){pRn(this,u(n,37),t)};var ion;v(ad,"BreadthFirstModelOrderLayerer",1373),m(1374,1,Kt,dx),s.Le=function(n,t){return tCn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(ad,"BreadthFirstModelOrderLayerer/lambda$0$Type",1374),m(1364,1,lc,Mxe),s.pg=function(n){return u(n,37),ron},s.If=function(n,t){mBn(this,u(n,37),t)};var ron;v(ad,"CoffmanGrahamLayerer",1364),m(1365,1,Kt,VEe),s.Le=function(n,t){return lDn(this.a,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(ad,"CoffmanGrahamLayerer/0methodref$compareNodesInTopo$Type",1365),m(1366,1,Kt,KEe),s.Le=function(n,t){return Svn(this.a,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(ad,"CoffmanGrahamLayerer/lambda$1$Type",1366),m(1375,1,lc,MT),s.pg=function(n){return u(n,37),con},s.If=function(n,t){rBn(this,u(n,37),t)},s.c=0,s.e=0;var con;v(ad,"DepthFirstModelOrderLayerer",1375),m(1376,1,Kt,F6),s.Le=function(n,t){return iCn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(ad,"DepthFirstModelOrderLayerer/lambda$0$Type",1376),m(1367,1,lc,H6),s.pg=function(n){return u(n,37),Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Lte)),p1,Lm),eo,Im)},s.If=function(n,t){TRn(u(n,37),t)},v(ad,"InteractiveLayerer",1367),m(564,1,{564:1},oMe),s.a=0,s.c=0,v(ad,"InteractiveLayerer/LayerSpan",564),m(1363,1,lc,fP),s.pg=function(n){return u(n,37),uon},s.If=function(n,t){iDn(this,u(n,37),t)};var uon;v(ad,"LongestPathLayerer",1363),m(1372,1,lc,aP),s.pg=function(n){return u(n,37),oon},s.If=function(n,t){SDn(this,u(n,37),t)};var oon;v(ad,"LongestPathSourceLayerer",1372),m(1370,1,lc,ko),s.pg=function(n){return u(n,37),Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)},s.If=function(n,t){RRn(this,u(n,37),t)},s.a=0,s.b=0,s.d=0;var W5e,Z5e;v(ad,"MinWidthLayerer",1370),m(1371,1,Kt,QEe),s.Le=function(n,t){return q7n(this,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(ad,"MinWidthLayerer/MinOutgoingEdgesComparator",1371),m(1362,1,lc,lP),s.pg=function(n){return u(n,37),son},s.If=function(n,t){n$n(this,u(n,37),t)};var son;v(ad,"NetworkSimplexLayerer",1362),m(1368,1,lc,eNe),s.pg=function(n){return u(n,37),Ht(Ht(Ht(new sr,(Hr(),ea),(Vr(),Qv)),p1,Lm),eo,Im)},s.If=function(n,t){z$n(this,u(n,37),t)},s.d=0,s.f=0,s.g=0,s.i=0,s.s=0,s.t=0,s.u=0,v(ad,"StretchWidthLayerer",1368),m(1369,1,Kt,eU),s.Le=function(n,t){return M9n(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(ad,"StretchWidthLayerer/1",1369),m(406,1,R2e),s.eg=function(n,t,i,r,c,o){},s.tg=function(n,t,i){return UXe(this,n,t,i)},s.dg=function(){this.g=oe(b3,RYe,30,this.d,15,1),this.f=oe(b3,RYe,30,this.d,15,1)},s.fg=function(n,t){this.e[n]=oe(It,ei,30,t[n].length,15,1)},s.gg=function(n,t,i){var r;r=i[n][t],r.p=t,this.e[n][t]=t},s.hg=function(n,t,i,r){u(Le(r[n][t].j,i),12).p=this.d++},s.b=0,s.c=0,s.d=0,v(Ro,"AbstractBarycenterPortDistributor",406),m(1663,1,Kt,YEe),s.Le=function(n,t){return Zjn(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ro,"AbstractBarycenterPortDistributor/lambda$0$Type",1663),m(816,1,IS,Dae),s.eg=function(n,t,i,r,c,o){},s.gg=function(n,t,i){},s.hg=function(n,t,i,r){},s.cg=function(){return!1},s.dg=function(){this.c=this.e.a,this.g=this.f.g},s.fg=function(n,t){t[n][0].c.p=n},s.ig=function(){return!1},s.ug=function(n,t,i,r){i?$Je(this,n):(JJe(this,n,r),lKe(this,n,t)),n.c.length>1&&(Re($e(T(Pr((mn(0,n.c.length),u(n.c[0],9))),(Oe(),H7))))?gUe(n,this.d,u(this,660)):(yn(),Nr(n,this.d)),cze(this.e,n))},s.jg=function(n,t,i,r){var c,o,l,f,h,b,p;for(t!=yDe(i,n.length)&&(o=n[t-(i?1:-1)],ihe(this.f,o,i?(Nc(),Do):(Nc(),Ms))),c=n[t][0],p=!r||c.k==(Bn(),pr),b=Jf(n[t]),this.ug(b,p,!1,i),l=0,h=new L(b);h.a"),n0?qK(this.a,n[t-1],n[t]):!i&&t1&&(Re($e(T(Pr((mn(0,n.c.length),u(n.c[0],9))),(Oe(),H7))))?gUe(n,this.d,this):(yn(),Nr(n,this.d)),Re($e(T(Pr((mn(0,n.c.length),u(n.c[0],9))),H7)))||cze(this.e,n))},v(Ro,"ModelOrderBarycenterHeuristic",660),m(1843,1,Kt,cje),s.Le=function(n,t){return PLn(this.a,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ro,"ModelOrderBarycenterHeuristic/lambda$0$Type",1843),m(1383,1,lc,dP),s.pg=function(n){var t;return u(n,37),t=R$(won),Ht(t,(Hr(),eo),(Vr(),zH)),t},s.If=function(n,t){W4n((u(n,37),t))};var won;v(Ro,"NoCrossingMinimizer",1383),m(796,406,R2e,$oe),s.sg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A;switch(y=this.g,i.g){case 1:{for(c=0,o=0,p=new L(n.j);p.a1&&(c.j==(Ne(),Wn)?this.b[n]=!0:c.j==Xn&&n>0&&(this.b[n-1]=!0))},s.f=0,v(g1,"AllCrossingsCounter",1838),m(583,1,{},NB),s.b=0,s.d=0,v(g1,"BinaryIndexedTree",583),m(519,1,{},IC);var eye,LJ;v(g1,"CrossingsCounter",519),m(1912,1,Kt,uje),s.Le=function(n,t){return bvn(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(g1,"CrossingsCounter/lambda$0$Type",1912),m(1913,1,Kt,oje),s.Le=function(n,t){return gvn(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(g1,"CrossingsCounter/lambda$1$Type",1913),m(1914,1,Kt,sje),s.Le=function(n,t){return wvn(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(g1,"CrossingsCounter/lambda$2$Type",1914),m(1915,1,Kt,lje),s.Le=function(n,t){return pvn(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(g1,"CrossingsCounter/lambda$3$Type",1915),m(1916,1,rt,fje),s.Ad=function(n){s8n(this.a,u(n,12))},v(g1,"CrossingsCounter/lambda$4$Type",1916),m(1917,1,Rt,aje),s.Mb=function(n){return nwn(this.a,u(n,12))},v(g1,"CrossingsCounter/lambda$5$Type",1917),m(1918,1,rt,hje),s.Ad=function(n){QTe(this,n)},v(g1,"CrossingsCounter/lambda$6$Type",1918),m(1919,1,rt,nTe),s.Ad=function(n){var t;H9(),W0(this.b,(t=this.a,u(n,12),t))},v(g1,"CrossingsCounter/lambda$7$Type",1919),m(823,1,_h,px),s.Lb=function(n){return H9(),bi(u(n,12),(pe(),Ss))},s.Fb=function(n){return this===n},s.Mb=function(n){return H9(),bi(u(n,12),(pe(),Ss))},v(g1,"CrossingsCounter/lambda$8$Type",823),m(1911,1,{},dje),v(g1,"HyperedgeCrossingsCounter",1911),m(467,1,{35:1,467:1},nNe),s.Dd=function(n){return Hjn(this,u(n,467))},s.b=0,s.c=0,s.e=0,s.f=0;var ZBn=v(g1,"HyperedgeCrossingsCounter/Hyperedge",467);m(370,1,{35:1,370:1},NR),s.Dd=function(n){return LOn(this,u(n,370))},s.b=0,s.c=0;var pon=v(g1,"HyperedgeCrossingsCounter/HyperedgeCorner",370);m(518,23,{3:1,35:1,23:1,518:1},mse);var PM,$M,mon=vt(g1,"HyperedgeCrossingsCounter/HyperedgeCorner/Type",518,At,b5n,Pmn),von;m(1385,1,lc,NU),s.pg=function(n){return u(T(u(n,37),(pe(),po)),22).Gc((Dc(),rf))?yon:null},s.If=function(n,t){aAn(this,u(n,37),t)};var yon;v(Lc,"InteractiveNodePlacer",1385),m(1386,1,lc,NT),s.pg=function(n){return u(T(u(n,37),(pe(),po)),22).Gc((Dc(),rf))?kon:null},s.If=function(n,t){YSn(this,u(n,37),t)};var kon,PJ,$J;v(Lc,"LinearSegmentsNodePlacer",1386),m(263,1,{35:1,263:1},woe),s.Dd=function(n){return ggn(this,u(n,263))},s.Fb=function(n){var t;return X(n,263)?(t=u(n,263),this.b==t.b):!1},s.Hb=function(){return this.b},s.Ib=function(){return"ls"+Qa(this.e)},s.a=0,s.b=0,s.c=-1,s.d=-1,s.g=0;var Eon=v(Lc,"LinearSegmentsNodePlacer/LinearSegment",263);m(1388,1,lc,ODe),s.pg=function(n){return u(T(u(n,37),(pe(),po)),22).Gc((Dc(),rf))?jon:null},s.If=function(n,t){cBn(this,u(n,37),t)},s.b=0,s.g=0;var jon;v(Lc,"NetworkSimplexPlacer",1388),m(1407,1,Kt,I3),s.Le=function(n,t){return oo(u(n,15).a,u(t,15).a)},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lc,"NetworkSimplexPlacer/0methodref$compare$Type",1407),m(1409,1,Kt,gx),s.Le=function(n,t){return oo(u(n,15).a,u(t,15).a)},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Lc,"NetworkSimplexPlacer/1methodref$compare$Type",1409),m(644,1,{644:1},tTe);var ezn=v(Lc,"NetworkSimplexPlacer/EdgeRep",644);m(405,1,{405:1},rae),s.b=!1;var nzn=v(Lc,"NetworkSimplexPlacer/NodeRep",405);m(500,13,{3:1,4:1,20:1,31:1,56:1,13:1,18:1,16:1,59:1,500:1},dMe),v(Lc,"NetworkSimplexPlacer/Path",500),m(1389,1,{},Ck),s.Kb=function(n){return u(n,17).d.i.k},v(Lc,"NetworkSimplexPlacer/Path/lambda$0$Type",1389),m(1390,1,Rt,hI),s.Mb=function(n){return u(n,249)==(Bn(),br)},v(Lc,"NetworkSimplexPlacer/Path/lambda$1$Type",1390),m(1391,1,{},dI),s.Kb=function(n){return u(n,17).d.i},v(Lc,"NetworkSimplexPlacer/Path/lambda$2$Type",1391),m(1392,1,Rt,bje),s.Mb=function(n){return FOe(eHe(u(n,9)))},v(Lc,"NetworkSimplexPlacer/Path/lambda$3$Type",1392),m(1393,1,Rt,Z4),s.Mb=function(n){return nvn(u(n,12))},v(Lc,"NetworkSimplexPlacer/lambda$0$Type",1393),m(1394,1,rt,iTe),s.Ad=function(n){Xwn(this.a,this.b,u(n,12))},v(Lc,"NetworkSimplexPlacer/lambda$1$Type",1394),m(1403,1,rt,gje),s.Ad=function(n){ECn(this.a,u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$10$Type",1403),m(1404,1,{},wx),s.Kb=function(n){return hl(),new wn(null,new pn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$11$Type",1404),m(1405,1,rt,wje),s.Ad=function(n){t_n(this.a,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$12$Type",1405),m(1406,1,{},Ok),s.Kb=function(n){return hl(),me(u(n,124).e)},v(Lc,"NetworkSimplexPlacer/lambda$13$Type",1406),m(1408,1,{},Nk),s.Kb=function(n){return hl(),me(u(n,124).e)},v(Lc,"NetworkSimplexPlacer/lambda$15$Type",1408),m(1410,1,Rt,bI),s.Mb=function(n){return hl(),u(n,405).c.k==(Bn(),Wi)},v(Lc,"NetworkSimplexPlacer/lambda$17$Type",1410),m(1411,1,Rt,gI),s.Mb=function(n){return hl(),u(n,405).c.j.c.length>1},v(Lc,"NetworkSimplexPlacer/lambda$18$Type",1411),m(1412,1,rt,$_e),s.Ad=function(n){hjn(this.c,this.b,this.d,this.a,u(n,405))},s.c=0,s.d=0,v(Lc,"NetworkSimplexPlacer/lambda$19$Type",1412),m(1395,1,{},L3),s.Kb=function(n){return hl(),new wn(null,new pn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$2$Type",1395),m(1413,1,rt,pje),s.Ad=function(n){Ywn(this.a,u(n,12))},s.a=0,v(Lc,"NetworkSimplexPlacer/lambda$20$Type",1413),m(1414,1,{},P3),s.Kb=function(n){return hl(),new wn(null,new pn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$21$Type",1414),m(1415,1,rt,mje),s.Ad=function(n){i2n(this.a,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$22$Type",1415),m(1416,1,Rt,wI),s.Mb=function(n){return FOe(n)},v(Lc,"NetworkSimplexPlacer/lambda$23$Type",1416),m(1417,1,{},e5),s.Kb=function(n){return hl(),new wn(null,new pn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$24$Type",1417),m(1418,1,Rt,vje),s.Mb=function(n){return fwn(this.a,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$25$Type",1418),m(1419,1,rt,rTe),s.Ad=function(n){MTn(this.a,this.b,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$26$Type",1419),m(1420,1,Rt,J6),s.Mb=function(n){return hl(),!sc(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$27$Type",1420),m(1421,1,Rt,Dk),s.Mb=function(n){return hl(),!sc(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$28$Type",1421),m(1422,1,{},yje),s.Te=function(n,t){return Qwn(this.a,u(n,25),u(t,25))},v(Lc,"NetworkSimplexPlacer/lambda$29$Type",1422),m(1396,1,{},G6),s.Kb=function(n){return hl(),new wn(null,new Gp(new Gn(Vn(Di(u(n,9)).a.Jc(),new ee))))},v(Lc,"NetworkSimplexPlacer/lambda$3$Type",1396),m(1397,1,Rt,_k),s.Mb=function(n){return hl(),Wyn(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$4$Type",1397),m(1398,1,rt,kje),s.Ad=function(n){aLn(this.a,u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$5$Type",1398),m(1399,1,{},pI),s.Kb=function(n){return hl(),new wn(null,new pn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$6$Type",1399),m(1400,1,Rt,$3),s.Mb=function(n){return hl(),u(n,9).k==(Bn(),Wi)},v(Lc,"NetworkSimplexPlacer/lambda$7$Type",1400),m(1401,1,{},mI),s.Kb=function(n){return hl(),new wn(null,new Gp(new Gn(Vn(Mh(u(n,9)).a.Jc(),new ee))))},v(Lc,"NetworkSimplexPlacer/lambda$8$Type",1401),m(1402,1,Rt,lp),s.Mb=function(n){return hl(),Z3n(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$9$Type",1402),m(1384,1,lc,DT),s.pg=function(n){return u(T(u(n,37),(pe(),po)),22).Gc((Dc(),rf))?Son:null},s.If=function(n,t){JLn(u(n,37),t)};var Son;v(Lc,"SimpleNodePlacer",1384),m(185,1,{185:1},_v),s.Ib=function(){var n;return n="",this.c==(Eh(),H2)?n+=Oy:this.c==f0&&(n+=Cy),this.o==(Fa(),Yg)?n+=KZ:this.o==ch?n+="UP":n+="BALANCED",n},v(yb,"BKAlignedLayout",185),m(509,23,{3:1,35:1,23:1,509:1},vse);var f0,H2,Mon=vt(yb,"BKAlignedLayout/HDirection",509,At,w5n,$mn),Aon;m(508,23,{3:1,35:1,23:1,508:1},yse);var Yg,ch,xon=vt(yb,"BKAlignedLayout/VDirection",508,At,g5n,Rmn),Ton;m(1664,1,{},cTe),v(yb,"BKAligner",1664),m(1667,1,{},AJe),v(yb,"BKCompactor",1667),m(652,1,{652:1},mx),s.a=0,v(yb,"BKCompactor/ClassEdge",652),m(456,1,{456:1},lMe),s.a=null,s.b=0,v(yb,"BKCompactor/ClassNode",456),m(1387,1,lc,vTe),s.pg=function(n){return u(T(u(n,37),(pe(),po)),22).Gc((Dc(),rf))?Con:null},s.If=function(n,t){EBn(this,u(n,37),t)},s.d=!1;var Con;v(yb,"BKNodePlacer",1387),m(1665,1,{},vx),s.d=0,v(yb,"NeighborhoodInformation",1665),m(1666,1,Kt,Eje),s.Le=function(n,t){return j8n(this,u(n,49),u(t,49))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(yb,"NeighborhoodInformation/NeighborComparator",1666),m(809,1,{}),v(yb,"ThresholdStrategy",809),m(1795,809,{},bMe),s.vg=function(n,t,i){return this.a.o==(Fa(),ch)?Ki:Ir},s.wg=function(){},v(yb,"ThresholdStrategy/NullThresholdStrategy",1795),m(576,1,{576:1},sTe),s.c=!1,s.d=!1,v(yb,"ThresholdStrategy/Postprocessable",576),m(1796,809,{},gMe),s.vg=function(n,t,i){var r,c,o;return c=t==i,r=this.a.a[i.p]==t,c||r?(o=n,this.a.c==(Eh(),H2)?(c&&(o=YW(this,t,!0)),!isNaN(o)&&!isFinite(o)&&r&&(o=YW(this,i,!1))):(c&&(o=YW(this,t,!0)),!isNaN(o)&&!isFinite(o)&&r&&(o=YW(this,i,!1))),o):n},s.wg=function(){for(var n,t,i,r,c;this.d.b!=0;)c=u(EIe(this.d),576),r=sVe(this,c),r.a&&(n=r.a,i=Re(this.a.f[this.a.g[c.b.p].p]),!(!i&&!sc(n)&&n.c.i.c==n.d.i.c)&&(t=fUe(this,c),t||gCe(this.e,c)));for(;this.e.a.c.length!=0;)fUe(this,u(T1e(this.e),576))},v(yb,"ThresholdStrategy/SimpleThresholdStrategy",1796),m(635,1,{635:1,188:1,196:1},fp),s.bg=function(){return rze(this)},s.og=function(){return rze(this)};var hre;v(Xee,"EdgeRouterFactory",635),m(1445,1,lc,PU),s.pg=function(n){return _Dn(u(n,37))},s.If=function(n,t){WLn(u(n,37),t)};var Oon,Non,Don,_on,Ion,nye,Lon,Pon;v(Xee,"OrthogonalEdgeRouter",1445),m(1438,1,lc,mTe),s.pg=function(n){return yAn(u(n,37))},s.If=function(n,t){kRn(this,u(n,37),t)};var $on,Ron,Bon,zon,SD,Fon;v(Xee,"PolylineEdgeRouter",1438),m(1439,1,_h,ap),s.Lb=function(n){return c1e(u(n,9))},s.Fb=function(n){return this===n},s.Mb=function(n){return c1e(u(n,9))},v(Xee,"PolylineEdgeRouter/1",1439),m(1851,1,Rt,q6),s.Mb=function(n){return u(n,133).c==(ka(),Nb)},v(Ta,"HyperEdgeCycleDetector/lambda$0$Type",1851),m(1852,1,{},yx),s.Xe=function(n){return u(n,133).d},v(Ta,"HyperEdgeCycleDetector/lambda$1$Type",1852),m(1853,1,Rt,kx),s.Mb=function(n){return u(n,133).c==(ka(),Nb)},v(Ta,"HyperEdgeCycleDetector/lambda$2$Type",1853),m(1854,1,{},U6),s.Xe=function(n){return u(n,133).d},v(Ta,"HyperEdgeCycleDetector/lambda$3$Type",1854),m(1855,1,{},X6),s.Xe=function(n){return u(n,133).d},v(Ta,"HyperEdgeCycleDetector/lambda$4$Type",1855),m(1856,1,{},vI),s.Xe=function(n){return u(n,133).d},v(Ta,"HyperEdgeCycleDetector/lambda$5$Type",1856),m(116,1,{35:1,116:1},jO),s.Dd=function(n){return wgn(this,u(n,116))},s.Fb=function(n){var t;return X(n,116)?(t=u(n,116),this.g==t.g):!1},s.Hb=function(){return this.g},s.Ib=function(){var n,t,i,r;for(n=new fl("{"),r=new L(this.n);r.a"+this.b+" ("+_2n(this.c)+")"},s.d=0,v(Ta,"HyperEdgeSegmentDependency",133),m(515,23,{3:1,35:1,23:1,515:1},kse);var Nb,Ym,Hon=vt(Ta,"HyperEdgeSegmentDependency/DependencyType",515,At,p5n,Bmn),Jon;m(1857,1,{},jje),v(Ta,"HyperEdgeSegmentSplitter",1857),m(1858,1,{},lAe),s.a=0,s.b=0,v(Ta,"HyperEdgeSegmentSplitter/AreaRating",1858),m(340,1,{340:1},ZV),s.a=0,s.b=0,s.c=0,v(Ta,"HyperEdgeSegmentSplitter/FreeArea",340),m(1859,1,Kt,yI),s.Le=function(n,t){return Mpn(u(n,116),u(t,116))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ta,"HyperEdgeSegmentSplitter/lambda$0$Type",1859),m(1860,1,rt,R_e),s.Ad=function(n){H6n(this.a,this.d,this.c,this.b,u(n,116))},s.b=0,v(Ta,"HyperEdgeSegmentSplitter/lambda$1$Type",1860),m(1861,1,{},n5),s.Kb=function(n){return new wn(null,new pn(u(n,116).e,16))},v(Ta,"HyperEdgeSegmentSplitter/lambda$2$Type",1861),m(1862,1,{},Ik),s.Kb=function(n){return new wn(null,new pn(u(n,116).j,16))},v(Ta,"HyperEdgeSegmentSplitter/lambda$3$Type",1862),m(1863,1,{},kI),s.We=function(n){return te(re(n))},v(Ta,"HyperEdgeSegmentSplitter/lambda$4$Type",1863),m(653,1,{},SK),s.a=0,s.b=0,s.c=0,v(Ta,"OrthogonalRoutingGenerator",653),m(1668,1,{},Ex),s.Kb=function(n){return new wn(null,new pn(u(n,116).e,16))},v(Ta,"OrthogonalRoutingGenerator/lambda$0$Type",1668),m(1669,1,{},jx),s.Kb=function(n){return new wn(null,new pn(u(n,116).j,16))},v(Ta,"OrthogonalRoutingGenerator/lambda$1$Type",1669),m(661,1,{}),v(Vee,"BaseRoutingDirectionStrategy",661),m(1849,661,{},wMe),s.xg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A,N,_;if(!(n.r&&!n.q))for(p=t+n.o*i,b=new L(n.n);b.aIh&&(o=p,c=n,r=new Ee(y,o),Vt(l.a,r),p2(this,l,c,r,!1),S=n.r,S&&(A=te(re(Qu(S.e,0))),r=new Ee(A,o),Vt(l.a,r),p2(this,l,c,r,!1),o=t+S.o*i,c=S,r=new Ee(A,o),Vt(l.a,r),p2(this,l,c,r,!1)),r=new Ee(_,o),Vt(l.a,r),p2(this,l,c,r,!1)))},s.yg=function(n){return n.i.n.a+n.n.a+n.a.a},s.zg=function(){return Ne(),bt},s.Ag=function(){return Ne(),Un},v(Vee,"NorthToSouthRoutingStrategy",1849),m(1850,661,{},pMe),s.xg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A,N,_;if(!(n.r&&!n.q))for(p=t-n.o*i,b=new L(n.n);b.aIh&&(o=p,c=n,r=new Ee(y,o),Vt(l.a,r),p2(this,l,c,r,!1),S=n.r,S&&(A=te(re(Qu(S.e,0))),r=new Ee(A,o),Vt(l.a,r),p2(this,l,c,r,!1),o=t-S.o*i,c=S,r=new Ee(A,o),Vt(l.a,r),p2(this,l,c,r,!1)),r=new Ee(_,o),Vt(l.a,r),p2(this,l,c,r,!1)))},s.yg=function(n){return n.i.n.a+n.n.a+n.a.a},s.zg=function(){return Ne(),Un},s.Ag=function(){return Ne(),bt},v(Vee,"SouthToNorthRoutingStrategy",1850),m(1848,661,{},mMe),s.xg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A,N,_;if(!(n.r&&!n.q))for(p=t+n.o*i,b=new L(n.n);b.aIh&&(o=p,c=n,r=new Ee(o,y),Vt(l.a,r),p2(this,l,c,r,!0),S=n.r,S&&(A=te(re(Qu(S.e,0))),r=new Ee(o,A),Vt(l.a,r),p2(this,l,c,r,!0),o=t+S.o*i,c=S,r=new Ee(o,A),Vt(l.a,r),p2(this,l,c,r,!0)),r=new Ee(o,_),Vt(l.a,r),p2(this,l,c,r,!0)))},s.yg=function(n){return n.i.n.b+n.n.b+n.a.b},s.zg=function(){return Ne(),Wn},s.Ag=function(){return Ne(),Xn},v(Vee,"WestToEastRoutingStrategy",1848),m(812,1,{},lge),s.Ib=function(){return Qa(this.a)},s.b=0,s.c=!1,s.d=!1,s.f=0,v(xm,"NubSpline",812),m(410,1,{410:1},qUe,yIe),v(xm,"NubSpline/PolarCP",410),m(1440,1,lc,wJe),s.pg=function(n){return oxn(u(n,37))},s.If=function(n,t){FRn(this,u(n,37),t)};var Gon,qon,Uon,Xon,Von;v(xm,"SplineEdgeRouter",1440),m(273,1,{273:1},tB),s.Ib=function(){return this.a+" ->("+this.c+") "+this.b},s.c=0,v(xm,"SplineEdgeRouter/Dependency",273),m(454,23,{3:1,35:1,23:1,454:1},Ese);var Db,h4,Kon=vt(xm,"SplineEdgeRouter/SideToProcess",454,At,m5n,zmn),Qon;m(1441,1,Rt,P1),s.Mb=function(n){return aS(),!u(n,132).o},v(xm,"SplineEdgeRouter/lambda$0$Type",1441),m(1442,1,{},Od),s.Xe=function(n){return aS(),u(n,132).v+1},v(xm,"SplineEdgeRouter/lambda$1$Type",1442),m(1443,1,rt,uTe),s.Ad=function(n){rvn(this.a,this.b,u(n,49))},v(xm,"SplineEdgeRouter/lambda$2$Type",1443),m(1444,1,rt,oTe),s.Ad=function(n){cvn(this.a,this.b,u(n,49))},v(xm,"SplineEdgeRouter/lambda$3$Type",1444),m(132,1,{35:1,132:1},ZGe,gge),s.Dd=function(n){return pgn(this,u(n,132))},s.b=0,s.e=!1,s.f=0,s.g=0,s.j=!1,s.k=!1,s.n=0,s.o=!1,s.p=!1,s.q=!1,s.s=0,s.u=0,s.v=0,s.F=0,v(xm,"SplineSegment",132),m(457,1,{457:1},hp),s.a=0,s.b=!1,s.c=!1,s.d=!1,s.e=!1,s.f=0,v(xm,"SplineSegment/EdgeInformation",457),m(1167,1,{},Sx),v(hd,nwe,1167),m(1168,1,Kt,EI),s.Le=function(n,t){return LCn(u(n,120),u(t,120))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(hd,KQe,1168),m(1166,1,{},OAe),v(hd,"MrTree",1166),m(398,23,{3:1,35:1,23:1,398:1,188:1,196:1},k$),s.bg=function(){return Eqe(this)},s.og=function(){return Eqe(this)};var RJ,RM,BM,zM,tye=vt(hd,"TreeLayoutPhases",398,At,y6n,Fmn),Yon;m(1082,214,E2,iNe),s.kf=function(n,t){var i,r,c,o,l,f,h,b;for(Re($e(ve(n,(Tu(),xye))))||VC((i=new yE((cg(),new B0(n))),i)),l=t.dh(Yee),l.Tg("build tGraph",1),f=(h=new tO,$u(h,n),ae(h,(Ci(),HM),n),b=new wt,pIn(n,h,b),IIn(n,h,b),h),l.Ug(),l=t.dh(Yee),l.Tg("Split graph",1),o=jIn(this.a,f),l.Ug(),c=new L(o);c.a"+pg(this.c):"e_"+Ni(this)},v(RS,"TEdge",65),m(120,150,{3:1,120:1,105:1,150:1},tO),s.Ib=function(){var n,t,i,r,c;for(c=null,r=jt(this.b,0);r.b!=r.d.c;)i=u(kt(r),40),c+=(i.c==null||i.c.length==0?"n_"+i.g:"n_"+i.c)+` -`;for(t=jt(this.a,0);t.b!=t.d.c;)n=u(kt(t),65),c+=(n.b&&n.c?pg(n.b)+"->"+pg(n.c):"e_"+Ni(n))+` -`;return c};var tzn=v(RS,"TGraph",120);m(633,494,{3:1,494:1,633:1,105:1,150:1}),v(RS,"TShape",633),m(40,633,{3:1,494:1,40:1,633:1,105:1,150:1},iY),s.Ib=function(){return pg(this)};var BJ=v(RS,"TNode",40);m(236,1,a1,J1),s.Ic=function(n){oc(this,n)},s.Jc=function(){var n;return n=jt(this.a.d,0),new X3(n)},v(RS,"TNode/2",236),m(334,1,Jr,X3),s.Nb=function(n){nc(this,n)},s.Pb=function(){return u(kt(this.a),65).c},s.Ob=function(){return nC(this.a)},s.Qb=function(){NQ(this.a)},v(RS,"TNode/2/1",334),m(1893,1,xi,vo),s.If=function(n,t){pBn(this,u(n,120),t)},v(go,"CompactionProcessor",1893),m(1894,1,Kt,Tje),s.Le=function(n,t){return J7n(this.a,u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(go,"CompactionProcessor/lambda$0$Type",1894),m(1895,1,Rt,fTe),s.Mb=function(n){return c5n(this.b,this.a,u(n,49))},s.a=0,s.b=0,v(go,"CompactionProcessor/lambda$1$Type",1895),m(1904,1,Kt,Pl),s.Le=function(n,t){return Wvn(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(go,"CompactionProcessor/lambda$10$Type",1904),m(1905,1,Kt,Pk),s.Le=function(n,t){return k2n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(go,"CompactionProcessor/lambda$11$Type",1905),m(1906,1,Kt,t5),s.Le=function(n,t){return Zvn(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(go,"CompactionProcessor/lambda$12$Type",1906),m(1896,1,Rt,Cje),s.Mb=function(n){return o2n(this.a,u(n,49))},s.a=0,v(go,"CompactionProcessor/lambda$2$Type",1896),m(1897,1,Rt,Oje),s.Mb=function(n){return s2n(this.a,u(n,49))},s.a=0,v(go,"CompactionProcessor/lambda$3$Type",1897),m(1898,1,Rt,R3),s.Mb=function(n){return u(n,40).c.indexOf($F)==-1},v(go,"CompactionProcessor/lambda$4$Type",1898),m(1899,1,{},Nje),s.Kb=function(n){return Qyn(this.a,u(n,40))},s.a=0,v(go,"CompactionProcessor/lambda$5$Type",1899),m(pb,1,{},Dje),s.Kb=function(n){return f8n(this.a,u(n,40))},s.a=0,v(go,"CompactionProcessor/lambda$6$Type",pb),m(1901,1,Kt,_je),s.Le=function(n,t){return m9n(this.a,u(n,240),u(t,240))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(go,"CompactionProcessor/lambda$7$Type",1901),m(1902,1,Kt,Ije),s.Le=function(n,t){return v9n(this.a,u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(go,"CompactionProcessor/lambda$8$Type",1902),m(1903,1,Kt,$k),s.Le=function(n,t){return E2n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(go,"CompactionProcessor/lambda$9$Type",1903),m(1891,1,xi,V6),s.If=function(n,t){d_n(u(n,120),t)},v(go,"DirectionProcessor",1891),m(1883,1,xi,rNe),s.If=function(n,t){_In(this,u(n,120),t)},v(go,"FanProcessor",1883),m(1251,1,xi,i5),s.If=function(n,t){aXe(u(n,120),t)},v(go,"GraphBoundsProcessor",1251),m(1252,1,{},nU),s.We=function(n){return u(n,40).e.a},v(go,"GraphBoundsProcessor/lambda$0$Type",1252),m(1253,1,{},Us),s.We=function(n){return u(n,40).e.b},v(go,"GraphBoundsProcessor/lambda$1$Type",1253),m(1254,1,{},Mx),s.We=function(n){return Jgn(u(n,40))},v(go,"GraphBoundsProcessor/lambda$2$Type",1254),m(1255,1,{},Ax),s.We=function(n){return Ggn(u(n,40))},v(go,"GraphBoundsProcessor/lambda$3$Type",1255),m(264,23,{3:1,35:1,23:1,264:1,196:1},zw),s.bg=function(){switch(this.g){case 0:return new DMe;case 1:return new rNe;case 2:return new NMe;case 3:return new Tx;case 4:return new SI;case 8:return new jI;case 5:return new V6;case 6:return new ph;case 7:return new vo;case 9:return new i5;case 10:return new sl;default:throw $(new Jn(iee+(this.f!=null?this.f:""+this.g)))}};var iye,rye,cye,uye,oye,sye,lye,fye,aye,hye,dre,izn=vt(go,ree,264,At,ize,Hmn),Won;m(1890,1,xi,jI),s.If=function(n,t){gRn(u(n,120),t)},v(go,"LevelCoordinatesProcessor",1890),m(1888,1,xi,SI),s.If=function(n,t){$Nn(this,u(n,120),t)},s.a=0,v(go,"LevelHeightProcessor",1888),m(1889,1,a1,tU),s.Ic=function(n){oc(this,n)},s.Jc=function(){return yn(),_9(),C7},v(go,"LevelHeightProcessor/1",1889),m(1884,1,xi,NMe),s.If=function(n,t){QDn(this,u(n,120),t)},v(go,"LevelProcessor",1884),m(1885,1,Rt,xx),s.Mb=function(n){return Re($e(T(u(n,40),(Ci(),_b))))},v(go,"LevelProcessor/lambda$0$Type",1885),m(1886,1,xi,Tx),s.If=function(n,t){qTn(this,u(n,120),t)},s.a=0,v(go,"NeighborsProcessor",1886),m(1887,1,a1,Cx),s.Ic=function(n){oc(this,n)},s.Jc=function(){return yn(),_9(),C7},v(go,"NeighborsProcessor/1",1887),m(1892,1,xi,ph),s.If=function(n,t){NIn(this,u(n,120),t)},s.a=0,v(go,"NodePositionProcessor",1892),m(1882,1,xi,DMe),s.If=function(n,t){wPn(this,u(n,120),t)},v(go,"RootProcessor",1882),m(1907,1,xi,sl),s.If=function(n,t){_Sn(u(n,120),t)},v(go,"Untreeifyer",1907),m(385,23,{3:1,35:1,23:1,385:1},fV);var MD,bre,dye,bye=vt(zN,"EdgeRoutingMode",385,At,byn,Jmn),Zon,AD,Q7,gre,gye,wye,wre,pre,pye,mre,mye,vre,FM,yre,zJ,FJ,ta,Da,Y7,HM,JM,a0,vye,esn,kre,_b,xD,TD;m(846,1,eh,OT),s.tf=function(n){Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,F2e),""),qYe),"Turns on Tree compaction which decreases the size of the whole tree by placing nodes of multiple levels in one large level"),(Ln(),!1)),(Og(),xr)),Yi),nn((Th(),Sn))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,H2e),""),"Edge End Texture Length"),"Should be set to the length of the texture at the end of an edge. This value can be used to improve the Edge Routing."),7),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,J2e),""),"Tree Level"),"The index for the tree level the node is in"),me(0)),gc),Mr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,G2e),""),qYe),"When set to a positive number this option will force the algorithm to place the node to the specified position within the trees layer if weighting is set to constraint"),me(-1)),gc),Mr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,q2e),""),"Weighting of Nodes"),"Which weighting to use when computing a node order."),Eye),Bi),Iye),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,U2e),""),"Edge Routing Mode"),"Chooses an Edge Routing algorithm."),yye),Bi),bye),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,X2e),""),"Search Order"),"Which search order to use when computing a spanning tree."),kye),Bi),Pye),nn(Sn)))),LKe((new gP,n))};var nsn,tsn,isn,yye,rsn,csn,kye,usn,osn,Eye;v(zN,"MrTreeMetaDataProvider",846),m(990,1,eh,gP),s.tf=function(n){LKe(n)};var ssn,jye,Sye,J2,Mye,Aye,Ere,lsn,fsn,asn,hsn,dsn,bsn,gsn,xye,Tye,Cye,wsn,d4,HJ,Oye,psn,Nye,jre,msn,vsn,ysn,Dye,ksn,Hh,_ye;v(zN,"MrTreeOptions",990),m(991,1,{},Rk),s.uf=function(){var n;return n=new iNe,n},s.vf=function(n){},v(zN,"MrTreeOptions/MrtreeFactory",991),m(353,23,{3:1,35:1,23:1,353:1},E$);var Sre,JJ,Mre,Are,Iye=vt(zN,"OrderWeighting",353,At,S6n,Gmn),Esn;m(425,23,{3:1,35:1,23:1,425:1},jse);var Lye,xre,Pye=vt(zN,"TreeifyingOrder",425,At,v5n,qmn),jsn;m(1446,1,lc,IU),s.pg=function(n){return u(n,120),Ssn},s.If=function(n,t){v7n(this,u(n,120),t)};var Ssn;v("org.eclipse.elk.alg.mrtree.p1treeify","DFSTreeifyer",1446),m(1447,1,lc,hP),s.pg=function(n){return u(n,120),Msn},s.If=function(n,t){e_n(this,u(n,120),t)};var Msn;v(d7,"NodeOrderer",1447),m(1454,1,{},iU),s.rd=function(n){return uDe(n)},v(d7,"NodeOrderer/0methodref$lambda$6$Type",1454),m(1448,1,Rt,TI),s.Mb=function(n){return ry(),Re($e(T(u(n,40),(Ci(),_b))))},v(d7,"NodeOrderer/lambda$0$Type",1448),m(1449,1,Rt,CI),s.Mb=function(n){return ry(),u(T(u(n,40),(Tu(),d4)),15).a<0},v(d7,"NodeOrderer/lambda$1$Type",1449),m(1450,1,Rt,Pje),s.Mb=function(n){return u7n(this.a,u(n,40))},v(d7,"NodeOrderer/lambda$2$Type",1450),m(1451,1,Rt,Lje),s.Mb=function(n){return Yyn(this.a,u(n,40))},v(d7,"NodeOrderer/lambda$3$Type",1451),m(1452,1,Kt,_x),s.Le=function(n,t){return M8n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(d7,"NodeOrderer/lambda$4$Type",1452),m(1453,1,Rt,OI),s.Mb=function(n){return ry(),u(T(u(n,40),(Ci(),pre)),15).a!=0},v(d7,"NodeOrderer/lambda$5$Type",1453),m(1455,1,lc,LU),s.pg=function(n){return u(n,120),Asn},s.If=function(n,t){uIn(this,u(n,120),t)},s.b=0;var Asn;v("org.eclipse.elk.alg.mrtree.p3place","NodePlacer",1455),m(1456,1,lc,CT),s.pg=function(n){return u(n,120),xsn},s.If=function(n,t){F_n(u(n,120),t)};var xsn,rzn=v(rl,"EdgeRouter",1456);m(1458,1,Kt,Bk),s.Le=function(n,t){return oo(u(n,15).a,u(t,15).a)},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/0methodref$compare$Type",1458),m(1463,1,{},Ox),s.We=function(n){return te(re(n))},v(rl,"EdgeRouter/1methodref$doubleValue$Type",1463),m(1465,1,Kt,Tw),s.Le=function(n,t){return ki(te(re(n)),te(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/2methodref$compare$Type",1465),m(1467,1,Kt,zk),s.Le=function(n,t){return ki(te(re(n)),te(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/3methodref$compare$Type",1467),m(1469,1,{},K6),s.We=function(n){return te(re(n))},v(rl,"EdgeRouter/4methodref$doubleValue$Type",1469),m(1471,1,Kt,Nx),s.Le=function(n,t){return ki(te(re(n)),te(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/5methodref$compare$Type",1471),m(1473,1,Kt,Dx),s.Le=function(n,t){return ki(te(re(n)),te(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/6methodref$compare$Type",1473),m(1457,1,{},MI),s.Kb=function(n){return nd(),u(T(u(n,40),(Tu(),Hh)),15)},v(rl,"EdgeRouter/lambda$0$Type",1457),m(1468,1,{},AI),s.Kb=function(n){return I2n(u(n,40))},v(rl,"EdgeRouter/lambda$11$Type",1468),m(1470,1,{},hTe),s.Kb=function(n){return tvn(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(rl,"EdgeRouter/lambda$13$Type",1470),m(1472,1,{},aTe),s.Kb=function(n){return $2n(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(rl,"EdgeRouter/lambda$15$Type",1472),m(1474,1,Kt,xI),s.Le=function(n,t){return aSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/lambda$17$Type",1474),m(1475,1,Kt,rU),s.Le=function(n,t){return hSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/lambda$18$Type",1475),m(1476,1,Kt,NI),s.Le=function(n,t){return bSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/lambda$19$Type",1476),m(1459,1,Rt,$je),s.Mb=function(n){return I5n(this.a,u(n,40))},s.a=0,v(rl,"EdgeRouter/lambda$2$Type",1459),m(1477,1,Kt,DI),s.Le=function(n,t){return dSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/lambda$20$Type",1477),m(1460,1,Kt,_I),s.Le=function(n,t){return q3n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/lambda$3$Type",1460),m(1461,1,Kt,Ix),s.Le=function(n,t){return U3n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"EdgeRouter/lambda$4$Type",1461),m(1462,1,{},II),s.Kb=function(n){return L2n(u(n,40))},v(rl,"EdgeRouter/lambda$5$Type",1462),m(1464,1,{},dTe),s.Kb=function(n){return ivn(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(rl,"EdgeRouter/lambda$7$Type",1464),m(1466,1,{},bTe),s.Kb=function(n){return P2n(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(rl,"EdgeRouter/lambda$9$Type",1466),m(662,1,{662:1},cJe),s.e=0,s.f=!1,s.g=!1,v(rl,"MultiLevelEdgeNodeNodeGap",662),m(1864,1,Kt,LI),s.Le=function(n,t){return X5n(u(n,240),u(t,240))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"MultiLevelEdgeNodeNodeGap/lambda$0$Type",1864),m(1865,1,Kt,PI),s.Le=function(n,t){return V5n(u(n,240),u(t,240))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(rl,"MultiLevelEdgeNodeNodeGap/lambda$1$Type",1865);var b4;m(487,23,{3:1,35:1,23:1,487:1,188:1,196:1},Sse),s.bg=function(){return JFe(this)},s.og=function(){return JFe(this)};var GJ,g4,$ye=vt(V2e,"RadialLayoutPhases",487,At,y5n,Umn),Tsn;m(1083,214,E2,_Ae),s.kf=function(n,t){var i,r,c,o,l,f;if(i=FUe(this,n),t.Tg("Radial layout",i.c.length),Re($e(ve(n,(ab(),Vye))))||VC((r=new yE((cg(),new B0(n))),r)),f=fxn(n),Ei(n,(lv(),b4),f),!f)throw $(new Jn("The given graph is not a tree!"));for(c=te(re(ve(n,XJ))),c==0&&(c=gqe(n)),Ei(n,XJ,c),l=new L(FUe(this,n));l.a=3)for(fe=u(V(ie,0),26),_e=u(V(ie,1),26),o=0;o+2=fe.f+_e.f+p||_e.f>=de.f+fe.f+p){cn=!0;break}else++o;else cn=!0;if(!cn){for(S=ie.i,f=new ot(ie);f.e!=f.i.gc();)l=u(ft(f),26),Ei(l,(Gt(),FD),me(S)),--S;pVe(n,new j5),t.Ug();return}for(i=(JC(this.a),va(this.a,(iz(),GM),u(ve(n,M6e),188)),va(this.a,VJ,u(ve(n,v6e),188)),va(this.a,Bre,u(ve(n,E6e),188)),zse(this.a,(Mn=new sr,Ht(Mn,GM,(Az(),Hre)),Ht(Mn,VJ,Fre),Re($e(ve(n,p6e)))&&Ht(Mn,GM,Jre),Re($e(ve(n,w6e)))&&Ht(Mn,GM,zre),Mn)),lN(this.a,n)),b=1/i.c.length,N=new L(i);N.a0&&aFe((Kn(t-1,n.length),n.charCodeAt(t-1)),oYe);)--t;if(r>=t)throw $(new Jn("The given string does not contain any numbers."));if(c=vm((Zr(r,t,n.length),n.substr(r,t-r)),`,|;|\r| -`),c.length!=2)throw $(new Jn("Exactly two numbers are expected, "+c.length+" were found."));try{this.a=hm(dm(c[0])),this.b=hm(dm(c[1]))}catch(o){throw o=lr(o),X(o,131)?(i=o,$(new Jn(sYe+i))):$(o)}},s.Ib=function(){return"("+this.a+","+this.b+")"},s.a=0,s.b=0;var $r=v(IN,"KVector",8);m(78,66,{3:1,4:1,20:1,31:1,56:1,18:1,66:1,16:1,78:1,414:1},Os,QP,xOe),s.Nc=function(){return Fkn(this)},s.ag=function(n){var t,i,r,c,o,l;r=vm(n,`,|;|\\(|\\)|\\[|\\]|\\{|\\}| | | -`),Ws(this);try{for(i=0,o=0,c=0,l=0;i0&&(o%2==0?c=hm(r[i]):l=hm(r[i]),o>0&&o%2!=0&&Vt(this,new Ee(c,l)),++o),++i}catch(f){throw f=lr(f),X(f,131)?(t=f,$(new Jn("The given string does not match the expected format for vectors."+t))):$(f)}},s.Ib=function(){var n,t,i;for(n=new fl("("),t=jt(this,0);t.b!=t.d.c;)i=u(kt(t),8),Xt(n,i.a+","+i.b),t.b!=t.d.c&&(n.a+="; ");return(n.a+=")",n).a};var s9e=v(IN,"KVectorChain",78);m(256,23,{3:1,35:1,23:1,256:1},UE);var fce,rG,cG,ID,LD,uG,l9e=vt(Oo,"Alignment",256,At,H9n,v3n),lfn;m(975,1,eh,IT),s.tf=function(n){eVe(n)};var f9e,ace,ffn,a9e,h9e,afn,d9e,hfn,dfn,b9e,g9e,bfn;v(Oo,"BoxLayouterOptions",975),m(976,1,{},Kx),s.uf=function(){var n;return n=new pL,n},s.vf=function(n){},v(Oo,"BoxLayouterOptions/BoxFactory",976),m(299,23,{3:1,35:1,23:1,299:1},XE);var WM,hce,ZM,eA,nA,dce,bce=vt(Oo,"ContentAlignment",299,At,J9n,y3n),gfn;m(689,1,eh,_T),s.tf=function(n){Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,dWe),""),"Layout Algorithm"),"Select a specific layout algorithm."),(Og(),c6)),Be),nn((Th(),Sn))))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,bWe),""),"Resolved Layout Algorithm"),"Meta data associated with the selected algorithm."),oh),ozn),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,w2e),""),"Alignment"),"Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."),w9e),Bi),l9e),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,u7),""),"Aspect Ratio"),"The desired aspect ratio of the drawing, that is the quotient of width by height."),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,Ope),""),"Bend Points"),"A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points."),oh),s9e),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,_F),""),"Content Alignment"),"Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option."),m9e),r6),bce),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,BN),""),"Debug Mode"),"Whether additional debug information shall be generated."),(Ln(),!1)),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Jee),""),"Direction"),"Overall direction of edges: horizontal (right / left) or vertical (down / up)."),v9e),Bi),iA),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,RN),""),"Edge Routing"),"What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline."),E9e),Bi),Tce),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Tpe),""),"Expand Nodes"),"If active, nodes are expanded to fill the area of their parent."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,DF),""),"Hierarchy Handling"),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),S9e),Bi),d8e),Ti(Sn,z(B(uh,1),ye,160,0,[ar]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Am),""),"Padding"),"The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately."),L9e),oh),k3e),Ti(Sn,z(B(uh,1),ye,160,0,[ar]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,OS),""),"Interactive"),"Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,LF),""),"interactive Layout"),"Whether the graph should be changeable interactively and by setting constraints"),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,NS),""),"Omit Node Micro Layout"),"Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,eee),""),"Port Constraints"),"Defines constraints of the position of the ports of a node."),z9e),Bi),w8e),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,IF),""),"Position"),"The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."),oh),$r),Ti(ar,z(B(uh,1),ye,160,0,[h0,wd]))))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,TN),""),"Priority"),"Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."),gc),Mr),Ti(ar,z(B(uh,1),ye,160,0,[_a]))))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,dF),""),"Randomization Seed"),"Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time)."),gc),Mr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,CS),""),"Separate Connected Components"),"Whether each connected component should be processed separately."),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,x2e),""),"Junction Points"),"This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order."),x9e),oh),s9e),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,N2e),""),"Comment Box"),"Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related."),!1),xr),Yi),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,D2e),""),"Hypernode"),"Whether the node should be handled as a hypernode."),!1),xr),Yi),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,IBn),""),"Label Manager"),"Label managers can shorten labels upon a layout algorithm's request."),oh),dzn),Ti(Sn,z(B(uh,1),ye,160,0,[wd]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,gWe),""),"Softwrapping Fuzziness"),"Determines the amount of fuzziness to be used when performing softwrapping on labels. The value expresses the percent of overhang that is permitted for each line. If the next line would take up less space than this threshold, it is appended to the current line instead of being placed in a new line."),0),tc),wr),nn(wd)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,I2e),""),"Margins"),"Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels."),T9e),oh),y3e),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,b2e),""),"No Layout"),"No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node."),!1),xr),Yi),Ti(ar,z(B(uh,1),ye,160,0,[_a,h0,wd]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,wWe),""),"Scale Factor"),"The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set."),1),tc),wr),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,pWe),""),"Child Area Width"),"The width of the area occupied by the laid out children of a node."),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,mWe),""),"Child Area Height"),"The height of the area occupied by the laid out children of a node."),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,CN),""),sWe),"Turns topdown layout on and off. If this option is enabled, hierarchical layout will be computed first for the root node and then for its children recursively. Layouts are then scaled down to fit the area provided by their parents. Graphs must follow a certain structure for topdown layout to work properly. {@link TopdownNodeTypes.PARALLEL_NODE} nodes must have children of type {@link TopdownNodeTypes.HIERARCHICAL_NODE} and must define {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} for their children. Furthermore they need to be laid out using an algorithm that is a {@link TopdownLayoutProvider}. Hierarchical nodes can also be parents of other hierarchical nodes and can optionally use a {@link TopdownSizeApproximator} to dynamically set sizes during topdown layout. In this case {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} should be set on the node itself rather than the parent. The values are then used by the size approximator as base values. Hierarchical nodes require the layout option {@link nodeSize.fixedGraphSize} to be true to prevent the algorithm used there from resizing the hierarchical node. This option is not supported if 'Hierarchy Handling' is set to 'INCLUDE_CHILDREN'"),!1),xr),Yi),nn(Sn)))),Gi(n,CN,j2,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,vWe),""),"Animate"),"Whether the shift from the old layout to the new computed layout shall be animated."),!0),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,yWe),""),"Animation Time Factor"),"Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'."),me(100)),gc),Mr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,kWe),""),"Layout Ancestors"),"Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,EWe),""),"Maximal Animation Time"),"The maximal time for animations, in milliseconds."),me(4e3)),gc),Mr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,jWe),""),"Minimal Animation Time"),"The minimal time for animations, in milliseconds."),me(400)),gc),Mr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,SWe),""),"Progress Bar"),"Whether a progress bar shall be displayed during layout computations."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,MWe),""),"Validate Graph"),"Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,AWe),""),"Validate Options"),"Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!0),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,xWe),""),"Zoom to Fit"),"Whether the zoom level shall be set to view the whole diagram after layout."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Cpe),"box"),"Box Layout Mode"),"Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better."),p9e),Bi),C8e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,TWe),"json"),"Shape Coords"),"For layouts transferred into JSON graphs, specify the coordinate system to be used for nodes, ports, and labels of nodes and ports."),A9e),Bi),v8e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,CWe),"json"),"Edge Coords"),"For layouts transferred into JSON graphs, specify the coordinate system to be used for edge route points and edge labels."),M9e),Bi),e8e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,t2e),th),"Comment Comment Spacing"),"Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing."),10),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,i2e),th),"Comment Node Spacing"),"Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing."),10),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,r2e),th),"Components Spacing"),"Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."),20),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,c2e),th),"Edge Spacing"),"Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines."),10),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,ZZ),th),"Edge Label Spacing"),"The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option."),2),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Hee),th),"Edge Node Spacing"),"Spacing to be preserved between nodes and edges."),10),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,u2e),th),"Label Spacing"),"Determines the amount of space to be left between two labels of the same graph element."),0),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,l2e),th),"Label Node Spacing"),"Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option."),5),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,o2e),th),"Horizontal spacing between Label and Port"),"Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,s2e),th),"Vertical spacing between Label and Port"),"Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Mm),th),"Node Spacing"),"The minimal distance to be preserved between each two nodes."),20),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,f2e),th),"Node Self Loop Spacing"),"Spacing to be preserved between a node and its self loops."),10),tc),wr),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,a2e),th),"Port Spacing"),"Spacing between pairs of ports of the same node."),10),tc),wr),Ti(Sn,z(B(uh,1),ye,160,0,[ar]))))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,h2e),th),"Individual Spacing"),"Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."),oh),aan),Ti(ar,z(B(uh,1),ye,160,0,[_a,h0,wd]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,L2e),th),"Additional Port Space"),"Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border."),Q9e),oh),y3e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,qee),DWe),"Layout Partition"),"Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction)."),gc),Mr),Ti(Sn,z(B(uh,1),ye,160,0,[ar]))))),Gi(n,qee,Gee,xfn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Gee),DWe),"Layout Partitioning"),"Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle."),P9e),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,v2e),_We),"Node Label Padding"),"Define padding for node labels that are placed inside of a node."),O9e),oh),k3e),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,s7),_We),"Node Label Placement"),"Hints for where node labels are to be placed; if empty, the node label's position is not modified."),N9e),r6),$c),Ti(ar,z(B(uh,1),ye,160,0,[wd]))))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,E2e),JF),"Port Alignment"),"Defines the default port distribution for a node. May be overridden for each side individually."),R9e),Bi),oA),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,j2e),JF),"Port Alignment (North)"),"Defines how ports on the northern side are placed, overriding the node's general port alignment."),Bi),oA),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,S2e),JF),"Port Alignment (South)"),"Defines how ports on the southern side are placed, overriding the node's general port alignment."),Bi),oA),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,M2e),JF),"Port Alignment (West)"),"Defines how ports on the western side are placed, overriding the node's general port alignment."),Bi),oA),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,A2e),JF),"Port Alignment (East)"),"Defines how ports on the eastern side are placed, overriding the node's general port alignment."),Bi),oA),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,zv),wne),"Node Size Constraints"),"What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed."),D9e),r6),fA),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Dy),wne),"Node Size Options"),"Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications."),I9e),r6),y8e),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,_y),wne),"Node Size Minimum"),"The minimal size to which a node can be reduced."),_9e),oh),$r),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,o7),wne),"Fixed Graph Size"),"By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so."),!1),xr),Yi),nn(Sn)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,C2e),Fee),"Edge Label Placement"),"Gives a hint on where to put edge labels."),y9e),Bi),n8e),nn(wd)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,bF),Fee),"Inline Edge Labels"),"If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible."),!1),xr),Yi),nn(wd)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,LBn),"font"),"Font Name"),"Font name used for a label."),c6),Be),nn(wd)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,OWe),"font"),"Font Size"),"Font size used for a label."),gc),Mr),nn(wd)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,_2e),pne),"Port Anchor Offset"),"The offset to the port position where connections shall be attached."),oh),$r),nn(h0)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,O2e),pne),"Port Index"),"The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case."),gc),Mr),nn(h0)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,g2e),pne),"Port Side"),"The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports."),J9e),Bi),Ac),nn(h0)))),Ye(n,new Je(Ke(Ve(Qe(Ge(Xe(qe(Ue(new Fe,d2e),pne),"Port Border Offset"),"The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border."),tc),wr),nn(h0)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,l7),_pe),"Port Label Placement"),"Decides on a placement method for port labels; if empty, the node label's position is not modified."),F9e),r6),dG),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,y2e),_pe),"Port Labels Next to Port"),"Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."),!1),xr),Yi),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,k2e),_pe),"Treat Port Labels as Group"),"If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port."),!0),xr),Yi),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,bne),m7),"Number of size categories"),"Defines the number of categories to use for the FIXED_INTEGER_RATIO_BOXES size approximator."),me(3)),gc),Mr),nn(Sn)))),Gi(n,bne,gne,Bfn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Npe),m7),"Weight of a node containing children for determining the graph size"),"When determining the graph size for the size categorisation, this value determines how many times a node containing children is weighted more than a simple node. For example setting this value to four would result in a graph containing a simple node and a hierarchical node to be counted as having a size of five."),me(4)),gc),Mr),nn(Sn)))),Gi(n,Npe,bne,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,ON),m7),"Topdown Scale Factor"),"The scaling factor to be applied to the nodes laid out within the node in recursive topdown layout. The difference to 'Scale Factor' is that the node itself is not scaled. This value has to be set on hierarchical nodes."),1),tc),wr),nn(Sn)))),Gi(n,ON,j2,Pfn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,gne),m7),"Topdown Size Approximator"),"The size approximator to be used to set sizes of hierarchical nodes during topdown layout. The default value is null, which results in nodes keeping whatever size is defined for them e.g. through parent parallel node or by manually setting the size."),null),oh),szn),nn(ar)))),Gi(n,gne,j2,$fn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,NN),m7),"Topdown Hierarchical Node Width"),"The fixed size of a hierarchical node when using topdown layout. If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."),150),tc),wr),Ti(Sn,z(B(uh,1),ye,160,0,[ar]))))),Gi(n,NN,j2,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,DN),m7),"Topdown Hierarchical Node Aspect Ratio"),"The fixed aspect ratio of a hierarchical node when using topdown layout. Default is 1/sqrt(2). If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."),1.414),tc),wr),Ti(Sn,z(B(uh,1),ye,160,0,[ar]))))),Gi(n,DN,j2,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,j2),m7),"Topdown Node Type"),"The different node types used for topdown layout. If the node type is set to {@link TopdownNodeTypes.PARALLEL_NODE} the algorithm must be set to a {@link TopdownLayoutProvider} such as {@link TopdownPacking}. The {@link nodeSize.fixedGraphSize} option is technically only required for hierarchical nodes."),null),Bi),E8e),nn(ar)))),Gi(n,j2,o7,null),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,Dpe),m7),"Topdown Scale Cap"),"Determines the upper limit for the topdown scale factor. The default value is 1.0 which ensures that nested children never end up appearing larger than their parents in terms of unit sizes such as the font size. If the limit is larger, nodes will fully utilize the available space, but it is counteriniuitive for inner nodes to have a larger scale than outer nodes."),1),tc),wr),nn(Sn)))),Gi(n,Dpe,j2,Lfn),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,p2e),IWe),"Activate Inside Self Loops"),"Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports."),!1),xr),Yi),nn(ar)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,m2e),IWe),"Inside Self Loop"),"Whether a self loop should be routed inside a node instead of around that node."),!1),xr),Yi),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,T2e),"edge"),"Edge Thickness"),"The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it."),1),tc),wr),nn(_a)))),Ye(n,new Je(Ke(Ve(Qe(hn(Ge(Xe(qe(Ue(new Fe,NWe),"edge"),"Edge Type"),"The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."),j9e),Bi),o8e),nn(_a)))),$E(n,new Y5(NE(T9(x9(new _0,Pn),"Layered"),'The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.'))),$E(n,new Y5(NE(T9(x9(new _0,"org.eclipse.elk.orthogonal"),"Orthogonal"),`Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia '86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.`))),$E(n,new Y5(NE(T9(x9(new _0,$o),"Force"),"Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984."))),$E(n,new Y5(NE(T9(x9(new _0,"org.eclipse.elk.circle"),"Circle"),"Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph."))),$E(n,new Y5(NE(T9(x9(new _0,UYe),"Tree"),"Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type."))),$E(n,new Y5(NE(T9(x9(new _0,"org.eclipse.elk.planar"),"Planar"),"Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable."))),$E(n,new Y5(NE(T9(x9(new _0,Zl),"Radial"),"Radial layout algorithms usually position the nodes of the graph on concentric circles."))),RXe((new zU,n)),eVe((new IT,n)),fXe((new FU,n))};var u6,wfn,w9e,Z7,pfn,mfn,p9e,Zm,e3,vfn,PD,m9e,$D,Wg,v9e,gce,wce,y9e,k9e,E9e,yfn,j9e,kfn,p4,S9e,Efn,RD,pce,BD,mce,jfn,M9e,Sfn,A9e,m4,x9e,ek,T9e,C9e,O9e,v4,N9e,Zg,D9e,n3,y4,_9e,Ib,I9e,oG,zD,y1,L9e,Mfn,P9e,Afn,xfn,$9e,R9e,vce,yce,kce,Ece,B9e,Fs,tA,z9e,jce,Sce,t3,F9e,H9e,k4,J9e,o6,FD,Mce,i3,Tfn,Ace,Cfn,Ofn,Nfn,Dfn,G9e,q9e,s6,U9e,sG,X9e,V9e,d0,_fn,K9e,Q9e,Y9e,nk,r3,tk,l6,Ifn,Lfn,lG,Pfn,fG,$fn,Rfn,Bfn,zfn;v(Oo,"CoreOptions",689),m(86,23,{3:1,35:1,23:1,86:1},vC);var sh,Zc,cu,lh,cf,iA=vt(Oo,"Direction",86,At,t9n,w3n),Ffn;m(278,23,{3:1,35:1,23:1,278:1},M$);var aG,HD,W9e,Z9e,e8e=vt(Oo,"EdgeCoords",278,At,M6n,p3n),Hfn;m(279,23,{3:1,35:1,23:1,279:1},mV);var ik,c3,rk,n8e=vt(Oo,"EdgeLabelPlacement",279,At,Eyn,m3n),Jfn;m(222,23,{3:1,35:1,23:1,222:1},A$);var ck,JD,f6,xce,Tce=vt(Oo,"EdgeRouting",222,At,A6n,g3n),Gfn;m(327,23,{3:1,35:1,23:1,327:1},VE);var t8e,i8e,r8e,c8e,Cce,u8e,o8e=vt(Oo,"EdgeType",327,At,U9n,A3n),qfn;m(973,1,eh,zU),s.tf=function(n){RXe(n)};var s8e,l8e,f8e,a8e,Ufn,h8e,rA;v(Oo,"FixedLayouterOptions",973),m(974,1,{},Qx),s.uf=function(){var n;return n=new Cw,n},s.vf=function(n){},v(Oo,"FixedLayouterOptions/FixedFactory",974),m(347,23,{3:1,35:1,23:1,347:1},vV);var b0,hG,cA,d8e=vt(Oo,"HierarchyHandling",347,At,jyn,x3n),Xfn,szn=Ji(Oo,"ITopdownSizeApproximator");m(292,23,{3:1,35:1,23:1,292:1},x$);var k1,Lb,GD,qD,Vfn=vt(Oo,"LabelSide",292,At,x6n,M3n),Kfn;m(96,23,{3:1,35:1,23:1,96:1},W3);var pd,ia,Sf,ra,Ml,ca,Mf,E1,ua,$c=vt(Oo,"NodeLabelPlacement",96,At,X8n,k3n),Qfn;m(257,23,{3:1,35:1,23:1,257:1},yC);var b8e,uA,Pb,g8e,UD,oA=vt(Oo,"PortAlignment",257,At,b9n,E3n),Yfn;m(102,23,{3:1,35:1,23:1,102:1},KE);var ew,to,j1,uk,fh,$b,w8e=vt(Oo,"PortConstraints",102,At,q9n,j3n),Wfn;m(280,23,{3:1,35:1,23:1,280:1},QE);var sA,lA,md,XD,Rb,a6,dG=vt(Oo,"PortLabelPlacement",280,At,G9n,S3n),Zfn;m(64,23,{3:1,35:1,23:1,64:1},kC);var Wn,Un,uf,of,es,zo,ah,oa,As,ws,mo,xs,ns,ts,sa,Al,xl,Af,bt,Eu,Xn,Ac=vt(Oo,"PortSide",64,At,i9n,N3n),ean;m(977,1,eh,FU),s.tf=function(n){fXe(n)};var nan,tan,p8e,ian,ran;v(Oo,"RandomLayouterOptions",977),m(978,1,{},Yx),s.uf=function(){var n;return n=new nT,n},s.vf=function(n){},v(Oo,"RandomLayouterOptions/RandomFactory",978),m(300,23,{3:1,35:1,23:1,300:1},yV);var VD,Oce,m8e,v8e=vt(Oo,"ShapeCoords",300,At,Syn,D3n),can;m(380,23,{3:1,35:1,23:1,380:1},T$);var u3,KD,QD,nw,fA=vt(Oo,"SizeConstraint",380,At,C6n,_3n),uan;m(266,23,{3:1,35:1,23:1,266:1},Z3);var YD,bG,ok,Nce,WD,aA,gG,wG,pG,y8e=vt(Oo,"SizeOptions",266,At,e7n,C3n),oan;m(281,23,{3:1,35:1,23:1,281:1},kV);var o3,k8e,mG,E8e=vt(Oo,"TopdownNodeTypes",281,At,Myn,O3n),san;m(288,23,qF);var j8e,Dce,S8e,M8e,ZD=vt(Oo,"TopdownSizeApproximator",288,At,T6n,T3n);m(969,288,qF,aDe),s.Sg=function(n){return VHe(n)},vt(Oo,"TopdownSizeApproximator/1",969,ZD,null,null),m(970,288,qF,XDe),s.Sg=function(n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn,Mn;for(t=u(ve(n,(Gt(),i3)),144),_e=(H0(),A=new ME,A),eN(_e,n),cn=new wt,o=new ot((!n.a&&(n.a=new we(Bt,n,10,11)),n.a));o.e!=o.i.gc();)r=u(ft(o),26),K=(S=new ME,S),Rz(K,_e),eN(K,r),Mn=VHe(r),Fw(K,k.Math.max(r.g,Mn.a),k.Math.max(r.f,Mn.b)),Qo(cn.f,r,K);for(c=new ot((!n.a&&(n.a=new we(Bt,n,10,11)),n.a));c.e!=c.i.gc();)for(r=u(ft(c),26),p=new ot((!r.e&&(r.e=new Tn(mr,r,7,4)),r.e));p.e!=p.i.gc();)b=u(ft(p),85),de=u(bu(Xc(cn.f,r)),26),fe=u(Rn(cn,V((!b.c&&(b.c=new Tn(mt,b,5,8)),b.c),0)),26),ie=(y=new z3,y),Et((!ie.b&&(ie.b=new Tn(mt,ie,4,7)),ie.b),de),Et((!ie.c&&(ie.c=new Tn(mt,ie,5,8)),ie.c),fe),$z(ie,zi(de)),eN(ie,b);_=u(XC(t.f),214);try{_.kf(_e,new I0),Yfe(t.f,_)}catch(Cn){throw Cn=lr(Cn),X(Cn,101)?(N=Cn,$(N)):$(Cn)}return Ea(_e,e3)||Ea(_e,Zm)||lZ(_e),h=te(re(ve(_e,e3))),f=te(re(ve(_e,Zm))),l=h/f,i=te(re(ve(_e,r3)))*k.Math.sqrt((!_e.a&&(_e.a=new we(Bt,_e,10,11)),_e.a).i),tn=u(ve(_e,y1),104),U=tn.b+tn.c+1,R=tn.d+tn.a+1,new Ee(k.Math.max(U,i),k.Math.max(R,i/l))},vt(Oo,"TopdownSizeApproximator/2",970,ZD,null,null),m(971,288,qF,vIe),s.Sg=function(n){var t,i,r,c,o,l;return i=te(re(ve(n,(Gt(),r3)))),t=i/te(re(ve(n,nk))),r=eLn(n),o=u(ve(n,y1),104),c=te(re(Ie(d0))),zi(n)&&(c=te(re(ve(zi(n),d0)))),l=q1(new Ee(i,t),r),gi(l,new Ee(-(o.b+o.c)-c,-(o.d+o.a)-c))},vt(Oo,"TopdownSizeApproximator/3",971,ZD,null,null),m(972,288,qF,VDe),s.Sg=function(n){var t,i,r,c,o,l,f,h,b,p;for(l=new ot((!n.a&&(n.a=new we(Bt,n,10,11)),n.a));l.e!=l.i.gc();)o=u(ft(l),26),ve(o,(Gt(),fG))!=null&&(!o.a&&(o.a=new we(Bt,o,10,11)),!!o.a)&&(!o.a&&(o.a=new we(Bt,o,10,11)),o.a).i>0?(i=u(ve(o,fG),521),p=i.Sg(o),b=u(ve(o,y1),104),Fw(o,k.Math.max(o.g,p.a+b.b+b.c),k.Math.max(o.f,p.b+b.d+b.a))):(!o.a&&(o.a=new we(Bt,o,10,11)),o.a).i!=0&&Fw(o,te(re(ve(o,r3))),te(re(ve(o,r3)))/te(re(ve(o,nk))));t=u(ve(n,(Gt(),i3)),144),h=u(XC(t.f),214);try{h.kf(n,new I0),Yfe(t.f,h)}catch(y){throw y=lr(y),X(y,101)?(f=y,$(f)):$(y)}return Ei(n,u6,v7),lPe(n),lZ(n),c=te(re(ve(n,e3))),r=te(re(ve(n,Zm))),new Ee(c,r)},vt(Oo,"TopdownSizeApproximator/4",972,ZD,null,null);var lan;m(345,1,{852:1},j5),s.Tg=function(n,t){return oGe(this,n,t)},s.Ug=function(){_Ge(this)},s.Vg=function(){return this.q},s.Wg=function(){return this.f?LR(this.f):null},s.Xg=function(){return LR(this.a)},s.Yg=function(){return this.p},s.Zg=function(){return!1},s.$g=function(){return this.n},s._g=function(){return this.p!=null&&!this.b},s.ah=function(n){var t;this.n&&(t=n,xe(this.f,t))},s.bh=function(n,t){var i,r;this.n&&n&&Jyn(this,(i=new s_e,r=HW(i,n),B$n(i),r),(FB(),Ice))},s.dh=function(n){var t;return this.b?null:(t=O8n(this,this.g),Vt(this.a,t),t.i=this,this.d=n,t)},s.eh=function(n){n>0&&!this.b&&Vhe(this,n)},s.b=!1,s.c=0,s.d=-1,s.e=null,s.f=null,s.g=-1,s.j=!1,s.k=!1,s.n=!1,s.o=0,s.q=0,s.r=0,v(Ru,"BasicProgressMonitor",345),m(706,214,E2,pL),s.kf=function(n,t){pVe(n,t)},v(Ru,"BoxLayoutProvider",706),m(965,1,Kt,Kje),s.Le=function(n,t){return BNn(this,u(n,26),u(t,26))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},s.a=!1,v(Ru,"BoxLayoutProvider/1",965),m(167,1,{167:1},mB,AOe),s.Ib=function(){return this.c?Fbe(this.c):Qa(this.b)},v(Ru,"BoxLayoutProvider/Group",167),m(326,23,{3:1,35:1,23:1,326:1},C$);var A8e,x8e,T8e,_ce,C8e=vt(Ru,"BoxLayoutProvider/PackingMode",326,At,O6n,I3n),fan;m(966,1,Kt,Wx),s.Le=function(n,t){return K4n(u(n,167),u(t,167))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ru,"BoxLayoutProvider/lambda$0$Type",966),m(967,1,Kt,Xk),s.Le=function(n,t){return B4n(u(n,167),u(t,167))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ru,"BoxLayoutProvider/lambda$1$Type",967),m(968,1,Kt,Zx),s.Le=function(n,t){return z4n(u(n,167),u(t,167))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(Ru,"BoxLayoutProvider/lambda$2$Type",968),m(1338,1,{829:1},mL),s.Lg=function(n,t){return i$(),!X(t,174)||TAe((sy(),u(n,174)),t)},v(Ru,"ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type",1338),m(1339,1,rt,Qje),s.Ad=function(n){Hkn(this.a,u(n,147))},v(Ru,"ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type",1339),m(1340,1,rt,eT),s.Ad=function(n){u(n,105),i$()},v(Ru,"ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type",1340),m(1344,1,rt,Yje),s.Ad=function(n){b7n(this.a,u(n,105))},v(Ru,"ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type",1344),m(1342,1,Rt,jTe),s.Mb=function(n){return Skn(this.a,this.b,u(n,147))},v(Ru,"ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type",1342),m(1341,1,Rt,STe),s.Mb=function(n){return R2n(this.a,this.b,u(n,829))},v(Ru,"ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type",1341),m(1343,1,rt,MTe),s.Ad=function(n){$vn(this.a,this.b,u(n,147))},v(Ru,"ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type",1343),m(930,1,{},vL),s.Kb=function(n){return yCe(n)},s.Fb=function(n){return this===n},v(Ru,"ElkUtil/lambda$0$Type",930),m(931,1,rt,ATe),s.Ad=function(n){JCn(this.a,this.b,u(n,85))},s.a=0,s.b=0,v(Ru,"ElkUtil/lambda$1$Type",931),m(932,1,rt,xTe),s.Ad=function(n){Bbn(this.a,this.b,u(n,170))},s.a=0,s.b=0,v(Ru,"ElkUtil/lambda$2$Type",932),m(933,1,rt,TTe),s.Ad=function(n){_wn(this.a,this.b,u(n,157))},s.a=0,s.b=0,v(Ru,"ElkUtil/lambda$3$Type",933),m(934,1,rt,Wje),s.Ad=function(n){uvn(this.a,u(n,372))},v(Ru,"ElkUtil/lambda$4$Type",934),m(331,1,{35:1,331:1},bbn),s.Dd=function(n){return r2n(this,u(n,242))},s.Fb=function(n){var t;return X(n,331)?(t=u(n,331),this.a==t.a):!1},s.Hb=function(){return ac(this.a)},s.Ib=function(){return this.a+" (exclusive)"},s.a=0,v(Ru,"ExclusiveBounds/ExclusiveLowerBound",331),m(1088,214,E2,Cw),s.kf=function(n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U,K,ie,de,fe,_e,cn,tn;for(t.Tg("Fixed Layout",1),o=u(ve(n,(Gt(),k9e)),222),y=0,S=0,K=new ot((!n.a&&(n.a=new we(Bt,n,10,11)),n.a));K.e!=K.i.gc();){for(R=u(ft(K),26),tn=u(ve(R,(HB(),rA)),8),tn&&(Fl(R,tn.a,tn.b),u(ve(R,l8e),182).Gc((tl(),u3))&&(A=u(ve(R,a8e),8),A.a>0&&A.b>0&&m2(R,A.a,A.b,!0,!0))),y=k.Math.max(y,R.i+R.g),S=k.Math.max(S,R.j+R.f),b=new ot((!R.n&&(R.n=new we(ju,R,1,7)),R.n));b.e!=b.i.gc();)f=u(ft(b),157),tn=u(ve(f,rA),8),tn&&Fl(f,tn.a,tn.b),y=k.Math.max(y,R.i+f.i+f.g),S=k.Math.max(S,R.j+f.j+f.f);for(fe=new ot((!R.c&&(R.c=new we(Hs,R,9,9)),R.c));fe.e!=fe.i.gc();)for(de=u(ft(fe),125),tn=u(ve(de,rA),8),tn&&Fl(de,tn.a,tn.b),_e=R.i+de.i,cn=R.j+de.j,y=k.Math.max(y,_e+de.g),S=k.Math.max(S,cn+de.f),h=new ot((!de.n&&(de.n=new we(ju,de,1,7)),de.n));h.e!=h.i.gc();)f=u(ft(h),157),tn=u(ve(f,rA),8),tn&&Fl(f,tn.a,tn.b),y=k.Math.max(y,_e+f.i+f.g),S=k.Math.max(S,cn+f.j+f.f);for(c=new Gn(Vn(hb(R).a.Jc(),new ee));ht(c);)i=u(it(c),85),p=CKe(i),y=k.Math.max(y,p.a),S=k.Math.max(S,p.b);for(r=new Gn(Vn(TW(R).a.Jc(),new ee));ht(r);)i=u(it(r),85),zi(bW(i))!=n&&(p=CKe(i),y=k.Math.max(y,p.a),S=k.Math.max(S,p.b))}if(o==(cd(),ck))for(U=new ot((!n.a&&(n.a=new we(Bt,n,10,11)),n.a));U.e!=U.i.gc();)for(R=u(ft(U),26),r=new Gn(Vn(hb(R).a.Jc(),new ee));ht(r);)i=u(it(r),85),l=BIn(i),l.b==0?Ei(i,m4,null):Ei(i,m4,l);Re($e(ve(n,(HB(),f8e))))||(ie=u(ve(n,Ufn),104),_=y+ie.b+ie.c,N=S+ie.d+ie.a,m2(n,_,N,!0,!0)),t.Ug()},v(Ru,"FixedLayoutProvider",1088),m(379,150,{3:1,414:1,379:1,105:1,150:1},e9,pRe),s.ag=function(n){var t,i,r,c,o,l,f,h,b;if(n)try{for(h=vm(n,";,;"),o=h,l=0,f=o.length;l>16&Er|t^r<<16},s.Jc=function(){return new Zje(this)},s.Ib=function(){return this.a==null&&this.b==null?"pair(null,null)":this.a==null?"pair(null,"+fu(this.b)+")":this.b==null?"pair("+fu(this.a)+",null)":"pair("+fu(this.a)+","+fu(this.b)+")"},v(Ru,"Pair",49),m(979,1,Jr,Zje),s.Nb=function(n){nc(this,n)},s.Ob=function(){return!this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)},s.Pb=function(){if(!this.c&&!this.b&&this.a.a!=null)return this.b=!0,this.a.a;if(!this.c&&this.a.b!=null)return this.c=!0,this.a.b;throw $(new hu)},s.Qb=function(){throw this.c&&this.a.b!=null?this.a.b=null:this.b&&this.a.a!=null&&(this.a.a=null),$(new os)},s.b=!1,s.c=!1,v(Ru,"Pair/1",979),m(1078,214,E2,nT),s.kf=function(n,t){var i,r,c,o,l;if(t.Tg("Random Layout",1),(!n.a&&(n.a=new we(Bt,n,10,11)),n.a).i==0){t.Ug();return}o=u(ve(n,(dde(),ian)),15),o&&o.a!=0?c=new WR(o.a):c=new kY,i=eC(re(ve(n,nan))),l=eC(re(ve(n,ran))),r=u(ve(n,tan),104),uRn(n,c,i,l,r),t.Ug()},v(Ru,"RandomLayoutProvider",1078),m(240,1,{240:1},nK),s.Fb=function(n){return Vu(this.a,u(n,240).a)&&Vu(this.b,u(n,240).b)&&Vu(this.c,u(n,240).c)},s.Hb=function(){return JB(z(B(Cr,1),xn,1,5,[this.a,this.b,this.c]))},s.Ib=function(){return"("+this.a+Co+this.b+Co+this.c+")"},v(Ru,"Triple",240);var ban;m(550,1,{}),s.Jf=function(){return new Ee(this.f.i,this.f.j)},s.mf=function(n){return wIe(n,(Gt(),Fs))?ve(this.f,gan):ve(this.f,n)},s.Kf=function(){return new Ee(this.f.g,this.f.f)},s.Lf=function(){return this.g},s.nf=function(n){return Ea(this.f,n)},s.Mf=function(n){Ls(this.f,n.a),Ps(this.f,n.b)},s.Nf=function(n){r2(this.f,n.a),i2(this.f,n.b)},s.Of=function(n){this.g=n},s.g=0;var gan;v(FS,"ElkGraphAdapters/AbstractElkGraphElementAdapter",550),m(552,1,{837:1},IP),s.Pf=function(){var n,t;if(!this.b)for(this.b=qR(DK(this.a).i),t=new ot(DK(this.a));t.e!=t.i.gc();)n=u(ft(t),157),xe(this.b,new TX(n));return this.b},s.b=null,v(FS,"ElkGraphAdapters/ElkEdgeAdapter",552),m(260,550,{},B0),s.Qf=function(){return bJe(this)},s.a=null,v(FS,"ElkGraphAdapters/ElkGraphAdapter",260),m(630,550,{187:1},TX),v(FS,"ElkGraphAdapters/ElkLabelAdapter",630),m(551,550,{685:1},V$),s.Pf=function(){return dMn(this)},s.Tf=function(){var n;return n=u(ve(this.f,(Gt(),ek)),140),!n&&(n=new SE),n},s.Vf=function(){return bMn(this)},s.Xf=function(n){var t;t=new WV(n),Ei(this.f,(Gt(),ek),t)},s.Yf=function(n){Ei(this.f,(Gt(),y1),new Kle(n))},s.Rf=function(){return this.d},s.Sf=function(){var n,t;if(!this.a)for(this.a=new Te,t=new Gn(Vn(TW(u(this.f,26)).a.Jc(),new ee));ht(t);)n=u(it(t),85),xe(this.a,new IP(n));return this.a},s.Uf=function(){var n,t;if(!this.c)for(this.c=new Te,t=new Gn(Vn(hb(u(this.f,26)).a.Jc(),new ee));ht(t);)n=u(it(t),85),xe(this.c,new IP(n));return this.c},s.Wf=function(){return _R(u(this.f,26)).i!=0||Re($e(u(this.f,26).mf((Gt(),RD))))},s.Zf=function(){a8n(this,(cg(),ban))},s.a=null,s.b=null,s.c=null,s.d=null,s.e=null,v(FS,"ElkGraphAdapters/ElkNodeAdapter",551),m(1249,550,{836:1},eSe),s.Pf=function(){return kMn(this)},s.Sf=function(){var n,t;if(!this.a)for(this.a=e1(u(this.f,125).gh().i),t=new ot(u(this.f,125).gh());t.e!=t.i.gc();)n=u(ft(t),85),xe(this.a,new IP(n));return this.a},s.Uf=function(){var n,t;if(!this.c)for(this.c=e1(u(this.f,125).hh().i),t=new ot(u(this.f,125).hh());t.e!=t.i.gc();)n=u(ft(t),85),xe(this.c,new IP(n));return this.c},s.$f=function(){return u(u(this.f,125).mf((Gt(),k4)),64)},s._f=function(){var n,t,i,r,c,o,l,f;for(r=Ha(u(this.f,125)),i=new ot(u(this.f,125).hh());i.e!=i.i.gc();)for(n=u(ft(i),85),f=new ot((!n.c&&(n.c=new Tn(mt,n,5,8)),n.c));f.e!=f.i.gc();){if(l=u(ft(f),84),em(ru(l),r))return!0;if(ru(l)==r&&Re($e(ve(n,(Gt(),pce)))))return!0}for(t=new ot(u(this.f,125).gh());t.e!=t.i.gc();)for(n=u(ft(t),85),o=new ot((!n.b&&(n.b=new Tn(mt,n,4,7)),n.b));o.e!=o.i.gc();)if(c=u(ft(o),84),em(ru(c),r))return!0;return!1},s.a=null,s.b=null,s.c=null,v(FS,"ElkGraphAdapters/ElkPortAdapter",1249),m(1250,1,Kt,kL),s.Le=function(n,t){return N_n(u(n,125),u(t,125))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(FS,"ElkGraphAdapters/PortComparator",1250);var Bb=Ji(ef,"EObject"),sk=Ji(Gv,$We),Tl=Ji(Gv,RWe),e_=Ji(Gv,BWe),n_=Ji(Gv,"ElkShape"),mt=Ji(Gv,zWe),mr=Ji(Gv,Lpe),$i=Ji(Gv,FWe),t_=Ji(ef,HWe),hA=Ji(ef,"EFactory"),wan,Lce=Ji(ef,JWe),Ia=Ji(ef,"EPackage"),Rr,pan,man,_8e,vG,van,I8e,L8e,P8e,S1,yan,kan,ju=Ji(Gv,Ppe),Bt=Ji(Gv,$pe),Hs=Ji(Gv,Rpe);m(93,1,GWe),s.qh=function(){return this.rh(),null},s.rh=function(){return null},s.sh=function(){return this.rh(),!1},s.th=function(){return!1},s.uh=function(n){hi(this,n)},v(Py,"BasicNotifierImpl",93),m(100,93,VWe),s.Vh=function(){return Vs(this)},s.vh=function(n,t){return n},s.wh=function(){throw $(new Nt)},s.xh=function(n){var t;return t=Oc(u(jn(this.Ah(),this.Ch()),19)),this.Mh().Qh(this,t.n,t.f,n)},s.yh=function(n,t){throw $(new Nt)},s.zh=function(n,t,i){return yl(this,n,t,i)},s.Ah=function(){var n;return this.wh()&&(n=this.wh().Lk(),n)?n:this.fi()},s.Bh=function(){return AW(this)},s.Ch=function(){throw $(new Nt)},s.Dh=function(){var n,t;return t=this.Xh().Mk(),!t&&this.wh().Rk(t=(BE(),n=hae(Oh(this.Ah())),n==null?Jce:new xC(this,n))),t},s.Eh=function(n,t){return n},s.Fh=function(n){var t;return t=n.nk(),t?n.Jj():Fi(this.Ah(),n)},s.Gh=function(){var n;return n=this.wh(),n?n.Ok():null},s.Hh=function(){return this.wh()?this.wh().Lk():null},s.Ih=function(n,t,i){return az(this,n,t,i)},s.Jh=function(n){return i8(this,n)},s.Kh=function(n,t){return hQ(this,n,t)},s.Lh=function(){var n;return n=this.wh(),!!n&&n.Pk()},s.Mh=function(){throw $(new Nt)},s.Nh=function(){return uz(this)},s.Oh=function(n,t,i,r){return by(this,n,t,r)},s.Ph=function(n,t,i){var r;return r=u(jn(this.Ah(),t),69),r.uk().xk(this,this.ei(),t-this.gi(),n,i)},s.Qh=function(n,t,i,r){return RR(this,n,t,r)},s.Rh=function(n,t,i){var r;return r=u(jn(this.Ah(),t),69),r.uk().yk(this,this.ei(),t-this.gi(),n,i)},s.Sh=function(){return!!this.wh()&&!!this.wh().Nk()},s.Th=function(n){return PY(this,n)},s.Uh=function(n){return NIe(this,n)},s.Wh=function(n){return hKe(this,n)},s.Xh=function(){throw $(new Nt)},s.Yh=function(){return this.wh()?this.wh().Nk():null},s.Zh=function(){return uz(this)},s.$h=function(n,t){kW(this,n,t)},s._h=function(n){this.Xh().Qk(n)},s.ai=function(n){this.Xh().Tk(n)},s.bi=function(n){this.Xh().Sk(n)},s.ci=function(n,t){var i,r,c,o;return o=this.Gh(),o&&n&&(t=kc(o.Cl(),this,t),o.Gl(this)),r=this.Mh(),r&&((BW(this,this.Mh(),this.Ch()).Bb&Sc)!=0?(c=r.Nh(),c&&(n?!o&&c.Gl(this):c.Fl(this))):(t=(i=this.Ch(),i>=0?this.xh(t):this.Mh().Qh(this,-1-i,null,t)),t=this.zh(null,-1,t))),this.ai(n),t},s.di=function(n){var t,i,r,c,o,l,f,h;if(i=this.Ah(),o=Fi(i,n),t=this.gi(),o>=t)return u(n,69).uk().Bk(this,this.ei(),o-t);if(o<=-1)if(l=Lv((ds(),ic),i,n),l){if(Cc(),u(l,69).vk()||(l=W5(Kc(ic,l))),c=(r=this.Fh(l),u(r>=0?this.Ih(r,!0,!0):g2(this,l,!0),163)),h=l.Gk(),h>1||h==-1)return u(u(c,219).Ql(n,!1),77)}else throw $(new Jn(kb+n.ve()+mne));else if(n.Hk())return r=this.Fh(n),u(r>=0?this.Ih(r,!1,!0):g2(this,n,!1),77);return f=new GTe(this,n),f},s.ei=function(){return yhe(this)},s.fi=function(){return(V0(),$n).S},s.gi=function(){return dt(this.fi())},s.hi=function(n){mW(this,n)},s.Ib=function(){return Vf(this)},v(zn,"BasicEObjectImpl",100);var Ean;m(117,100,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1}),s.ii=function(n){var t;return t=khe(this),t[n]},s.ji=function(n,t){var i;i=khe(this),cr(i,n,t)},s.ki=function(n){var t;t=khe(this),cr(t,n,null)},s.qh=function(){return u(qn(this,4),129)},s.rh=function(){throw $(new Nt)},s.sh=function(){return(this.Db&4)!=0},s.wh=function(){throw $(new Nt)},s.li=function(n){hy(this,2,n)},s.yh=function(n,t){this.Db=t<<16|this.Db&255,this.li(n)},s.Ah=function(){return Uo(this)},s.Ch=function(){return this.Db>>16},s.Dh=function(){var n,t;return BE(),t=hae(Oh((n=u(qn(this,16),29),n||this.fi()))),t==null?Jce:new xC(this,t)},s.th=function(){return(this.Db&1)==0},s.Gh=function(){return u(qn(this,128),1996)},s.Hh=function(){return u(qn(this,16),29)},s.Lh=function(){return(this.Db&32)!=0},s.Mh=function(){return u(qn(this,2),52)},s.Sh=function(){return(this.Db&64)!=0},s.Xh=function(){throw $(new Nt)},s.Yh=function(){return u(qn(this,64),290)},s._h=function(n){hy(this,16,n)},s.ai=function(n){hy(this,128,n)},s.bi=function(n){hy(this,64,n)},s.ei=function(){return Lo(this)},s.Db=0,v(zn,"MinimalEObjectImpl",117),m(118,117,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.li=function(n){this.Cb=n},s.Mh=function(){return this.Cb},v(zn,"MinimalEObjectImpl/Container",118),m(2045,118,{109:1,343:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return Pde(this,n,t,i)},s.Rh=function(n,t,i){return M0e(this,n,t,i)},s.Th=function(n){return Cae(this,n)},s.$h=function(n,t){E1e(this,n,t)},s.fi=function(){return Gu(),kan},s.hi=function(n){l1e(this,n)},s.lf=function(){return IHe(this)},s.fh=function(){return!this.o&&(this.o=new as((Gu(),S1),g0,this,0)),this.o},s.mf=function(n){return ve(this,n)},s.nf=function(n){return Ea(this,n)},s.of=function(n,t){return Ei(this,n,t)},v($g,"EMapPropertyHolderImpl",2045),m(559,118,{109:1,372:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Kk),s.Ih=function(n,t,i){switch(n){case 0:return this.a;case 1:return this.b}return az(this,n,t,i)},s.Th=function(n){switch(n){case 0:return this.a!=0;case 1:return this.b!=0}return PY(this,n)},s.$h=function(n,t){switch(n){case 0:vB(this,te(re(t)));return;case 1:yB(this,te(re(t)));return}kW(this,n,t)},s.fi=function(){return Gu(),pan},s.hi=function(n){switch(n){case 0:vB(this,0);return;case 1:yB(this,0);return}mW(this,n)},s.Ib=function(){var n;return(this.Db&64)!=0?Vf(this):(n=new df(Vf(this)),n.a+=" (x: ",V3(n,this.a),n.a+=", y: ",V3(n,this.b),n.a+=")",n.a)},s.a=0,s.b=0,v($g,"ElkBendPointImpl",559),m(727,2045,{109:1,343:1,174:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return F1e(this,n,t,i)},s.Ph=function(n,t,i){return fW(this,n,t,i)},s.Rh=function(n,t,i){return KQ(this,n,t,i)},s.Th=function(n){return i1e(this,n)},s.$h=function(n,t){n0e(this,n,t)},s.fi=function(){return Gu(),van},s.hi=function(n){$1e(this,n)},s.ih=function(){return this.k},s.jh=function(){return DK(this)},s.Ib=function(){return yY(this)},s.k=null,v($g,"ElkGraphElementImpl",727),m(728,727,{109:1,343:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return ede(this,n,t,i)},s.Th=function(n){return ode(this,n)},s.$h=function(n,t){t0e(this,n,t)},s.fi=function(){return Gu(),yan},s.hi=function(n){hde(this,n)},s.kh=function(){return this.f},s.lh=function(){return this.g},s.mh=function(){return this.i},s.nh=function(){return this.j},s.oh=function(n,t){Fw(this,n,t)},s.ph=function(n,t){Fl(this,n,t)},s.Ib=function(){return wW(this)},s.f=0,s.g=0,s.i=0,s.j=0,v($g,"ElkShapeImpl",728),m(729,728,{109:1,343:1,84:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return Ode(this,n,t,i)},s.Ph=function(n,t,i){return Kde(this,n,t,i)},s.Rh=function(n,t,i){return Qde(this,n,t,i)},s.Th=function(n){return m1e(this,n)},s.$h=function(n,t){lbe(this,n,t)},s.fi=function(){return Gu(),man},s.hi=function(n){Mde(this,n)},s.gh=function(){return!this.d&&(this.d=new Tn(mr,this,8,5)),this.d},s.hh=function(){return!this.e&&(this.e=new Tn(mr,this,7,4)),this.e},v($g,"ElkConnectableShapeImpl",729),m(271,727,{109:1,343:1,85:1,174:1,271:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},z3),s.xh=function(n){return qde(this,n)},s.Ih=function(n,t,i){switch(n){case 3:return Xp(this);case 4:return!this.b&&(this.b=new Tn(mt,this,4,7)),this.b;case 5:return!this.c&&(this.c=new Tn(mt,this,5,8)),this.c;case 6:return!this.a&&(this.a=new we($i,this,6,6)),this.a;case 7:return Ln(),!this.b&&(this.b=new Tn(mt,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new Tn(mt,this,5,8)),this.c.i<=1));case 8:return Ln(),!!oS(this);case 9:return Ln(),!!b2(this);case 10:return Ln(),!this.b&&(this.b=new Tn(mt,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new Tn(mt,this,5,8)),this.c.i!=0)}return F1e(this,n,t,i)},s.Ph=function(n,t,i){var r;switch(t){case 3:return this.Cb&&(i=(r=this.Db>>16,r>=0?qde(this,i):this.Cb.Qh(this,-1-r,null,i))),xle(this,u(n,26),i);case 4:return!this.b&&(this.b=new Tn(mt,this,4,7)),To(this.b,n,i);case 5:return!this.c&&(this.c=new Tn(mt,this,5,8)),To(this.c,n,i);case 6:return!this.a&&(this.a=new we($i,this,6,6)),To(this.a,n,i)}return fW(this,n,t,i)},s.Rh=function(n,t,i){switch(t){case 3:return xle(this,null,i);case 4:return!this.b&&(this.b=new Tn(mt,this,4,7)),kc(this.b,n,i);case 5:return!this.c&&(this.c=new Tn(mt,this,5,8)),kc(this.c,n,i);case 6:return!this.a&&(this.a=new we($i,this,6,6)),kc(this.a,n,i)}return KQ(this,n,t,i)},s.Th=function(n){switch(n){case 3:return!!Xp(this);case 4:return!!this.b&&this.b.i!=0;case 5:return!!this.c&&this.c.i!=0;case 6:return!!this.a&&this.a.i!=0;case 7:return!this.b&&(this.b=new Tn(mt,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new Tn(mt,this,5,8)),this.c.i<=1));case 8:return oS(this);case 9:return b2(this);case 10:return!this.b&&(this.b=new Tn(mt,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new Tn(mt,this,5,8)),this.c.i!=0)}return i1e(this,n)},s.$h=function(n,t){switch(n){case 3:$z(this,u(t,26));return;case 4:!this.b&&(this.b=new Tn(mt,this,4,7)),yt(this.b),!this.b&&(this.b=new Tn(mt,this,4,7)),ir(this.b,u(t,18));return;case 5:!this.c&&(this.c=new Tn(mt,this,5,8)),yt(this.c),!this.c&&(this.c=new Tn(mt,this,5,8)),ir(this.c,u(t,18));return;case 6:!this.a&&(this.a=new we($i,this,6,6)),yt(this.a),!this.a&&(this.a=new we($i,this,6,6)),ir(this.a,u(t,18));return}n0e(this,n,t)},s.fi=function(){return Gu(),_8e},s.hi=function(n){switch(n){case 3:$z(this,null);return;case 4:!this.b&&(this.b=new Tn(mt,this,4,7)),yt(this.b);return;case 5:!this.c&&(this.c=new Tn(mt,this,5,8)),yt(this.c);return;case 6:!this.a&&(this.a=new we($i,this,6,6)),yt(this.a);return}$1e(this,n)},s.Ib=function(){return _Ve(this)},v($g,"ElkEdgeImpl",271),m(443,2045,{109:1,343:1,170:1,443:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},yo),s.xh=function(n){return Fde(this,n)},s.Ih=function(n,t,i){switch(n){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return!this.a&&(this.a=new yr(Tl,this,5)),this.a;case 6:return OIe(this);case 7:return t?FY(this):this.i;case 8:return t?zY(this):this.f;case 9:return!this.g&&(this.g=new Tn($i,this,9,10)),this.g;case 10:return!this.e&&(this.e=new Tn($i,this,10,9)),this.e;case 11:return this.d}return Pde(this,n,t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 6:return this.Cb&&(i=(c=this.Db>>16,c>=0?Fde(this,i):this.Cb.Qh(this,-1-c,null,i))),Tle(this,u(n,85),i);case 9:return!this.g&&(this.g=new Tn($i,this,9,10)),To(this.g,n,i);case 10:return!this.e&&(this.e=new Tn($i,this,10,9)),To(this.e,n,i)}return o=u(jn((r=u(qn(this,16),29),r||(Gu(),vG)),t),69),o.uk().xk(this,Lo(this),t-dt((Gu(),vG)),n,i)},s.Rh=function(n,t,i){switch(t){case 5:return!this.a&&(this.a=new yr(Tl,this,5)),kc(this.a,n,i);case 6:return Tle(this,null,i);case 9:return!this.g&&(this.g=new Tn($i,this,9,10)),kc(this.g,n,i);case 10:return!this.e&&(this.e=new Tn($i,this,10,9)),kc(this.e,n,i)}return M0e(this,n,t,i)},s.Th=function(n){switch(n){case 1:return this.j!=0;case 2:return this.k!=0;case 3:return this.b!=0;case 4:return this.c!=0;case 5:return!!this.a&&this.a.i!=0;case 6:return!!OIe(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&this.g.i!=0;case 10:return!!this.e&&this.e.i!=0;case 11:return this.d!=null}return Cae(this,n)},s.$h=function(n,t){switch(n){case 1:vv(this,te(re(t)));return;case 2:yv(this,te(re(t)));return;case 3:pv(this,te(re(t)));return;case 4:mv(this,te(re(t)));return;case 5:!this.a&&(this.a=new yr(Tl,this,5)),yt(this.a),!this.a&&(this.a=new yr(Tl,this,5)),ir(this.a,u(t,18));return;case 6:DUe(this,u(t,85));return;case 7:xB(this,u(t,84));return;case 8:AB(this,u(t,84));return;case 9:!this.g&&(this.g=new Tn($i,this,9,10)),yt(this.g),!this.g&&(this.g=new Tn($i,this,9,10)),ir(this.g,u(t,18));return;case 10:!this.e&&(this.e=new Tn($i,this,10,9)),yt(this.e),!this.e&&(this.e=new Tn($i,this,10,9)),ir(this.e,u(t,18));return;case 11:Uhe(this,_t(t));return}E1e(this,n,t)},s.fi=function(){return Gu(),vG},s.hi=function(n){switch(n){case 1:vv(this,0);return;case 2:yv(this,0);return;case 3:pv(this,0);return;case 4:mv(this,0);return;case 5:!this.a&&(this.a=new yr(Tl,this,5)),yt(this.a);return;case 6:DUe(this,null);return;case 7:xB(this,null);return;case 8:AB(this,null);return;case 9:!this.g&&(this.g=new Tn($i,this,9,10)),yt(this.g);return;case 10:!this.e&&(this.e=new Tn($i,this,10,9)),yt(this.e);return;case 11:Uhe(this,null);return}l1e(this,n)},s.Ib=function(){return Jqe(this)},s.b=0,s.c=0,s.d=null,s.j=0,s.k=0,v($g,"ElkEdgeSectionImpl",443),m(161,118,{109:1,94:1,93:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),s.Ih=function(n,t,i){var r;return n==0?(!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab):ql(this,n-dt(this.fi()),jn((r=u(qn(this,16),29),r||this.fi()),n),t,i)},s.Ph=function(n,t,i){var r,c;return t==0?(!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i)):(c=u(jn((r=u(qn(this,16),29),r||this.fi()),t),69),c.uk().xk(this,Lo(this),t-dt(this.fi()),n,i))},s.Rh=function(n,t,i){var r,c;return t==0?(!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i)):(c=u(jn((r=u(qn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i))},s.Th=function(n){var t;return n==0?!!this.Ab&&this.Ab.i!=0:Gl(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.Wh=function(n){return xge(this,n)},s.$h=function(n,t){var i;if(n===0){!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return}Yl(this,n-dt(this.fi()),jn((i=u(qn(this,16),29),i||this.fi()),n),t)},s.ai=function(n){hy(this,128,n)},s.fi=function(){return vn(),zan},s.hi=function(n){var t;if(n===0){!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return}Ql(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.mi=function(){this.Bb|=1},s.ni=function(n){return bS(this,n)},s.Bb=0,v(zn,"EModelElementImpl",161),m(710,161,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},LT),s.oi=function(n,t){return cKe(this,n,t)},s.pi=function(n){var t,i,r,c,o;if(this.a!=gl(n)||(n.Bb&256)!=0)throw $(new Jn(yne+n.zb+T2));for(r=iu(n);Ku(r.a).i!=0;){if(i=u(fN(r,0,(t=u(V(Ku(r.a),0),87),o=t.c,X(o,88)?u(o,29):(vn(),Of))),29),h2(i))return c=gl(i).ti().pi(i),u(c,52)._h(n),c;r=iu(i)}return(n.D!=null?n.D:n.B)=="java.util.Map$Entry"?new fDe(n):new dfe(n)},s.qi=function(n,t){return v2(this,n,t)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.a}return ql(this,n-dt((vn(),Hb)),jn((r=u(qn(this,16),29),r||Hb),n),t,i)},s.Ph=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 1:return this.a&&(i=u(this.a,52).Qh(this,4,Ia,i)),L1e(this,u(n,241),i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),Hb)),t),69),c.uk().xk(this,Lo(this),t-dt((vn(),Hb)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 1:return L1e(this,null,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),Hb)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),Hb)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return!!this.a}return Gl(this,n-dt((vn(),Hb)),jn((t=u(qn(this,16),29),t||Hb),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:vGe(this,u(t,241));return}Yl(this,n-dt((vn(),Hb)),jn((i=u(qn(this,16),29),i||Hb),n),t)},s.fi=function(){return vn(),Hb},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:vGe(this,null);return}Ql(this,n-dt((vn(),Hb)),jn((t=u(qn(this,16),29),t||Hb),n))};var dA,$8e,jan;v(zn,"EFactoryImpl",710),m(1018,710,{109:1,2075:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},dU),s.oi=function(n,t){switch(n.fk()){case 12:return u(t,147).Og();case 13:return fu(t);default:throw $(new Jn(y7+n.ve()+T2))}},s.pi=function(n){var t,i,r,c,o,l,f,h;switch(n.G==-1&&(n.G=(t=gl(n),t?Zd(t.si(),n):-1)),n.G){case 4:return o=new tT,o;case 6:return l=new ME,l;case 7:return f=new moe,f;case 8:return r=new z3,r;case 9:return i=new Kk,i;case 10:return c=new yo,c;case 11:return h=new n9,h;default:throw $(new Jn(yne+n.zb+T2))}},s.qi=function(n,t){switch(n.fk()){case 13:case 12:return null;default:throw $(new Jn(y7+n.ve()+T2))}},v($g,"ElkGraphFactoryImpl",1018),m(439,161,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),s.Dh=function(){var n,t;return t=(n=u(qn(this,16),29),hae(Oh(n||this.fi()))),t==null?(BE(),BE(),Jce):new NOe(this,t)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.ve()}return ql(this,n-dt(this.fi()),jn((r=u(qn(this,16),29),r||this.fi()),n),t,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null}return Gl(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:this.ri(_t(t));return}Yl(this,n-dt(this.fi()),jn((i=u(qn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return vn(),Fan},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:this.ri(null);return}Ql(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.ve=function(){return this.zb},s.ri=function(n){xo(this,n)},s.Ib=function(){return Hj(this)},s.zb=null,v(zn,"ENamedElementImpl",439),m(184,439,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},nIe),s.xh=function(n){return OJe(this,n)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return!this.rb&&(this.rb=new Jp(this,La,this)),this.rb;case 6:return!this.vb&&(this.vb=new z5(Ia,this,6,7)),this.vb;case 7:return t?this.Db>>16==7?u(this.Cb,241):null:$Ie(this)}return ql(this,n-dt((vn(),v0)),jn((r=u(qn(this,16),29),r||v0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 4:return this.sb&&(i=u(this.sb,52).Qh(this,1,hA,i)),R1e(this,u(n,469),i);case 5:return!this.rb&&(this.rb=new Jp(this,La,this)),To(this.rb,n,i);case 6:return!this.vb&&(this.vb=new z5(Ia,this,6,7)),To(this.vb,n,i);case 7:return this.Cb&&(i=(c=this.Db>>16,c>=0?OJe(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,7,i)}return o=u(jn((r=u(qn(this,16),29),r||(vn(),v0)),t),69),o.uk().xk(this,Lo(this),t-dt((vn(),v0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 4:return R1e(this,null,i);case 5:return!this.rb&&(this.rb=new Jp(this,La,this)),kc(this.rb,n,i);case 6:return!this.vb&&(this.vb=new z5(Ia,this,6,7)),kc(this.vb,n,i);case 7:return yl(this,null,7,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),v0)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),v0)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.yb!=null;case 3:return this.xb!=null;case 4:return!!this.sb;case 5:return!!this.rb&&this.rb.i!=0;case 6:return!!this.vb&&this.vb.i!=0;case 7:return!!$Ie(this)}return Gl(this,n-dt((vn(),v0)),jn((t=u(qn(this,16),29),t||v0),n))},s.Wh=function(n){var t;return t=KNn(this,n),t||xge(this,n)},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:xo(this,_t(t));return;case 2:_B(this,_t(t));return;case 3:DB(this,_t(t));return;case 4:gW(this,u(t,469));return;case 5:!this.rb&&(this.rb=new Jp(this,La,this)),yt(this.rb),!this.rb&&(this.rb=new Jp(this,La,this)),ir(this.rb,u(t,18));return;case 6:!this.vb&&(this.vb=new z5(Ia,this,6,7)),yt(this.vb),!this.vb&&(this.vb=new z5(Ia,this,6,7)),ir(this.vb,u(t,18));return}Yl(this,n-dt((vn(),v0)),jn((i=u(qn(this,16),29),i||v0),n),t)},s.bi=function(n){var t,i;if(n&&this.rb)for(i=new ot(this.rb);i.e!=i.i.gc();)t=ft(i),X(t,360)&&(u(t,360).w=null);hy(this,64,n)},s.fi=function(){return vn(),v0},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:xo(this,null);return;case 2:_B(this,null);return;case 3:DB(this,null);return;case 4:gW(this,null);return;case 5:!this.rb&&(this.rb=new Jp(this,La,this)),yt(this.rb);return;case 6:!this.vb&&(this.vb=new z5(Ia,this,6,7)),yt(this.vb);return}Ql(this,n-dt((vn(),v0)),jn((t=u(qn(this,16),29),t||v0),n))},s.mi=function(){eW(this)},s.si=function(){return!this.rb&&(this.rb=new Jp(this,La,this)),this.rb},s.ti=function(){return this.sb},s.ui=function(){return this.ub},s.vi=function(){return this.xb},s.wi=function(){return this.yb},s.xi=function(n){this.ub=n},s.Ib=function(){var n;return(this.Db&64)!=0?Hj(this):(n=new df(Hj(this)),n.a+=" (nsURI: ",Bc(n,this.yb),n.a+=", nsPrefix: ",Bc(n,this.xb),n.a+=")",n.a)},s.xb=null,s.yb=null,v(zn,"EPackageImpl",184),m(556,184,{109:1,2077:1,556:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},Yqe),s.q=!1,s.r=!1;var San=!1;v($g,"ElkGraphPackageImpl",556),m(362,728,{109:1,343:1,174:1,157:1,276:1,362:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},tT),s.xh=function(n){return Hde(this,n)},s.Ih=function(n,t,i){switch(n){case 7:return mae(this);case 8:return this.a}return ede(this,n,t,i)},s.Ph=function(n,t,i){var r;return t===7?(this.Cb&&(i=(r=this.Db>>16,r>=0?Hde(this,i):this.Cb.Qh(this,-1-r,null,i))),Afe(this,u(n,174),i)):fW(this,n,t,i)},s.Rh=function(n,t,i){return t==7?Afe(this,null,i):KQ(this,n,t,i)},s.Th=function(n){switch(n){case 7:return!!mae(this);case 8:return!bn("",this.a)}return ode(this,n)},s.$h=function(n,t){switch(n){case 7:Mbe(this,u(t,174));return;case 8:Jhe(this,_t(t));return}t0e(this,n,t)},s.fi=function(){return Gu(),I8e},s.hi=function(n){switch(n){case 7:Mbe(this,null);return;case 8:Jhe(this,"");return}hde(this,n)},s.Ib=function(){return RGe(this)},s.a="",v($g,"ElkLabelImpl",362),m(206,729,{109:1,343:1,84:1,174:1,26:1,276:1,206:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},ME),s.xh=function(n){return Ude(this,n)},s.Ih=function(n,t,i){switch(n){case 9:return!this.c&&(this.c=new we(Hs,this,9,9)),this.c;case 10:return!this.a&&(this.a=new we(Bt,this,10,11)),this.a;case 11:return zi(this);case 12:return!this.b&&(this.b=new we(mr,this,12,3)),this.b;case 13:return Ln(),!this.a&&(this.a=new we(Bt,this,10,11)),this.a.i>0}return Ode(this,n,t,i)},s.Ph=function(n,t,i){var r;switch(t){case 9:return!this.c&&(this.c=new we(Hs,this,9,9)),To(this.c,n,i);case 10:return!this.a&&(this.a=new we(Bt,this,10,11)),To(this.a,n,i);case 11:return this.Cb&&(i=(r=this.Db>>16,r>=0?Ude(this,i):this.Cb.Qh(this,-1-r,null,i))),Jle(this,u(n,26),i);case 12:return!this.b&&(this.b=new we(mr,this,12,3)),To(this.b,n,i)}return Kde(this,n,t,i)},s.Rh=function(n,t,i){switch(t){case 9:return!this.c&&(this.c=new we(Hs,this,9,9)),kc(this.c,n,i);case 10:return!this.a&&(this.a=new we(Bt,this,10,11)),kc(this.a,n,i);case 11:return Jle(this,null,i);case 12:return!this.b&&(this.b=new we(mr,this,12,3)),kc(this.b,n,i)}return Qde(this,n,t,i)},s.Th=function(n){switch(n){case 9:return!!this.c&&this.c.i!=0;case 10:return!!this.a&&this.a.i!=0;case 11:return!!zi(this);case 12:return!!this.b&&this.b.i!=0;case 13:return!this.a&&(this.a=new we(Bt,this,10,11)),this.a.i>0}return m1e(this,n)},s.$h=function(n,t){switch(n){case 9:!this.c&&(this.c=new we(Hs,this,9,9)),yt(this.c),!this.c&&(this.c=new we(Hs,this,9,9)),ir(this.c,u(t,18));return;case 10:!this.a&&(this.a=new we(Bt,this,10,11)),yt(this.a),!this.a&&(this.a=new we(Bt,this,10,11)),ir(this.a,u(t,18));return;case 11:Rz(this,u(t,26));return;case 12:!this.b&&(this.b=new we(mr,this,12,3)),yt(this.b),!this.b&&(this.b=new we(mr,this,12,3)),ir(this.b,u(t,18));return}lbe(this,n,t)},s.fi=function(){return Gu(),L8e},s.hi=function(n){switch(n){case 9:!this.c&&(this.c=new we(Hs,this,9,9)),yt(this.c);return;case 10:!this.a&&(this.a=new we(Bt,this,10,11)),yt(this.a);return;case 11:Rz(this,null);return;case 12:!this.b&&(this.b=new we(mr,this,12,3)),yt(this.b);return}Mde(this,n)},s.Ib=function(){return Fbe(this)},v($g,"ElkNodeImpl",206),m(193,729,{109:1,343:1,84:1,174:1,125:1,276:1,193:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},moe),s.xh=function(n){return Jde(this,n)},s.Ih=function(n,t,i){return n==9?Ha(this):Ode(this,n,t,i)},s.Ph=function(n,t,i){var r;return t===9?(this.Cb&&(i=(r=this.Db>>16,r>=0?Jde(this,i):this.Cb.Qh(this,-1-r,null,i))),Cle(this,u(n,26),i)):Kde(this,n,t,i)},s.Rh=function(n,t,i){return t==9?Cle(this,null,i):Qde(this,n,t,i)},s.Th=function(n){return n==9?!!Ha(this):m1e(this,n)},s.$h=function(n,t){if(n===9){ybe(this,u(t,26));return}lbe(this,n,t)},s.fi=function(){return Gu(),P8e},s.hi=function(n){if(n===9){ybe(this,null);return}Mde(this,n)},s.Ib=function(){return OXe(this)},v($g,"ElkPortImpl",193);var Man=Ji(Ec,"BasicEMap/Entry");m(1091,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,117:1,118:1},n9),s.Fb=function(n){return this===n},s.jd=function(){return this.b},s.Hb=function(){return Gw(this)},s.Ai=function(n){Bhe(this,u(n,147))},s.Ih=function(n,t,i){switch(n){case 0:return this.b;case 1:return this.c}return az(this,n,t,i)},s.Th=function(n){switch(n){case 0:return!!this.b;case 1:return this.c!=null}return PY(this,n)},s.$h=function(n,t){switch(n){case 0:Bhe(this,u(t,147));return;case 1:zhe(this,t);return}kW(this,n,t)},s.fi=function(){return Gu(),S1},s.hi=function(n){switch(n){case 0:Bhe(this,null);return;case 1:zhe(this,null);return}mW(this,n)},s.yi=function(){var n;return this.a==-1&&(n=this.b,this.a=n?Ni(n):0),this.a},s.kd=function(){return this.c},s.zi=function(n){this.a=n},s.ld=function(n){var t;return t=this.c,zhe(this,n),t},s.Ib=function(){var n;return(this.Db&64)!=0?Vf(this):(n=new z0,Xt(Xt(Xt(n,this.b?this.b.Og():Yo),tee),cj(this.c)),n.a)},s.a=-1,s.c=null;var g0=v($g,"ElkPropertyToValueMapEntryImpl",1091);m(980,1,{},bp),v(ec,"JsonAdapter",980),m(215,63,sd,mh),v(ec,"JsonImportException",215),m(850,1,{},Uqe),v(ec,"JsonImporter",850),m(884,1,{},CTe),s.Bi=function(n){zJe(this.a,this.b,u(n,139))},v(ec,"JsonImporter/lambda$0$Type",884),m(885,1,{},OTe),s.Bi=function(n){jqe(this.a,this.b,u(n,139))},v(ec,"JsonImporter/lambda$1$Type",885),m(893,1,{},nSe),s.Bi=function(n){L_e(this.a,u(n,149))},v(ec,"JsonImporter/lambda$10$Type",893),m(895,1,{},NTe),s.Bi=function(n){fqe(this.a,this.b,u(n,139))},v(ec,"JsonImporter/lambda$11$Type",895),m(896,1,{},DTe),s.Bi=function(n){aqe(this.a,this.b,u(n,139))},v(ec,"JsonImporter/lambda$12$Type",896),m(902,1,{},q_e),s.Bi=function(n){IGe(this.a,this.b,this.c,this.d,u(n,139))},v(ec,"JsonImporter/lambda$13$Type",902),m(901,1,{},U_e),s.Bi=function(n){YXe(this.a,this.b,this.c,this.d,u(n,149))},v(ec,"JsonImporter/lambda$14$Type",901),m(897,1,{},_Te),s.Bi=function(n){oNe(this.a,this.b,_t(n))},v(ec,"JsonImporter/lambda$15$Type",897),m(898,1,{},ITe),s.Bi=function(n){sNe(this.a,this.b,_t(n))},v(ec,"JsonImporter/lambda$16$Type",898),m(899,1,{},LTe),s.Bi=function(n){kJe(this.b,this.a,u(n,139))},v(ec,"JsonImporter/lambda$17$Type",899),m(900,1,{},PTe),s.Bi=function(n){EJe(this.b,this.a,u(n,139))},v(ec,"JsonImporter/lambda$18$Type",900),m(905,1,{},tSe),s.Bi=function(n){MGe(this.a,u(n,149))},v(ec,"JsonImporter/lambda$19$Type",905),m(886,1,{},iSe),s.Bi=function(n){_Je(this.a,u(n,139))},v(ec,"JsonImporter/lambda$2$Type",886),m(903,1,{},rSe),s.Bi=function(n){vv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$20$Type",903),m(904,1,{},cSe),s.Bi=function(n){yv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$21$Type",904),m(908,1,{},uSe),s.Bi=function(n){SGe(this.a,u(n,149))},v(ec,"JsonImporter/lambda$22$Type",908),m(906,1,{},oSe),s.Bi=function(n){pv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$23$Type",906),m(907,1,{},sSe),s.Bi=function(n){mv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$24$Type",907),m(910,1,{},lSe),s.Bi=function(n){YJe(this.a,u(n,139))},v(ec,"JsonImporter/lambda$25$Type",910),m(909,1,{},fSe),s.Bi=function(n){P_e(this.a,u(n,149))},v(ec,"JsonImporter/lambda$26$Type",909),m(911,1,rt,$Te),s.Ad=function(n){K9n(this.b,this.a,_t(n))},v(ec,"JsonImporter/lambda$27$Type",911),m(912,1,rt,RTe),s.Ad=function(n){Q9n(this.b,this.a,_t(n))},v(ec,"JsonImporter/lambda$28$Type",912),m(913,1,{},BTe),s.Bi=function(n){uUe(this.a,this.b,u(n,139))},v(ec,"JsonImporter/lambda$29$Type",913),m(889,1,{},aSe),s.Bi=function(n){qFe(this.a,u(n,149))},v(ec,"JsonImporter/lambda$3$Type",889),m(914,1,{},zTe),s.Bi=function(n){TUe(this.a,this.b,u(n,139))},v(ec,"JsonImporter/lambda$30$Type",914),m(915,1,{},hSe),s.Bi=function(n){dRe(this.a,re(n))},v(ec,"JsonImporter/lambda$31$Type",915),m(916,1,{},dSe),s.Bi=function(n){bRe(this.a,re(n))},v(ec,"JsonImporter/lambda$32$Type",916),m(917,1,{},bSe),s.Bi=function(n){gRe(this.a,re(n))},v(ec,"JsonImporter/lambda$33$Type",917),m(918,1,{},gSe),s.Bi=function(n){wRe(this.a,re(n))},v(ec,"JsonImporter/lambda$34$Type",918),m(919,1,{},wSe),s.Bi=function(n){Uxn(this.a,u(n,57))},v(ec,"JsonImporter/lambda$35$Type",919),m(920,1,{},pSe),s.Bi=function(n){Xxn(this.a,u(n,57))},v(ec,"JsonImporter/lambda$36$Type",920),m(924,1,{},G_e),v(ec,"JsonImporter/lambda$37$Type",924),m(921,1,rt,zNe),s.Ad=function(n){E7n(this.a,this.c,this.b,u(n,372))},v(ec,"JsonImporter/lambda$38$Type",921),m(922,1,rt,FTe),s.Ad=function(n){own(this.a,this.b,u(n,170))},v(ec,"JsonImporter/lambda$39$Type",922),m(887,1,{},mSe),s.Bi=function(n){vv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$4$Type",887),m(923,1,rt,HTe),s.Ad=function(n){swn(this.a,this.b,u(n,170))},v(ec,"JsonImporter/lambda$40$Type",923),m(925,1,rt,FNe),s.Ad=function(n){j7n(this.a,this.b,this.c,u(n,8))},v(ec,"JsonImporter/lambda$41$Type",925),m(888,1,{},vSe),s.Bi=function(n){yv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$5$Type",888),m(892,1,{},ySe),s.Bi=function(n){UFe(this.a,u(n,149))},v(ec,"JsonImporter/lambda$6$Type",892),m(890,1,{},kSe),s.Bi=function(n){pv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$7$Type",890),m(891,1,{},ESe),s.Bi=function(n){mv(this.a,te(re(n)))},v(ec,"JsonImporter/lambda$8$Type",891),m(894,1,{},jSe),s.Bi=function(n){WJe(this.a,u(n,139))},v(ec,"JsonImporter/lambda$9$Type",894),m(944,1,rt,SSe),s.Ad=function(n){V5(this.a,new qp(_t(n)))},v(ec,"JsonMetaDataConverter/lambda$0$Type",944),m(945,1,rt,MSe),s.Ad=function(n){e4n(this.a,u(n,244))},v(ec,"JsonMetaDataConverter/lambda$1$Type",945),m(946,1,rt,ASe),s.Ad=function(n){q5n(this.a,u(n,144))},v(ec,"JsonMetaDataConverter/lambda$2$Type",946),m(947,1,rt,xSe),s.Ad=function(n){n4n(this.a,u(n,160))},v(ec,"JsonMetaDataConverter/lambda$3$Type",947),m(244,23,{3:1,35:1,23:1,244:1},_5);var yG,kG,Pce,EG,jG,SG,$ce,Rce,MG=vt(AN,"GraphFeature",244,At,T8n,P3n),Aan;m(11,1,{35:1,147:1},yi,Pi,fn,Wr),s.Dd=function(n){return c2n(this,u(n,147))},s.Fb=function(n){return wIe(this,n)},s.Rg=function(){return Ie(this)},s.Og=function(){return this.b},s.Hb=function(){return Vd(this.b)},s.Ib=function(){return this.b},v(AN,"Property",11),m(657,1,Kt,dX),s.Le=function(n,t){return zEn(this,u(n,105),u(t,105))},s.Fb=function(n){return this===n},s.Me=function(){return new St(this)},v(AN,"PropertyHolderComparator",657),m(698,1,Jr,ioe),s.Nb=function(n){nc(this,n)},s.Pb=function(){return e8n(this)},s.Qb=function(){kAe()},s.Ob=function(){return!!this.a},v(VF,"ElkGraphUtil/AncestorIterator",698);var R8e=Ji(Ec,"EList");m(71,56,{20:1,31:1,56:1,18:1,16:1,71:1,61:1}),s._c=function(n,t){qj(this,n,t)},s.Ec=function(n){return Et(this,n)},s.ad=function(n,t){return a1e(this,n,t)},s.Fc=function(n){return ir(this,n)},s.Gi=function(){return new R5(this)},s.Hi=function(){return new AC(this)},s.Ii=function(n){return pO(this,n)},s.Ji=function(){return!0},s.Ki=function(n,t){},s.Li=function(){},s.Mi=function(n,t){wQ(this,n,t)},s.Ni=function(n,t,i){},s.Oi=function(n,t){},s.Pi=function(n,t,i){},s.Fb=function(n){return dXe(this,n)},s.Hb=function(){return o1e(this)},s.Qi=function(){return!1},s.Jc=function(){return new ot(this)},s.cd=function(){return new $5(this)},s.dd=function(n){var t;if(t=this.gc(),n<0||n>t)throw $(new Bp(n,t));return new kK(this,n)},s.Si=function(n,t){this.Ri(n,this.bd(t))},s.Kc=function(n){return dB(this,n)},s.Ui=function(n,t){return t},s.fd=function(n,t){return Av(this,n,t)},s.Ib=function(){return ide(this)},s.Wi=function(){return!0},s.Xi=function(n,t){return m8(this,t)},v(Ec,"AbstractEList",71),m(67,71,Rh,t9,t2,n1e),s.Ci=function(n,t){return aW(this,n,t)},s.Di=function(n){return tJe(this,n)},s.Ei=function(n,t){OO(this,n,t)},s.Fi=function(n){nO(this,n)},s.Yi=function(n){return whe(this,n)},s.$b=function(){xj(this)},s.Gc=function(n){return I8(this,n)},s.Xb=function(n){return V(this,n)},s.Zi=function(n){var t,i,r;++this.j,i=this.g==null?0:this.g.length,n>i&&(r=this.g,t=i+(i/2|0)+4,t=0?(this.ed(t),!0):!1},s.Vi=function(n,t){return this.Bj(n,this.Xi(n,t))},s.gc=function(){return this.Cj()},s.Nc=function(){return this.Dj()},s.Oc=function(n){return this.Ej(n)},s.Ib=function(){return this.Fj()},v(Ec,"DelegatingEList",2055),m(2056,2055,_Ze),s.Ci=function(n,t){return nge(this,n,t)},s.Di=function(n){return this.Ci(this.Cj(),n)},s.Ei=function(n,t){Wqe(this,n,t)},s.Fi=function(n){Fqe(this,n)},s.Ji=function(){return!this.Kj()},s.$b=function(){yS(this)},s.Gj=function(n,t,i,r,c){return new bIe(this,n,t,i,r,c)},s.Hj=function(n){hi(this.hj(),n)},s.Ij=function(){return null},s.Jj=function(){return-1},s.hj=function(){return null},s.Kj=function(){return!1},s.Lj=function(n,t){return t},s.Mj=function(n,t){return t},s.Nj=function(){return!1},s.Oj=function(){return!this.yj()},s.Ri=function(n,t){var i,r;return this.Nj()?(r=this.Oj(),i=E0e(this,n,t),this.Hj(this.Gj(7,me(t),i,n,r)),i):E0e(this,n,t)},s.ed=function(n){var t,i,r,c;return this.Nj()?(i=null,r=this.Oj(),t=this.Gj(4,c=sR(this,n),null,n,r),this.Kj()&&c?(i=this.Mj(c,i),i?(i.lj(t),i.mj()):this.Hj(t)):i?(i.lj(t),i.mj()):this.Hj(t),c):(c=sR(this,n),this.Kj()&&c&&(i=this.Mj(c,null),i&&i.mj()),c)},s.Vi=function(n,t){return lVe(this,n,t)},v(Py,"DelegatingNotifyingListImpl",2056),m(151,1,JN),s.lj=function(n){return o0e(this,n)},s.mj=function(){SQ(this)},s.ej=function(){return this.d},s.Ij=function(){return null},s.Pj=function(){return null},s.fj=function(n){return-1},s.gj=function(){return VUe(this)},s.hj=function(){return null},s.ij=function(){return Obe(this)},s.jj=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},s.Qj=function(){return!1},s.kj=function(n){var t,i,r,c,o,l,f,h,b,p,y;switch(this.d){case 1:case 2:switch(c=n.ej(),c){case 1:case 2:if(o=n.hj(),ue(o)===ue(this.hj())&&this.fj(null)==n.fj(null))return this.g=n.gj(),n.ej()==1&&(this.d=1),!0}case 4:{switch(c=n.ej(),c){case 4:{if(o=n.hj(),ue(o)===ue(this.hj())&&this.fj(null)==n.fj(null))return b=vge(this),h=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,l=n.jj(),this.d=6,y=new t2(2),h<=l?(Et(y,this.n),Et(y,n.ij()),this.g=z(B(It,1),ei,30,15,[this.o=h,l+1])):(Et(y,n.ij()),Et(y,this.n),this.g=z(B(It,1),ei,30,15,[this.o=l,h])),this.n=y,b||(this.o=-2-this.o-1),!0;break}}break}case 6:{switch(c=n.ej(),c){case 4:{if(o=n.hj(),ue(o)===ue(this.hj())&&this.fj(null)==n.fj(null)){for(b=vge(this),l=n.jj(),p=u(this.g,54),r=oe(It,ei,30,p.length+1,15,1),t=0;t>>0,t.toString(16))),r.a+=" (eventType: ",this.d){case 1:{r.a+="SET";break}case 2:{r.a+="UNSET";break}case 3:{r.a+="ADD";break}case 5:{r.a+="ADD_MANY";break}case 4:{r.a+="REMOVE";break}case 6:{r.a+="REMOVE_MANY";break}case 7:{r.a+="MOVE";break}case 8:{r.a+="REMOVING_ADAPTER";break}case 9:{r.a+="RESOLVE";break}default:{LX(r,this.d);break}}if(PXe(this)&&(r.a+=", touch: true"),r.a+=", position: ",LX(r,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),r.a+=", notifier: ",ZE(r,this.hj()),r.a+=", feature: ",ZE(r,this.Ij()),r.a+=", oldValue: ",ZE(r,Obe(this)),r.a+=", newValue: ",this.d==6&&X(this.g,54)){for(i=u(this.g,54),r.a+="[",n=0;n10?((!this.b||this.c.j!=this.a)&&(this.b=new Fp(this),this.a=this.j),hf(this.b,n)):I8(this,n)},s.Wi=function(){return!0},s.a=0,v(Ec,"AbstractEList/1",949),m(305,99,sF,Bp),v(Ec,"AbstractEList/BasicIndexOutOfBoundsException",305),m(42,1,Jr,ot),s.Nb=function(n){nc(this,n)},s.Vj=function(){if(this.i.j!=this.f)throw $(new zl)},s.Wj=function(){return ft(this)},s.Ob=function(){return this.e!=this.i.gc()},s.Pb=function(){return this.Wj()},s.Qb=function(){tS(this)},s.e=0,s.f=0,s.g=-1,v(Ec,"AbstractEList/EIterator",42),m(286,42,f1,$5,kK),s.Qb=function(){tS(this)},s.Rb=function(n){iHe(this,n)},s.Xj=function(){var n;try{return n=this.d.Xb(--this.e),this.Vj(),this.g=this.e,n}catch(t){throw t=lr(t),X(t,99)?(this.Vj(),$(new hu)):$(t)}},s.Yj=function(n){iJe(this,n)},s.Sb=function(){return this.e!=0},s.Tb=function(){return this.e},s.Ub=function(){return this.Xj()},s.Vb=function(){return this.e-1},s.Wb=function(n){this.Yj(n)},v(Ec,"AbstractEList/EListIterator",286),m(355,42,Jr,R5),s.Wj=function(){return $Y(this)},s.Qb=function(){throw $(new Nt)},v(Ec,"AbstractEList/NonResolvingEIterator",355),m(391,286,f1,AC,Ule),s.Rb=function(n){throw $(new Nt)},s.Wj=function(){var n;try{return n=this.c.Ti(this.e),this.Vj(),this.g=this.e++,n}catch(t){throw t=lr(t),X(t,99)?(this.Vj(),$(new hu)):$(t)}},s.Xj=function(){var n;try{return n=this.c.Ti(--this.e),this.Vj(),this.g=this.e,n}catch(t){throw t=lr(t),X(t,99)?(this.Vj(),$(new hu)):$(t)}},s.Qb=function(){throw $(new Nt)},s.Wb=function(n){throw $(new Nt)},v(Ec,"AbstractEList/NonResolvingEListIterator",391),m(2042,71,IZe),s.Ci=function(n,t){var i,r,c,o,l,f,h,b,p,y,S;if(c=t.gc(),c!=0){for(b=u(qn(this.a,4),129),p=b==null?0:b.length,S=p+c,r=sY(this,S),y=p-n,y>0&&Wu(b,n,r,n+c,y),h=t.Jc(),l=0;li)throw $(new Bp(n,i));return new C_e(this,n)},s.$b=function(){var n,t;++this.j,n=u(qn(this.a,4),129),t=n==null?0:n.length,N8(this,null),wQ(this,t,n)},s.Gc=function(n){var t,i,r,c,o;if(t=u(qn(this.a,4),129),t!=null){if(n!=null){for(r=t,c=0,o=r.length;c=i)throw $(new Bp(n,i));return t[n]},s.bd=function(n){var t,i,r;if(t=u(qn(this.a,4),129),t!=null){if(n!=null){for(i=0,r=t.length;ii)throw $(new Bp(n,i));return new T_e(this,n)},s.Ri=function(n,t){var i,r,c;if(i=hHe(this),c=i==null?0:i.length,n>=c)throw $(new Eo(Cne+n+Rg+c));if(t>=c)throw $(new Eo(One+t+Rg+c));return r=i[t],n!=t&&(n0&&Wu(n,0,t,0,i),t},s.Oc=function(n){var t,i,r;return t=u(qn(this.a,4),129),r=t==null?0:t.length,r>0&&(n.lengthr&&cr(n,r,null),n};var xan;v(Ec,"ArrayDelegatingEList",2042),m(1032,42,Jr,PPe),s.Vj=function(){if(this.b.j!=this.f||ue(u(qn(this.b.a,4),129))!==ue(this.a))throw $(new zl)},s.Qb=function(){tS(this),this.a=u(qn(this.b.a,4),129)},v(Ec,"ArrayDelegatingEList/EIterator",1032),m(712,286,f1,KDe,T_e),s.Vj=function(){if(this.b.j!=this.f||ue(u(qn(this.b.a,4),129))!==ue(this.a))throw $(new zl)},s.Yj=function(n){iJe(this,n),this.a=u(qn(this.b.a,4),129)},s.Qb=function(){tS(this),this.a=u(qn(this.b.a,4),129)},v(Ec,"ArrayDelegatingEList/EListIterator",712),m(1033,355,Jr,$Pe),s.Vj=function(){if(this.b.j!=this.f||ue(u(qn(this.b.a,4),129))!==ue(this.a))throw $(new zl)},v(Ec,"ArrayDelegatingEList/NonResolvingEIterator",1033),m(713,391,f1,QDe,C_e),s.Vj=function(){if(this.b.j!=this.f||ue(u(qn(this.b.a,4),129))!==ue(this.a))throw $(new zl)},v(Ec,"ArrayDelegatingEList/NonResolvingEListIterator",713),m(605,305,sF,SV),v(Ec,"BasicEList/BasicIndexOutOfBoundsException",605),m(699,67,Rh,Ose),s._c=function(n,t){throw $(new Nt)},s.Ec=function(n){throw $(new Nt)},s.ad=function(n,t){throw $(new Nt)},s.Fc=function(n){throw $(new Nt)},s.$b=function(){throw $(new Nt)},s.Zi=function(n){throw $(new Nt)},s.Jc=function(){return this.Gi()},s.cd=function(){return this.Hi()},s.dd=function(n){return this.Ii(n)},s.Ri=function(n,t){throw $(new Nt)},s.Si=function(n,t){throw $(new Nt)},s.ed=function(n){throw $(new Nt)},s.Kc=function(n){throw $(new Nt)},s.fd=function(n,t){throw $(new Nt)},v(Ec,"BasicEList/UnmodifiableEList",699),m(711,1,{3:1,20:1,18:1,16:1,61:1,586:1}),s._c=function(n,t){Vwn(this,n,u(t,45))},s.Ec=function(n){return H2n(this,u(n,45))},s.Ic=function(n){oc(this,n)},s.Xb=function(n){return u(V(this.c,n),136)},s.Ri=function(n,t){return u(this.c.Ri(n,t),45)},s.Si=function(n,t){Kwn(this,n,u(t,45))},s.ed=function(n){return u(this.c.ed(n),45)},s.fd=function(n,t){return i4n(this,n,u(t,45))},s.gd=function(n){yg(this,n)},s.Lc=function(){return new pn(this,16)},s.Mc=function(){return new wn(null,new pn(this,16))},s.ad=function(n,t){return this.c.ad(n,t)},s.Fc=function(n){return this.c.Fc(n)},s.$b=function(){this.c.$b()},s.Gc=function(n){return this.c.Gc(n)},s.Hc=function(n){return MO(this.c,n)},s.Zj=function(){var n,t,i;if(this.d==null){for(this.d=oe(B8e,eme,67,2*this.f+1,0,1),i=this.e,this.f=0,t=this.c.Jc();t.e!=t.i.gc();)n=u(t.Wj(),136),bz(this,n);this.e=i}},s.Fb=function(n){return yNe(this,n)},s.Hb=function(){return o1e(this.c)},s.bd=function(n){return this.c.bd(n)},s.$j=function(){this.c=new TSe(this)},s.dc=function(){return this.f==0},s.Jc=function(){return this.c.Jc()},s.cd=function(){return this.c.cd()},s.dd=function(n){return this.c.dd(n)},s._j=function(){return rO(this)},s.ak=function(n,t,i){return new HNe(n,t,i)},s.bk=function(){return new jL},s.Kc=function(n){return hBe(this,n)},s.gc=function(){return this.f},s.hd=function(n,t){return new Y0(this.c,n,t)},s.Nc=function(){return this.c.Nc()},s.Oc=function(n){return this.c.Oc(n)},s.Ib=function(){return ide(this.c)},s.e=0,s.f=0,v(Ec,"BasicEMap",711),m(1027,67,Rh,TSe),s.Ki=function(n,t){Obn(this,u(t,136))},s.Ni=function(n,t,i){var r;++(r=this,u(t,136),r).a.e},s.Oi=function(n,t){Nbn(this,u(t,136))},s.Pi=function(n,t,i){T2n(this,u(t,136),u(i,136))},s.Mi=function(n,t){uze(this.a)},v(Ec,"BasicEMap/1",1027),m(1028,67,Rh,jL),s.$i=function(n){return oe(fzn,LZe,611,n,0,1)},v(Ec,"BasicEMap/2",1028),m(1029,Wa,bs,CSe),s.$b=function(){this.a.c.$b()},s.Gc=function(n){return AY(this.a,n)},s.Jc=function(){return this.a.f==0?(z9(),c_.a):new dAe(this.a)},s.Kc=function(n){var t;return t=this.a.f,rz(this.a,n),this.a.f!=t},s.gc=function(){return this.a.f},v(Ec,"BasicEMap/3",1029),m(1030,31,km,OSe),s.$b=function(){this.a.c.$b()},s.Gc=function(n){return bXe(this.a,n)},s.Jc=function(){return this.a.f==0?(z9(),c_.a):new bAe(this.a)},s.gc=function(){return this.a.f},v(Ec,"BasicEMap/4",1030),m(1031,Wa,bs,NSe),s.$b=function(){this.a.c.$b()},s.Gc=function(n){var t,i,r,c,o,l,f,h,b;if(this.a.f>0&&X(n,45)&&(this.a.Zj(),h=u(n,45),f=h.jd(),c=f==null?0:Ni(f),o=Ole(this.a,c),t=this.a.d[o],t)){for(i=u(t.g,374),b=t.i,l=0;l"+this.c},s.a=0;var fzn=v(Ec,"BasicEMap/EntryImpl",611);m(534,1,{},r9),v(Ec,"BasicEMap/View",534);var c_;m(769,1,{}),s.Fb=function(n){return fbe((yn(),Mc),n)},s.Hb=function(){return v1e((yn(),Mc))},s.Ib=function(){return Qa((yn(),Mc))},v(Ec,"ECollections/BasicEmptyUnmodifiableEList",769),m(1302,1,f1,iT),s.Nb=function(n){nc(this,n)},s.Rb=function(n){throw $(new Nt)},s.Ob=function(){return!1},s.Sb=function(){return!1},s.Pb=function(){throw $(new hu)},s.Tb=function(){return 0},s.Ub=function(){throw $(new hu)},s.Vb=function(){return-1},s.Qb=function(){throw $(new Nt)},s.Wb=function(n){throw $(new Nt)},v(Ec,"ECollections/BasicEmptyUnmodifiableEList/1",1302),m(1300,769,{20:1,18:1,16:1,61:1},yMe),s._c=function(n,t){PAe()},s.Ec=function(n){return LAe()},s.ad=function(n,t){return $Ae()},s.Fc=function(n){return RAe()},s.$b=function(){BAe()},s.Gc=function(n){return!1},s.Hc=function(n){return!1},s.Ic=function(n){oc(this,n)},s.Xb=function(n){return Lse((yn(),n)),null},s.bd=function(n){return-1},s.dc=function(){return!0},s.Jc=function(){return this.a},s.cd=function(){return this.a},s.dd=function(n){return this.a},s.Ri=function(n,t){return zAe()},s.Si=function(n,t){FAe()},s.ed=function(n){return HAe()},s.Kc=function(n){return JAe()},s.fd=function(n,t){return GAe()},s.gc=function(){return 0},s.gd=function(n){yg(this,n)},s.Lc=function(){return new pn(this,16)},s.Mc=function(){return new wn(null,new pn(this,16))},s.hd=function(n,t){return yn(),new Y0(Mc,n,t)},s.Nc=function(){return Cfe((yn(),Mc))},s.Oc=function(n){return yn(),Wj(Mc,n)},v(Ec,"ECollections/EmptyUnmodifiableEList",1300),m(1301,769,{20:1,18:1,16:1,61:1,586:1},kMe),s._c=function(n,t){PAe()},s.Ec=function(n){return LAe()},s.ad=function(n,t){return $Ae()},s.Fc=function(n){return RAe()},s.$b=function(){BAe()},s.Gc=function(n){return!1},s.Hc=function(n){return!1},s.Ic=function(n){oc(this,n)},s.Xb=function(n){return Lse((yn(),n)),null},s.bd=function(n){return-1},s.dc=function(){return!0},s.Jc=function(){return this.a},s.cd=function(){return this.a},s.dd=function(n){return this.a},s.Ri=function(n,t){return zAe()},s.Si=function(n,t){FAe()},s.ed=function(n){return HAe()},s.Kc=function(n){return JAe()},s.fd=function(n,t){return GAe()},s.gc=function(){return 0},s.gd=function(n){yg(this,n)},s.Lc=function(){return new pn(this,16)},s.Mc=function(){return new wn(null,new pn(this,16))},s.hd=function(n,t){return yn(),new Y0(Mc,n,t)},s.Nc=function(){return Cfe((yn(),Mc))},s.Oc=function(n){return yn(),Wj(Mc,n)},s._j=function(){return yn(),yn(),w1},v(Ec,"ECollections/EmptyUnmodifiableEMap",1301);var F8e=Ji(Ec,"Enumerator"),AG;m(290,1,{290:1},IW),s.Fb=function(n){var t;return this===n?!0:X(n,290)?(t=u(n,290),this.f==t.f&&yvn(this.i,t.i)&&oK(this.a,(this.f&256)!=0?(t.f&256)!=0?t.a:null:(t.f&256)!=0?null:t.a)&&oK(this.d,t.d)&&oK(this.g,t.g)&&oK(this.e,t.e)&&jSn(this,t)):!1},s.Hb=function(){return this.f},s.Ib=function(){return VXe(this)},s.f=0;var Tan=0,Can=0,Oan=0,Nan=0,H8e=0,J8e=0,G8e=0,q8e=0,U8e=0,Dan,bA=0,gA=0,_an=0,Ian=0,xG,X8e;v(Ec,"URI",290),m(1090,44,Rv,EMe),s.yc=function(n,t){return u(Vc(this,_t(n),u(t,290)),290)},v(Ec,"URI/URICache",1090),m(492,67,Rh,rT,bR),s.Qi=function(){return!0},v(Ec,"UniqueEList",492),m(578,63,sd,aB),v(Ec,"WrappedException",578);var Wt=Ji(ef,RZe),s3=Ji(ef,BZe),is=Ji(ef,zZe),l3=Ji(ef,FZe),La=Ji(ef,HZe),xf=Ji(ef,"EClass"),Fce=Ji(ef,"EDataType"),Lan;m(1198,44,Rv,jMe),s.xc=function(n){return Br(n)?lo(this,n):bu(Xc(this.f,n))},v(ef,"EDataType/Internal/ConversionDelegate/Factory/Registry/Impl",1198);var TG=Ji(ef,"EEnum"),vd=Ji(ef,JZe),Rc=Ji(ef,GZe),Tf=Ji(ef,qZe),Cf,G2=Ji(ef,UZe),f3=Ji(ef,XZe);m(1023,1,{},cT),s.Ib=function(){return"NIL"},v(ef,"EStructuralFeature/Internal/DynamicValueHolder/1",1023);var Pan;m(1022,44,Rv,SMe),s.xc=function(n){return Br(n)?lo(this,n):bu(Xc(this.f,n))},v(ef,"EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl",1022);var Fo=Ji(ef,VZe),h6=Ji(ef,"EValidator/PatternMatcher"),V8e,K8e,$n,w0,a3,zb,$an,Ran,Ban,Fb,p0,Hb,q2,hh,zan,Fan,Of,m0,Han,v0,h3,E4,xc,Jan,Gan,U2,CG=Ji(Ri,"FeatureMap/Entry");m(533,1,{75:1},N$),s.Jk=function(){return this.a},s.kd=function(){return this.b},v(zn,"BasicEObjectImpl/1",533),m(1021,1,Pne,GTe),s.Dk=function(n){return hQ(this.a,this.b,n)},s.Oj=function(){return NIe(this.a,this.b)},s.Wb=function(n){wae(this.a,this.b,n)},s.Ek=function(){j4n(this.a,this.b)},v(zn,"BasicEObjectImpl/4",1021),m(2043,1,{114:1}),s.Kk=function(n){this.e=n==0?qan:oe(Cr,xn,1,n,5,1)},s.ii=function(n){return this.e[n]},s.ji=function(n,t){this.e[n]=t},s.ki=function(n){this.e[n]=null},s.Lk=function(){return this.c},s.Mk=function(){throw $(new Nt)},s.Nk=function(){throw $(new Nt)},s.Ok=function(){return this.d},s.Pk=function(){return this.e!=null},s.Qk=function(n){this.c=n},s.Rk=function(n){throw $(new Nt)},s.Sk=function(n){throw $(new Nt)},s.Tk=function(n){this.d=n};var qan;v(zn,"BasicEObjectImpl/EPropertiesHolderBaseImpl",2043),m(192,2043,{114:1},ll),s.Mk=function(){return this.a},s.Nk=function(){return this.b},s.Rk=function(n){this.a=n},s.Sk=function(n){this.b=n},v(zn,"BasicEObjectImpl/EPropertiesHolderImpl",192),m(501,100,VWe,F3),s.rh=function(){return this.f},s.wh=function(){return this.k},s.yh=function(n,t){this.g=n,this.i=t},s.Ah=function(){return(this.j&2)==0?this.fi():this.Xh().Lk()},s.Ch=function(){return this.i},s.th=function(){return(this.j&1)!=0},s.Mh=function(){return this.g},s.Sh=function(){return(this.j&4)!=0},s.Xh=function(){return!this.k&&(this.k=new ll),this.k},s._h=function(n){this.Xh().Qk(n),n?this.j|=2:this.j&=-3},s.bi=function(n){this.Xh().Sk(n),n?this.j|=4:this.j&=-5},s.fi=function(){return(V0(),$n).S},s.i=0,s.j=1,v(zn,"EObjectImpl",501),m(785,501,{109:1,94:1,93:1,57:1,114:1,52:1,100:1},dfe),s.ii=function(n){return this.e[n]},s.ji=function(n,t){this.e[n]=t},s.ki=function(n){this.e[n]=null},s.Ah=function(){return this.d},s.Fh=function(n){return Fi(this.d,n)},s.Hh=function(){return this.d},s.Lh=function(){return this.e!=null},s.Xh=function(){return!this.k&&(this.k=new SL),this.k},s._h=function(n){this.d=n},s.ei=function(){var n;return this.e==null&&(n=dt(this.d),this.e=n==0?Uan:oe(Cr,xn,1,n,5,1)),this},s.gi=function(){return 0};var Uan;v(zn,"DynamicEObjectImpl",785),m(1483,785,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1},fDe),s.Fb=function(n){return this===n},s.Hb=function(){return Gw(this)},s._h=function(n){this.d=n,this.b=tN(n,"key"),this.c=tN(n,GS)},s.yi=function(){var n;return this.a==-1&&(n=MQ(this,this.b),this.a=n==null?0:Ni(n)),this.a},s.jd=function(){return MQ(this,this.b)},s.kd=function(){return MQ(this,this.c)},s.zi=function(n){this.a=n},s.Ai=function(n){wae(this,this.b,n)},s.ld=function(n){var t;return t=MQ(this,this.c),wae(this,this.c,n),t},s.a=0,v(zn,"DynamicEObjectImpl/BasicEMapEntry",1483),m(1484,1,{114:1},SL),s.Kk=function(n){throw $(new Nt)},s.ii=function(n){throw $(new Nt)},s.ji=function(n,t){throw $(new Nt)},s.ki=function(n){throw $(new Nt)},s.Lk=function(){throw $(new Nt)},s.Mk=function(){return this.a},s.Nk=function(){return this.b},s.Ok=function(){return this.c},s.Pk=function(){throw $(new Nt)},s.Qk=function(n){throw $(new Nt)},s.Rk=function(n){this.a=n},s.Sk=function(n){this.b=n},s.Tk=function(n){this.c=n},v(zn,"DynamicEObjectImpl/DynamicEPropertiesHolderImpl",1484),m(504,161,{109:1,94:1,93:1,587:1,158:1,57:1,114:1,52:1,100:1,504:1,161:1,117:1,118:1},Wb),s.xh=function(n){return Gde(this,n)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.d;case 2:return i?(!this.b&&(this.b=new Qs((vn(),xc),Iu,this)),this.b):(!this.b&&(this.b=new Qs((vn(),xc),Iu,this)),rO(this.b));case 3:return RIe(this);case 4:return!this.a&&(this.a=new yr(Bb,this,4)),this.a;case 5:return!this.c&&(this.c=new ov(Bb,this,5)),this.c}return ql(this,n-dt((vn(),w0)),jn((r=u(qn(this,16),29),r||w0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 3:return this.Cb&&(i=(c=this.Db>>16,c>=0?Gde(this,i):this.Cb.Qh(this,-1-c,null,i))),xfe(this,u(n,158),i)}return o=u(jn((r=u(qn(this,16),29),r||(vn(),w0)),t),69),o.uk().xk(this,Lo(this),t-dt((vn(),w0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 2:return!this.b&&(this.b=new Qs((vn(),xc),Iu,this)),Y$(this.b,n,i);case 3:return xfe(this,null,i);case 4:return!this.a&&(this.a=new yr(Bb,this,4)),kc(this.a,n,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),w0)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),w0)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.d!=null;case 2:return!!this.b&&this.b.f!=0;case 3:return!!RIe(this);case 4:return!!this.a&&this.a.i!=0;case 5:return!!this.c&&this.c.i!=0}return Gl(this,n-dt((vn(),w0)),jn((t=u(qn(this,16),29),t||w0),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:ovn(this,_t(t));return;case 2:!this.b&&(this.b=new Qs((vn(),xc),Iu,this)),IB(this.b,t);return;case 3:PUe(this,u(t,158));return;case 4:!this.a&&(this.a=new yr(Bb,this,4)),yt(this.a),!this.a&&(this.a=new yr(Bb,this,4)),ir(this.a,u(t,18));return;case 5:!this.c&&(this.c=new ov(Bb,this,5)),yt(this.c),!this.c&&(this.c=new ov(Bb,this,5)),ir(this.c,u(t,18));return}Yl(this,n-dt((vn(),w0)),jn((i=u(qn(this,16),29),i||w0),n),t)},s.fi=function(){return vn(),w0},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:Hhe(this,null);return;case 2:!this.b&&(this.b=new Qs((vn(),xc),Iu,this)),this.b.c.$b();return;case 3:PUe(this,null);return;case 4:!this.a&&(this.a=new yr(Bb,this,4)),yt(this.a);return;case 5:!this.c&&(this.c=new ov(Bb,this,5)),yt(this.c);return}Ql(this,n-dt((vn(),w0)),jn((t=u(qn(this,16),29),t||w0),n))},s.Ib=function(){return xFe(this)},s.d=null,v(zn,"EAnnotationImpl",504),m(142,711,nme,as),s.Ei=function(n,t){Dwn(this,n,u(t,45))},s.Uk=function(n,t){return Dpn(this,u(n,45),t)},s.Yi=function(n){return u(u(this.c,72).Yi(n),136)},s.Gi=function(){return u(this.c,72).Gi()},s.Hi=function(){return u(this.c,72).Hi()},s.Ii=function(n){return u(this.c,72).Ii(n)},s.Vk=function(n,t){return Y$(this,n,t)},s.Dk=function(n){return u(this.c,77).Dk(n)},s.$j=function(){},s.Oj=function(){return u(this.c,77).Oj()},s.ak=function(n,t,i){var r;return r=u(gl(this.b).ti().pi(this.b),136),r.zi(n),r.Ai(t),r.ld(i),r},s.bk=function(){return new coe(this)},s.Wb=function(n){IB(this,n)},s.Ek=function(){u(this.c,77).Ek()},v(Ri,"EcoreEMap",142),m(169,142,nme,Qs),s.Zj=function(){var n,t,i,r,c,o;if(this.d==null){for(o=oe(B8e,eme,67,2*this.f+1,0,1),i=this.c.Jc();i.e!=i.i.gc();)t=u(i.Wj(),136),r=t.yi(),c=(r&ui)%o.length,n=o[c],!n&&(n=o[c]=new coe(this)),n.Ec(t);this.d=o}},v(zn,"EAnnotationImpl/1",169),m(293,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,470:1,52:1,100:1,161:1,293:1,117:1,118:1}),s.Ih=function(n,t,i){var r,c;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Ln(),(this.Bb&256)!=0;case 3:return Ln(),(this.Bb&512)!=0;case 4:return me(this.s);case 5:return me(this.t);case 6:return Ln(),!!this.Hk();case 7:return Ln(),c=this.s,c>=1;case 8:return t?mf(this):this.r;case 9:return this.q}return ql(this,n-dt(this.fi()),jn((r=u(qn(this,16),29),r||this.fi()),n),t,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 9:return MK(this,i)}return c=u(jn((r=u(qn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i)},s.Th=function(n){var t,i;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Kw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Kw(this.q).i==0)}return Gl(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:this.ri(_t(t));return;case 2:Yd(this,Re($e(t)));return;case 3:Wd(this,Re($e(t)));return;case 4:Xd(this,u(t,15).a);return;case 5:this.Xk(u(t,15).a);return;case 8:Ag(this,u(t,143));return;case 9:r=Ka(this,u(t,87),null),r&&r.mj();return}Yl(this,n-dt(this.fi()),jn((i=u(qn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return vn(),Gan},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:this.ri(null);return;case 2:Yd(this,!0);return;case 3:Wd(this,!0);return;case 4:Xd(this,0);return;case 5:this.Xk(1);return;case 8:Ag(this,null);return;case 9:i=Ka(this,null,null),i&&i.mj();return}Ql(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.mi=function(){mf(this),this.Bb|=1},s.Fk=function(){return mf(this)},s.Gk=function(){return this.t},s.Hk=function(){var n;return n=this.t,n>1||n==-1},s.Qi=function(){return(this.Bb&512)!=0},s.Wk=function(n,t){return B1e(this,n,t)},s.Xk=function(n){nm(this,n)},s.Ib=function(){return nbe(this)},s.s=0,s.t=1,v(zn,"ETypedElementImpl",293),m(451,293,{109:1,94:1,93:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,451:1,293:1,117:1,118:1,682:1}),s.xh=function(n){return mJe(this,n)},s.Ih=function(n,t,i){var r,c;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Ln(),(this.Bb&256)!=0;case 3:return Ln(),(this.Bb&512)!=0;case 4:return me(this.s);case 5:return me(this.t);case 6:return Ln(),!!this.Hk();case 7:return Ln(),c=this.s,c>=1;case 8:return t?mf(this):this.r;case 9:return this.q;case 10:return Ln(),(this.Bb&Yf)!=0;case 11:return Ln(),(this.Bb&gb)!=0;case 12:return Ln(),(this.Bb&jm)!=0;case 13:return this.j;case 14:return z8(this);case 15:return Ln(),(this.Bb&gs)!=0;case 16:return Ln(),(this.Bb&Nh)!=0;case 17:return Vp(this)}return ql(this,n-dt(this.fi()),jn((r=u(qn(this,16),29),r||this.fi()),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 17:return this.Cb&&(i=(c=this.Db>>16,c>=0?mJe(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,17,i)}return o=u(jn((r=u(qn(this,16),29),r||this.fi()),t),69),o.uk().xk(this,Lo(this),t-dt(this.fi()),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 9:return MK(this,i);case 17:return yl(this,null,17,i)}return c=u(jn((r=u(qn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i)},s.Th=function(n){var t,i;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Kw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Kw(this.q).i==0);case 10:return(this.Bb&Yf)==0;case 11:return(this.Bb&gb)!=0;case 12:return(this.Bb&jm)!=0;case 13:return this.j!=null;case 14:return z8(this)!=null;case 15:return(this.Bb&gs)!=0;case 16:return(this.Bb&Nh)!=0;case 17:return!!Vp(this)}return Gl(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:VK(this,_t(t));return;case 2:Yd(this,Re($e(t)));return;case 3:Wd(this,Re($e(t)));return;case 4:Xd(this,u(t,15).a);return;case 5:this.Xk(u(t,15).a);return;case 8:Ag(this,u(t,143));return;case 9:r=Ka(this,u(t,87),null),r&&r.mj();return;case 10:j8(this,Re($e(t)));return;case 11:A8(this,Re($e(t)));return;case 12:M8(this,Re($e(t)));return;case 13:Dse(this,_t(t));return;case 15:S8(this,Re($e(t)));return;case 16:x8(this,Re($e(t)));return}Yl(this,n-dt(this.fi()),jn((i=u(qn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return vn(),Jan},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:X(this.Cb,88)&&bm(Ds(u(this.Cb,88)),4),xo(this,null);return;case 2:Yd(this,!0);return;case 3:Wd(this,!0);return;case 4:Xd(this,0);return;case 5:this.Xk(1);return;case 8:Ag(this,null);return;case 9:i=Ka(this,null,null),i&&i.mj();return;case 10:j8(this,!0);return;case 11:A8(this,!1);return;case 12:M8(this,!1);return;case 13:this.i=null,TB(this,null);return;case 15:S8(this,!1);return;case 16:x8(this,!1);return}Ql(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.mi=function(){Y9(Kc((ds(),ic),this)),mf(this),this.Bb|=1},s.nk=function(){return this.f},s.gk=function(){return z8(this)},s.ok=function(){return Vp(this)},s.sk=function(){return null},s.Yk=function(){return this.k},s.Jj=function(){return this.n},s.tk=function(){return kz(this)},s.uk=function(){var n,t,i,r,c,o,l,f,h;return this.p||(i=Vp(this),(i.i==null&&Oh(i),i.i).length,r=this.sk(),r&&dt(Vp(r)),c=mf(this),l=c.ik(),n=l?(l.i&1)!=0?l==rs?Yi:l==It?Mr:l==b3?T7:l==Gr?wr:l==V2?O2:l==A4?N2:l==ps?$y:nM:l:null,t=z8(this),f=c.gk(),UEn(this),(this.Bb&Nh)!=0&&((o=Yde((ds(),ic),i))&&o!=this||(o=W5(Kc(ic,this))))?this.p=new UTe(this,o):this.Hk()?this.$k()?r?(this.Bb&gs)!=0?n?this._k()?this.p=new dg(47,n,this,r):this.p=new dg(5,n,this,r):this._k()?this.p=new vg(46,this,r):this.p=new vg(4,this,r):n?this._k()?this.p=new dg(49,n,this,r):this.p=new dg(7,n,this,r):this._k()?this.p=new vg(48,this,r):this.p=new vg(6,this,r):(this.Bb&gs)!=0?n?n==Fg?this.p=new Fd(50,Man,this):this._k()?this.p=new Fd(43,n,this):this.p=new Fd(1,n,this):this._k()?this.p=new Jd(42,this):this.p=new Jd(0,this):n?n==Fg?this.p=new Fd(41,Man,this):this._k()?this.p=new Fd(45,n,this):this.p=new Fd(3,n,this):this._k()?this.p=new Jd(44,this):this.p=new Jd(2,this):X(c,159)?n==CG?this.p=new Jd(40,this):(this.Bb&512)!=0?(this.Bb&gs)!=0?n?this.p=new Fd(9,n,this):this.p=new Jd(8,this):n?this.p=new Fd(11,n,this):this.p=new Jd(10,this):(this.Bb&gs)!=0?n?this.p=new Fd(13,n,this):this.p=new Jd(12,this):n?this.p=new Fd(15,n,this):this.p=new Jd(14,this):r?(h=r.t,h>1||h==-1?this._k()?(this.Bb&gs)!=0?n?this.p=new dg(25,n,this,r):this.p=new vg(24,this,r):n?this.p=new dg(27,n,this,r):this.p=new vg(26,this,r):(this.Bb&gs)!=0?n?this.p=new dg(29,n,this,r):this.p=new vg(28,this,r):n?this.p=new dg(31,n,this,r):this.p=new vg(30,this,r):this._k()?(this.Bb&gs)!=0?n?this.p=new dg(33,n,this,r):this.p=new vg(32,this,r):n?this.p=new dg(35,n,this,r):this.p=new vg(34,this,r):(this.Bb&gs)!=0?n?this.p=new dg(37,n,this,r):this.p=new vg(36,this,r):n?this.p=new dg(39,n,this,r):this.p=new vg(38,this,r)):this._k()?(this.Bb&gs)!=0?n?this.p=new Fd(17,n,this):this.p=new Jd(16,this):n?this.p=new Fd(19,n,this):this.p=new Jd(18,this):(this.Bb&gs)!=0?n?this.p=new Fd(21,n,this):this.p=new Jd(20,this):n?this.p=new Fd(23,n,this):this.p=new Jd(22,this):this.Zk()?this._k()?this.p=new LNe(u(c,29),this,r):this.p=new dae(u(c,29),this,r):X(c,159)?n==CG?this.p=new Jd(40,this):(this.Bb&gs)!=0?n?this.p=new DDe(t,f,this,(TY(),l==It?t7e:l==rs?Y8e:l==V2?i7e:l==b3?n7e:l==Gr?e7e:l==A4?r7e:l==ps?W8e:l==sf?Z8e:Gce)):this.p=new V_e(u(c,159),t,f,this):n?this.p=new NDe(t,f,this,(TY(),l==It?t7e:l==rs?Y8e:l==V2?i7e:l==b3?n7e:l==Gr?e7e:l==A4?r7e:l==ps?W8e:l==sf?Z8e:Gce)):this.p=new X_e(u(c,159),t,f,this):this.$k()?r?(this.Bb&gs)!=0?this._k()?this.p=new $Ne(u(c,29),this,r):this.p=new Wle(u(c,29),this,r):this._k()?this.p=new PNe(u(c,29),this,r):this.p=new eK(u(c,29),this,r):(this.Bb&gs)!=0?this._k()?this.p=new _Oe(u(c,29),this):this.p=new ple(u(c,29),this):this._k()?this.p=new DOe(u(c,29),this):this.p=new zV(u(c,29),this):this._k()?r?(this.Bb&gs)!=0?this.p=new RNe(u(c,29),this,r):this.p=new Zle(u(c,29),this,r):(this.Bb&gs)!=0?this.p=new IOe(u(c,29),this):this.p=new mle(u(c,29),this):r?(this.Bb&gs)!=0?this.p=new BNe(u(c,29),this,r):this.p=new efe(u(c,29),this,r):(this.Bb&gs)!=0?this.p=new LOe(u(c,29),this):this.p=new dR(u(c,29),this)),this.p},s.pk=function(){return(this.Bb&Yf)!=0},s.Zk=function(){return!1},s.$k=function(){return!1},s.qk=function(){return(this.Bb&Nh)!=0},s.vk=function(){return xQ(this)},s._k=function(){return!1},s.rk=function(){return(this.Bb&gs)!=0},s.al=function(n){this.k=n},s.ri=function(n){VK(this,n)},s.Ib=function(){return qz(this)},s.e=!1,s.n=0,v(zn,"EStructuralFeatureImpl",451),m(335,451,{109:1,94:1,93:1,38:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,335:1,161:1,451:1,293:1,117:1,118:1,682:1},yX),s.Ih=function(n,t,i){var r,c;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Ln(),(this.Bb&256)!=0;case 3:return Ln(),(this.Bb&512)!=0;case 4:return me(this.s);case 5:return me(this.t);case 6:return Ln(),!!K0e(this);case 7:return Ln(),c=this.s,c>=1;case 8:return t?mf(this):this.r;case 9:return this.q;case 10:return Ln(),(this.Bb&Yf)!=0;case 11:return Ln(),(this.Bb&gb)!=0;case 12:return Ln(),(this.Bb&jm)!=0;case 13:return this.j;case 14:return z8(this);case 15:return Ln(),(this.Bb&gs)!=0;case 16:return Ln(),(this.Bb&Nh)!=0;case 17:return Vp(this);case 18:return Ln(),(this.Bb&Bu)!=0;case 19:return t?VQ(this):QPe(this)}return ql(this,n-dt((vn(),a3)),jn((r=u(qn(this,16),29),r||a3),n),t,i)},s.Th=function(n){var t,i;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return K0e(this);case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Kw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Kw(this.q).i==0);case 10:return(this.Bb&Yf)==0;case 11:return(this.Bb&gb)!=0;case 12:return(this.Bb&jm)!=0;case 13:return this.j!=null;case 14:return z8(this)!=null;case 15:return(this.Bb&gs)!=0;case 16:return(this.Bb&Nh)!=0;case 17:return!!Vp(this);case 18:return(this.Bb&Bu)!=0;case 19:return!!QPe(this)}return Gl(this,n-dt((vn(),a3)),jn((t=u(qn(this,16),29),t||a3),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:VK(this,_t(t));return;case 2:Yd(this,Re($e(t)));return;case 3:Wd(this,Re($e(t)));return;case 4:Xd(this,u(t,15).a);return;case 5:yAe(this,u(t,15).a);return;case 8:Ag(this,u(t,143));return;case 9:r=Ka(this,u(t,87),null),r&&r.mj();return;case 10:j8(this,Re($e(t)));return;case 11:A8(this,Re($e(t)));return;case 12:M8(this,Re($e(t)));return;case 13:Dse(this,_t(t));return;case 15:S8(this,Re($e(t)));return;case 16:x8(this,Re($e(t)));return;case 18:vY(this,Re($e(t)));return}Yl(this,n-dt((vn(),a3)),jn((i=u(qn(this,16),29),i||a3),n),t)},s.fi=function(){return vn(),a3},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:X(this.Cb,88)&&bm(Ds(u(this.Cb,88)),4),xo(this,null);return;case 2:Yd(this,!0);return;case 3:Wd(this,!0);return;case 4:Xd(this,0);return;case 5:this.b=0,nm(this,1);return;case 8:Ag(this,null);return;case 9:i=Ka(this,null,null),i&&i.mj();return;case 10:j8(this,!0);return;case 11:A8(this,!1);return;case 12:M8(this,!1);return;case 13:this.i=null,TB(this,null);return;case 15:S8(this,!1);return;case 16:x8(this,!1);return;case 18:vY(this,!1);return}Ql(this,n-dt((vn(),a3)),jn((t=u(qn(this,16),29),t||a3),n))},s.mi=function(){VQ(this),Y9(Kc((ds(),ic),this)),mf(this),this.Bb|=1},s.Hk=function(){return K0e(this)},s.Wk=function(n,t){return this.b=0,this.a=null,B1e(this,n,t)},s.Xk=function(n){yAe(this,n)},s.Ib=function(){var n;return(this.Db&64)!=0?qz(this):(n=new df(qz(this)),n.a+=" (iD: ",Pd(n,(this.Bb&Bu)!=0),n.a+=")",n.a)},s.b=0,v(zn,"EAttributeImpl",335),m(360,439,{109:1,94:1,93:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,161:1,117:1,118:1,681:1}),s.bl=function(n){return n.Ah()==this},s.xh=function(n){return ZY(this,n)},s.yh=function(n,t){this.w=null,this.Db=t<<16|this.Db&255,this.Cb=n},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return h2(this);case 4:return this.gk();case 5:return this.F;case 6:return t?gl(this):e8(this);case 7:return!this.A&&(this.A=new ss(Fo,this,7)),this.A}return ql(this,n-dt(this.fi()),jn((r=u(qn(this,16),29),r||this.fi()),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 6:return this.Cb&&(i=(c=this.Db>>16,c>=0?ZY(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,6,i)}return o=u(jn((r=u(qn(this,16),29),r||this.fi()),t),69),o.uk().xk(this,Lo(this),t-dt(this.fi()),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 6:return yl(this,null,6,i);case 7:return!this.A&&(this.A=new ss(Fo,this,7)),kc(this.A,n,i)}return c=u(jn((r=u(qn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!h2(this);case 4:return this.gk()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!e8(this);case 7:return!!this.A&&this.A.i!=0}return Gl(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:JR(this,_t(t));return;case 2:xV(this,_t(t));return;case 5:X8(this,_t(t));return;case 7:!this.A&&(this.A=new ss(Fo,this,7)),yt(this.A),!this.A&&(this.A=new ss(Fo,this,7)),ir(this.A,u(t,18));return}Yl(this,n-dt(this.fi()),jn((i=u(qn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return vn(),$an},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:X(this.Cb,184)&&(u(this.Cb,184).tb=null),xo(this,null);return;case 2:v8(this,null),s8(this,this.D);return;case 5:X8(this,null);return;case 7:!this.A&&(this.A=new ss(Fo,this,7)),yt(this.A);return}Ql(this,n-dt(this.fi()),jn((t=u(qn(this,16),29),t||this.fi()),n))},s.fk=function(){var n;return this.G==-1&&(this.G=(n=gl(this),n?Zd(n.si(),this):-1)),this.G},s.gk=function(){return null},s.hk=function(){return gl(this)},s.cl=function(){return this.v},s.ik=function(){return h2(this)},s.jk=function(){return this.D!=null?this.D:this.B},s.kk=function(){return this.F},s.dk=function(n){return JW(this,n)},s.dl=function(n){this.v=n},s.el=function(n){BBe(this,n)},s.fl=function(n){this.C=n},s.ri=function(n){JR(this,n)},s.Ib=function(){return ez(this)},s.C=null,s.D=null,s.G=-1,v(zn,"EClassifierImpl",360),m(88,360,{109:1,94:1,93:1,29:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,88:1,360:1,161:1,471:1,117:1,118:1,681:1},aE),s.bl=function(n){return mpn(this,n.Ah())},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return h2(this);case 4:return null;case 5:return this.F;case 6:return t?gl(this):e8(this);case 7:return!this.A&&(this.A=new ss(Fo,this,7)),this.A;case 8:return Ln(),(this.Bb&256)!=0;case 9:return Ln(),(this.Bb&512)!=0;case 10:return iu(this);case 11:return!this.q&&(this.q=new we(Tf,this,11,10)),this.q;case 12:return Iv(this);case 13:return pS(this);case 14:return pS(this),this.r;case 15:return Iv(this),this.k;case 16:return R0e(this);case 17:return XW(this);case 18:return Oh(this);case 19:return Pz(this);case 20:return Iv(this),this.o;case 21:return!this.s&&(this.s=new we(is,this,21,17)),this.s;case 22:return Ku(this);case 23:return _W(this)}return ql(this,n-dt((vn(),zb)),jn((r=u(qn(this,16),29),r||zb),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 6:return this.Cb&&(i=(c=this.Db>>16,c>=0?ZY(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,6,i);case 11:return!this.q&&(this.q=new we(Tf,this,11,10)),To(this.q,n,i);case 21:return!this.s&&(this.s=new we(is,this,21,17)),To(this.s,n,i)}return o=u(jn((r=u(qn(this,16),29),r||(vn(),zb)),t),69),o.uk().xk(this,Lo(this),t-dt((vn(),zb)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 6:return yl(this,null,6,i);case 7:return!this.A&&(this.A=new ss(Fo,this,7)),kc(this.A,n,i);case 11:return!this.q&&(this.q=new we(Tf,this,11,10)),kc(this.q,n,i);case 21:return!this.s&&(this.s=new we(is,this,21,17)),kc(this.s,n,i);case 22:return kc(Ku(this),n,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),zb)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),zb)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!h2(this);case 4:return!1;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!e8(this);case 7:return!!this.A&&this.A.i!=0;case 8:return(this.Bb&256)!=0;case 9:return(this.Bb&512)!=0;case 10:return!!this.u&&Ku(this.u.a).i!=0&&!(this.n&&HY(this.n));case 11:return!!this.q&&this.q.i!=0;case 12:return Iv(this).i!=0;case 13:return pS(this).i!=0;case 14:return pS(this),this.r.i!=0;case 15:return Iv(this),this.k.i!=0;case 16:return R0e(this).i!=0;case 17:return XW(this).i!=0;case 18:return Oh(this).i!=0;case 19:return Pz(this).i!=0;case 20:return Iv(this),!!this.o;case 21:return!!this.s&&this.s.i!=0;case 22:return!!this.n&&HY(this.n);case 23:return _W(this).i!=0}return Gl(this,n-dt((vn(),zb)),jn((t=u(qn(this,16),29),t||zb),n))},s.Wh=function(n){var t;return t=this.i==null||this.q&&this.q.i!=0?null:tN(this,n),t||xge(this,n)},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:JR(this,_t(t));return;case 2:xV(this,_t(t));return;case 5:X8(this,_t(t));return;case 7:!this.A&&(this.A=new ss(Fo,this,7)),yt(this.A),!this.A&&(this.A=new ss(Fo,this,7)),ir(this.A,u(t,18));return;case 8:H1e(this,Re($e(t)));return;case 9:J1e(this,Re($e(t)));return;case 10:yS(iu(this)),ir(iu(this),u(t,18));return;case 11:!this.q&&(this.q=new we(Tf,this,11,10)),yt(this.q),!this.q&&(this.q=new we(Tf,this,11,10)),ir(this.q,u(t,18));return;case 21:!this.s&&(this.s=new we(is,this,21,17)),yt(this.s),!this.s&&(this.s=new we(is,this,21,17)),ir(this.s,u(t,18));return;case 22:yt(Ku(this)),ir(Ku(this),u(t,18));return}Yl(this,n-dt((vn(),zb)),jn((i=u(qn(this,16),29),i||zb),n),t)},s.fi=function(){return vn(),zb},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:X(this.Cb,184)&&(u(this.Cb,184).tb=null),xo(this,null);return;case 2:v8(this,null),s8(this,this.D);return;case 5:X8(this,null);return;case 7:!this.A&&(this.A=new ss(Fo,this,7)),yt(this.A);return;case 8:H1e(this,!1);return;case 9:J1e(this,!1);return;case 10:this.u&&yS(this.u);return;case 11:!this.q&&(this.q=new we(Tf,this,11,10)),yt(this.q);return;case 21:!this.s&&(this.s=new we(is,this,21,17)),yt(this.s);return;case 22:this.n&&yt(this.n);return}Ql(this,n-dt((vn(),zb)),jn((t=u(qn(this,16),29),t||zb),n))},s.mi=function(){var n,t;if(Iv(this),pS(this),R0e(this),XW(this),Oh(this),Pz(this),_W(this),xj(z3n(Ds(this))),this.s)for(n=0,t=this.s.i;n=0;--t)V(this,t);return ade(this,n)},s.Ek=function(){yt(this)},s.Xi=function(n,t){return aBe(this,n,t)},v(Ri,"EcoreEList",623),m(491,623,au,BC),s.Ji=function(){return!1},s.Jj=function(){return this.c},s.Kj=function(){return!1},s.ml=function(){return!0},s.Qi=function(){return!0},s.Ui=function(n,t){return t},s.Wi=function(){return!1},s.c=0,v(Ri,"EObjectEList",491),m(81,491,au,yr),s.Kj=function(){return!0},s.kl=function(){return!1},s.$k=function(){return!0},v(Ri,"EObjectContainmentEList",81),m(543,81,au,H$),s.Li=function(){this.b=!0},s.Oj=function(){return this.b},s.Ek=function(){var n;yt(this),Vs(this.e)?(n=this.b,this.b=!1,hi(this.e,new Hf(this.e,2,this.c,n,!1))):this.b=!1},s.b=!1,v(Ri,"EObjectContainmentEList/Unsettable",543),m(1130,543,au,_De),s.Ri=function(n,t){var i,r;return i=u(Uj(this,n,t),87),Vs(this.e)&&S9(this,new oO(this.a,7,(vn(),Ran),me(t),(r=i.c,X(r,88)?u(r,29):Of),n)),i},s.Sj=function(n,t){return Sjn(this,u(n,87),t)},s.Tj=function(n,t){return Mjn(this,u(n,87),t)},s.Uj=function(n,t,i){return AAn(this,u(n,87),u(t,87),i)},s.Gj=function(n,t,i,r,c){switch(n){case 3:return kj(this,n,t,i,r,this.i>1);case 5:return kj(this,n,t,i,r,this.i-u(i,16).gc()>0);default:return new ed(this.e,n,this.c,t,i,r,!0)}},s.Rj=function(){return!0},s.Oj=function(){return HY(this)},s.Ek=function(){yt(this)},v(zn,"EClassImpl/1",1130),m(1144,1143,Zpe),s.bj=function(n){var t,i,r,c,o,l,f;if(i=n.ej(),i!=8){if(r=sSn(n),r==0)switch(i){case 1:case 9:{f=n.ij(),f!=null&&(t=Ds(u(f,471)),!t.c&&(t.c=new Bl),dB(t.c,n.hj())),l=n.gj(),l!=null&&(c=u(l,471),(c.Bb&1)==0&&(t=Ds(c),!t.c&&(t.c=new Bl),Et(t.c,u(n.hj(),29))));break}case 3:{l=n.gj(),l!=null&&(c=u(l,471),(c.Bb&1)==0&&(t=Ds(c),!t.c&&(t.c=new Bl),Et(t.c,u(n.hj(),29))));break}case 5:{if(l=n.gj(),l!=null)for(o=u(l,18).Jc();o.Ob();)c=u(o.Pb(),471),(c.Bb&1)==0&&(t=Ds(c),!t.c&&(t.c=new Bl),Et(t.c,u(n.hj(),29)));break}case 4:{f=n.ij(),f!=null&&(c=u(f,471),(c.Bb&1)==0&&(t=Ds(c),!t.c&&(t.c=new Bl),dB(t.c,n.hj())));break}case 6:{if(f=n.ij(),f!=null)for(o=u(f,18).Jc();o.Ob();)c=u(o.Pb(),471),(c.Bb&1)==0&&(t=Ds(c),!t.c&&(t.c=new Bl),dB(t.c,n.hj()));break}}this.ol(r)}},s.ol=function(n){EXe(this,n)},s.b=63,v(zn,"ESuperAdapter",1144),m(1145,1144,Zpe,_Se),s.ol=function(n){bm(this,n)},v(zn,"EClassImpl/10",1145),m(1134,699,au),s.Ci=function(n,t){return aW(this,n,t)},s.Di=function(n){return tJe(this,n)},s.Ei=function(n,t){OO(this,n,t)},s.Fi=function(n){nO(this,n)},s.Yi=function(n){return whe(this,n)},s.Vi=function(n,t){return AQ(this,n,t)},s.Uk=function(n,t){throw $(new Nt)},s.Gi=function(){return new R5(this)},s.Hi=function(){return new AC(this)},s.Ii=function(n){return pO(this,n)},s.Vk=function(n,t){throw $(new Nt)},s.Dk=function(n){return this},s.Oj=function(){return this.i!=0},s.Wb=function(n){throw $(new Nt)},s.Ek=function(){throw $(new Nt)},v(Ri,"EcoreEList/UnmodifiableEList",1134),m(333,1134,au,nv),s.Wi=function(){return!1},v(Ri,"EcoreEList/UnmodifiableEList/FastCompare",333),m(1137,333,au,Nze),s.bd=function(n){var t,i,r;if(X(n,179)&&(t=u(n,179),i=t.Jj(),i!=-1)){for(r=this.i;i4)if(this.dk(n)){if(this.$k()){if(r=u(n,52),i=r.Bh(),f=i==this.b&&(this.kl()?r.vh(r.Ch(),u(jn(Uo(this.b),this.Jj()).Fk(),29).ik())==Oc(u(jn(Uo(this.b),this.Jj()),19)).n:-1-r.Ch()==this.Jj()),this.ll()&&!f&&!i&&r.Gh()){for(c=0;c1||r==-1)):!1},s.kl=function(){var n,t,i;return t=jn(Uo(this.b),this.Jj()),X(t,103)?(n=u(t,19),i=Oc(n),!!i):!1},s.ll=function(){var n,t;return t=jn(Uo(this.b),this.Jj()),X(t,103)?(n=u(t,19),(n.Bb&Sc)!=0):!1},s.bd=function(n){var t,i,r,c;if(r=this.xj(n),r>=0)return r;if(this.ml()){for(i=0,c=this.Cj();i=0;--n)fN(this,n,this.vj(n));return this.Dj()},s.Oc=function(n){var t;if(this.ll())for(t=this.Cj()-1;t>=0;--t)fN(this,t,this.vj(t));return this.Ej(n)},s.Ek=function(){yS(this)},s.Xi=function(n,t){return L$e(this,n,t)},v(Ri,"DelegatingEcoreEList",744),m(1140,744,ime,qOe),s.oj=function(n,t){X2n(this,n,u(t,29))},s.pj=function(n){Iwn(this,u(n,29))},s.vj=function(n){var t,i;return t=u(V(Ku(this.a),n),87),i=t.c,X(i,88)?u(i,29):(vn(),Of)},s.Aj=function(n){var t,i;return t=u(pm(Ku(this.a),n),87),i=t.c,X(i,88)?u(i,29):(vn(),Of)},s.Bj=function(n,t){return eMn(this,n,u(t,29))},s.Ji=function(){return!1},s.Gj=function(n,t,i,r,c){return null},s.qj=function(){return new PSe(this)},s.rj=function(){yt(Ku(this.a))},s.sj=function(n){return TFe(this,n)},s.tj=function(n){var t,i;for(i=n.Jc();i.Ob();)if(t=i.Pb(),!TFe(this,t))return!1;return!0},s.uj=function(n){var t,i,r;if(X(n,16)&&(r=u(n,16),r.gc()==Ku(this.a).i)){for(t=r.Jc(),i=new ot(this);t.Ob();)if(ue(t.Pb())!==ue(ft(i)))return!1;return!0}return!1},s.wj=function(){var n,t,i,r,c;for(i=1,t=new ot(Ku(this.a));t.e!=t.i.gc();)n=u(ft(t),87),r=(c=n.c,X(c,88)?u(c,29):(vn(),Of)),i=31*i+(r?Gw(r):0);return i},s.xj=function(n){var t,i,r,c;for(r=0,i=new ot(Ku(this.a));i.e!=i.i.gc();){if(t=u(ft(i),87),ue(n)===ue((c=t.c,X(c,88)?u(c,29):(vn(),Of))))return r;++r}return-1},s.yj=function(){return Ku(this.a).i==0},s.zj=function(){return null},s.Cj=function(){return Ku(this.a).i},s.Dj=function(){var n,t,i,r,c,o;for(o=Ku(this.a).i,c=oe(Cr,xn,1,o,5,1),i=0,t=new ot(Ku(this.a));t.e!=t.i.gc();)n=u(ft(t),87),c[i++]=(r=n.c,X(r,88)?u(r,29):(vn(),Of));return c},s.Ej=function(n){var t,i,r,c,o,l,f;for(f=Ku(this.a).i,n.lengthf&&cr(n,f,null),r=0,i=new ot(Ku(this.a));i.e!=i.i.gc();)t=u(ft(i),87),o=(l=t.c,X(l,88)?u(l,29):(vn(),Of)),cr(n,r++,o);return n},s.Fj=function(){var n,t,i,r,c;for(c=new Ld,c.a+="[",n=Ku(this.a),t=0,r=Ku(this.a).i;t>16,c>=0?ZY(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,6,i);case 9:return!this.a&&(this.a=new we(vd,this,9,5)),To(this.a,n,i)}return o=u(jn((r=u(qn(this,16),29),r||(vn(),Fb)),t),69),o.uk().xk(this,Lo(this),t-dt((vn(),Fb)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 6:return yl(this,null,6,i);case 7:return!this.A&&(this.A=new ss(Fo,this,7)),kc(this.A,n,i);case 9:return!this.a&&(this.a=new we(vd,this,9,5)),kc(this.a,n,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),Fb)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),Fb)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!h2(this);case 4:return!!C1e(this);case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!e8(this);case 7:return!!this.A&&this.A.i!=0;case 8:return(this.Bb&256)==0;case 9:return!!this.a&&this.a.i!=0}return Gl(this,n-dt((vn(),Fb)),jn((t=u(qn(this,16),29),t||Fb),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:JR(this,_t(t));return;case 2:xV(this,_t(t));return;case 5:X8(this,_t(t));return;case 7:!this.A&&(this.A=new ss(Fo,this,7)),yt(this.A),!this.A&&(this.A=new ss(Fo,this,7)),ir(this.A,u(t,18));return;case 8:UB(this,Re($e(t)));return;case 9:!this.a&&(this.a=new we(vd,this,9,5)),yt(this.a),!this.a&&(this.a=new we(vd,this,9,5)),ir(this.a,u(t,18));return}Yl(this,n-dt((vn(),Fb)),jn((i=u(qn(this,16),29),i||Fb),n),t)},s.fi=function(){return vn(),Fb},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:X(this.Cb,184)&&(u(this.Cb,184).tb=null),xo(this,null);return;case 2:v8(this,null),s8(this,this.D);return;case 5:X8(this,null);return;case 7:!this.A&&(this.A=new ss(Fo,this,7)),yt(this.A);return;case 8:UB(this,!0);return;case 9:!this.a&&(this.a=new we(vd,this,9,5)),yt(this.a);return}Ql(this,n-dt((vn(),Fb)),jn((t=u(qn(this,16),29),t||Fb),n))},s.mi=function(){var n,t;if(this.a)for(n=0,t=this.a.i;n>16==5?u(this.Cb,675):null}return ql(this,n-dt((vn(),p0)),jn((r=u(qn(this,16),29),r||p0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 5:return this.Cb&&(i=(c=this.Db>>16,c>=0?CJe(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,5,i)}return o=u(jn((r=u(qn(this,16),29),r||(vn(),p0)),t),69),o.uk().xk(this,Lo(this),t-dt((vn(),p0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 5:return yl(this,null,5,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),p0)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),p0)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.d!=0;case 3:return!!this.b;case 4:return this.c!=null;case 5:return!!(this.Db>>16==5&&u(this.Cb,675))}return Gl(this,n-dt((vn(),p0)),jn((t=u(qn(this,16),29),t||p0),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:xo(this,_t(t));return;case 2:_Q(this,u(t,15).a);return;case 3:Dqe(this,u(t,2001));return;case 4:LQ(this,_t(t));return}Yl(this,n-dt((vn(),p0)),jn((i=u(qn(this,16),29),i||p0),n),t)},s.fi=function(){return vn(),p0},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:xo(this,null);return;case 2:_Q(this,0);return;case 3:Dqe(this,null);return;case 4:LQ(this,null);return}Ql(this,n-dt((vn(),p0)),jn((t=u(qn(this,16),29),t||p0),n))},s.Ib=function(){var n;return n=this.c,n??this.zb},s.b=null,s.c=null,s.d=0,v(zn,"EEnumLiteralImpl",568);var azn=Ji(zn,"EFactoryImpl/InternalEDateTimeFormat");m(485,1,{2076:1},YT),v(zn,"EFactoryImpl/1ClientInternalEDateTimeFormat",485),m(248,118,{109:1,94:1,93:1,87:1,57:1,114:1,52:1,100:1,248:1,117:1,118:1},$w),s.zh=function(n,t,i){var r;return i=yl(this,n,t,i),this.e&&X(n,179)&&(r=Lz(this,this.e),r!=this.c&&(i=V8(this,r,i))),i},s.Ih=function(n,t,i){var r;switch(n){case 0:return this.f;case 1:return!this.d&&(this.d=new yr(Rc,this,1)),this.d;case 2:return t?Xz(this):this.c;case 3:return this.b;case 4:return this.e;case 5:return t?qY(this):this.a}return ql(this,n-dt((vn(),q2)),jn((r=u(qn(this,16),29),r||q2),n),t,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return bFe(this,null,i);case 1:return!this.d&&(this.d=new yr(Rc,this,1)),kc(this.d,n,i);case 3:return dFe(this,null,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),q2)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),q2)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.f;case 1:return!!this.d&&this.d.i!=0;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return Gl(this,n-dt((vn(),q2)),jn((t=u(qn(this,16),29),t||q2),n))},s.$h=function(n,t){var i;switch(n){case 0:VJe(this,u(t,87));return;case 1:!this.d&&(this.d=new yr(Rc,this,1)),yt(this.d),!this.d&&(this.d=new yr(Rc,this,1)),ir(this.d,u(t,18));return;case 3:c0e(this,u(t,87));return;case 4:S0e(this,u(t,834));return;case 5:o8(this,u(t,143));return}Yl(this,n-dt((vn(),q2)),jn((i=u(qn(this,16),29),i||q2),n),t)},s.fi=function(){return vn(),q2},s.hi=function(n){var t;switch(n){case 0:VJe(this,null);return;case 1:!this.d&&(this.d=new yr(Rc,this,1)),yt(this.d);return;case 3:c0e(this,null);return;case 4:S0e(this,null);return;case 5:o8(this,null);return}Ql(this,n-dt((vn(),q2)),jn((t=u(qn(this,16),29),t||q2),n))},s.Ib=function(){var n;return n=new fl(Vf(this)),n.a+=" (expression: ",WW(this,n),n.a+=")",n.a};var Q8e;v(zn,"EGenericTypeImpl",248),m(2029,2024,ZF),s.Ei=function(n,t){XOe(this,n,t)},s.Uk=function(n,t){return XOe(this,this.gc(),n),t},s.Yi=function(n){return Qu(this.nj(),n)},s.Gi=function(){return this.Hi()},s.nj=function(){return new zSe(this)},s.Hi=function(){return this.Ii(0)},s.Ii=function(n){return this.nj().dd(n)},s.Vk=function(n,t){return om(this,n,!0),t},s.Ri=function(n,t){var i,r;return r=tW(this,t),i=this.dd(n),i.Rb(r),r},s.Si=function(n,t){var i;om(this,t,!0),i=this.dd(n),i.Rb(t)},v(Ri,"AbstractSequentialInternalEList",2029),m(482,2029,ZF,xC),s.Yi=function(n){return Qu(this.nj(),n)},s.Gi=function(){return this.b==null?(Bd(),Bd(),u_):this.ql()},s.nj=function(){return new hCe(this.a,this.b)},s.Hi=function(){return this.b==null?(Bd(),Bd(),u_):this.ql()},s.Ii=function(n){var t,i;if(this.b==null){if(n<0||n>1)throw $(new Eo(qS+n+", size=0"));return Bd(),Bd(),u_}for(i=this.ql(),t=0;t0;)if(t=this.c[--this.d],(!this.e||t.nk()!=sk||t.Jj()!=0)&&(!this.tl()||this.b.Uh(t))){if(o=this.b.Kh(t,this.sl()),this.f=(Cc(),u(t,69).vk()),this.f||t.Hk()){if(this.sl()?(r=u(o,16),this.k=r):(r=u(o,72),this.k=this.j=r),X(this.k,59)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j.Ii(this.k.gc()):this.k.dd(this.k.gc()),this.p?UGe(this,this.p):tqe(this))return c=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(n=u(c,75),n.Jk(),i=n.kd(),this.i=i):(i=c,this.i=i),this.g=-3,!0}else if(o!=null)return this.k=null,this.p=null,i=o,this.i=i,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}else return c=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(n=u(c,75),n.Jk(),i=n.kd(),this.i=i):(i=c,this.i=i),this.g=-3,!0}},s.Pb=function(){return LB(this)},s.Tb=function(){return this.a},s.Ub=function(){var n;if(this.g<-1||this.Sb())return--this.a,this.g=0,n=this.i,this.Sb(),n;throw $(new hu)},s.Vb=function(){return this.a-1},s.Qb=function(){throw $(new Nt)},s.sl=function(){return!1},s.Wb=function(n){throw $(new Nt)},s.tl=function(){return!0},s.a=0,s.d=0,s.f=!1,s.g=0,s.n=0,s.o=0;var u_;v(Ri,"EContentsEList/FeatureIteratorImpl",287),m(700,287,eH,wle),s.sl=function(){return!0},v(Ri,"EContentsEList/ResolvingFeatureIteratorImpl",700),m(1147,700,eH,COe),s.tl=function(){return!1},v(zn,"ENamedElementImpl/1/1",1147),m(1148,287,eH,OOe),s.tl=function(){return!1},v(zn,"ENamedElementImpl/1/2",1148),m(39,151,JN,Wp,cQ,Lr,vQ,ed,Hf,The,gLe,Che,wLe,Jae,pLe,Dhe,mLe,Gae,vLe,Ohe,yLe,bj,oO,BK,Nhe,kLe,qae,ELe),s.Ij=function(){return fhe(this)},s.Pj=function(){var n;return n=fhe(this),n?n.gk():null},s.fj=function(n){return this.b==-1&&this.a&&(this.b=this.c.Eh(this.a.Jj(),this.a.nk())),this.c.vh(this.b,n)},s.hj=function(){return this.c},s.Qj=function(){var n;return n=fhe(this),n?n.rk():!1},s.b=-1,v(zn,"ENotificationImpl",39),m(403,293,{109:1,94:1,93:1,158:1,197:1,57:1,62:1,114:1,470:1,52:1,100:1,161:1,403:1,293:1,117:1,118:1},kX),s.xh=function(n){return NJe(this,n)},s.Ih=function(n,t,i){var r,c,o;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Ln(),(this.Bb&256)!=0;case 3:return Ln(),(this.Bb&512)!=0;case 4:return me(this.s);case 5:return me(this.t);case 6:return Ln(),o=this.t,o>1||o==-1;case 7:return Ln(),c=this.s,c>=1;case 8:return t?mf(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?u(this.Cb,29):null;case 11:return!this.d&&(this.d=new ss(Fo,this,11)),this.d;case 12:return!this.c&&(this.c=new we(G2,this,12,10)),this.c;case 13:return!this.a&&(this.a=new NC(this,this)),this.a;case 14:return Is(this)}return ql(this,n-dt((vn(),m0)),jn((r=u(qn(this,16),29),r||m0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 10:return this.Cb&&(i=(c=this.Db>>16,c>=0?NJe(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,10,i);case 12:return!this.c&&(this.c=new we(G2,this,12,10)),To(this.c,n,i)}return o=u(jn((r=u(qn(this,16),29),r||(vn(),m0)),t),69),o.uk().xk(this,Lo(this),t-dt((vn(),m0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 9:return MK(this,i);case 10:return yl(this,null,10,i);case 11:return!this.d&&(this.d=new ss(Fo,this,11)),kc(this.d,n,i);case 12:return!this.c&&(this.c=new we(G2,this,12,10)),kc(this.c,n,i);case 14:return kc(Is(this),n,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),m0)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),m0)),n,i)},s.Th=function(n){var t,i,r;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Kw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Kw(this.q).i==0);case 10:return!!(this.Db>>16==10&&u(this.Cb,29));case 11:return!!this.d&&this.d.i!=0;case 12:return!!this.c&&this.c.i!=0;case 13:return!!this.a&&Is(this.a.a).i!=0&&!(this.b&&JY(this.b));case 14:return!!this.b&&JY(this.b)}return Gl(this,n-dt((vn(),m0)),jn((t=u(qn(this,16),29),t||m0),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:xo(this,_t(t));return;case 2:Yd(this,Re($e(t)));return;case 3:Wd(this,Re($e(t)));return;case 4:Xd(this,u(t,15).a);return;case 5:nm(this,u(t,15).a);return;case 8:Ag(this,u(t,143));return;case 9:r=Ka(this,u(t,87),null),r&&r.mj();return;case 11:!this.d&&(this.d=new ss(Fo,this,11)),yt(this.d),!this.d&&(this.d=new ss(Fo,this,11)),ir(this.d,u(t,18));return;case 12:!this.c&&(this.c=new we(G2,this,12,10)),yt(this.c),!this.c&&(this.c=new we(G2,this,12,10)),ir(this.c,u(t,18));return;case 13:!this.a&&(this.a=new NC(this,this)),yS(this.a),!this.a&&(this.a=new NC(this,this)),ir(this.a,u(t,18));return;case 14:yt(Is(this)),ir(Is(this),u(t,18));return}Yl(this,n-dt((vn(),m0)),jn((i=u(qn(this,16),29),i||m0),n),t)},s.fi=function(){return vn(),m0},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:xo(this,null);return;case 2:Yd(this,!0);return;case 3:Wd(this,!0);return;case 4:Xd(this,0);return;case 5:nm(this,1);return;case 8:Ag(this,null);return;case 9:i=Ka(this,null,null),i&&i.mj();return;case 11:!this.d&&(this.d=new ss(Fo,this,11)),yt(this.d);return;case 12:!this.c&&(this.c=new we(G2,this,12,10)),yt(this.c);return;case 13:this.a&&yS(this.a);return;case 14:this.b&&yt(this.b);return}Ql(this,n-dt((vn(),m0)),jn((t=u(qn(this,16),29),t||m0),n))},s.mi=function(){var n,t;if(this.c)for(n=0,t=this.c.i;nf&&cr(n,f,null),r=0,i=new ot(Is(this.a));i.e!=i.i.gc();)t=u(ft(i),87),o=(l=t.c,l||(vn(),hh)),cr(n,r++,o);return n},s.Fj=function(){var n,t,i,r,c;for(c=new Ld,c.a+="[",n=Is(this.a),t=0,r=Is(this.a).i;t1);case 5:return kj(this,n,t,i,r,this.i-u(i,16).gc()>0);default:return new ed(this.e,n,this.c,t,i,r,!0)}},s.Rj=function(){return!0},s.Oj=function(){return JY(this)},s.Ek=function(){yt(this)},v(zn,"EOperationImpl/2",1331),m(493,1,{1999:1,493:1},qTe),v(zn,"EPackageImpl/1",493),m(14,81,au,we),s.gl=function(){return this.d},s.hl=function(){return this.b},s.kl=function(){return!0},s.b=0,v(Ri,"EObjectContainmentWithInverseEList",14),m(361,14,au,z5),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectContainmentWithInverseEList/Resolving",361),m(312,361,au,Jp),s.Li=function(){this.a.tb=null},v(zn,"EPackageImpl/2",312),m(1243,1,{},Cs),v(zn,"EPackageImpl/3",1243),m(721,44,Rv,voe),s._b=function(n){return Br(n)?zK(this,n):!!Xc(this.f,n)},v(zn,"EPackageRegistryImpl",721),m(503,293,{109:1,94:1,93:1,158:1,197:1,57:1,2078:1,114:1,470:1,52:1,100:1,161:1,503:1,293:1,117:1,118:1},EX),s.xh=function(n){return DJe(this,n)},s.Ih=function(n,t,i){var r,c,o;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Ln(),(this.Bb&256)!=0;case 3:return Ln(),(this.Bb&512)!=0;case 4:return me(this.s);case 5:return me(this.t);case 6:return Ln(),o=this.t,o>1||o==-1;case 7:return Ln(),c=this.s,c>=1;case 8:return t?mf(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?u(this.Cb,62):null}return ql(this,n-dt((vn(),h3)),jn((r=u(qn(this,16),29),r||h3),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),To(this.Ab,n,i);case 10:return this.Cb&&(i=(c=this.Db>>16,c>=0?DJe(this,i):this.Cb.Qh(this,-1-c,null,i))),yl(this,n,10,i)}return o=u(jn((r=u(qn(this,16),29),r||(vn(),h3)),t),69),o.uk().xk(this,Lo(this),t-dt((vn(),h3)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 9:return MK(this,i);case 10:return yl(this,null,10,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),h3)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),h3)),n,i)},s.Th=function(n){var t,i,r;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Kw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Kw(this.q).i==0);case 10:return!!(this.Db>>16==10&&u(this.Cb,62))}return Gl(this,n-dt((vn(),h3)),jn((t=u(qn(this,16),29),t||h3),n))},s.fi=function(){return vn(),h3},v(zn,"EParameterImpl",503),m(103,451,{109:1,94:1,93:1,158:1,197:1,57:1,19:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,103:1,451:1,293:1,117:1,118:1,682:1},yle),s.Ih=function(n,t,i){var r,c,o,l;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Ln(),(this.Bb&256)!=0;case 3:return Ln(),(this.Bb&512)!=0;case 4:return me(this.s);case 5:return me(this.t);case 6:return Ln(),l=this.t,l>1||l==-1;case 7:return Ln(),c=this.s,c>=1;case 8:return t?mf(this):this.r;case 9:return this.q;case 10:return Ln(),(this.Bb&Yf)!=0;case 11:return Ln(),(this.Bb&gb)!=0;case 12:return Ln(),(this.Bb&jm)!=0;case 13:return this.j;case 14:return z8(this);case 15:return Ln(),(this.Bb&gs)!=0;case 16:return Ln(),(this.Bb&Nh)!=0;case 17:return Vp(this);case 18:return Ln(),(this.Bb&Bu)!=0;case 19:return Ln(),o=Oc(this),!!(o&&(o.Bb&Bu)!=0);case 20:return Ln(),(this.Bb&Sc)!=0;case 21:return t?Oc(this):this.b;case 22:return t?h1e(this):BPe(this);case 23:return!this.a&&(this.a=new ov(l3,this,23)),this.a}return ql(this,n-dt((vn(),E4)),jn((r=u(qn(this,16),29),r||E4),n),t,i)},s.Th=function(n){var t,i,r,c;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return c=this.t,c>1||c==-1;case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Kw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Kw(this.q).i==0);case 10:return(this.Bb&Yf)==0;case 11:return(this.Bb&gb)!=0;case 12:return(this.Bb&jm)!=0;case 13:return this.j!=null;case 14:return z8(this)!=null;case 15:return(this.Bb&gs)!=0;case 16:return(this.Bb&Nh)!=0;case 17:return!!Vp(this);case 18:return(this.Bb&Bu)!=0;case 19:return r=Oc(this),!!r&&(r.Bb&Bu)!=0;case 20:return(this.Bb&Sc)==0;case 21:return!!this.b;case 22:return!!BPe(this);case 23:return!!this.a&&this.a.i!=0}return Gl(this,n-dt((vn(),E4)),jn((t=u(qn(this,16),29),t||E4),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:VK(this,_t(t));return;case 2:Yd(this,Re($e(t)));return;case 3:Wd(this,Re($e(t)));return;case 4:Xd(this,u(t,15).a);return;case 5:nm(this,u(t,15).a);return;case 8:Ag(this,u(t,143));return;case 9:r=Ka(this,u(t,87),null),r&&r.mj();return;case 10:j8(this,Re($e(t)));return;case 11:A8(this,Re($e(t)));return;case 12:M8(this,Re($e(t)));return;case 13:Dse(this,_t(t));return;case 15:S8(this,Re($e(t)));return;case 16:x8(this,Re($e(t)));return;case 18:U5n(this,Re($e(t)));return;case 20:K1e(this,Re($e(t)));return;case 21:Xhe(this,u(t,19));return;case 23:!this.a&&(this.a=new ov(l3,this,23)),yt(this.a),!this.a&&(this.a=new ov(l3,this,23)),ir(this.a,u(t,18));return}Yl(this,n-dt((vn(),E4)),jn((i=u(qn(this,16),29),i||E4),n),t)},s.fi=function(){return vn(),E4},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:X(this.Cb,88)&&bm(Ds(u(this.Cb,88)),4),xo(this,null);return;case 2:Yd(this,!0);return;case 3:Wd(this,!0);return;case 4:Xd(this,0);return;case 5:nm(this,1);return;case 8:Ag(this,null);return;case 9:i=Ka(this,null,null),i&&i.mj();return;case 10:j8(this,!0);return;case 11:A8(this,!1);return;case 12:M8(this,!1);return;case 13:this.i=null,TB(this,null);return;case 15:S8(this,!1);return;case 16:x8(this,!1);return;case 18:Q1e(this,!1),X(this.Cb,88)&&bm(Ds(u(this.Cb,88)),2);return;case 20:K1e(this,!0);return;case 21:Xhe(this,null);return;case 23:!this.a&&(this.a=new ov(l3,this,23)),yt(this.a);return}Ql(this,n-dt((vn(),E4)),jn((t=u(qn(this,16),29),t||E4),n))},s.mi=function(){h1e(this),Y9(Kc((ds(),ic),this)),mf(this),this.Bb|=1},s.sk=function(){return Oc(this)},s.Zk=function(){var n;return n=Oc(this),!!n&&(n.Bb&Bu)!=0},s.$k=function(){return(this.Bb&Bu)!=0},s._k=function(){return(this.Bb&Sc)!=0},s.Wk=function(n,t){return this.c=null,B1e(this,n,t)},s.Ib=function(){var n;return(this.Db&64)!=0?qz(this):(n=new df(qz(this)),n.a+=" (containment: ",Pd(n,(this.Bb&Bu)!=0),n.a+=", resolveProxies: ",Pd(n,(this.Bb&Sc)!=0),n.a+=")",n.a)},v(zn,"EReferenceImpl",103),m(549,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,549:1,117:1,118:1},Kh),s.Fb=function(n){return this===n},s.jd=function(){return this.b},s.kd=function(){return this.c},s.Hb=function(){return Gw(this)},s.Ai=function(n){svn(this,_t(n))},s.ld=function(n){return Y3n(this,_t(n))},s.Ih=function(n,t,i){var r;switch(n){case 0:return this.b;case 1:return this.c}return ql(this,n-dt((vn(),xc)),jn((r=u(qn(this,16),29),r||xc),n),t,i)},s.Th=function(n){var t;switch(n){case 0:return this.b!=null;case 1:return this.c!=null}return Gl(this,n-dt((vn(),xc)),jn((t=u(qn(this,16),29),t||xc),n))},s.$h=function(n,t){var i;switch(n){case 0:lvn(this,_t(t));return;case 1:Fhe(this,_t(t));return}Yl(this,n-dt((vn(),xc)),jn((i=u(qn(this,16),29),i||xc),n),t)},s.fi=function(){return vn(),xc},s.hi=function(n){var t;switch(n){case 0:Ghe(this,null);return;case 1:Fhe(this,null);return}Ql(this,n-dt((vn(),xc)),jn((t=u(qn(this,16),29),t||xc),n))},s.yi=function(){var n;return this.a==-1&&(n=this.b,this.a=n==null?0:Vd(n)),this.a},s.zi=function(n){this.a=n},s.Ib=function(){var n;return(this.Db&64)!=0?Vf(this):(n=new df(Vf(this)),n.a+=" (key: ",Bc(n,this.b),n.a+=", value: ",Bc(n,this.c),n.a+=")",n.a)},s.a=-1,s.b=null,s.c=null;var Iu=v(zn,"EStringToStringMapEntryImpl",549),Van=Ji(Ri,"FeatureMap/Entry/Internal");m(562,1,nH),s.vl=function(n){return this.wl(u(n,52))},s.wl=function(n){return this.vl(n)},s.Fb=function(n){var t,i;return this===n?!0:X(n,75)?(t=u(n,75),t.Jk()==this.c?(i=this.kd(),i==null?t.kd()==null:di(i,t.kd())):!1):!1},s.Jk=function(){return this.c},s.Hb=function(){var n;return n=this.kd(),Ni(this.c)^(n==null?0:Ni(n))},s.Ib=function(){var n,t;return n=this.c,t=gl(n.ok()).vi(),n.ve(),(t!=null&&t.length!=0?t+":"+n.ve():n.ve())+"="+this.kd()},v(zn,"EStructuralFeatureImpl/BasicFeatureMapEntry",562),m(777,562,nH,Ale),s.wl=function(n){return new Ale(this.c,n)},s.kd=function(){return this.a},s.xl=function(n,t,i){return I7n(this,n,this.a,t,i)},s.yl=function(n,t,i){return L7n(this,n,this.a,t,i)},v(zn,"EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry",777),m(1304,1,{},UTe),s.wk=function(n,t,i,r,c){var o;return o=u(i8(n,this.b),219),o.Wl(this.a).Dk(r)},s.xk=function(n,t,i,r,c){var o;return o=u(i8(n,this.b),219),o.Nl(this.a,r,c)},s.yk=function(n,t,i,r,c){var o;return o=u(i8(n,this.b),219),o.Ol(this.a,r,c)},s.zk=function(n,t,i){var r;return r=u(i8(n,this.b),219),r.Wl(this.a).Oj()},s.Ak=function(n,t,i,r){var c;c=u(i8(n,this.b),219),c.Wl(this.a).Wb(r)},s.Bk=function(n,t,i){return u(i8(n,this.b),219).Wl(this.a)},s.Ck=function(n,t,i){var r;r=u(i8(n,this.b),219),r.Wl(this.a).Ek()},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator",1304),m(89,1,{},Fd,dg,Jd,vg),s.wk=function(n,t,i,r,c){var o;if(o=t.ii(i),o==null&&t.ji(i,o=iF(this,n)),!c)switch(this.e){case 50:case 41:return u(o,586)._j();case 40:return u(o,219).Tl()}return o},s.xk=function(n,t,i,r,c){var o,l;return l=t.ii(i),l==null&&t.ji(i,l=iF(this,n)),o=u(l,72).Uk(r,c),o},s.yk=function(n,t,i,r,c){var o;return o=t.ii(i),o!=null&&(c=u(o,72).Vk(r,c)),c},s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null&&u(r,77).Oj()},s.Ak=function(n,t,i,r){var c;c=u(t.ii(i),77),!c&&t.ji(i,c=iF(this,n)),c.Wb(r)},s.Bk=function(n,t,i){var r,c;return c=t.ii(i),c==null&&t.ji(i,c=iF(this,n)),X(c,77)?u(c,77):(r=u(t.ii(i),16),new RSe(r))},s.Ck=function(n,t,i){var r;r=u(t.ii(i),77),!r&&t.ji(i,r=iF(this,n)),r.Ek()},s.b=0,s.e=0,v(zn,"EStructuralFeatureImpl/InternalSettingDelegateMany",89),m(498,1,{}),s.xk=function(n,t,i,r,c){throw $(new Nt)},s.yk=function(n,t,i,r,c){throw $(new Nt)},s.Bk=function(n,t,i){return new J_e(this,n,t,i)};var M1;v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingle",498),m(1321,1,Pne,J_e),s.Dk=function(n){return this.a.wk(this.c,this.d,this.b,n,!0)},s.Oj=function(){return this.a.zk(this.c,this.d,this.b)},s.Wb=function(n){this.a.Ak(this.c,this.d,this.b,n)},s.Ek=function(){this.a.Ck(this.c,this.d,this.b)},s.b=0,v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingle/1",1321),m(770,498,{},dae),s.wk=function(n,t,i,r,c){return BW(n,n.Mh(),n.Ch())==this.b?this._k()&&r?AW(n):n.Mh():null},s.xk=function(n,t,i,r,c){var o,l;return n.Mh()&&(c=(o=n.Ch(),o>=0?n.xh(c):n.Mh().Qh(n,-1-o,null,c))),l=Fi(n.Ah(),this.e),n.zh(r,l,c)},s.yk=function(n,t,i,r,c){var o;return o=Fi(n.Ah(),this.e),n.zh(null,o,c)},s.zk=function(n,t,i){var r;return r=Fi(n.Ah(),this.e),!!n.Mh()&&n.Ch()==r},s.Ak=function(n,t,i,r){var c,o,l,f,h;if(r!=null&&!JW(this.a,r))throw $(new M9(tH+(X(r,57)?r0e(u(r,57).Ah()):She(Zs(r)))+iH+this.a+"'"));if(c=n.Mh(),l=Fi(n.Ah(),this.e),ue(r)!==ue(c)||n.Ch()!=l&&r!=null){if(D8(n,u(r,57)))throw $(new Jn(JS+n.Ib()));h=null,c&&(h=(o=n.Ch(),o>=0?n.xh(h):n.Mh().Qh(n,-1-o,null,h))),f=u(r,52),f&&(h=f.Oh(n,Fi(f.Ah(),this.b),null,h)),h=n.zh(f,l,h),h&&h.mj()}else n.sh()&&n.th()&&hi(n,new Lr(n,1,l,r,r))},s.Ck=function(n,t,i){var r,c,o,l;r=n.Mh(),r?(l=(c=n.Ch(),c>=0?n.xh(null):n.Mh().Qh(n,-1-c,null,null)),o=Fi(n.Ah(),this.e),l=n.zh(null,o,l),l&&l.mj()):n.sh()&&n.th()&&hi(n,new bj(n,1,this.e,null,null))},s._k=function(){return!1},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainer",770),m(1305,770,{},LNe),s._k=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving",1305),m(560,498,{}),s.wk=function(n,t,i,r,c){var o;return o=t.ii(i),o==null?this.b:ue(o)===ue(M1)?null:o},s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null&&(ue(r)===ue(M1)||!di(r,this.b))},s.Ak=function(n,t,i,r){var c,o;n.sh()&&n.th()?(c=(o=t.ii(i),o==null?this.b:ue(o)===ue(M1)?null:o),r==null?this.c!=null?(t.ji(i,null),r=this.b):this.b!=null?t.ji(i,M1):t.ji(i,null):(this.zl(r),t.ji(i,r)),hi(n,this.d.Al(n,1,this.e,c,r))):r==null?this.c!=null?t.ji(i,null):this.b!=null?t.ji(i,M1):t.ji(i,null):(this.zl(r),t.ji(i,r))},s.Ck=function(n,t,i){var r,c;n.sh()&&n.th()?(r=(c=t.ii(i),c==null?this.b:ue(c)===ue(M1)?null:c),t.ki(i),hi(n,this.d.Al(n,1,this.e,r,this.b))):t.ki(i)},s.zl=function(n){throw $(new VSe)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData",560),m(Xv,1,{},Ow),s.Al=function(n,t,i,r,c){return new bj(n,t,i,r,c)},s.Bl=function(n,t,i,r,c,o){return new BK(n,t,i,r,c,o)};var Y8e,W8e,Z8e,e7e,n7e,t7e,i7e,Gce,r7e;v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator",Xv),m(1322,Xv,{},xL),s.Al=function(n,t,i,r,c){return new qae(n,t,i,Re($e(r)),Re($e(c)))},s.Bl=function(n,t,i,r,c,o){return new ELe(n,t,i,Re($e(r)),Re($e(c)),o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1",1322),m(1323,Xv,{},TL),s.Al=function(n,t,i,r,c){return new The(n,t,i,u(r,221).a,u(c,221).a)},s.Bl=function(n,t,i,r,c,o){return new gLe(n,t,i,u(r,221).a,u(c,221).a,o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2",1323),m(1324,Xv,{},CL),s.Al=function(n,t,i,r,c){return new Che(n,t,i,u(r,180).a,u(c,180).a)},s.Bl=function(n,t,i,r,c,o){return new wLe(n,t,i,u(r,180).a,u(c,180).a,o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3",1324),m(1325,Xv,{},gU),s.Al=function(n,t,i,r,c){return new Jae(n,t,i,te(re(r)),te(re(c)))},s.Bl=function(n,t,i,r,c,o){return new pLe(n,t,i,te(re(r)),te(re(c)),o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4",1325),m(1326,Xv,{},Qk),s.Al=function(n,t,i,r,c){return new Dhe(n,t,i,u(r,164).a,u(c,164).a)},s.Bl=function(n,t,i,r,c,o){return new mLe(n,t,i,u(r,164).a,u(c,164).a,o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5",1326),m(1327,Xv,{},Qh),s.Al=function(n,t,i,r,c){return new Gae(n,t,i,u(r,15).a,u(c,15).a)},s.Bl=function(n,t,i,r,c,o){return new vLe(n,t,i,u(r,15).a,u(c,15).a,o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6",1327),m(1328,Xv,{},L0),s.Al=function(n,t,i,r,c){return new Ohe(n,t,i,u(r,190).a,u(c,190).a)},s.Bl=function(n,t,i,r,c,o){return new yLe(n,t,i,u(r,190).a,u(c,190).a,o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7",1328),m(1329,Xv,{},OL),s.Al=function(n,t,i,r,c){return new Nhe(n,t,i,u(r,191).a,u(c,191).a)},s.Bl=function(n,t,i,r,c,o){return new kLe(n,t,i,u(r,191).a,u(c,191).a,o)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8",1329),m(1307,560,{},X_e),s.zl=function(n){if(!this.a.dk(n))throw $(new M9(tH+Zs(n)+iH+this.a+"'"))},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic",1307),m(1308,560,{},NDe),s.zl=function(n){},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic",1308),m(771,560,{}),s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null},s.Ak=function(n,t,i,r){var c,o;n.sh()&&n.th()?(c=!0,o=t.ii(i),o==null?(c=!1,o=this.b):ue(o)===ue(M1)&&(o=null),r==null?this.c!=null?(t.ji(i,null),r=this.b):t.ji(i,M1):(this.zl(r),t.ji(i,r)),hi(n,this.d.Bl(n,1,this.e,o,r,!c))):r==null?this.c!=null?t.ji(i,null):t.ji(i,M1):(this.zl(r),t.ji(i,r))},s.Ck=function(n,t,i){var r,c;n.sh()&&n.th()?(r=!0,c=t.ii(i),c==null?(r=!1,c=this.b):ue(c)===ue(M1)&&(c=null),t.ki(i),hi(n,this.d.Bl(n,2,this.e,c,this.b,r))):t.ki(i)},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable",771),m(1309,771,{},V_e),s.zl=function(n){if(!this.a.dk(n))throw $(new M9(tH+Zs(n)+iH+this.a+"'"))},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic",1309),m(1310,771,{},DDe),s.zl=function(n){},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic",1310),m(402,498,{},dR),s.wk=function(n,t,i,r,c){var o,l,f,h,b;if(b=t.ii(i),this.rk()&&ue(b)===ue(M1))return null;if(this._k()&&r&&b!=null){if(f=u(b,52),f.Sh()&&(h=ub(n,f),f!=h)){if(!JW(this.a,h))throw $(new M9(tH+Zs(h)+iH+this.a+"'"));t.ji(i,b=h),this.$k()&&(o=u(h,52),l=f.Qh(n,this.b?Fi(f.Ah(),this.b):-1-Fi(n.Ah(),this.e),null,null),!o.Mh()&&(l=o.Oh(n,this.b?Fi(o.Ah(),this.b):-1-Fi(n.Ah(),this.e),null,l)),l&&l.mj()),n.sh()&&n.th()&&hi(n,new bj(n,9,this.e,f,h))}return b}else return b},s.xk=function(n,t,i,r,c){var o,l;return l=t.ii(i),ue(l)===ue(M1)&&(l=null),t.ji(i,r),this.Kj()?ue(l)!==ue(r)&&l!=null&&(o=u(l,52),c=o.Qh(n,Fi(o.Ah(),this.b),null,c)):this.$k()&&l!=null&&(c=u(l,52).Qh(n,-1-Fi(n.Ah(),this.e),null,c)),n.sh()&&n.th()&&(!c&&(c=new F0(4)),c.lj(new bj(n,1,this.e,l,r))),c},s.yk=function(n,t,i,r,c){var o;return o=t.ii(i),ue(o)===ue(M1)&&(o=null),t.ki(i),n.sh()&&n.th()&&(!c&&(c=new F0(4)),this.rk()?c.lj(new bj(n,2,this.e,o,null)):c.lj(new bj(n,1,this.e,o,null))),c},s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null},s.Ak=function(n,t,i,r){var c,o,l,f,h;if(r!=null&&!JW(this.a,r))throw $(new M9(tH+(X(r,57)?r0e(u(r,57).Ah()):She(Zs(r)))+iH+this.a+"'"));h=t.ii(i),f=h!=null,this.rk()&&ue(h)===ue(M1)&&(h=null),l=null,this.Kj()?ue(h)!==ue(r)&&(h!=null&&(c=u(h,52),l=c.Qh(n,Fi(c.Ah(),this.b),null,l)),r!=null&&(c=u(r,52),l=c.Oh(n,Fi(c.Ah(),this.b),null,l))):this.$k()&&ue(h)!==ue(r)&&(h!=null&&(l=u(h,52).Qh(n,-1-Fi(n.Ah(),this.e),null,l)),r!=null&&(l=u(r,52).Oh(n,-1-Fi(n.Ah(),this.e),null,l))),r==null&&this.rk()?t.ji(i,M1):t.ji(i,r),n.sh()&&n.th()?(o=new BK(n,1,this.e,h,r,this.rk()&&!f),l?(l.lj(o),l.mj()):hi(n,o)):l&&l.mj()},s.Ck=function(n,t,i){var r,c,o,l,f;f=t.ii(i),l=f!=null,this.rk()&&ue(f)===ue(M1)&&(f=null),o=null,f!=null&&(this.Kj()?(r=u(f,52),o=r.Qh(n,Fi(r.Ah(),this.b),null,o)):this.$k()&&(o=u(f,52).Qh(n,-1-Fi(n.Ah(),this.e),null,o))),t.ki(i),n.sh()&&n.th()?(c=new BK(n,this.rk()?2:1,this.e,f,null,l),o?(o.lj(c),o.mj()):hi(n,c)):o&&o.mj()},s.Kj=function(){return!1},s.$k=function(){return!1},s._k=function(){return!1},s.rk=function(){return!1},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObject",402),m(561,402,{},zV),s.$k=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment",561),m(1313,561,{},DOe),s._k=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving",1313),m(773,561,{},ple),s.rk=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable",773),m(1315,773,{},_Oe),s._k=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving",1315),m(638,561,{},eK),s.Kj=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse",638),m(1314,638,{},PNe),s._k=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving",1314),m(774,638,{},Wle),s.rk=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable",774),m(1316,774,{},$Ne),s._k=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving",1316),m(639,402,{},mle),s._k=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving",639),m(1317,639,{},IOe),s.rk=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable",1317),m(775,639,{},Zle),s.Kj=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse",775),m(1318,775,{},RNe),s.rk=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable",1318),m(1311,402,{},LOe),s.rk=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable",1311),m(772,402,{},efe),s.Kj=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse",772),m(1312,772,{},BNe),s.rk=function(){return!0},v(zn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable",1312),m(776,562,nH,Qfe),s.wl=function(n){return new Qfe(this.a,this.c,n)},s.kd=function(){return this.b},s.xl=function(n,t,i){return N9n(this,n,this.b,i)},s.yl=function(n,t,i){return D9n(this,n,this.b,i)},v(zn,"EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry",776),m(1319,1,Pne,RSe),s.Dk=function(n){return this.a},s.Oj=function(){return X(this.a,98)?u(this.a,98).Oj():!this.a.dc()},s.Wb=function(n){this.a.$b(),this.a.Fc(u(n,16))},s.Ek=function(){X(this.a,98)?u(this.a,98).Ek():this.a.$b()},v(zn,"EStructuralFeatureImpl/SettingMany",1319),m(1320,562,nH,aPe),s.vl=function(n){return new JV((ji(),vA),this.b.oi(this.a,n))},s.kd=function(){return null},s.xl=function(n,t,i){return i},s.yl=function(n,t,i){return i},v(zn,"EStructuralFeatureImpl/SimpleContentFeatureMapEntry",1320),m(640,562,nH,JV),s.vl=function(n){return new JV(this.c,n)},s.kd=function(){return this.a},s.xl=function(n,t,i){return i},s.yl=function(n,t,i){return i},v(zn,"EStructuralFeatureImpl/SimpleFeatureMapEntry",640),m(396,492,Rh,Bl),s.$i=function(n){return oe(xf,xn,29,n,0,1)},s.Wi=function(){return!1},v(zn,"ESuperAdapter/1",396),m(446,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,834:1,52:1,100:1,161:1,446:1,117:1,118:1},Yk),s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return!this.a&&(this.a=new fj(this,Rc,this)),this.a}return ql(this,n-dt((vn(),U2)),jn((r=u(qn(this,16),29),r||U2),n),t,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Wt,this,0,3)),kc(this.Ab,n,i);case 2:return!this.a&&(this.a=new fj(this,Rc,this)),kc(this.a,n,i)}return c=u(jn((r=u(qn(this,16),29),r||(vn(),U2)),t),69),c.uk().yk(this,Lo(this),t-dt((vn(),U2)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!!this.a&&this.a.i!=0}return Gl(this,n-dt((vn(),U2)),jn((t=u(qn(this,16),29),t||U2),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab),!this.Ab&&(this.Ab=new we(Wt,this,0,3)),ir(this.Ab,u(t,18));return;case 1:xo(this,_t(t));return;case 2:!this.a&&(this.a=new fj(this,Rc,this)),yt(this.a),!this.a&&(this.a=new fj(this,Rc,this)),ir(this.a,u(t,18));return}Yl(this,n-dt((vn(),U2)),jn((i=u(qn(this,16),29),i||U2),n),t)},s.fi=function(){return vn(),U2},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Wt,this,0,3)),yt(this.Ab);return;case 1:xo(this,null);return;case 2:!this.a&&(this.a=new fj(this,Rc,this)),yt(this.a);return}Ql(this,n-dt((vn(),U2)),jn((t=u(qn(this,16),29),t||U2),n))},v(zn,"ETypeParameterImpl",446),m(447,81,au,fj),s.Lj=function(n,t){return jxn(this,u(n,87),t)},s.Mj=function(n,t){return Sxn(this,u(n,87),t)},v(zn,"ETypeParameterImpl/1",447),m(637,44,Rv,jX),s.ec=function(){return new LP(this)},v(zn,"ETypeParameterImpl/2",637),m(557,Wa,bs,LP),s.Ec=function(n){return bNe(this,u(n,87))},s.Fc=function(n){var t,i,r;for(r=!1,i=n.Jc();i.Ob();)t=u(i.Pb(),87),Zt(this.a,t,"")==null&&(r=!0);return r},s.$b=function(){Ju(this.a)},s.Gc=function(n){return so(this.a,n)},s.Jc=function(){var n;return n=new im(new sn(this.a).a),new PP(n)},s.Kc=function(n){return YPe(this,n)},s.gc=function(){return _E(this.a)},v(zn,"ETypeParameterImpl/2/1",557),m(558,1,Jr,PP),s.Nb=function(n){nc(this,n)},s.Pb=function(){return u(kv(this.a).jd(),87)},s.Ob=function(){return this.a.b},s.Qb=function(){aRe(this.a)},v(zn,"ETypeParameterImpl/2/1/1",558),m(1281,44,Rv,xMe),s._b=function(n){return Br(n)?zK(this,n):!!Xc(this.f,n)},s.xc=function(n){var t,i;return t=Br(n)?lo(this,n):bu(Xc(this.f,n)),X(t,835)?(i=u(t,835),t=i.Ik(),Zt(this,u(n,241),t),t):t??(n==null?(FX(),Qan):null)},v(zn,"EValidatorRegistryImpl",1281),m(1303,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,2002:1,52:1,100:1,161:1,117:1,118:1},Nw),s.oi=function(n,t){switch(n.fk()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return t==null?null:fu(t);case 25:return J8n(t);case 27:return r8n(t);case 28:return c8n(t);case 29:return t==null?null:$Ce(dA[0],u(t,205));case 41:return t==null?"":ig(u(t,298));case 42:return fu(t);case 50:return _t(t);default:throw $(new Jn(y7+n.ve()+T2))}},s.pi=function(n){var t,i,r,c,o,l,f,h,b,p,y,S,A,N,_,R;switch(n.G==-1&&(n.G=(S=gl(n),S?Zd(S.si(),n):-1)),n.G){case 0:return i=new yX,i;case 1:return t=new Wb,t;case 2:return r=new aE,r;case 4:return c=new BP,c;case 5:return o=new AMe,o;case 6:return l=new JSe,l;case 7:return f=new LT,f;case 10:return b=new F3,b;case 11:return p=new kX,p;case 12:return y=new nIe,y;case 13:return A=new EX,A;case 14:return N=new yle,N;case 17:return _=new Kh,_;case 18:return h=new $w,h;case 19:return R=new Yk,R;default:throw $(new Jn(yne+n.zb+T2))}},s.qi=function(n,t){switch(n.fk()){case 20:return t==null?null:new Foe(t);case 21:return t==null?null:new U0(t);case 23:case 22:return t==null?null:Fjn(t);case 26:case 24:return t==null?null:dO(vl(t,-128,127)<<24>>24);case 25:return $On(t);case 27:return jMn(t);case 28:return SMn(t);case 29:return Jxn(t);case 32:case 31:return t==null?null:hm(t);case 38:case 37:return t==null?null:new foe(t);case 40:case 39:return t==null?null:me(vl(t,Kr,ui));case 41:return null;case 42:return t==null,null;case 44:case 43:return t==null?null:lm(tF(t));case 49:case 48:return t==null?null:k8(vl(t,rH,32767)<<16>>16);case 50:return t;default:throw $(new Jn(y7+n.ve()+T2))}},v(zn,"EcoreFactoryImpl",1303),m(548,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,2e3:1,52:1,100:1,161:1,184:1,548:1,117:1,118:1,680:1},A_e),s.gb=!1,s.hb=!1;var c7e,Kan=!1;v(zn,"EcorePackageImpl",548),m(1199,1,{835:1},H3),s.Ik=function(){return uOe(),Yan},v(zn,"EcorePackageImpl/1",1199),m(1208,1,ti,Dw),s.dk=function(n){return X(n,158)},s.ek=function(n){return oe(t_,xn,158,n,0,1)},v(zn,"EcorePackageImpl/10",1208),m(1209,1,ti,oT),s.dk=function(n){return X(n,197)},s.ek=function(n){return oe(Lce,xn,197,n,0,1)},v(zn,"EcorePackageImpl/11",1209),m(1210,1,ti,sT),s.dk=function(n){return X(n,57)},s.ek=function(n){return oe(Bb,xn,57,n,0,1)},v(zn,"EcorePackageImpl/12",1210),m(1211,1,ti,P0),s.dk=function(n){return X(n,403)},s.ek=function(n){return oe(Tf,tme,62,n,0,1)},v(zn,"EcorePackageImpl/13",1211),m(1212,1,ti,NL),s.dk=function(n){return X(n,241)},s.ek=function(n){return oe(Ia,xn,241,n,0,1)},v(zn,"EcorePackageImpl/14",1212),m(1213,1,ti,c5),s.dk=function(n){return X(n,503)},s.ek=function(n){return oe(G2,xn,2078,n,0,1)},v(zn,"EcorePackageImpl/15",1213),m(1214,1,ti,u9),s.dk=function(n){return X(n,103)},s.ek=function(n){return oe(f3,Uv,19,n,0,1)},v(zn,"EcorePackageImpl/16",1214),m(1215,1,ti,o9),s.dk=function(n){return X(n,179)},s.ek=function(n){return oe(is,Uv,179,n,0,1)},v(zn,"EcorePackageImpl/17",1215),m(1216,1,ti,u5),s.dk=function(n){return X(n,470)},s.ek=function(n){return oe(s3,xn,470,n,0,1)},v(zn,"EcorePackageImpl/18",1216),m(1217,1,ti,DL),s.dk=function(n){return X(n,549)},s.ek=function(n){return oe(Iu,LZe,549,n,0,1)},v(zn,"EcorePackageImpl/19",1217),m(1200,1,ti,_L),s.dk=function(n){return X(n,335)},s.ek=function(n){return oe(l3,Uv,38,n,0,1)},v(zn,"EcorePackageImpl/2",1200),m(1218,1,ti,s9),s.dk=function(n){return X(n,248)},s.ek=function(n){return oe(Rc,WZe,87,n,0,1)},v(zn,"EcorePackageImpl/20",1218),m(1219,1,ti,IL),s.dk=function(n){return X(n,446)},s.ek=function(n){return oe(Fo,xn,834,n,0,1)},v(zn,"EcorePackageImpl/21",1219),m(1220,1,ti,Wk),s.dk=function(n){return Dp(n)},s.ek=function(n){return oe(Yi,Ae,473,n,8,1)},v(zn,"EcorePackageImpl/22",1220),m(1221,1,ti,LL),s.dk=function(n){return X(n,195)},s.ek=function(n){return oe(ps,Ae,195,n,0,2)},v(zn,"EcorePackageImpl/23",1221),m(1222,1,ti,wU),s.dk=function(n){return X(n,221)},s.ek=function(n){return oe($y,Ae,221,n,0,1)},v(zn,"EcorePackageImpl/24",1222),m(1223,1,ti,pU),s.dk=function(n){return X(n,180)},s.ek=function(n){return oe(nM,Ae,180,n,0,1)},v(zn,"EcorePackageImpl/25",1223),m(1224,1,ti,Hu),s.dk=function(n){return X(n,205)},s.ek=function(n){return oe(bH,Ae,205,n,0,1)},v(zn,"EcorePackageImpl/26",1224),m(1225,1,ti,_o),s.dk=function(n){return!1},s.ek=function(n){return oe(j7e,xn,2174,n,0,1)},v(zn,"EcorePackageImpl/27",1225),m(1226,1,ti,Jc),s.dk=function(n){return _p(n)},s.ek=function(n){return oe(wr,Ae,346,n,7,1)},v(zn,"EcorePackageImpl/28",1226),m(1227,1,ti,tu),s.dk=function(n){return X(n,61)},s.ek=function(n){return oe(R8e,Sm,61,n,0,1)},v(zn,"EcorePackageImpl/29",1227),m(1201,1,ti,io),s.dk=function(n){return X(n,504)},s.ek=function(n){return oe(Wt,{3:1,4:1,5:1,1995:1},587,n,0,1)},v(zn,"EcorePackageImpl/3",1201),m(1228,1,ti,R1),s.dk=function(n){return X(n,568)},s.ek=function(n){return oe(F8e,xn,2001,n,0,1)},v(zn,"EcorePackageImpl/30",1228),m(1229,1,ti,gp),s.dk=function(n){return X(n,163)},s.ek=function(n){return oe(f7e,Sm,163,n,0,1)},v(zn,"EcorePackageImpl/31",1229),m(1230,1,ti,o5),s.dk=function(n){return X(n,75)},s.ek=function(n){return oe(CG,oen,75,n,0,1)},v(zn,"EcorePackageImpl/32",1230),m(1231,1,ti,lT),s.dk=function(n){return X(n,164)},s.ek=function(n){return oe(T7,Ae,164,n,0,1)},v(zn,"EcorePackageImpl/33",1231),m(1232,1,ti,_w),s.dk=function(n){return X(n,15)},s.ek=function(n){return oe(Mr,Ae,15,n,0,1)},v(zn,"EcorePackageImpl/34",1232),m(1233,1,ti,Xs),s.dk=function(n){return X(n,298)},s.ek=function(n){return oe(gme,xn,298,n,0,1)},v(zn,"EcorePackageImpl/35",1233),m(1234,1,ti,wp),s.dk=function(n){return X(n,190)},s.ek=function(n){return oe(O2,Ae,190,n,0,1)},v(zn,"EcorePackageImpl/36",1234),m(1235,1,ti,J3),s.dk=function(n){return X(n,92)},s.ek=function(n){return oe(wme,xn,92,n,0,1)},v(zn,"EcorePackageImpl/37",1235),m(1236,1,ti,fT),s.dk=function(n){return X(n,588)},s.ek=function(n){return oe(u7e,xn,588,n,0,1)},v(zn,"EcorePackageImpl/38",1236),m(1237,1,ti,B1),s.dk=function(n){return!1},s.ek=function(n){return oe(S7e,xn,2175,n,0,1)},v(zn,"EcorePackageImpl/39",1237),m(1202,1,ti,s5),s.dk=function(n){return X(n,88)},s.ek=function(n){return oe(xf,xn,29,n,0,1)},v(zn,"EcorePackageImpl/4",1202),m(1238,1,ti,l9),s.dk=function(n){return X(n,191)},s.ek=function(n){return oe(N2,Ae,191,n,0,1)},v(zn,"EcorePackageImpl/40",1238),m(1239,1,ti,Yh),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(zn,"EcorePackageImpl/41",1239),m(1240,1,ti,aT),s.dk=function(n){return X(n,585)},s.ek=function(n){return oe(z8e,xn,585,n,0,1)},v(zn,"EcorePackageImpl/42",1240),m(1241,1,ti,Zk),s.dk=function(n){return!1},s.ek=function(n){return oe(M7e,Ae,2176,n,0,1)},v(zn,"EcorePackageImpl/43",1241),m(1242,1,ti,PL),s.dk=function(n){return X(n,45)},s.ek=function(n){return oe(Fg,cF,45,n,0,1)},v(zn,"EcorePackageImpl/44",1242),m(1203,1,ti,eE),s.dk=function(n){return X(n,143)},s.ek=function(n){return oe(La,xn,143,n,0,1)},v(zn,"EcorePackageImpl/5",1203),m(1204,1,ti,nE),s.dk=function(n){return X(n,159)},s.ek=function(n){return oe(Fce,xn,159,n,0,1)},v(zn,"EcorePackageImpl/6",1204),m(1205,1,ti,pp),s.dk=function(n){return X(n,459)},s.ek=function(n){return oe(TG,xn,675,n,0,1)},v(zn,"EcorePackageImpl/7",1205),m(1206,1,ti,ff),s.dk=function(n){return X(n,568)},s.ek=function(n){return oe(vd,xn,684,n,0,1)},v(zn,"EcorePackageImpl/8",1206),m(1207,1,ti,mp),s.dk=function(n){return X(n,469)},s.ek=function(n){return oe(hA,xn,469,n,0,1)},v(zn,"EcorePackageImpl/9",1207),m(1019,2042,IZe,YMe),s.Ki=function(n,t){yEn(this,u(t,415))},s.Oi=function(n,t){eqe(this,n,u(t,415))},v(zn,"MinimalEObjectImpl/1ArrayDelegatingAdapterList",1019),m(1020,151,JN,w_e),s.hj=function(){return this.a.a},v(zn,"MinimalEObjectImpl/1ArrayDelegatingAdapterList/1",1020),m(1047,1046,{},xCe),v("org.eclipse.emf.ecore.plugin","EcorePlugin",1047);var u7e=Ji(sen,"Resource");m(786,1485,len),s.Fl=function(n){},s.Gl=function(n){},s.Cl=function(){return!this.a&&(this.a=new bX(this)),this.a},s.Dl=function(n){var t,i,r,c,o;if(r=n.length,r>0)if(Kn(0,n.length),n.charCodeAt(0)==47){for(o=new Mo(4),c=1,t=1;t0&&(n=(Zr(0,i,n.length),n.substr(0,i))));return OCn(this,n)},s.El=function(){return this.c},s.Ib=function(){var n;return ig(this.Pm)+"@"+(n=Ni(this)>>>0,n.toString(16))+" uri='"+this.d+"'"},s.b=!1,v($ne,"ResourceImpl",786),m(1486,786,len,BSe),v($ne,"BinaryResourceImpl",1486),m(1159,697,Nne),s._i=function(n){return X(n,57)?o5n(this,u(n,57)):X(n,588)?new ot(u(n,588).Cl()):ue(n)===ue(this.f)?u(n,18).Jc():(z9(),c_.a)},s.Ob=function(){return W0e(this)},s.a=!1,v(Ri,"EcoreUtil/ContentTreeIterator",1159),m(1487,1159,Nne,UDe),s._i=function(n){return ue(n)===ue(this.f)?u(n,16).Jc():new XLe(u(n,57))},v($ne,"ResourceImpl/5",1487),m(647,2054,YZe,bX),s.Gc=function(n){return this.i<=4?I8(this,n):X(n,52)&&u(n,52).Gh()==this.a},s.Ki=function(n,t){n==this.i-1&&(this.a.b||(this.a.b=!0))},s.Mi=function(n,t){n==0?this.a.b||(this.a.b=!0):wQ(this,n,t)},s.Oi=function(n,t){},s.Pi=function(n,t,i){},s.Jj=function(){return 2},s.hj=function(){return this.a},s.Kj=function(){return!0},s.Lj=function(n,t){var i;return i=u(n,52),t=i.ci(this.a,t),t},s.Mj=function(n,t){var i;return i=u(n,52),i.ci(null,t)},s.Nj=function(){return!1},s.Qi=function(){return!0},s.$i=function(n){return oe(Bb,xn,57,n,0,1)},s.Wi=function(){return!1},v($ne,"ResourceImpl/ContentsEList",647),m(953,2024,Z8,zSe),s.dd=function(n){return this.a.Ii(n)},s.gc=function(){return this.a.gc()},v(Ri,"AbstractSequentialInternalEList/1",953);var o7e,s7e,ic,l7e;m(625,1,{},KNe);var OG,NG;v(Ri,"BasicExtendedMetaData",625),m(1150,1,{},XTe),s.Hl=function(){return null},s.Il=function(){return this.a==-2&&VT(this,Pxn(this.d,this.b)),this.a},s.Jl=function(){return null},s.Kl=function(){return yn(),yn(),Mc},s.ve=function(){return this.c==S7&&sX(this,EHe(this.d,this.b)),this.c},s.Ll=function(){return 0},s.a=-2,s.c=S7,v(Ri,"BasicExtendedMetaData/EClassExtendedMetaDataImpl",1150),m(1151,1,{},SLe),s.Hl=function(){return this.a==(t8(),OG)&&DP(this,y_n(this.f,this.b)),this.a},s.Il=function(){return 0},s.Jl=function(){return this.c==(t8(),OG)&&y9(this,k_n(this.f,this.b)),this.c},s.Kl=function(){return!this.d&&fX(this,rLn(this.f,this.b)),this.d},s.ve=function(){return this.e==S7&&QT(this,EHe(this.f,this.b)),this.e},s.Ll=function(){return this.g==-2&&d(this,ixn(this.f,this.b)),this.g},s.e=S7,s.g=-2,v(Ri,"BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl",1151),m(1149,1,{},VTe),s.b=!1,s.c=!1,v(Ri,"BasicExtendedMetaData/EPackageExtendedMetaDataImpl",1149),m(1152,1,{},MLe),s.c=-2,s.e=S7,s.f=S7,v(Ri,"BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl",1152),m(581,623,au,rR),s.Jj=function(){return this.c},s.ml=function(){return!1},s.Ui=function(n,t){return t},s.c=0,v(Ri,"EDataTypeEList",581);var f7e=Ji(Ri,"FeatureMap");m(76,581,{3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,77:1,163:1,219:1,1998:1,72:1,98:1},rr),s._c=function(n,t){FNn(this,n,u(t,75))},s.Ec=function(n){return rNn(this,u(n,75))},s.Fi=function(n){t4n(this,u(n,75))},s.Lj=function(n,t){return _pn(this,u(n,75),t)},s.Mj=function(n,t){return Gle(this,u(n,75),t)},s.Ri=function(n,t){return aIn(this,n,t)},s.Ui=function(n,t){return ZPn(this,n,u(t,75))},s.fd=function(n,t){return ADn(this,n,u(t,75))},s.Sj=function(n,t){return Ipn(this,u(n,75),t)},s.Tj=function(n,t){return ENe(this,u(n,75),t)},s.Uj=function(n,t,i){return UAn(this,u(n,75),u(t,75),i)},s.Xi=function(n,t){return sW(this,n,u(t,75))},s.Ml=function(n,t){return Ube(this,n,t)},s.ad=function(n,t){var i,r,c,o,l,f,h,b,p;for(b=new t2(t.gc()),c=t.Jc();c.Ob();)if(r=u(c.Pb(),75),o=r.Jk(),od(this.e,o))(!o.Qi()||!VR(this,o,r.kd())&&!I8(b,r))&&Et(b,r);else{for(p=Po(this.e.Ah(),o),i=u(this.g,122),l=!0,f=0;f=0;)if(t=n[this.c],this.k.$l(t.Jk()))return this.j=this.f?t:t.kd(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},v(Ri,"BasicFeatureMap/FeatureEIterator",412),m(666,412,f1,MV),s.sl=function(){return!0},v(Ri,"BasicFeatureMap/ResolvingFeatureEIterator",666),m(951,482,ZF,FCe),s.nj=function(){return this},v(Ri,"EContentsEList/1",951),m(952,482,ZF,hCe),s.sl=function(){return!1},v(Ri,"EContentsEList/2",952),m(950,287,eH,HCe),s.ul=function(n){},s.Ob=function(){return!1},s.Sb=function(){return!1},v(Ri,"EContentsEList/FeatureIteratorImpl/1",950),m(824,581,au,Wse),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;yt(this),Vs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Hf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EDataTypeEList/Unsettable",824),m(1920,581,au,VCe),s.Qi=function(){return!0},v(Ri,"EDataTypeUniqueEList",1920),m(1921,824,au,KCe),s.Qi=function(){return!0},v(Ri,"EDataTypeUniqueEList/Unsettable",1921),m(145,81,au,ss),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectContainmentEList/Resolving",145),m(1153,543,au,XCe),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectContainmentEList/Unsettable/Resolving",1153),m(753,14,au,$le),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;yt(this),Vs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Hf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EObjectContainmentWithInverseEList/Unsettable",753),m(1187,753,au,lNe),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectContainmentWithInverseEList/Unsettable/Resolving",1187),m(745,491,au,Yse),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;yt(this),Vs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Hf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EObjectEList/Unsettable",745),m(339,491,au,ov),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectResolvingEList",339),m(1825,745,au,QCe),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectResolvingEList/Unsettable",1825),m(1488,1,{},l5);var Qan;v(Ri,"EObjectValidator",1488),m(547,491,au,jR),s.gl=function(){return this.d},s.hl=function(){return this.b},s.Kj=function(){return!0},s.kl=function(){return!0},s.b=0,v(Ri,"EObjectWithInverseEList",547),m(1190,547,au,fNe),s.jl=function(){return!0},v(Ri,"EObjectWithInverseEList/ManyInverse",1190),m(626,547,au,UV),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;yt(this),Vs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Hf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EObjectWithInverseEList/Unsettable",626),m(1189,626,au,aNe),s.jl=function(){return!0},v(Ri,"EObjectWithInverseEList/Unsettable/ManyInverse",1189),m(754,547,au,Rle),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectWithInverseResolvingEList",754),m(33,754,au,Tn),s.jl=function(){return!0},v(Ri,"EObjectWithInverseResolvingEList/ManyInverse",33),m(755,626,au,Ble),s.ll=function(){return!0},s.Ui=function(n,t){return Ey(this,n,u(t,57))},v(Ri,"EObjectWithInverseResolvingEList/Unsettable",755),m(1188,755,au,hNe),s.jl=function(){return!0},v(Ri,"EObjectWithInverseResolvingEList/Unsettable/ManyInverse",1188),m(1154,623,au),s.Ji=function(){return(this.b&1792)==0},s.Li=function(){this.b|=1},s.il=function(){return(this.b&4)!=0},s.Kj=function(){return(this.b&40)!=0},s.jl=function(){return(this.b&16)!=0},s.kl=function(){return(this.b&8)!=0},s.ll=function(){return(this.b&gb)!=0},s.$k=function(){return(this.b&32)!=0},s.ml=function(){return(this.b&Yf)!=0},s.dk=function(n){return this.d?ePe(this.d,n):this.Jk().Fk().dk(n)},s.Oj=function(){return(this.b&2)!=0?(this.b&1)!=0:this.i!=0},s.Qi=function(){return(this.b&128)!=0},s.Ek=function(){var n;yt(this),(this.b&2)!=0&&(Vs(this.e)?(n=(this.b&1)!=0,this.b&=-2,S9(this,new Hf(this.e,2,Fi(this.e.Ah(),this.Jk()),n,!1))):this.b&=-2)},s.Wi=function(){return(this.b&1536)==0},s.b=0,v(Ri,"EcoreEList/Generic",1154),m(1155,1154,au,cIe),s.Jk=function(){return this.a},v(Ri,"EcoreEList/Dynamic",1155),m(752,67,Rh,coe),s.$i=function(n){return wO(this.a.a,n)},v(Ri,"EcoreEMap/1",752),m(751,81,au,Ife),s.Ki=function(n,t){bz(this.b,u(t,136))},s.Mi=function(n,t){uze(this.b)},s.Ni=function(n,t,i){var r;++(r=this.b,u(t,136),r).e},s.Oi=function(n,t){pY(this.b,u(t,136))},s.Pi=function(n,t,i){pY(this.b,u(i,136)),ue(i)===ue(t)&&u(i,136).zi(Nwn(u(t,136).jd())),bz(this.b,u(t,136))},v(Ri,"EcoreEMap/DelegateEObjectContainmentEList",751),m(1185,142,nme,pBe),v(Ri,"EcoreEMap/Unsettable",1185),m(1186,751,au,dNe),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;yt(this),Vs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Hf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList",1186),m(1158,223,Rv,s_e),s.a=!1,s.b=!1,v(Ri,"EcoreUtil/Copier",1158),m(747,1,Jr,XLe),s.Nb=function(n){nc(this,n)},s.Ob=function(){return oHe(this)},s.Pb=function(){var n;return oHe(this),n=this.b,this.b=null,n},s.Qb=function(){this.a.Qb()},v(Ri,"EcoreUtil/ProperContentIterator",747),m(1489,1488,{},HU);var Yan;v(Ri,"EcoreValidator",1489);var Wan;Ji(Ri,"FeatureMapUtil/Validator"),m(1258,1,{2003:1},Iw),s.$l=function(n){return!0},v(Ri,"FeatureMapUtil/1",1258),m(760,1,{2003:1},Mge),s.$l=function(n){var t;return this.c==n?!0:(t=$e(Rn(this.a,n)),t==null?A_n(this,n)?(HPe(this.a,n,(Ln(),x7)),!0):(HPe(this.a,n,(Ln(),jb)),!1):t==(Ln(),x7))},s.e=!1;var qce;v(Ri,"FeatureMapUtil/BasicValidator",760),m(761,44,Rv,Vse),v(Ri,"FeatureMapUtil/BasicValidator/Cache",761),m(495,56,{20:1,31:1,56:1,18:1,16:1,61:1,77:1,72:1,98:1},EC),s._c=function(n,t){KUe(this.c,this.b,n,t)},s.Ec=function(n){return Ube(this.c,this.b,n)},s.ad=function(n,t){return qLn(this.c,this.b,n,t)},s.Fc=function(n){return ij(this,n)},s.Ei=function(n,t){N8n(this.c,this.b,n,t)},s.Uk=function(n,t){return Rbe(this.c,this.b,n,t)},s.Yi=function(n){return Yz(this.c,this.b,n,!1)},s.Gi=function(){return kCe(this.c,this.b)},s.Hi=function(){return jwn(this.c,this.b)},s.Ii=function(n){return _9n(this.c,this.b,n)},s.Vk=function(n,t){return UOe(this,n,t)},s.$b=function(){k5(this)},s.Gc=function(n){return VR(this.c,this.b,n)},s.Hc=function(n){return D7n(this.c,this.b,n)},s.Xb=function(n){return Yz(this.c,this.b,n,!0)},s.Dk=function(n){return this},s.bd=function(n){return J6n(this.c,this.b,n)},s.dc=function(){return D$(this)},s.Oj=function(){return!LO(this.c,this.b)},s.Jc=function(){return g8n(this.c,this.b)},s.cd=function(){return w8n(this.c,this.b)},s.dd=function(n){return $En(this.c,this.b,n)},s.Ri=function(n,t){return hVe(this.c,this.b,n,t)},s.Si=function(n,t){$9n(this.c,this.b,n,t)},s.ed=function(n){return BGe(this.c,this.b,n)},s.Kc=function(n){return Q_n(this.c,this.b,n)},s.fd=function(n,t){return kVe(this.c,this.b,n,t)},s.Wb=function(n){Dz(this.c,this.b),ij(this,u(n,16))},s.gc=function(){return REn(this.c,this.b)},s.Nc=function(){return Gyn(this.c,this.b)},s.Oc=function(n){return G6n(this.c,this.b,n)},s.Ib=function(){var n,t;for(t=new Ld,t.a+="[",n=kCe(this.c,this.b);oY(n);)Bc(t,cj(hz(n))),oY(n)&&(t.a+=Co);return t.a+="]",t.a},s.Ek=function(){Dz(this.c,this.b)},v(Ri,"FeatureMapUtil/FeatureEList",495),m(634,39,JN,uQ),s.fj=function(n){return Gj(this,n)},s.kj=function(n){var t,i,r,c,o,l,f;switch(this.d){case 1:case 2:{if(o=n.hj(),ue(o)===ue(this.c)&&Gj(this,null)==n.fj(null))return this.g=n.gj(),n.ej()==1&&(this.d=1),!0;break}case 3:{switch(c=n.ej(),c){case 3:{if(o=n.hj(),ue(o)===ue(this.c)&&Gj(this,null)==n.fj(null))return this.d=5,t=new t2(2),Et(t,this.g),Et(t,n.gj()),this.g=t,!0;break}}break}case 5:{switch(c=n.ej(),c){case 3:{if(o=n.hj(),ue(o)===ue(this.c)&&Gj(this,null)==n.fj(null))return i=u(this.g,18),i.Ec(n.gj()),!0;break}}break}case 4:{switch(c=n.ej(),c){case 3:{if(o=n.hj(),ue(o)===ue(this.c)&&Gj(this,null)==n.fj(null))return this.d=1,this.g=n.gj(),!0;break}case 4:{if(o=n.hj(),ue(o)===ue(this.c)&&Gj(this,null)==n.fj(null))return this.d=6,f=new t2(2),Et(f,this.n),Et(f,n.ij()),this.n=f,l=z(B(It,1),ei,30,15,[this.o,n.jj()]),this.g=l,!0;break}}break}case 6:{switch(c=n.ej(),c){case 4:{if(o=n.hj(),ue(o)===ue(this.c)&&Gj(this,null)==n.fj(null))return i=u(this.n,18),i.Ec(n.ij()),l=u(this.g,54),r=oe(It,ei,30,l.length+1,15,1),Wu(l,0,r,0,l.length),r[l.length]=n.jj(),this.g=r,!0;break}}break}}return!1},v(Ri,"FeatureMapUtil/FeatureENotificationImpl",634),m(553,495,{20:1,31:1,56:1,18:1,16:1,61:1,77:1,163:1,219:1,1998:1,72:1,98:1},lR),s.Ml=function(n,t){return Ube(this.c,n,t)},s.Nl=function(n,t,i){return Rbe(this.c,n,t,i)},s.Ol=function(n,t,i){return dge(this.c,n,t,i)},s.Pl=function(){return this},s.Ql=function(n,t){return sN(this.c,n,t)},s.Rl=function(n){return u(Yz(this.c,this.b,n,!1),75).Jk()},s.Sl=function(n){return u(Yz(this.c,this.b,n,!1),75).kd()},s.Tl=function(){return this.a},s.Ul=function(n){return!LO(this.c,n)},s.Vl=function(n,t){Wz(this.c,n,t)},s.Wl=function(n){return MBe(this.c,n)},s.Xl=function(n){uJe(this.c,n)},v(Ri,"FeatureMapUtil/FeatureFeatureMap",553),m(1257,1,Pne,YTe),s.Dk=function(n){return Yz(this.b,this.a,-1,n)},s.Oj=function(){return!LO(this.b,this.a)},s.Wb=function(n){Wz(this.b,this.a,n)},s.Ek=function(){Dz(this.b,this.a)},v(Ri,"FeatureMapUtil/FeatureValue",1257);var d6,Uce,Xce,b6,Zan,o_=Ji(sH,"AnyType");m(670,63,sd,OX),v(sH,"InvalidDatatypeValueException",670);var DG=Ji(sH,aen),s_=Ji(sH,hen),a7e=Ji(sH,den),ehn,zu,h7e,iw,nhn,thn,ihn,rhn,chn,uhn,ohn,shn,lhn,fhn,ahn,j4,hhn,S4,pA,dhn,X2,l_,f_,bhn,mA,vA;m(828,501,{109:1,94:1,93:1,57:1,52:1,100:1,841:1},yoe),s.Ih=function(n,t,i){switch(n){case 0:return i?(!this.c&&(this.c=new rr(this,0)),this.c):(!this.c&&(this.c=new rr(this,0)),this.c.b);case 1:return i?(!this.c&&(this.c=new rr(this,0)),u(fo(this.c,(ji(),iw)),163)):(!this.c&&(this.c=new rr(this,0)),u(u(fo(this.c,(ji(),iw)),163),219)).Tl();case 2:return i?(!this.b&&(this.b=new rr(this,2)),this.b):(!this.b&&(this.b=new rr(this,2)),this.b.b)}return ql(this,n-dt(this.fi()),jn((this.j&2)==0?this.fi():(!this.k&&(this.k=new ll),this.k).Lk(),n),t,i)},s.Rh=function(n,t,i){var r;switch(t){case 0:return!this.c&&(this.c=new rr(this,0)),cN(this.c,n,i);case 1:return(!this.c&&(this.c=new rr(this,0)),u(u(fo(this.c,(ji(),iw)),163),72)).Vk(n,i);case 2:return!this.b&&(this.b=new rr(this,2)),cN(this.b,n,i)}return r=u(jn((this.j&2)==0?this.fi():(!this.k&&(this.k=new ll),this.k).Lk(),t),69),r.uk().yk(this,yhe(this),t-dt(this.fi()),n,i)},s.Th=function(n){switch(n){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new rr(this,0)),u(fo(this.c,(ji(),iw)),163)).dc();case 2:return!!this.b&&this.b.i!=0}return Gl(this,n-dt(this.fi()),jn((this.j&2)==0?this.fi():(!this.k&&(this.k=new ll),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:!this.c&&(this.c=new rr(this,0)),HC(this.c,t);return;case 1:(!this.c&&(this.c=new rr(this,0)),u(u(fo(this.c,(ji(),iw)),163),219)).Wb(t);return;case 2:!this.b&&(this.b=new rr(this,2)),HC(this.b,t);return}Yl(this,n-dt(this.fi()),jn((this.j&2)==0?this.fi():(!this.k&&(this.k=new ll),this.k).Lk(),n),t)},s.fi=function(){return ji(),h7e},s.hi=function(n){switch(n){case 0:!this.c&&(this.c=new rr(this,0)),yt(this.c);return;case 1:(!this.c&&(this.c=new rr(this,0)),u(fo(this.c,(ji(),iw)),163)).$b();return;case 2:!this.b&&(this.b=new rr(this,2)),yt(this.b);return}Ql(this,n-dt(this.fi()),jn((this.j&2)==0?this.fi():(!this.k&&(this.k=new ll),this.k).Lk(),n))},s.Ib=function(){var n;return(this.j&4)!=0?Vf(this):(n=new df(Vf(this)),n.a+=" (mixed: ",ZE(n,this.c),n.a+=", anyAttribute: ",ZE(n,this.b),n.a+=")",n.a)},v(jr,"AnyTypeImpl",828),m(671,501,{109:1,94:1,93:1,57:1,52:1,100:1,2081:1,671:1},mU),s.Ih=function(n,t,i){switch(n){case 0:return this.a;case 1:return this.b}return ql(this,n-dt((ji(),j4)),jn((this.j&2)==0?j4:(!this.k&&(this.k=new ll),this.k).Lk(),n),t,i)},s.Th=function(n){switch(n){case 0:return this.a!=null;case 1:return this.b!=null}return Gl(this,n-dt((ji(),j4)),jn((this.j&2)==0?j4:(!this.k&&(this.k=new ll),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:C(this,_t(t));return;case 1:Q(this,_t(t));return}Yl(this,n-dt((ji(),j4)),jn((this.j&2)==0?j4:(!this.k&&(this.k=new ll),this.k).Lk(),n),t)},s.fi=function(){return ji(),j4},s.hi=function(n){switch(n){case 0:this.a=null;return;case 1:this.b=null;return}Ql(this,n-dt((ji(),j4)),jn((this.j&2)==0?j4:(!this.k&&(this.k=new ll),this.k).Lk(),n))},s.Ib=function(){var n;return(this.j&4)!=0?Vf(this):(n=new df(Vf(this)),n.a+=" (data: ",Bc(n,this.a),n.a+=", target: ",Bc(n,this.b),n.a+=")",n.a)},s.a=null,s.b=null,v(jr,"ProcessingInstructionImpl",671),m(672,828,{109:1,94:1,93:1,57:1,52:1,100:1,841:1,2082:1,672:1},TMe),s.Ih=function(n,t,i){switch(n){case 0:return i?(!this.c&&(this.c=new rr(this,0)),this.c):(!this.c&&(this.c=new rr(this,0)),this.c.b);case 1:return i?(!this.c&&(this.c=new rr(this,0)),u(fo(this.c,(ji(),iw)),163)):(!this.c&&(this.c=new rr(this,0)),u(u(fo(this.c,(ji(),iw)),163),219)).Tl();case 2:return i?(!this.b&&(this.b=new rr(this,2)),this.b):(!this.b&&(this.b=new rr(this,2)),this.b.b);case 3:return!this.c&&(this.c=new rr(this,0)),_t(sN(this.c,(ji(),pA),!0));case 4:return Fle(this.a,(!this.c&&(this.c=new rr(this,0)),_t(sN(this.c,(ji(),pA),!0))));case 5:return this.a}return ql(this,n-dt((ji(),S4)),jn((this.j&2)==0?S4:(!this.k&&(this.k=new ll),this.k).Lk(),n),t,i)},s.Th=function(n){switch(n){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new rr(this,0)),u(fo(this.c,(ji(),iw)),163)).dc();case 2:return!!this.b&&this.b.i!=0;case 3:return!this.c&&(this.c=new rr(this,0)),_t(sN(this.c,(ji(),pA),!0))!=null;case 4:return Fle(this.a,(!this.c&&(this.c=new rr(this,0)),_t(sN(this.c,(ji(),pA),!0))))!=null;case 5:return!!this.a}return Gl(this,n-dt((ji(),S4)),jn((this.j&2)==0?S4:(!this.k&&(this.k=new ll),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:!this.c&&(this.c=new rr(this,0)),HC(this.c,t);return;case 1:(!this.c&&(this.c=new rr(this,0)),u(u(fo(this.c,(ji(),iw)),163),219)).Wb(t);return;case 2:!this.b&&(this.b=new rr(this,2)),HC(this.b,t);return;case 3:Tae(this,_t(t));return;case 4:Tae(this,zle(this.a,t));return;case 5:D(this,u(t,159));return}Yl(this,n-dt((ji(),S4)),jn((this.j&2)==0?S4:(!this.k&&(this.k=new ll),this.k).Lk(),n),t)},s.fi=function(){return ji(),S4},s.hi=function(n){switch(n){case 0:!this.c&&(this.c=new rr(this,0)),yt(this.c);return;case 1:(!this.c&&(this.c=new rr(this,0)),u(fo(this.c,(ji(),iw)),163)).$b();return;case 2:!this.b&&(this.b=new rr(this,2)),yt(this.b);return;case 3:!this.c&&(this.c=new rr(this,0)),Wz(this.c,(ji(),pA),null);return;case 4:Tae(this,zle(this.a,null));return;case 5:this.a=null;return}Ql(this,n-dt((ji(),S4)),jn((this.j&2)==0?S4:(!this.k&&(this.k=new ll),this.k).Lk(),n))},v(jr,"SimpleAnyTypeImpl",672),m(673,501,{109:1,94:1,93:1,57:1,52:1,100:1,2083:1,673:1},CMe),s.Ih=function(n,t,i){switch(n){case 0:return i?(!this.a&&(this.a=new rr(this,0)),this.a):(!this.a&&(this.a=new rr(this,0)),this.a.b);case 1:return i?(!this.b&&(this.b=new as((vn(),xc),Iu,this,1)),this.b):(!this.b&&(this.b=new as((vn(),xc),Iu,this,1)),rO(this.b));case 2:return i?(!this.c&&(this.c=new as((vn(),xc),Iu,this,2)),this.c):(!this.c&&(this.c=new as((vn(),xc),Iu,this,2)),rO(this.c));case 3:return!this.a&&(this.a=new rr(this,0)),fo(this.a,(ji(),l_));case 4:return!this.a&&(this.a=new rr(this,0)),fo(this.a,(ji(),f_));case 5:return!this.a&&(this.a=new rr(this,0)),fo(this.a,(ji(),mA));case 6:return!this.a&&(this.a=new rr(this,0)),fo(this.a,(ji(),vA))}return ql(this,n-dt((ji(),X2)),jn((this.j&2)==0?X2:(!this.k&&(this.k=new ll),this.k).Lk(),n),t,i)},s.Rh=function(n,t,i){var r;switch(t){case 0:return!this.a&&(this.a=new rr(this,0)),cN(this.a,n,i);case 1:return!this.b&&(this.b=new as((vn(),xc),Iu,this,1)),Y$(this.b,n,i);case 2:return!this.c&&(this.c=new as((vn(),xc),Iu,this,2)),Y$(this.c,n,i);case 5:return!this.a&&(this.a=new rr(this,0)),UOe(fo(this.a,(ji(),mA)),n,i)}return r=u(jn((this.j&2)==0?(ji(),X2):(!this.k&&(this.k=new ll),this.k).Lk(),t),69),r.uk().yk(this,yhe(this),t-dt((ji(),X2)),n,i)},s.Th=function(n){switch(n){case 0:return!!this.a&&this.a.i!=0;case 1:return!!this.b&&this.b.f!=0;case 2:return!!this.c&&this.c.f!=0;case 3:return!this.a&&(this.a=new rr(this,0)),!D$(fo(this.a,(ji(),l_)));case 4:return!this.a&&(this.a=new rr(this,0)),!D$(fo(this.a,(ji(),f_)));case 5:return!this.a&&(this.a=new rr(this,0)),!D$(fo(this.a,(ji(),mA)));case 6:return!this.a&&(this.a=new rr(this,0)),!D$(fo(this.a,(ji(),vA)))}return Gl(this,n-dt((ji(),X2)),jn((this.j&2)==0?X2:(!this.k&&(this.k=new ll),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:!this.a&&(this.a=new rr(this,0)),HC(this.a,t);return;case 1:!this.b&&(this.b=new as((vn(),xc),Iu,this,1)),IB(this.b,t);return;case 2:!this.c&&(this.c=new as((vn(),xc),Iu,this,2)),IB(this.c,t);return;case 3:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),l_))),!this.a&&(this.a=new rr(this,0)),ij(fo(this.a,l_),u(t,18));return;case 4:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),f_))),!this.a&&(this.a=new rr(this,0)),ij(fo(this.a,f_),u(t,18));return;case 5:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),mA))),!this.a&&(this.a=new rr(this,0)),ij(fo(this.a,mA),u(t,18));return;case 6:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),vA))),!this.a&&(this.a=new rr(this,0)),ij(fo(this.a,vA),u(t,18));return}Yl(this,n-dt((ji(),X2)),jn((this.j&2)==0?X2:(!this.k&&(this.k=new ll),this.k).Lk(),n),t)},s.fi=function(){return ji(),X2},s.hi=function(n){switch(n){case 0:!this.a&&(this.a=new rr(this,0)),yt(this.a);return;case 1:!this.b&&(this.b=new as((vn(),xc),Iu,this,1)),this.b.c.$b();return;case 2:!this.c&&(this.c=new as((vn(),xc),Iu,this,2)),this.c.c.$b();return;case 3:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),l_)));return;case 4:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),f_)));return;case 5:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),mA)));return;case 6:!this.a&&(this.a=new rr(this,0)),k5(fo(this.a,(ji(),vA)));return}Ql(this,n-dt((ji(),X2)),jn((this.j&2)==0?X2:(!this.k&&(this.k=new ll),this.k).Lk(),n))},s.Ib=function(){var n;return(this.j&4)!=0?Vf(this):(n=new df(Vf(this)),n.a+=" (mixed: ",ZE(n,this.a),n.a+=")",n.a)},v(jr,"XMLTypeDocumentRootImpl",673),m(1990,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1,2084:1},hT),s.oi=function(n,t){switch(n.fk()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return t==null?null:fu(t);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return _t(t);case 6:return W2n(u(t,195));case 12:case 47:case 49:case 11:return cKe(this,n,t);case 13:return t==null?null:YLn(u(t,247));case 15:case 14:return t==null?null:Uvn(te(re(t)));case 17:return KJe((ji(),t));case 18:return KJe(t);case 21:case 20:return t==null?null:Xvn(u(t,164).a);case 27:return Y2n(u(t,195));case 30:return oJe((ji(),u(t,16)));case 31:return oJe(u(t,16));case 40:return Q2n((ji(),t));case 42:return QJe((ji(),t));case 43:return QJe(t);case 59:case 48:return K2n((ji(),t));default:throw $(new Jn(y7+n.ve()+T2))}},s.pi=function(n){var t,i,r,c,o;switch(n.G==-1&&(n.G=(i=gl(n),i?Zd(i.si(),n):-1)),n.G){case 0:return t=new yoe,t;case 1:return r=new mU,r;case 2:return c=new TMe,c;case 3:return o=new CMe,o;default:throw $(new Jn(yne+n.zb+T2))}},s.qi=function(n,t){var i,r,c,o,l,f,h,b,p,y,S,A,N,_,R,U;switch(n.fk()){case 5:case 52:case 4:return t;case 6:return gSn(t);case 8:case 7:return t==null?null:ZAn(t);case 9:return t==null?null:dO(vl((r=bo(t,!0),r.length>0&&(Kn(0,r.length),r.charCodeAt(0)==43)?(Kn(1,r.length+1),r.substr(1)):r),-128,127)<<24>>24);case 10:return t==null?null:dO(vl((c=bo(t,!0),c.length>0&&(Kn(0,c.length),c.charCodeAt(0)==43)?(Kn(1,c.length+1),c.substr(1)):c),-128,127)<<24>>24);case 11:return _t(v2(this,(ji(),ihn),t));case 12:return _t(v2(this,(ji(),rhn),t));case 13:return t==null?null:new Foe(bo(t,!0));case 15:case 14:return oNn(t);case 16:return _t(v2(this,(ji(),chn),t));case 17:return lHe((ji(),t));case 18:return lHe(t);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return bo(t,!0);case 21:case 20:return pNn(t);case 22:return _t(v2(this,(ji(),uhn),t));case 23:return _t(v2(this,(ji(),ohn),t));case 24:return _t(v2(this,(ji(),shn),t));case 25:return _t(v2(this,(ji(),lhn),t));case 26:return _t(v2(this,(ji(),fhn),t));case 27:return uSn(t);case 30:return fHe((ji(),t));case 31:return fHe(t);case 32:return t==null?null:me(vl((p=bo(t,!0),p.length>0&&(Kn(0,p.length),p.charCodeAt(0)==43)?(Kn(1,p.length+1),p.substr(1)):p),Kr,ui));case 33:return t==null?null:new U0((y=bo(t,!0),y.length>0&&(Kn(0,y.length),y.charCodeAt(0)==43)?(Kn(1,y.length+1),y.substr(1)):y));case 34:return t==null?null:me(vl((S=bo(t,!0),S.length>0&&(Kn(0,S.length),S.charCodeAt(0)==43)?(Kn(1,S.length+1),S.substr(1)):S),Kr,ui));case 36:return t==null?null:lm(tF((A=bo(t,!0),A.length>0&&(Kn(0,A.length),A.charCodeAt(0)==43)?(Kn(1,A.length+1),A.substr(1)):A)));case 37:return t==null?null:lm(tF((N=bo(t,!0),N.length>0&&(Kn(0,N.length),N.charCodeAt(0)==43)?(Kn(1,N.length+1),N.substr(1)):N)));case 40:return tMn((ji(),t));case 42:return aHe((ji(),t));case 43:return aHe(t);case 44:return t==null?null:new U0((_=bo(t,!0),_.length>0&&(Kn(0,_.length),_.charCodeAt(0)==43)?(Kn(1,_.length+1),_.substr(1)):_));case 45:return t==null?null:new U0((R=bo(t,!0),R.length>0&&(Kn(0,R.length),R.charCodeAt(0)==43)?(Kn(1,R.length+1),R.substr(1)):R));case 46:return bo(t,!1);case 47:return _t(v2(this,(ji(),ahn),t));case 59:case 48:return nMn((ji(),t));case 49:return _t(v2(this,(ji(),hhn),t));case 50:return t==null?null:k8(vl((U=bo(t,!0),U.length>0&&(Kn(0,U.length),U.charCodeAt(0)==43)?(Kn(1,U.length+1),U.substr(1)):U),rH,32767)<<16>>16);case 51:return t==null?null:k8(vl((o=bo(t,!0),o.length>0&&(Kn(0,o.length),o.charCodeAt(0)==43)?(Kn(1,o.length+1),o.substr(1)):o),rH,32767)<<16>>16);case 53:return _t(v2(this,(ji(),dhn),t));case 55:return t==null?null:k8(vl((l=bo(t,!0),l.length>0&&(Kn(0,l.length),l.charCodeAt(0)==43)?(Kn(1,l.length+1),l.substr(1)):l),rH,32767)<<16>>16);case 56:return t==null?null:k8(vl((f=bo(t,!0),f.length>0&&(Kn(0,f.length),f.charCodeAt(0)==43)?(Kn(1,f.length+1),f.substr(1)):f),rH,32767)<<16>>16);case 57:return t==null?null:lm(tF((h=bo(t,!0),h.length>0&&(Kn(0,h.length),h.charCodeAt(0)==43)?(Kn(1,h.length+1),h.substr(1)):h)));case 58:return t==null?null:lm(tF((b=bo(t,!0),b.length>0&&(Kn(0,b.length),b.charCodeAt(0)==43)?(Kn(1,b.length+1),b.substr(1)):b)));case 60:return t==null?null:me(vl((i=bo(t,!0),i.length>0&&(Kn(0,i.length),i.charCodeAt(0)==43)?(Kn(1,i.length+1),i.substr(1)):i),Kr,ui));case 61:return t==null?null:me(vl(bo(t,!0),Kr,ui));default:throw $(new Jn(y7+n.ve()+T2))}};var ghn,d7e,whn,b7e;v(jr,"XMLTypeFactoryImpl",1990),m(582,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1,2006:1,582:1},M_e),s.N=!1,s.O=!1;var phn=!1;v(jr,"XMLTypePackageImpl",582),m(1923,1,{835:1},dT),s.Ik=function(){return ige(),Ahn},v(jr,"XMLTypePackageImpl/1",1923),m(1932,1,ti,$L),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/10",1932),m(1933,1,ti,f9),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/11",1933),m(1934,1,ti,bT),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/12",1934),m(1935,1,ti,z1),s.dk=function(n){return _p(n)},s.ek=function(n){return oe(wr,Ae,346,n,7,1)},v(jr,"XMLTypePackageImpl/13",1935),m(1936,1,ti,RL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/14",1936),m(1937,1,ti,Wh),s.dk=function(n){return X(n,16)},s.ek=function(n){return oe(jl,Sm,16,n,0,1)},v(jr,"XMLTypePackageImpl/15",1937),m(1938,1,ti,BL),s.dk=function(n){return X(n,16)},s.ek=function(n){return oe(jl,Sm,16,n,0,1)},v(jr,"XMLTypePackageImpl/16",1938),m(1939,1,ti,zL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/17",1939),m(1940,1,ti,vp),s.dk=function(n){return X(n,164)},s.ek=function(n){return oe(T7,Ae,164,n,0,1)},v(jr,"XMLTypePackageImpl/18",1940),m(1941,1,ti,tE),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/19",1941),m(1924,1,ti,gT),s.dk=function(n){return X(n,841)},s.ek=function(n){return oe(o_,xn,841,n,0,1)},v(jr,"XMLTypePackageImpl/2",1924),m(1942,1,ti,f5),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/20",1942),m(1943,1,ti,FL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/21",1943),m(1944,1,ti,HL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/22",1944),m(1945,1,ti,JL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/23",1945),m(1946,1,ti,GL),s.dk=function(n){return X(n,195)},s.ek=function(n){return oe(ps,Ae,195,n,0,2)},v(jr,"XMLTypePackageImpl/24",1946),m(1947,1,ti,iE),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/25",1947),m(1948,1,ti,wT),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/26",1948),m(1949,1,ti,vU),s.dk=function(n){return X(n,16)},s.ek=function(n){return oe(jl,Sm,16,n,0,1)},v(jr,"XMLTypePackageImpl/27",1949),m(1950,1,ti,yU),s.dk=function(n){return X(n,16)},s.ek=function(n){return oe(jl,Sm,16,n,0,1)},v(jr,"XMLTypePackageImpl/28",1950),m(1951,1,ti,kU),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/29",1951),m(1925,1,ti,qL),s.dk=function(n){return X(n,671)},s.ek=function(n){return oe(DG,xn,2081,n,0,1)},v(jr,"XMLTypePackageImpl/3",1925),m(1952,1,ti,UL),s.dk=function(n){return X(n,15)},s.ek=function(n){return oe(Mr,Ae,15,n,0,1)},v(jr,"XMLTypePackageImpl/30",1952),m(1953,1,ti,a5),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/31",1953),m(1954,1,ti,rE),s.dk=function(n){return X(n,190)},s.ek=function(n){return oe(O2,Ae,190,n,0,1)},v(jr,"XMLTypePackageImpl/32",1954),m(1955,1,ti,XL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/33",1955),m(1956,1,ti,VL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/34",1956),m(1957,1,ti,KL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/35",1957),m(1958,1,ti,QL),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/36",1958),m(1959,1,ti,YL),s.dk=function(n){return X(n,16)},s.ek=function(n){return oe(jl,Sm,16,n,0,1)},v(jr,"XMLTypePackageImpl/37",1959),m(1960,1,ti,WL),s.dk=function(n){return X(n,16)},s.ek=function(n){return oe(jl,Sm,16,n,0,1)},v(jr,"XMLTypePackageImpl/38",1960),m(1961,1,ti,cE),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/39",1961),m(1926,1,ti,ZL),s.dk=function(n){return X(n,672)},s.ek=function(n){return oe(s_,xn,2082,n,0,1)},v(jr,"XMLTypePackageImpl/4",1926),m(1962,1,ti,eP),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/40",1962),m(1963,1,ti,ro),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/41",1963),m(1964,1,ti,pT),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/42",1964),m(1965,1,ti,EU),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/43",1965),m(1966,1,ti,nP),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/44",1966),m(1967,1,ti,jU),s.dk=function(n){return X(n,191)},s.ek=function(n){return oe(N2,Ae,191,n,0,1)},v(jr,"XMLTypePackageImpl/45",1967),m(1968,1,ti,SU),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/46",1968),m(1969,1,ti,MU),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/47",1969),m(1970,1,ti,uE),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/48",1970),m(1971,1,ti,h5),s.dk=function(n){return X(n,191)},s.ek=function(n){return oe(N2,Ae,191,n,0,1)},v(jr,"XMLTypePackageImpl/49",1971),m(1927,1,ti,mT),s.dk=function(n){return X(n,673)},s.ek=function(n){return oe(a7e,xn,2083,n,0,1)},v(jr,"XMLTypePackageImpl/5",1927),m(1972,1,ti,oE),s.dk=function(n){return X(n,190)},s.ek=function(n){return oe(O2,Ae,190,n,0,1)},v(jr,"XMLTypePackageImpl/50",1972),m(1973,1,ti,vT),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/51",1973),m(1974,1,ti,yp),s.dk=function(n){return X(n,15)},s.ek=function(n){return oe(Mr,Ae,15,n,0,1)},v(jr,"XMLTypePackageImpl/52",1974),m(1928,1,ti,Zb),s.dk=function(n){return Br(n)},s.ek=function(n){return oe(Be,Ae,2,n,6,1)},v(jr,"XMLTypePackageImpl/6",1928),m(1929,1,ti,a9),s.dk=function(n){return X(n,195)},s.ek=function(n){return oe(ps,Ae,195,n,0,2)},v(jr,"XMLTypePackageImpl/7",1929),m(1930,1,ti,AU),s.dk=function(n){return Dp(n)},s.ek=function(n){return oe(Yi,Ae,473,n,8,1)},v(jr,"XMLTypePackageImpl/8",1930),m(1931,1,ti,tP),s.dk=function(n){return X(n,221)},s.ek=function(n){return oe($y,Ae,221,n,0,1)},v(jr,"XMLTypePackageImpl/9",1931);var dh,y0,yA,_G,J;m(53,63,sd,Pt),v(u0,"RegEx/ParseException",53),m(820,1,{},yT),s._l=function(n){return ni*16)throw $(new Pt(zt((Dt(),SZe))));i=i*16+c}while(!0);if(this.a!=125)throw $(new Pt(zt((Dt(),MZe))));if(i>M7)throw $(new Pt(zt((Dt(),AZe))));n=i}else{if(c=0,this.c!=0||(c=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(i=c,si(this),this.c!=0||(c=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));i=i*16+c,n=i}break;case 117:if(r=0,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=t*16+r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=t*16+r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));t=t*16+r,n=t;break;case 118:if(si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=t*16+r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=t*16+r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=t*16+r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=t*16+r,si(this),this.c!=0||(r=Tg(this.a))<0)throw $(new Pt(zt((Dt(),c0))));if(t=t*16+r,t>M7)throw $(new Pt(zt((Dt(),"parser.descappe.4"))));n=t;break;case 65:case 90:case 122:throw $(new Pt(zt((Dt(),xZe))))}return n},s.bm=function(n){var t,i;switch(n){case 100:i=(this.e&32)==32?bb("Nd",!0):(fi(),IG);break;case 68:i=(this.e&32)==32?bb("Nd",!1):(fi(),y7e);break;case 119:i=(this.e&32)==32?bb("IsWord",!0):(fi(),ak);break;case 87:i=(this.e&32)==32?bb("IsWord",!1):(fi(),E7e);break;case 115:i=(this.e&32)==32?bb("IsSpace",!0):(fi(),g6);break;case 83:i=(this.e&32)==32?bb("IsSpace",!1):(fi(),k7e);break;default:throw $(new du((t=n,xen+t.toString(16))))}return i},s.cm=function(n){var t,i,r,c,o,l,f,h,b,p,y,S;for(this.b=1,si(this),t=null,this.c==0&&this.a==94?(si(this),n?p=(fi(),fi(),new dl(5)):(t=(fi(),fi(),new dl(4)),ho(t,0,M7),p=new dl(4))):p=(fi(),fi(),new dl(4)),c=!0;(S=this.c)!=1&&!(S==0&&this.a==93&&!c);){if(c=!1,i=this.a,r=!1,S==10)switch(i){case 100:case 68:case 119:case 87:case 115:case 83:ym(p,this.bm(i)),r=!0;break;case 105:case 73:case 99:case 67:i=this.sm(p,i),i<0&&(r=!0);break;case 112:case 80:if(y=Q0e(this,i),!y)throw $(new Pt(zt((Dt(),_ne))));ym(p,y),r=!0;break;default:i=this.am()}else if(S==20){if(l=$9(this.i,58,this.d),l<0)throw $(new Pt(zt((Dt(),Kpe))));if(f=!0,uc(this.i,this.d)==94&&(++this.d,f=!1),o=gf(this.i,this.d,l),h=D$e(o,f,(this.e&512)==512),!h)throw $(new Pt(zt((Dt(),vZe))));if(ym(p,h),r=!0,l+1>=this.j||uc(this.i,l+1)!=93)throw $(new Pt(zt((Dt(),Kpe))));this.d=l+2}if(si(this),!r)if(this.c!=0||this.a!=45)ho(p,i,i);else{if(si(this),(S=this.c)==1)throw $(new Pt(zt((Dt(),YF))));S==0&&this.a==93?(ho(p,i,i),ho(p,45,45)):(b=this.a,S==10&&(b=this.am()),si(this),ho(p,i,b))}(this.e&Yf)==Yf&&this.c==0&&this.a==44&&si(this)}if(this.c==1)throw $(new Pt(zt((Dt(),YF))));return t&&(kS(t,p),p=t),Nv(p),vS(p),this.b=0,si(this),p},s.dm=function(){var n,t,i,r;for(i=this.cm(!1);(r=this.c)!=7;)if(n=this.a,r==0&&(n==45||n==38)||r==4){if(si(this),this.c!=9)throw $(new Pt(zt((Dt(),kZe))));if(t=this.cm(!1),r==4)ym(i,t);else if(n==45)kS(i,t);else if(n==38)nKe(i,t);else throw $(new du("ASSERT"))}else throw $(new Pt(zt((Dt(),EZe))));return si(this),i},s.em=function(){var n,t;return n=this.a-48,t=(fi(),fi(),new JK(12,null,n)),!this.g&&(this.g=new FP),zP(this.g,new uoe(n)),si(this),t},s.fm=function(){return si(this),fi(),yhn},s.gm=function(){return si(this),fi(),vhn},s.hm=function(){throw $(new Pt(zt((Dt(),nf))))},s.im=function(){throw $(new Pt(zt((Dt(),nf))))},s.jm=function(){return si(this),Okn()},s.km=function(){return si(this),fi(),Ehn},s.lm=function(){return si(this),fi(),Shn},s.mm=function(){var n;if(this.d>=this.j||((n=uc(this.i,this.d++))&65504)!=64)throw $(new Pt(zt((Dt(),wZe))));return si(this),fi(),fi(),new t1(0,n-64)},s.nm=function(){return si(this),ZIn()},s.om=function(){return si(this),fi(),Mhn},s.pm=function(){var n;return n=(fi(),fi(),new t1(0,105)),si(this),n},s.qm=function(){return si(this),fi(),jhn},s.rm=function(){return si(this),fi(),khn},s.sm=function(n,t){return this.am()},s.tm=function(){return si(this),fi(),m7e},s.um=function(){var n,t,i,r,c;if(this.d+1>=this.j)throw $(new Pt(zt((Dt(),dZe))));if(r=-1,t=null,n=uc(this.i,this.d),49<=n&&n<=57){if(r=n-48,!this.g&&(this.g=new FP),zP(this.g,new uoe(r)),++this.d,uc(this.i,this.d)!=41)throw $(new Pt(zt((Dt(),Bg))));++this.d}else switch(n==63&&--this.d,si(this),t=Cge(this),t.e){case 20:case 21:case 22:case 23:break;case 8:if(this.c!=7)throw $(new Pt(zt((Dt(),Bg))));break;default:throw $(new Pt(zt((Dt(),bZe))))}if(si(this),c=f2(this),i=null,c.e==2){if(c.Nm()!=2)throw $(new Pt(zt((Dt(),gZe))));i=c.Jm(1),c=c.Jm(0)}if(this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),fi(),fi(),new jRe(r,t,c,i)},s.vm=function(){return si(this),fi(),v7e},s.wm=function(){var n;if(si(this),n=SR(24,f2(this)),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),n},s.xm=function(){var n;if(si(this),n=SR(20,f2(this)),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),n},s.ym=function(){var n;if(si(this),n=SR(22,f2(this)),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),n},s.zm=function(){var n,t,i,r,c;for(n=0,i=0,t=-1;this.d=this.j)throw $(new Pt(zt((Dt(),Xpe))));if(t==45){for(++this.d;this.d=this.j)throw $(new Pt(zt((Dt(),Xpe))))}if(t==58){if(++this.d,si(this),r=f_e(f2(this),n,i),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));si(this)}else if(t==41)++this.d,si(this),r=f_e(f2(this),n,i);else throw $(new Pt(zt((Dt(),hZe))));return r},s.Am=function(){var n;if(si(this),n=SR(21,f2(this)),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),n},s.Bm=function(){var n;if(si(this),n=SR(23,f2(this)),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),n},s.Cm=function(){var n,t;if(si(this),n=this.f++,t=mK(f2(this),n),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),t},s.Dm=function(){var n;if(si(this),n=mK(f2(this),0),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),n},s.Em=function(n){return si(this),this.c==5?(si(this),wR(n,(fi(),fi(),new Yp(9,n)))):wR(n,(fi(),fi(),new Yp(3,n)))},s.Fm=function(n){var t;return si(this),t=(fi(),fi(),new tj(2)),this.c==5?(si(this),Ng(t,EA),Ng(t,n)):(Ng(t,n),Ng(t,EA)),t},s.Gm=function(n){return si(this),this.c==5?(si(this),fi(),fi(),new Yp(9,n)):(fi(),fi(),new Yp(3,n))},s.a=0,s.b=0,s.c=0,s.d=0,s.e=0,s.f=1,s.g=null,s.j=0,v(u0,"RegEx/RegexParser",820),m(1910,820,{},OMe),s._l=function(n){return!1},s.am=function(){return Ibe(this)},s.bm=function(n){return G8(n)},s.cm=function(n){return VKe(this)},s.dm=function(){throw $(new Pt(zt((Dt(),nf))))},s.em=function(){throw $(new Pt(zt((Dt(),nf))))},s.fm=function(){throw $(new Pt(zt((Dt(),nf))))},s.gm=function(){throw $(new Pt(zt((Dt(),nf))))},s.hm=function(){return si(this),G8(67)},s.im=function(){return si(this),G8(73)},s.jm=function(){throw $(new Pt(zt((Dt(),nf))))},s.km=function(){throw $(new Pt(zt((Dt(),nf))))},s.lm=function(){throw $(new Pt(zt((Dt(),nf))))},s.mm=function(){return si(this),G8(99)},s.nm=function(){throw $(new Pt(zt((Dt(),nf))))},s.om=function(){throw $(new Pt(zt((Dt(),nf))))},s.pm=function(){return si(this),G8(105)},s.qm=function(){throw $(new Pt(zt((Dt(),nf))))},s.rm=function(){throw $(new Pt(zt((Dt(),nf))))},s.sm=function(n,t){return ym(n,G8(t)),-1},s.tm=function(){return si(this),fi(),fi(),new t1(0,94)},s.um=function(){throw $(new Pt(zt((Dt(),nf))))},s.vm=function(){return si(this),fi(),fi(),new t1(0,36)},s.wm=function(){throw $(new Pt(zt((Dt(),nf))))},s.xm=function(){throw $(new Pt(zt((Dt(),nf))))},s.ym=function(){throw $(new Pt(zt((Dt(),nf))))},s.zm=function(){throw $(new Pt(zt((Dt(),nf))))},s.Am=function(){throw $(new Pt(zt((Dt(),nf))))},s.Bm=function(){throw $(new Pt(zt((Dt(),nf))))},s.Cm=function(){var n;if(si(this),n=mK(f2(this),0),this.c!=7)throw $(new Pt(zt((Dt(),Bg))));return si(this),n},s.Dm=function(){throw $(new Pt(zt((Dt(),nf))))},s.Em=function(n){return si(this),wR(n,(fi(),fi(),new Yp(3,n)))},s.Fm=function(n){var t;return si(this),t=(fi(),fi(),new tj(2)),Ng(t,n),Ng(t,EA),t},s.Gm=function(n){return si(this),fi(),fi(),new Yp(3,n)};var M4=null,lk=null;v(u0,"RegEx/ParserForXMLSchema",1910),m(121,1,A7,Pw),s.Hm=function(n){throw $(new du("Not supported."))},s.Im=function(){return-1},s.Jm=function(n){return null},s.Km=function(){return null},s.Lm=function(n){},s.Mm=function(n){},s.Nm=function(){return 0},s.Ib=function(){return this.Om(0)},s.Om=function(n){return this.e==11?".":""},s.e=0;var g7e,fk,kA,mhn,w7e,d3=null,IG,Vce=null,p7e,EA,Kce=null,m7e,v7e,y7e,k7e,E7e,vhn,g6,yhn,khn,Ehn,jhn,ak,Shn,Mhn,hzn=v(u0,"RegEx/Token",121);m(137,121,{3:1,137:1,121:1},dl),s.Om=function(n){var t,i,r;if(this.e==4)if(this==p7e)i=".";else if(this==IG)i="\\d";else if(this==ak)i="\\w";else if(this==g6)i="\\s";else{for(r=new Ld,r.a+="[",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?Bc(r,oN(this.b[t])):(Bc(r,oN(this.b[t])),r.a+="-",Bc(r,oN(this.b[t+1])));r.a+="]",i=r.a}else if(this==y7e)i="\\D";else if(this==E7e)i="\\W";else if(this==k7e)i="\\S";else{for(r=new Ld,r.a+="[^",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?Bc(r,oN(this.b[t])):(Bc(r,oN(this.b[t])),r.a+="-",Bc(r,oN(this.b[t+1])));r.a+="]",i=r.a}return i},s.a=!1,s.c=!1,v(u0,"RegEx/RangeToken",137),m(580,1,{580:1},uoe),s.a=0,v(u0,"RegEx/RegexParser/ReferencePosition",580),m(579,1,{3:1,579:1},hxe),s.Fb=function(n){var t;return n==null||!X(n,579)?!1:(t=u(n,579),bn(this.b,t.b)&&this.a==t.a)},s.Hb=function(){return Vd(this.b+"/"+xbe(this.a))},s.Ib=function(){return this.c.Om(this.a)},s.a=0,v(u0,"RegEx/RegularExpression",579),m(228,121,A7,t1),s.Im=function(){return this.a},s.Om=function(n){var t,i,r;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:r="\\"+GV(this.a&Er);break;case 12:r="\\f";break;case 10:r="\\n";break;case 13:r="\\r";break;case 9:r="\\t";break;case 27:r="\\e";break;default:this.a>=Sc?(i=(t=this.a>>>0,"0"+t.toString(16)),r="\\v"+gf(i,i.length-6,i.length)):r=""+GV(this.a&Er)}break;case 8:this==m7e||this==v7e?r=""+GV(this.a&Er):r="\\"+GV(this.a&Er);break;default:r=null}return r},s.a=0,v(u0,"RegEx/Token/CharToken",228),m(322,121,A7,Yp),s.Jm=function(n){return this.a},s.Lm=function(n){this.b=n},s.Mm=function(n){this.c=n},s.Nm=function(){return 1},s.Om=function(n){var t;if(this.e==3)if(this.c<0&&this.b<0)t=this.a.Om(n)+"*";else if(this.c==this.b)t=this.a.Om(n)+"{"+this.c+"}";else if(this.c>=0&&this.b>=0)t=this.a.Om(n)+"{"+this.c+","+this.b+"}";else if(this.c>=0&&this.b<0)t=this.a.Om(n)+"{"+this.c+",}";else throw $(new du("Token#toString(): CLOSURE "+this.c+Co+this.b));else if(this.c<0&&this.b<0)t=this.a.Om(n)+"*?";else if(this.c==this.b)t=this.a.Om(n)+"{"+this.c+"}?";else if(this.c>=0&&this.b>=0)t=this.a.Om(n)+"{"+this.c+","+this.b+"}?";else if(this.c>=0&&this.b<0)t=this.a.Om(n)+"{"+this.c+",}?";else throw $(new du("Token#toString(): NONGREEDYCLOSURE "+this.c+Co+this.b));return t},s.b=0,s.c=0,v(u0,"RegEx/Token/ClosureToken",322),m(821,121,A7,Bfe),s.Jm=function(n){return n==0?this.a:this.b},s.Nm=function(){return 2},s.Om=function(n){var t;return this.b.e==3&&this.b.Jm(0)==this.a?t=this.a.Om(n)+"+":this.b.e==9&&this.b.Jm(0)==this.a?t=this.a.Om(n)+"+?":t=this.a.Om(n)+(""+this.b.Om(n)),t},v(u0,"RegEx/Token/ConcatToken",821),m(1908,121,A7,jRe),s.Jm=function(n){if(n==0)return this.d;if(n==1)return this.b;throw $(new du("Internal Error: "+n))},s.Nm=function(){return this.b?2:1},s.Om=function(n){var t;return this.c>0?t="(?("+this.c+")":this.a.e==8?t="(?("+this.a+")":t="(?"+this.a,this.b?t+=this.d+"|"+this.b+")":t+=this.d+")",t},s.c=0,v(u0,"RegEx/Token/ConditionToken",1908),m(1909,121,A7,oLe),s.Jm=function(n){return this.b},s.Nm=function(){return 1},s.Om=function(n){return"(?"+(this.a==0?"":xbe(this.a))+(this.c==0?"":xbe(this.c))+":"+this.b.Om(n)+")"},s.a=0,s.c=0,v(u0,"RegEx/Token/ModifierToken",1909),m(822,121,A7,Kfe),s.Jm=function(n){return this.a},s.Nm=function(){return 1},s.Om=function(n){var t;switch(t=null,this.e){case 6:this.b==0?t="(?:"+this.a.Om(n)+")":t="("+this.a.Om(n)+")";break;case 20:t="(?="+this.a.Om(n)+")";break;case 21:t="(?!"+this.a.Om(n)+")";break;case 22:t="(?<="+this.a.Om(n)+")";break;case 23:t="(?"+this.a.Om(n)+")"}return t},s.b=0,v(u0,"RegEx/Token/ParenToken",822),m(517,121,{3:1,121:1,517:1},JK),s.Km=function(){return this.b},s.Om=function(n){return this.e==12?"\\"+this.a:XOn(this.b)},s.a=0,v(u0,"RegEx/Token/StringToken",517),m(466,121,A7,tj),s.Hm=function(n){Ng(this,n)},s.Jm=function(n){return u(Vw(this.a,n),121)},s.Nm=function(){return this.a?this.a.a.c.length:0},s.Om=function(n){var t,i,r,c,o;if(this.e==1){if(this.a.a.c.length==2)t=u(Vw(this.a,0),121),i=u(Vw(this.a,1),121),i.e==3&&i.Jm(0)==t?c=t.Om(n)+"+":i.e==9&&i.Jm(0)==t?c=t.Om(n)+"+?":c=t.Om(n)+(""+i.Om(n));else{for(o=new Ld,r=0;r=this.c.b:this.a<=this.c.b},s.Sb=function(){return this.b>0},s.Tb=function(){return this.b},s.Vb=function(){return this.b-1},s.Qb=function(){throw $(new _d(Ien))},s.a=0,s.b=0,v(bme,"ExclusiveRange/RangeIterator",259);var sf=K9(WF,"C"),It=K9(KS,"I"),rs=K9(Sy,"Z"),V2=K9(QS,"J"),ps=K9(US,"B"),Gr=K9(XS,"D"),b3=K9(VS,"F"),A4=K9(YS,"S"),dzn=Ji("org.eclipse.elk.core.labels","ILabelManager"),j7e=Ji(Ec,"DiagnosticChain"),S7e=Ji(sen,"ResourceSet"),M7e=v(Ec,"InvocationTargetException",null),xhn=(XP(),r9n),Thn=Thn=$An;n7n(xbn),p7n("permProps",[[["locale","default"],[Len,"gecko1_8"]],[["locale","default"],[Len,"safari"]]]),Thn(null,"elk",null)}).call(this)}).call(this,typeof Ohn<"u"?Ohn:typeof self<"u"?self:typeof window<"u"?window:{})},{}],3:[function(M,x,O){function P(je){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ze){return typeof ze}:function(ze){return ze&&typeof Symbol=="function"&&ze.constructor===Symbol&&ze!==Symbol.prototype?"symbol":typeof ze},P(je)}function k(je,ze,be){return Object.defineProperty(je,"prototype",{writable:!1}),je}function H(je,ze){if(!(je instanceof ze))throw new TypeError("Cannot call a class as a function")}function q(je,ze,be){return ze=ne(ze),F(je,Z()?Reflect.construct(ze,be||[],ne(je).constructor):ze.apply(je,be))}function F(je,ze){if(ze&&(P(ze)=="object"||typeof ze=="function"))return ze;if(ze!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W(je)}function W(je){if(je===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return je}function Z(){try{var je=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z=function(){return!!je})()}function ne(je){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(ze){return ze.__proto__||Object.getPrototypeOf(ze)},ne(je)}function le(je,ze){if(typeof ze!="function"&&ze!==null)throw new TypeError("Super expression must either be null or a function");je.prototype=Object.create(ze&&ze.prototype,{constructor:{value:je,writable:!0,configurable:!0}}),Object.defineProperty(je,"prototype",{writable:!1}),ze&&se(je,ze)}function se(je,ze){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(be,De){return be.__proto__=De,be},se(je,ze)}var ee=M("./elk-api.js").default,Ce=(function(je){function ze(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};H(this,ze);var De=Object.assign({},be),rn=!1;try{M.resolve("web-worker"),rn=!0}catch{}if(be.workerUrl)if(rn){var an=M("web-worker");De.workerFactory=function(Dn){return new an(Dn)}}else console.warn(`Web worker requested but 'web-worker' package not installed. -Consider installing the package or pass your own 'workerFactory' to ELK's constructor. -... Falling back to non-web worker version.`);if(!De.workerFactory){var un=M("./elk-worker.min.js"),An=un.Worker;De.workerFactory=function(Dn){return new An(Dn)}}return q(this,ze,[De])}return le(ze,je),k(ze)})(ee);Object.defineProperty(x.exports,"__esModule",{value:!0}),x.exports=Ce,Ce.default=Ce},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(M,x,O){var P=typeof Worker<"u"?Worker:void 0;x.exports=P},{}]},{},[3])(3)})})(U7e)),U7e.exports}var iVn=tVn();const rVn=ake(iVn),cVn=new rVn;async function idn(g,E,M="data_flow"){const x=M==="call_stack"?E.filter(q=>oVn(q.data)):E,O={id:"root",layoutOptions:uVn(M),children:g.map(q=>({id:q.id,width:lbn(q.data),height:sVn(q.data),ports:[udn(q.id,"target"),...q.data.inputs.map((F,W)=>cdn(F,W)),...q.data.outputs.map((F,W)=>cdn(F,W)),udn(q.id,"source")],layoutOptions:{"org.eclipse.elk.portConstraints":"FIXED_ORDER"}})),edges:x.map(q=>({id:q.id,sources:[q.sourceHandle??q.source],targets:[q.targetHandle??q.target]}))},P=await cVn.layout(O),k=new Map((P.children??[]).map(q=>[q.id,{x:q.x??0,y:q.y??0}])),H=M==="scale_grouped"?rdn(g,260):M==="overview"?rdn(g,130):new Map;return g.map(q=>{const F=k.get(q.id)??q.position;return{...q,position:{x:F.x,y:F.y+(H.get(q.data.scale)??0)}}})}function uVn(g){return g==="compact"?{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.spacing.nodeNode":"28","elk.layered.spacing.nodeNodeBetweenLayers":"52","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.crossingMinimization.semiInteractive":"true","elk.edgeRouting":"ORTHOGONAL"}:g==="overview"?{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.spacing.nodeNode":"24","elk.layered.spacing.nodeNodeBetweenLayers":"46","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.crossingMinimization.semiInteractive":"true","elk.edgeRouting":"ORTHOGONAL"}:g==="call_stack"?{"elk.algorithm":"layered","elk.direction":"DOWN","elk.spacing.nodeNode":"46","elk.layered.spacing.nodeNodeBetweenLayers":"76","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.edgeRouting":"ORTHOGONAL"}:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.spacing.nodeNode":g==="scale_grouped"?"72":"58","elk.layered.spacing.nodeNodeBetweenLayers":g==="scale_grouped"?"130":"110","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.crossingMinimization.semiInteractive":"true","elk.edgeRouting":"ORTHOGONAL"}}function rdn(g,E){const M=[...new Set(g.map(x=>x.data.scale))].sort();return new Map(M.map((x,O)=>[x,O*E]))}function oVn(g){return g?.kind==="hard_dependency"&&!g.sourcePort&&!g.targetPort}function sVn(g){return g.viewMode==="overview"?108:Math.max(160,112+Math.max(g.inputs.length,g.outputs.length)*28)}function cdn(g,E){return{id:g.id,width:9,height:9,layoutOptions:{"org.eclipse.elk.port.side":g.role==="input"?"WEST":"EAST","org.eclipse.elk.port.index":String(E)}}}function udn(g,E){return{id:`${g}:call-${E}`,width:12,height:36,layoutOptions:{"org.eclipse.elk.port.side":E==="target"?"WEST":"EAST","org.eclipse.elk.port.index":E==="target"?"-1":"9999"}}}const lVn=["Scene","Plant","Leaf"],fVn={nodes:[y6("meteo","Scene","WeatherDriver","hourly",[],[p3("meteo","Scene","PPFD"),p3("meteo","Scene","Tair"),p3("meteo","Scene","VPD")]),y6("lai","Plant","ToyLAIModel","daily",[Jh("lai","Plant","TT_cu",{defaultValue:"0.0"}),Jh("lai","Plant","biomass",{previousTimeStep:!0,defaultValue:"PreviousTimeStep(Float64)"})],[p3("lai","Plant","LAI")],["biomass is read from the previous timestep to keep the growth/LAI feedback open."]),y6("light_interception","Leaf","BeerLambert","hourly",[Jh("light_interception","Leaf","LAI",{mappingMode:"SingleNodeMapping",sourceScale:"Plant",sourceVariable:"LAI",defaultValue:"0.0"}),Jh("light_interception","Leaf","PPFD",{mappingMode:"SingleNodeMapping",sourceScale:"Scene",sourceVariable:"PPFD",defaultValue:"0.0"})],[p3("light_interception","Leaf","aPPFD")]),y6("stomatal_conductance","Leaf","MedlynGs","hourly",[Jh("stomatal_conductance","Leaf","VPD",{mappingMode:"SingleNodeMapping",sourceScale:"Scene",sourceVariable:"VPD",defaultValue:"1.0"}),Jh("stomatal_conductance","Leaf","psi_leaf",{mappingMode:"SingleNodeMapping",sourceScale:"Plant",sourceVariable:"psi_leaf",previousTimeStep:!0,defaultValue:"PreviousTimeStep(-0.3)"})],[p3("stomatal_conductance","Leaf","gs")]),y6("boundary_layer","Leaf","ForcedConvection","hourly",[Jh("boundary_layer","Leaf","wind",{mappingMode:"SingleNodeMapping",sourceScale:"Scene",sourceVariable:"wind",defaultValue:"1.2"}),Jh("boundary_layer","Leaf","leaf_width",{defaultValue:"0.04"})],[p3("boundary_layer","Leaf","gb")],["Hard dependency: called inside transpiration.run!, not scheduled as an independent soft node."],"hard_dependency",LA("transpiration","Leaf")),y6("photosynthesis","Leaf","Farquhar","hourly",[Jh("photosynthesis","Leaf","aPPFD",{defaultValue:"0.0"}),Jh("photosynthesis","Leaf","Tair",{mappingMode:"SingleNodeMapping",sourceScale:"Scene",sourceVariable:"Tair",defaultValue:"20.0"}),Jh("photosynthesis","Leaf","gs",{defaultValue:"0.0"})],[p3("photosynthesis","Leaf","An")]),y6("transpiration","Leaf","PenmanMonteith","hourly",[Jh("transpiration","Leaf","gs",{defaultValue:"0.0"}),Jh("transpiration","Leaf","VPD",{mappingMode:"SingleNodeMapping",sourceScale:"Scene",sourceVariable:"VPD",defaultValue:"1.0"}),Jh("transpiration","Leaf","gb",{defaultValue:"0.0"})],[p3("transpiration","Leaf","E")]),y6("water_balance","Plant","SoilPlantWater","daily",[Jh("water_balance","Plant","transpiration",{mappingMode:"MultiNodeMapping",sourceScale:"Leaf",sourceVariable:"E",defaultValue:"RefVector length 0"}),Jh("water_balance","Plant","soil_water",{defaultValue:"0.32"})],[p3("water_balance","Plant","psi_leaf")]),y6("growth","Plant","CarbonAllocation","daily",[Jh("growth","Plant","assimilation",{mappingMode:"MultiNodeMapping",sourceScale:"Leaf",sourceVariable:"An",defaultValue:"RefVector length 0"}),Jh("growth","Plant","LAI",{defaultValue:"0.0"})],[p3("growth","Plant","biomass")])],edges:[m3("meteo","Scene","PPFD","light_interception","Leaf","PPFD","mapped_variable","multiscale","PPFD"),m3("lai","Plant","LAI","light_interception","Leaf","LAI","mapped_variable","multiscale","LAI"),m3("light_interception","Leaf","aPPFD","photosynthesis","Leaf","aPPFD","soft_dependency","same_scale","aPPFD"),m3("meteo","Scene","Tair","photosynthesis","Leaf","Tair","mapped_variable","multiscale","Tair"),m3("meteo","Scene","VPD","stomatal_conductance","Leaf","VPD","mapped_variable","multiscale","VPD"),m3("stomatal_conductance","Leaf","gs","photosynthesis","Leaf","gs","soft_dependency","same_scale","gs"),m3("stomatal_conductance","Leaf","gs","transpiration","Leaf","gs","soft_dependency","same_scale","gs"),aVn("transpiration","Leaf","boundary_layer","Leaf","calls"),m3("meteo","Scene","VPD","transpiration","Leaf","VPD","mapped_variable","multiscale","VPD"),m3("transpiration","Leaf","E","water_balance","Plant","transpiration","mapped_variable","multiscale","E → transpiration"),m3("photosynthesis","Leaf","An","growth","Plant","assimilation","mapped_variable","multiscale","An → assimilation"),m3("lai","Plant","LAI","growth","Plant","LAI","soft_dependency","same_scale","LAI")],scales:lVn,cyclic:!1,cycleNodes:[],diagnostics:["Potential feedback stomatal_conductance.gs -> transpiration.E -> water_balance.psi_leaf -> stomatal_conductance.psi_leaf is opened with PreviousTimeStep.","Potential feedback growth.biomass -> lai.biomass is opened with PreviousTimeStep."]};function y6(g,E,M,x,O,P,k=[],H="model",q=null){return{id:LA(g,E),process:g,scale:E,modelType:M,role:H,rate:x,inputs:O,outputs:P,parent:q,diagnostics:k}}function Jh(g,E,M,x={}){return fbn(g,E,M,"input",x)}function p3(g,E,M,x={}){return fbn(g,E,M,"output",{defaultValue:"Float64",...x})}function fbn(g,E,M,x,O){return{id:lke(g,E,x,M),name:M,role:x,mappingMode:O.mappingMode??null,sourceScale:O.sourceScale??null,sourceVariable:O.sourceVariable??null,previousTimeStep:O.previousTimeStep??!1,default:O.defaultValue??"uninitialized"}}function m3(g,E,M,x,O,P,k,H,q){return{id:`edge:${E}:${g}:${M}->${O}:${x}:${P}`,source:LA(g,E),target:LA(x,O),sourcePort:lke(g,E,"output",M),targetPort:lke(x,O,"input",P),sourceVariable:M,targetVariable:P,kind:k,scaleRelation:H,label:q,diagnostics:[]}}function aVn(g,E,M,x,O){return{id:`edge:hard:${E}:${g}->${x}:${M}`,source:LA(g,E),target:LA(M,x),sourcePort:null,targetPort:null,sourceVariable:null,targetVariable:null,kind:"hard_dependency",scaleRelation:"same_scale",label:O,diagnostics:["Hard dependency: target model is invoked manually by the caller."]}}function LA(g,E){return`model:${E}:${g}`}function lke(g,E,M,x){return`${LA(g,E)}:${M}:${x}`}const hVn={model:eVn},dVn={dependency:UXn},lue={base:"#a99a8c",accent:"#1f7a53",mapped:"#4f8d69",hard:"#bf6a54"},bVn={dataFlow:!0,mapped:!0,callStack:!0},odn={none:"No focus",upstream:"Upstream",downstream:"Downstream",neighborhood:"Both"},sdn={data_flow:"Data-flow",compact:"Compact",scale_grouped:"Scale grouped",call_stack:"Call stack",overview:"Overview"},gVn=["float","integer","boolean","symbol","string","nothing","julia"];function wVn(){const[g,E]=Pe.useState(adn()),[M,x]=Pe.useState([]),[O,P]=Pe.useState(null),[k,H]=Pe.useState(!1),[q,F]=Pe.useState(!1),[W,Z]=Pe.useState(!1),[ne,le]=Pe.useState(()=>bdn()?.websocketUrl?"inspector":null),[se,ee]=Pe.useState(""),[Ce,je]=Pe.useState([]),[ze,be]=Pe.useState(null),[De,rn]=Pe.useState(null),[an,un]=Pe.useState(null),[An,Dn]=Pe.useState(null),[$t,In]=Pe.useState([]),[et,Y]=Pe.useState(null),[He,en]=Pe.useState("mapping.generated.jl"),[ke,Ze]=Pe.useState([]),[ln,En]=Pe.useState(null),[nt,Se]=Pe.useState(null),[on,ct]=Pe.useState(null),[lt,qt]=Pe.useState(!1),[wi,li]=Pe.useState(!1),[Ut,ai]=Pe.useState(!1),[rc,Qr]=Pe.useState(!1),[vr,Si]=Pe.useState(!1),[Ui,Su]=Pe.useState(!1),[uu,Js]=Pe.useState(""),[fa,bh]=Pe.useState("data_flow"),[aa,nu]=Pe.useState("neighborhood"),[cl,S0]=Pe.useState(()=>hdn(adn())),[Dl,fw]=Pe.useState(!1),[A1,qb]=Pe.useState(bVn),[x1,S3]=Pe.useState(()=>new Set),[Ub,M0]=Pe.useState(null),[S6,ha]=Pe.useState(null),[Gs,qh]=Pe.useState(!1),[Ho,Sd]=Pe.useState(null),[M6,A6]=Pe.useState(null),[aw,hw]=Pe.useState(0),[Xb,T1]=Pe.useState(!1),[Nf,dw]=Pe.useState(null),[A0,x0,M3]=iXn([]),[T0,Q2,bw]=rXn([]),gw=Pe.useRef(null),gh=Pe.useMemo(()=>new Map(g.nodes.map(Zn=>[Zn.id,Zn])),[g]),cs=Pe.useMemo(()=>tKn(g),[g]),C1=Pe.useMemo(()=>vdn(g.edges,"targetPort"),[g.edges]),I4=Pe.useMemo(()=>vdn(g.edges,"sourcePort"),[g.edges]),Uh=Pe.useMemo(()=>$Vn(g),[g]),_l=Pe.useMemo(()=>BVn(g,M,C1),[M,g,C1]),Jo=Pe.useMemo(()=>zVn(g,Uh,C1),[g,C1,Uh]),ul=Pe.useMemo(()=>YVn(g,Uh,C1),[g,C1,Uh]),wh=Pe.useMemo(()=>ul.filter(Zn=>Zn.severity!=="info"),[ul]),ww=Pe.useMemo(()=>QVn(g,uu),[g,uu]),Vb=Pe.useMemo(()=>g.nodes.filter(Zn=>!x1.has(Zn.scale)),[x1,g.nodes]),A3=Pe.useMemo(()=>{const Ft=[...g.scales.length>0?g.scales:["Default"],...ke];return[...new Set(Ft)]},[ke,g.scales]),Y2=Pe.useMemo(()=>new Set(Vb.map(Zn=>Zn.id)),[Vb]),C0=Pe.useMemo(()=>g.edges.filter(Zn=>iKn(Zn,A1)&&Y2.has(Zn.source)&&Y2.has(Zn.target)),[A1,g.edges,Y2]),O1=Pe.useMemo(()=>RVn(g,gh,cs),[g,gh,cs]),N1=Pe.useMemo(()=>new Set(O1.map(Zn=>Zn.port.id)),[O1]),D1=Pe.useMemo(()=>VVn(g,nt),[nt,g]),O0=Pe.useMemo(()=>KVn(g,ln?.id??null,nt,aa),[nt,aa,g,ln?.id]),Ra=Pe.useMemo(()=>Ub?.active?Ub:O0,[Ub,O0]),us=Ho?.portId??null,Xh=Pe.useMemo(()=>{if(!Ho)return null;const Zn=cs.get(Ho.portId);if(!Zn||!_l.has(Ho.portId))return null;const{port:Ft}=Zn,nr=Ft.role==="input"?"outputs":"inputs",Sr=M.filter(ms=>Object.prototype.hasOwnProperty.call(xue(ms,nr),Ft.name)).sort((ms,N0)=>ms.name.localeCompare(N0.name));return Sr.length===0?null:{anchor:Ho.anchor,node:Zn.node,port:Ft,title:Ft.role==="input"?"Models That Compute":"Models That Consume",models:Sr}},[Ho,_l,M,cs]),pw=Pe.useCallback((Zn,Ft)=>{Se(Zn),Sd(nr=>nr?.portId===Zn.id?null:{portId:Zn.id,anchor:Ft})},[]);Pe.useEffect(()=>{const Zn=bdn();if(!Zn?.websocketUrl)return;const Ft=new WebSocket(Zn.websocketUrl);return P(Ft),Ft.addEventListener("open",()=>{H(!0),Y(null)}),Ft.addEventListener("close",()=>{H(!1),Y({kind:"error",text:"Graph editor connection closed. Refresh the page or restart the Julia session."})}),Ft.addEventListener("message",nr=>{const Sr=JSON.parse(nr.data);if(Sr.graph&&E(Sr.graph),Sr.models&&x(Sr.models),typeof Sr.mappingCode=="string"&&ee(Sr.mappingCode),Array.isArray(Sr.initializations)&&je(Sr.initializations),be(typeof Sr.lastSavedPath=="string"?Sr.lastSavedPath:null),rn(typeof Sr.saveTargetPath=="string"?Sr.saveTargetPath:null),typeof Sr.saveTargetPath=="string"&&en(Sr.saveTargetPath),un(typeof Sr.autosavePath=="string"?Sr.autosavePath:null),Dn(typeof Sr.lastAutosavedPath=="string"?Sr.lastAutosavedPath:null),Array.isArray(Sr.recentMappings)&&In(Sr.recentMappings),F(!!Sr.canUndo),Z(!!Sr.canRedo),Sr.ok===!1){const ms=Sr.diagnostics?.[0]??"Graph editor command failed.";Y({kind:"error",text:ms})}else Sr.diagnostics?.length?Y({kind:"info",text:Sr.diagnostics[0]}):Y(null)}),()=>Ft.close()},[]);const qs=Pe.useCallback(Zn=>{if(!O||O.readyState!==WebSocket.OPEN){Y({kind:"error",text:"Graph editor is offline; command was not sent."});return}O.send(JSON.stringify(Zn))},[O]),_1=Pe.useCallback(Zn=>{const Ft=cs.get(Zn.id);!Ft||Zn.role!=="input"||(qs({action:"edit",kind:"mark_previous_timestep",scale:Ft.node.scale,process:Ft.node.process,variable:Zn.name}),qh(!1),M0(null),ha(null),En(Ft.node),Se(Zn))},[cs,qs]),W2=Pe.useCallback(Zn=>{const Ft=PVn(Zn,gh);if(!Ft){Y({kind:"error",text:`Cannot remove ${Zn.process}: no owning ModelMapping model was found.`});return}qs({action:"edit",kind:"remove_model",scale:Ft.scale,process:Ft.process}),En(nr=>nr?.id===Zn.id||nr?.id===Ft.id?null:nr),Se(null),ha(null)},[gh,qs]),mw=Pe.useCallback(Zn=>{le(Ft=>Ft===Zn?null:Zn)},[]),L4=Pe.useCallback(()=>{le("add_model"),T1(!0),hw(Date.now())},[]),x3=Pe.useCallback(Zn=>{const Ft=Zn.trim();Ft&&Ze(nr=>nr.includes(Ft)||g.scales.includes(Ft)?nr:[...nr,Ft])},[g.scales]);Pe.useEffect(()=>{if(ne!=="add_model"||!Xb)return;gw.current?.scrollIntoView({block:"nearest",inline:"nearest"}),gw.current?.focus({preventScroll:!0});const Zn=window.setTimeout(()=>T1(!1),1800);return()=>window.clearTimeout(Zn)},[ne,Xb,aw]),Pe.useEffect(()=>{Dl||S0(hdn(g))},[g,Dl]),Pe.useEffect(()=>{const Zn=Vb.map(nr=>({id:nr.id,type:"model",position:{x:0,y:0},data:gdn(nr,{activePort:null,highlightedPortIds:new Set,focusedPortIds:new Set,requiredInputPortIds:Uh,candidatePortIds:_l,cycleNodeIds:new Set(g.cycleNodes),cycleBreakPortIds:N1,cycleBreakMode:Gs,focusedNodeIds:new Set,hasActiveFocus:!1,activeCandidatePortId:us,setActivePort:Se,setCandidatePopover:pw,breakCycleAtPort:_1,removeGraphModel:W2,viewMode:cl})})),Ft=C0.map(nr=>pdn(nr,new Set,new Set,!1,!1));idn(Zn,Ft,ddn(cl,fa)).then(nr=>{x0(nr),Q2(Ft)})},[us,_1,_l,Gs,N1,g.cycleNodes,fa,W2,Uh,Q2,x0,pw,cl,C0,Vb]),Pe.useEffect(()=>{const Zn=Ra.active?Ra.edges:new Set;x0(Ft=>Ft.map(nr=>({...nr,data:gdn(nr.data,{activePort:nt,highlightedPortIds:D1.ports,focusedPortIds:Ra.ports,requiredInputPortIds:Uh,candidatePortIds:_l,cycleNodeIds:new Set(g.cycleNodes),cycleBreakPortIds:N1,cycleBreakMode:Gs,focusedNodeIds:Ra.nodes,hasActiveFocus:Ra.active,activeCandidatePortId:us,setActivePort:Se,setCandidatePopover:pw,breakCycleAtPort:_1,removeGraphModel:W2,viewMode:cl})}))),Q2(Ft=>Ft.map(nr=>nr.data?pdn(nr.data,D1.edges,Zn,!!nt,Ra.active):nr))},[us,nt,_1,_l,Gs,N1,Ra,g.cycleNodes,D1.edges,D1.ports,W2,Uh,Q2,x0,pw,cl]),Pe.useEffect(()=>{Ho&&!_l.has(Ho.portId)&&Sd(null)},[Ho,_l]);const vw=Pe.useCallback(Zn=>{if(!k)return;const Ft=Zn.sourceHandle,nr=Zn.targetHandle;if(!Ft||!nr)return;const Sr=cs.get(Ft),ms=cs.get(nr);!Sr||!ms||Sr.port.role!=="output"||ms.port.role!=="input"||ct({sourceNode:Sr.node,sourcePort:Sr.port,targetNode:ms.node,targetPort:ms.port})},[k,cs]),Z2=Pe.useCallback(()=>{idn(A0,T0,ddn(cl,fa)).then(x0)},[T0,fa,A0,x0,cl]),Il=Pe.useCallback((Zn,Ft)=>{M0(null),ha(null),En(Zn),Se(Ft??null),le("inspector"),S3(Sr=>{if(!Sr.has(Zn.scale))return Sr;const ms=new Set(Sr);return ms.delete(Zn.scale),ms});const nr=A0.find(Sr=>Sr.id===Zn.id);nr&&Nf&&Nf.setCenter(nr.position.x+156,nr.position.y+90,{zoom:.85,duration:520})},[Nf,A0]),Df=Pe.useCallback(Zn=>{const Ft=Zn.targetPort?cs.get(Zn.targetPort)?.port:Zn.sourcePort?cs.get(Zn.sourcePort)?.port:null,nr=Ft?.id===Zn.targetPort?gh.get(Zn.target):gh.get(Zn.source);nr&&Il(nr,Ft??null)},[Il,gh,cs]),P4=Pe.useCallback(()=>{qh(!0),fw(!0),S0("detail"),le("inspector"),En(null),ha(null),Sd(null),Se(null);const Zn=Tue();Zn.active=!0;for(const Ft of O1)Zn.edges.add(Ft.edge.id),Zn.nodes.add(Ft.edge.source),Zn.nodes.add(Ft.edge.target),Ft.edge.sourcePort&&Zn.ports.add(Ft.edge.sourcePort),Zn.ports.add(Ft.port.id);if(M0(Zn),Nf&&O1.length>0){const Ft=[...new Set(O1.flatMap(nr=>[nr.edge.source,nr.edge.target]))];Nf.fitView({nodes:Ft.map(nr=>({id:nr})),padding:.36,duration:520,maxZoom:1.05})}},[O1,Nf]);Pe.useEffect(()=>{g.cyclic||qh(!1)},[g.cyclic]);const x6=Pe.useCallback(Zn=>{qb(Ft=>({...Ft,[Zn]:!Ft[Zn]}))},[]),ep=Pe.useCallback(Zn=>{En(null),ha(null),Se(null),M0(null),S3(Ft=>{const nr=new Set(Ft);return nr.has(Zn)?nr.delete(Zn):nr.add(Zn),nr})},[]),$4=Pe.useCallback(()=>S3(new Set),[]),yw=Pe.useCallback(Zn=>{if(Zn.portIds?.length){const Ft=Tue();Ft.active=!0;for(const Sr of Zn.portIds){const ms=cs.get(Sr);ms&&(Ft.ports.add(Sr),Ft.nodes.add(ms.node.id))}M0(Ft);const nr=cs.get(Zn.portIds[0]);if(nr)if(En(null),ha(null),Se(null),Nf&&Zn.nodeIds&&Zn.nodeIds.length>1)Nf.fitView({nodes:Zn.nodeIds.map(Sr=>({id:Sr})),padding:.28,duration:520,maxZoom:.95});else{const Sr=A0.find(ms=>ms.id===nr.node.id);Sr&&Nf&&Nf.setCenter(Sr.position.x+156,Sr.position.y+90,{zoom:.9,duration:520})}return}if(M0(null),ha(null),Zn.edgeId){const Ft=g.edges.find(nr=>nr.id===Zn.edgeId);Ft&&Df(Ft);return}if(Zn.portId){const Ft=cs.get(Zn.portId);Ft&&Il(Ft.node,Ft.port);return}if(Zn.nodeId){const Ft=gh.get(Zn.nodeId);Ft&&Il(Ft)}},[Nf,Df,Il,g.edges,gh,A0,cs]);return G.jsxs("main",{className:`app-shell ${ne?"has-side-panel":""} ${cl==="overview"?"overview-mode":"detail-mode"} ${Ho?"has-candidate-popover":""} ${Gs?"cycle-break-mode":""}`,children:[G.jsxs("section",{className:"graph-panel",children:[G.jsxs("div",{className:"topbar graph-workbench",children:[G.jsxs("button",{className:`metric-button open-button ${Ut?"active":""}`,disabled:!k,onClick:()=>ai(Zn=>!Zn),title:"Open a ModelMapping",children:[G.jsx($Xn,{size:14})," Open"]}),G.jsxs("div",{className:"brand-block",children:[G.jsx("div",{className:"eyebrow",children:"PlantSimEngine"}),G.jsx("h1",{children:"Dependency Graph"})]}),G.jsxs("div",{className:"search-box",children:[G.jsx(GXn,{size:15}),G.jsx("input",{value:uu,placeholder:"Search model or variable",onChange:Zn=>{Js(Zn.target.value),Su(!0)},onFocus:()=>Su(!0)}),uu&&G.jsx("button",{className:"clear-search",onClick:()=>Js(""),title:"Clear search",children:G.jsx(zue,{size:13})}),Ui&&uu.trim().length>0&&G.jsx("div",{className:"search-results",children:ww.length>0?ww.map(Zn=>G.jsxs("button",{className:"search-result",onClick:()=>{Il(Zn.node,Zn.port??null),Js(Zn.label),Su(!1)},children:[G.jsx("strong",{children:Zn.label}),G.jsx("span",{children:Zn.detail})]},Zn.id)):G.jsx("div",{className:"empty-state compact",children:"No match."})})]}),G.jsxs("div",{className:"metrics",children:[G.jsxs("span",{children:[Vb.length,"/",g.nodes.length," models"]}),G.jsxs("span",{children:[C0.length,"/",g.edges.length," links"]}),Jo.length>0&&G.jsxs("button",{className:`metric-button warn ${lt?"active":""}`,title:`${Jo.length} required initializations`,onClick:()=>qt(Zn=>!Zn),children:[G.jsx(Aue,{size:14})," ",Jo.length," init"]}),wh.length>0&&G.jsxs("button",{className:`metric-button caution ${wi?"active":""}`,title:`${wh.length} actionable graph warnings`,onClick:()=>li(Zn=>!Zn),children:[G.jsx(V1n,{size:14})," ",wh.length," warn"]}),g.cyclic&&G.jsxs("span",{className:"warn",children:[G.jsx(V1n,{size:14})," cycle"]})]}),G.jsxs("div",{className:"toolbar-group",children:[G.jsx("button",{className:`metric-button view-mode-button ${cl==="overview"?"active overview-cta":""}`,onClick:()=>{fw(!0),S0(Zn=>Zn==="overview"?"detail":"overview")},title:cl==="overview"?"Show full model inputs and outputs":"Show compact cards for large graphs",children:cl==="overview"?"Overview Mode - Show Detailed View":"Show Overview"}),G.jsxs("label",{className:"select-control",title:"Choose how the graph should be arranged",children:[G.jsx(ske,{size:14}),G.jsx("select",{value:fa,onChange:Zn=>bh(Zn.target.value),children:Object.keys(sdn).filter(Zn=>Zn!=="overview").map(Zn=>G.jsx("option",{value:Zn,children:sdn[Zn]},Zn))})]}),G.jsxs("label",{className:"select-control",title:"Dim graph context around the current selection",children:[G.jsx(JXn,{size:14}),G.jsx("select",{value:aa,onChange:Zn=>nu(Zn.target.value),children:Object.keys(odn).map(Zn=>G.jsx("option",{value:Zn,children:odn[Zn]},Zn))})]}),G.jsx("button",{className:"icon-button",onClick:Z2,title:"Run layout",children:G.jsx(HXn,{size:17})})]}),G.jsxs("div",{className:"toolbar-group graph-filter-buttons",children:[G.jsxs("button",{className:`metric-button ${rc?"active":""}`,onClick:()=>Qr(Zn=>!Zn),title:"Show relationship filters",children:[G.jsx(sbn,{size:14})," Relationships"]}),G.jsxs("button",{className:`metric-button ${vr?"active":""}`,onClick:()=>Si(Zn=>!Zn),title:"Show scale visibility controls",children:[G.jsx(ske,{size:14})," Scales ",x1.size>0?`${g.scales.length-x1.size}/${g.scales.length}`:g.scales.length]})]}),G.jsxs("div",{className:"toolbar-group panel-switch",children:[G.jsx("button",{"data-testid":"toolbar-inspector",className:`metric-button ${ne==="inspector"?"active":""}`,onClick:()=>mw("inspector"),children:"Inspector"}),O&&G.jsxs(G.Fragment,{children:[G.jsx("button",{"data-testid":"toolbar-add-model",className:`metric-button ${ne==="add_model"?"active":""}`,onClick:L4,children:"Add model"}),G.jsx("button",{className:`metric-button ${ne==="initializations"?"active":""}`,onClick:()=>mw("initializations"),children:"Initializations"}),G.jsx("button",{"data-testid":"toolbar-mapping-code",className:`metric-button ${ne==="mapping_code"?"active":""}`,onClick:()=>mw("mapping_code"),children:"Mapping code"})]})]}),O&&G.jsxs("div",{className:"toolbar-group live-session",children:[G.jsx("span",{className:k?"live-pill connected":"live-pill",children:k?"live":"offline"}),G.jsx("button",{className:"metric-button",disabled:!q,onClick:()=>qs({action:"undo"}),children:"Undo"}),G.jsx("button",{className:"metric-button",disabled:!W,onClick:()=>qs({action:"redo"}),children:"Redo"})]})]}),et&&G.jsx("div",{className:`editor-feedback ${et.kind}`,role:"status","aria-live":"polite",children:et.text}),g.cyclic&&G.jsx(EVn,{active:Gs,optionCount:O1.length,editorConnected:k,onChoose:P4}),rc&&G.jsx(mVn,{filters:A1,onToggle:x6}),vr&&G.jsx(vVn,{scales:g.scales,collapsedScales:x1,onToggle:ep,onExpandAll:$4}),lt&&G.jsx(fke,{className:"required-panel",title:"Required Initializations",subtitle:`${Jo.length} inputs`,onClose:()=>qt(!1),children:G.jsx(ldn,{groups:wdn(Jo),onSelect:Il})}),wi&&G.jsx(fke,{className:"warnings-panel",title:"Validation Warnings",subtitle:`${wh.length} warnings, ${ul.length-wh.length} info`,onClose:()=>li(!1),children:G.jsx(yVn,{warnings:ul,onFocusWarning:yw})}),Ut&&G.jsx(kVn,{recentMappings:$t,disabled:!k,onOpen:Zn=>{qs({action:"open_mapping_code",path:Zn}),ai(!1)},onClose:()=>ai(!1)}),G.jsxs(eXn,{nodes:A0,edges:T0,nodeTypes:hVn,edgeTypes:dVn,onNodesChange:M3,onEdgesChange:bw,onConnect:vw,onInit:dw,onPaneClick:()=>{Su(!1),Sd(null),ai(!1),Qr(!1),Si(!1)},onEdgeClick:(Zn,Ft)=>{Ft.data&&(Sd(null),ha(Ft.data),En(null),Se(null),M0(null),le("inspector"))},onNodeClick:(Zn,Ft)=>{Sd(null),ha(null),En(Ft.data),le("inspector")},fitView:!0,fitViewOptions:{padding:cl==="overview"?.14:.08,minZoom:.03,maxZoom:cl==="overview"?1.25:1},minZoom:.03,maxZoom:2,children:[G.jsx(lXn,{color:"transparent"}),G.jsx(wXn,{}),G.jsx(CXn,{pannable:!0,zoomable:!0,nodeStrokeWidth:3})]}),Xh&&G.jsx(MVn,{anchor:Xh.anchor,title:Xh.title,variable:Xh.port.name,role:Xh.port.role,models:Xh.models,onSelectModel:Zn=>{const Ft=Date.now();A6({modelType:Zn.type,scale:Xh.node.scale,requestId:Ft}),hw(Ft),T1(!0),le("add_model"),Sd(null)},onClose:()=>Sd(null)})]}),ne&&G.jsxs("aside",{ref:gw,className:`inspector ${ne==="add_model"&&Xb?"guided-focus":""}`,tabIndex:-1,children:[ne==="inspector"&&G.jsxs(G.Fragment,{children:[G.jsxs("header",{children:[G.jsx(oue,{size:19}),G.jsx("h2",{children:"Inspector"})]}),G.jsx(jVn,{selected:ln,selectedEdge:S6,activePort:nt,requiredInputPortIds:Uh,incomingEdges:nt?C1.get(nt.id)??[]:[],outgoingEdges:nt?I4.get(nt.id)??[]:[],nodeById:gh,portById:cs,graphNodes:g.nodes,onFocusEdge:Df,models:M,scales:A3,onAddScale:x3,onCommand:qs,editorConnected:k}),G.jsx("h3",{children:"Required Initializations"}),G.jsx(ldn,{groups:wdn(Jo),onSelect:Il,compact:!0}),G.jsx("h3",{children:"Diagnostics"}),g.diagnostics.length>0?g.diagnostics.map(Zn=>G.jsx("div",{className:"diagnostic",children:Zn},Zn)):G.jsx("div",{className:"empty-state",children:"No diagnostics."})]}),ne==="add_model"&&G.jsxs(G.Fragment,{children:[G.jsxs("header",{children:[G.jsx(oue,{size:19}),G.jsx("h2",{children:"Add Model"})]}),M.length>0?G.jsx(IVn,{models:M,scales:A3,selection:M6,focusRequestId:aw,onAddScale:x3,onCommand:qs,disabled:!k}):G.jsx("div",{className:"empty-state",children:"No model type is available."})]}),ne==="initializations"&&G.jsxs(G.Fragment,{children:[G.jsxs("header",{children:[G.jsx(oue,{size:19}),G.jsx("h2",{children:"Initializations"})]}),G.jsx(OVn,{initializations:Ce,disabled:!k,onCommand:qs})]}),ne==="mapping_code"&&G.jsxs(G.Fragment,{children:[G.jsxs("header",{children:[G.jsx(oue,{size:19}),G.jsx("h2",{children:"Mapping Code"})]}),G.jsx(DVn,{code:se,savePath:He,lastSavedPath:ze,saveTargetPath:De,autosavePath:an,lastAutosavedPath:An,onSavePathChange:en,onSave:()=>qs({action:"write_mapping_code",path:He}),disabled:!k})]})]}),on&&G.jsx(pVn,{connection:on,scales:A3,onConfirm:Zn=>{qs(Zn),ct(null)},onCancel:()=>ct(null)})]})}function pVn({connection:g,scales:E,onConfirm:M,onCancel:x}){const[O,P]=Pe.useState("single"),[k,H]=Pe.useState([g.sourceNode.scale]),q=W=>{H(Z=>Z.includes(W)?Z.filter(ne=>ne!==W):[...Z,W])},F=()=>{const W={action:"edit",kind:"set_mapped_variable",scale:g.targetNode.scale,process:g.targetNode.process,variable:g.targetPort.name,sourceScale:g.sourceNode.scale,sourceVariable:g.sourcePort.name,mode:O==="single"&&g.sourceNode.scale===g.targetNode.scale?"same_scale":O};if(O==="multi"){const Z=k.filter(ne=>ne!==g.sourceNode.scale);Z.length>0&&(W.extraSourceScales=Z)}M(W)};return G.jsx("div",{className:"mapping-dialog-overlay",onClick:x,role:"dialog","aria-modal":"true","aria-label":"Map variable",children:G.jsxs("div",{className:"mapping-dialog",onClick:W=>W.stopPropagation(),children:[G.jsxs("div",{className:"mapping-dialog-header",children:[G.jsx("div",{className:"eyebrow",children:"Variable Mapping"}),G.jsx("button",{className:"icon-button compact",onClick:x,title:"Cancel",children:G.jsx(zue,{size:14})})]}),G.jsxs("div",{className:"mapping-dialog-body",children:[G.jsxs("div",{className:"mapping-port-summary",children:[G.jsxs("div",{className:"mapping-port source",children:[G.jsx("small",{children:"Source"}),G.jsx("strong",{children:g.sourceNode.scale}),G.jsxs("span",{children:[g.sourceNode.process,".",g.sourcePort.name]})]}),G.jsx("div",{className:"mapping-arrow",children:"->"}),G.jsxs("div",{className:"mapping-port target",children:[G.jsx("small",{children:"Target"}),G.jsx("strong",{children:g.targetNode.scale}),G.jsxs("span",{children:[g.targetNode.process,".",g.targetPort.name]})]})]}),G.jsxs("div",{className:"mapping-mode-section",children:[G.jsx("div",{className:"mapping-mode-label",children:"Mapping mode"}),G.jsxs("label",{className:"mapping-radio",children:[G.jsx("input",{type:"radio",name:"mode",value:"single",checked:O==="single",onChange:()=>P("single")}),G.jsxs("span",{children:["Scalar - single node at :",g.sourceNode.scale]})]}),G.jsxs("label",{className:"mapping-radio",children:[G.jsx("input",{type:"radio",name:"mode",value:"multi",checked:O==="multi",onChange:()=>P("multi")}),G.jsx("span",{children:"Vector - all nodes from selected scales"})]})]}),O==="multi"&&G.jsxs("div",{className:"mapping-scale-picker",children:[G.jsx("div",{className:"mapping-mode-label",children:"Source scales"}),E.map(W=>G.jsxs("label",{className:"mapping-checkbox",children:[G.jsx("input",{type:"checkbox",checked:k.includes(W),disabled:W===g.sourceNode.scale,onChange:()=>q(W)}),G.jsx("span",{children:W})]},W))]})]}),G.jsxs("div",{className:"mapping-dialog-footer",children:[G.jsx("button",{className:"metric-button",onClick:x,children:"Cancel"}),G.jsx("button",{className:"metric-button accent-button",onClick:F,children:"Apply mapping"})]})]})})}function mVn({filters:g,onToggle:E}){return G.jsxs("div",{className:"relationship-legend",children:[G.jsxs("div",{className:"legend-title",children:[G.jsx(sbn,{size:13})," Relationships"]}),G.jsxs("button",{className:g.dataFlow?"active":"",onClick:()=>E("dataFlow"),children:[G.jsx("span",{className:"legend-line data-flow"})," data flow"]}),G.jsxs("button",{className:g.mapped?"active":"",onClick:()=>E("mapped"),children:[G.jsx("span",{className:"legend-line mapped"})," mapped"]}),G.jsxs("button",{className:g.callStack?"active":"",onClick:()=>E("callStack"),children:[G.jsx("span",{className:"legend-line call"})," call stack"]}),G.jsxs("div",{className:"legend-note",children:[G.jsx(Aue,{size:12})," red inputs need initialization"]})]})}function vVn({scales:g,collapsedScales:E,onToggle:M,onExpandAll:x}){return G.jsxs("div",{className:"scale-controls",children:[G.jsxs("div",{className:"legend-title",children:[G.jsx(ske,{size:13})," Scales"]}),G.jsx("div",{className:"scale-list",children:g.map(O=>{const P=E.has(O);return G.jsxs("button",{className:P?"collapsed":"active",onClick:()=>M(O),children:[G.jsx("span",{children:O}),G.jsx("small",{children:P?"collapsed":"visible"})]},O)})}),E.size>0&&G.jsx("button",{className:"scale-reset",onClick:x,children:"Show all scales"})]})}function fke({className:g,title:E,subtitle:M,onClose:x,children:O}){return G.jsxs("div",{className:`floating-panel ${g}`,children:[G.jsxs("div",{className:"floating-panel-header",children:[G.jsxs("div",{children:[G.jsx("div",{className:"eyebrow",children:E}),G.jsx("h2",{children:M})]}),G.jsx("button",{className:"icon-button compact",onClick:x,title:`Close ${E}`,children:G.jsx(zue,{size:14})})]}),O]})}function ldn({groups:g,onSelect:E,compact:M=!1}){return g.size===0?G.jsx("div",{className:"empty-state",children:"Every input is computed by another model."}):G.jsx("div",{className:`initialization-list ${M?"compact":""}`,children:[...g.entries()].map(([x,O])=>G.jsxs("section",{className:"initialization-group",children:[G.jsx("h4",{children:x}),O.map(({node:P,port:k,reason:H})=>G.jsxs("button",{className:`initialization-item ${H}`,onClick:()=>E(P,k),children:[G.jsxs("span",{children:[P.scale,".",P.process]}),G.jsx("strong",{children:k.name}),G.jsx("small",{children:qVn(H)})]},k.id))]},x))})}function yVn({warnings:g,onFocusWarning:E}){if(g.length===0)return G.jsx("div",{className:"empty-state",children:"No validation warnings."});const M=eKn(g);return G.jsx("div",{className:"warning-list",children:["error","warning","info"].map(x=>{const O=M.get(x)??[];return O.length===0?null:G.jsxs("section",{className:"warning-group",children:[G.jsxs("h4",{children:[nKn(x)," (",O.length,")"]}),O.map(P=>G.jsxs("button",{className:`warning-item ${P.severity} ${P.category}`,onClick:()=>E(P),children:[G.jsx("strong",{children:P.title}),G.jsx("span",{children:P.detail})]},P.id))]},x)})})}function kVn({recentMappings:g,disabled:E,onOpen:M,onClose:x}){const[O,P]=Pe.useState(""),k=()=>{const H=O.trim();H&&M(H)};return G.jsx(fke,{className:"open-panel",title:"Open",subtitle:"ModelMapping",onClose:x,children:G.jsxs("div",{className:"open-mapping-panel",children:[G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"File path"}),G.jsxs("div",{className:"inline-field",children:[G.jsx("input",{value:O,onChange:H=>P(H.target.value),onKeyDown:H=>{H.key==="Enter"&&k()},placeholder:"/path/to/mapping.jl"}),G.jsx("button",{className:"metric-button",disabled:E||!O.trim(),onClick:k,children:"Open"})]})]}),G.jsxs("div",{className:"recent-mappings",children:[G.jsx("div",{className:"row-with-actions",children:G.jsx("strong",{children:"Recent mappings"})}),g.length>0?G.jsx("div",{className:"recent-mapping-list",children:g.map(H=>G.jsxs("button",{className:"recent-mapping-item",disabled:E,onClick:()=>M(H),children:[G.jsx("span",{children:_Vn(H)}),G.jsx("small",{children:H})]},H))}):G.jsx("div",{className:"empty-state compact",children:"No recent mapping."})]})]})})}function EVn({active:g,optionCount:E,editorConnected:M,onChoose:x}){return G.jsxs("div",{"data-testid":"cycle-break-prompt",className:`cycle-break-prompt ${g?"active":""}`,role:"status","aria-live":"polite",children:[G.jsxs("div",{children:[G.jsx("strong",{children:"Cycle detected"}),G.jsxs("span",{children:["Choose which variable to decouple. The selected input will be wrapped in ",G.jsx("code",{children:"PreviousTimeStep"}),", so that model uses the value from the previous timestep and is disconnected from this current-step variable within a run."]})]}),G.jsxs("button",{"data-testid":"cycle-break-choose",className:"metric-button danger cycle-break-cta",disabled:!M||E===0,onClick:x,children:[G.jsx(ZG,{size:14}),g?"Choose a highlighted input":"Choose break point in graph"]})]})}function jVn({selected:g,selectedEdge:E,activePort:M,requiredInputPortIds:x,incomingEdges:O,outgoingEdges:P,nodeById:k,portById:H,graphNodes:q,onFocusEdge:F,models:W,scales:Z,onAddScale:ne,onCommand:le,editorConnected:se}){return G.jsxs(G.Fragment,{children:[E&&G.jsx(SVn,{edge:E,nodeById:k,portById:H,onCommand:le,editorConnected:se}),g?G.jsxs("div",{className:"details",children:[G.jsx(j0,{label:"Process",value:g.process}),G.jsx(j0,{label:"Model",value:g.modelType}),G.jsx(j0,{label:"Scale",value:g.scale}),G.jsx(j0,{label:"Rate",value:g.rate}),G.jsx(j0,{label:"Inputs",value:g.inputs.map(ee=>ee.name).join(", ")||"none"}),G.jsx(j0,{label:"Outputs",value:g.outputs.map(ee=>ee.name).join(", ")||"none"}),g.inputs.filter(ee=>x.has(ee.id)).map(ee=>G.jsxs("div",{className:"initialization-note",children:[G.jsx(Aue,{size:14})," ",ee.name," must be initialized"]},ee.id)),g.inputs.filter(ee=>ee.previousTimeStep).map(ee=>G.jsxs("div",{className:"edit-suggestion",children:[G.jsx(ZG,{size:14})," ",ee.name," uses previous timestep"]},ee.id)),g.role==="model"&&G.jsx(TVn,{node:g,models:W,scales:Z,onAddScale:ne,onCommand:le,disabled:!se},g.id)]}):E?null:G.jsx("div",{className:"empty-state",children:"Select a model node."}),G.jsx("h3",{children:"Variable Provenance"}),M?G.jsxs("div",{className:"variable-card",children:[G.jsxs("div",{className:"variable-card-title",children:[G.jsx("span",{children:M.name}),G.jsx("small",{children:M.role})]}),G.jsx(j0,{label:M.role==="input"?"Default":"Decl.",value:M.default}),M.mappingMode&&G.jsx(j0,{label:"Mapping",value:M.mappingMode}),M.sourceScale&&G.jsx(j0,{label:"Source",value:`${M.sourceScale}.${M.sourceVariable??M.name}`}),x.has(M.id)&&G.jsxs("div",{className:"initialization-note",children:[G.jsx(Aue,{size:14})," required initialization"]}),M.previousTimeStep&&G.jsxs("div",{className:"edit-suggestion",children:[G.jsx(ZG,{size:14})," uses previous timestep"]}),G.jsx(fdn,{title:"Produced by",edges:O,direction:"incoming",nodeById:k,portById:H,onFocusEdge:F}),G.jsx(fdn,{title:"Consumed by",edges:P,direction:"outgoing",nodeById:k,portById:H,onFocusEdge:F}),M.role==="input"&&G.jsx(CVn,{target:H.get(M.id)??null,graphNodes:q,disabled:!se,onCommand:le},M.id)]}):G.jsx("div",{className:"empty-state",children:"Hover, click, or search a variable to see where it comes from and where it goes."})]})}function SVn({edge:g,nodeById:E,portById:M,onCommand:x,editorConnected:O}){const P=E.get(g.source),k=E.get(g.target),H=g.sourcePort?M.get(g.sourcePort)?.port:null,q=g.targetPort?M.get(g.targetPort)?.port:null,F=C4(g)&&k&&q&&q.role==="input";return G.jsxs("div",{className:`edge-detail-card ${C4(g)?"cycle-edge-card":""}`,children:[G.jsxs("div",{className:"variable-card-title",children:[G.jsx("span",{children:dbn(g)}),G.jsx("small",{children:g.scaleRelation})]}),G.jsx(j0,{label:"Source",value:P?`${P.scale}.${P.process}`:g.source}),G.jsx(j0,{label:"Source var",value:H?.name??g.sourceVariable??"model call"}),G.jsx(j0,{label:"Target",value:k?`${k.scale}.${k.process}`:g.target}),G.jsx(j0,{label:"Target var",value:q?.name??g.targetVariable??"model call"}),G.jsx(j0,{label:"Kind",value:g.kind}),G.jsx(j0,{label:"Label",value:g.label||"none"}),F&&G.jsxs("button",{className:"metric-button danger cycle-break-button",disabled:!O,onClick:()=>x({action:"edit",kind:"mark_previous_timestep",scale:k.scale,process:k.process,variable:q.name}),children:[G.jsx(ZG,{size:14})," Use previous timestep for ",q.name]}),g.diagnostics.length>0?g.diagnostics.map(W=>G.jsx("div",{className:"diagnostic",children:W},W)):G.jsx("div",{className:"empty-state compact",children:"No edge diagnostics."})]})}function fdn({title:g,edges:E,direction:M,nodeById:x,portById:O,onFocusEdge:P}){return G.jsxs("div",{className:"provenance-block",children:[G.jsx("h4",{children:g}),E.length>0?E.map(k=>{const H=x.get(k.source),q=x.get(k.target),F=k.sourcePort?O.get(k.sourcePort)?.port:null,W=k.targetPort?O.get(k.targetPort)?.port:null,Z=M==="incoming"?`${H?.scale??"?"}.${H?.process??"?"}.${F?.name??k.sourceVariable??"model"}`:`${q?.scale??"?"}.${q?.process??"?"}.${W?.name??k.targetVariable??"model"}`;return G.jsxs("button",{className:`provenance-edge ${k.kind}`,onClick:()=>P(k),children:[G.jsx("strong",{children:Z}),G.jsxs("span",{children:[dbn(k),k.scaleRelation==="multiscale"?" across scales":""]}),k.diagnostics.length>0&&G.jsx("small",{children:k.diagnostics[0]})]},k.id)}):G.jsxs("div",{className:"empty-state compact",children:["No ",g.toLowerCase()," edge."]})]})}function MVn({anchor:g,title:E,variable:M,role:x,models:O,onSelectModel:P,onClose:k}){const H=x==="input"?"outputs":"inputs",q=x==="input"?"Outputs":"Inputs";return G.jsxs("div",{className:"candidate-popover",style:AVn(g),onClick:F=>F.stopPropagation(),children:[G.jsxs("div",{className:"candidate-popover-header",children:[G.jsxs("div",{children:[G.jsx("div",{className:"eyebrow",children:E}),G.jsx("h3",{children:M})]}),G.jsx("button",{className:"icon-button compact",onClick:F=>{F.stopPropagation(),k()},title:"Close model suggestions","aria-label":"Close model suggestions",children:G.jsx(zue,{size:14})})]}),G.jsx("div",{className:"candidate-popover-list",children:O.map(F=>{const W=xue(F,H);return G.jsxs("button",{className:"candidate-model-card",type:"button",onClick:Z=>{Z.stopPropagation(),P(F)},children:[G.jsx("strong",{children:F.name}),G.jsx("span",{children:F.process??F.processType??"unknown process"}),G.jsxs("small",{children:[q,": ",Object.keys(W).join(", ")||M]})]},`${F.type}:${F.process??""}`)})})]})}function AVn(g){if(typeof window>"u")return{left:g.x,top:g.y};const E=12,M=Math.min(360,window.innerWidth-E*2),x=Math.min(420,window.innerHeight-E*2),O=g.x+M+E>window.innerWidth,P=Math.min(Math.max(O?g.x-M-10:g.x+10,E),Math.max(E,window.innerWidth-M-E)),k=Math.min(Math.max(g.y-28,E),Math.max(E,window.innerHeight-x-E));return{left:P,top:k,width:M,maxHeight:x}}function xue(g,E){const M=g[E];return!M||typeof M!="object"||Array.isArray(M)?{}:M}function j0({label:g,value:E}){return G.jsxs("div",{className:"row",children:[G.jsx("span",{children:g}),G.jsx("strong",{children:E})]})}function xVn({mode:g,dt:E,phase:M,defaultLabel:x,onModeChange:O,onDtChange:P,onPhaseChange:k}){return G.jsxs("div",{className:"rate-editor",children:[G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Rate"}),G.jsxs("select",{value:g,onChange:H=>O(H.target.value),children:[G.jsx("option",{value:"default",children:"Default rate"}),G.jsx("option",{value:"clock",children:"Custom ClockSpec"})]})]}),g==="default"?G.jsxs("div",{className:"rate-summary",children:["Uses model default: ",x]}):G.jsxs("div",{className:"rate-clock-row",children:[G.jsxs("label",{children:[G.jsx("span",{children:"dt"}),G.jsx("input",{value:E,onChange:H=>P(H.target.value),inputMode:"decimal"})]}),G.jsxs("label",{children:[G.jsx("span",{children:"phase"}),G.jsx("input",{value:M,onChange:H=>k(H.target.value),inputMode:"decimal"})]})]})]})}function TVn({node:g,models:E,scales:M,onAddScale:x,onCommand:O,disabled:P}){const k=Pe.useMemo(()=>{const en=E.filter(ke=>ke.process===g.process);return en.length>0?en:E},[E,g.process]),H=k.find(en=>en.name===g.modelType||en.type===g.modelType)??k[0],[q,F]=Pe.useState(H?.type??g.modelType),W=k.find(en=>en.type===q)??H,[Z,ne]=Pe.useState(g.scale),[le,se]=Pe.useState(""),ee=Pe.useMemo(()=>W?Object.fromEntries(W.constructor.fields.map(en=>[en.name,g.modelParameters?.[en.name]?.value??abn(en.default)])):{},[g.modelParameters,W]),Ce=Pe.useMemo(()=>W?Object.fromEntries(W.constructor.fields.map(en=>[en.name,g.modelParameters?.[en.name]?.type??en.inferredChoice])):{},[g.modelParameters,W]),[je,ze]=Pe.useState(ee),[be,De]=Pe.useState(Ce),rn=g.timestep??{mode:"default",dt:"1.0",phase:"0.0"},[an,un]=Pe.useState(rn.mode==="clock"?"clock":"default"),[An,Dn]=Pe.useState(rn.dt??"1.0"),[$t,In]=Pe.useState(rn.phase??"0.0");Pe.useEffect(()=>{ze(ee),De(Ce)},[Ce,ee]);const et=Pe.useCallback((en,ke)=>{if(!W)return;const Ze=W.constructor.fields.find(En=>En.name===en),ln=Ze?.typeParameter?W.constructor.parameterGroups[Ze.typeParameter]??[en]:[en];De(En=>({...En,...Object.fromEntries(ln.map(nt=>[nt,ke]))}))},[W]),Y=Pe.useCallback(()=>W?Object.fromEntries(W.constructor.fields.map(en=>[en.name,{type:be[en.name]??en.inferredChoice,value:je[en.name]??""}])):{},[W,be,je]);if(!W)return null;const He=an==="clock"?{mode:"clock",dt:An,phase:$t}:{mode:"default"};return G.jsxs("div",{className:"existing-model-editor","data-testid":"existing-model-editor",children:[G.jsx("h3",{children:"Edit Model"}),G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Scale"}),G.jsx("select",{"data-testid":"edit-model-scale",value:Z,onChange:en=>ne(en.target.value),children:M.map(en=>G.jsx("option",{value:en,children:en},en))})]}),G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"New scale"}),G.jsxs("div",{className:"inline-field",children:[G.jsx("input",{value:le,onChange:en=>se(en.target.value),placeholder:"Leaf, Fruit, Soil"}),G.jsx("button",{className:"metric-button",onClick:()=>{x(le),le.trim()&&ne(le.trim()),se("")},children:"Add"})]})]}),G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Model"}),G.jsx("select",{"data-testid":"edit-model-type",value:W.type,onChange:en=>F(en.target.value),children:k.map(en=>G.jsx("option",{value:en.type,children:en.name},en.type))})]}),G.jsx(xVn,{mode:an,dt:An,phase:$t,defaultLabel:W.timespec??"default rate",onModeChange:un,onDtChange:Dn,onPhaseChange:In}),W.constructor.fields.map(en=>G.jsxs("div",{className:"parameter-row",children:[G.jsx("label",{children:en.name}),G.jsx("input",{"data-testid":`edit-param-${en.name}`,value:je[en.name]??"",onChange:ke=>ze(Ze=>({...Ze,[en.name]:ke.target.value}))}),G.jsx("select",{value:be[en.name]??en.inferredChoice,onChange:ke=>et(en.name,ke.target.value),children:en.choices.map(ke=>G.jsx("option",{value:ke,children:ke},ke))})]},en.name)),G.jsxs("div",{className:"row-with-actions",children:[G.jsx("button",{"data-testid":"update-model-submit",className:"metric-button",disabled:P,onClick:()=>O({action:"edit",kind:"update_model",scale:g.scale,process:g.process,targetScale:Z,modelType:W.type,parameters:Y(),timestep:He}),children:"Update model"}),G.jsx("button",{"data-testid":"remove-model-submit",className:"metric-button danger",disabled:P,onClick:()=>O({action:"edit",kind:"remove_model",scale:g.scale,process:g.process}),children:"Remove"})]})]})}function CVn({target:g,graphNodes:E,disabled:M,onCommand:x}){const O=Pe.useMemo(()=>g?E.flatMap(ee=>ee.outputs.map(Ce=>({node:ee,port:Ce}))).filter(({node:ee,port:Ce})=>ee.id!==g.node.id||Ce.name!==g.port.name).sort((ee,Ce)=>`${ee.node.scale}.${ee.node.process}.${ee.port.name}`.localeCompare(`${Ce.node.scale}.${Ce.node.process}.${Ce.port.name}`)):[],[E,g]),[P,k]=Pe.useState(""),[H,q]=Pe.useState("single"),[F,W]=Pe.useState([]);if(Pe.useEffect(()=>{k(O[0]?.port.id??""),q("single"),W([])},[O]),!g)return null;const Z=O.find(ee=>ee.port.id===P)??O[0]??null,ne=Z?[...new Set(O.filter(ee=>ee.port.name===Z.port.name&&ee.node.scale!==Z.node.scale).map(ee=>ee.node.scale))]:[],le=ee=>{W(Ce=>Ce.includes(ee)?Ce.filter(je=>je!==ee):[...Ce,ee])},se=()=>{if(!Z)return;const ee={action:"edit",kind:"set_mapped_variable",scale:g.node.scale,process:g.node.process,variable:g.port.name,sourceScale:Z.node.scale,sourceVariable:Z.port.name,mode:H==="single"&&Z.node.scale===g.node.scale?"same_scale":H};H==="multi"&&F.length>0&&(ee.extraSourceScales=F),x(ee)};return G.jsxs("div",{className:"variable-mapping-editor",children:[G.jsx("h4",{children:"Set Mapping"}),O.length===0?G.jsx("div",{className:"empty-state compact",children:"No output variable is available as a source."}):G.jsxs(G.Fragment,{children:[G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Source output"}),G.jsx("select",{"data-testid":"mapping-source-output",value:Z?.port.id??"",onChange:ee=>k(ee.target.value),children:O.map(({node:ee,port:Ce})=>G.jsxs("option",{value:Ce.id,children:[ee.scale,".",ee.process,".",Ce.name]},Ce.id))})]}),G.jsxs("div",{className:"mapping-mode-section",children:[G.jsxs("label",{className:"mapping-radio",children:[G.jsx("input",{type:"radio",name:`${g.port.id}-mapping-mode`,checked:H==="single",onChange:()=>q("single")}),G.jsx("span",{children:"Scalar"})]}),G.jsxs("label",{className:"mapping-radio",children:[G.jsx("input",{type:"radio",name:`${g.port.id}-mapping-mode`,checked:H==="multi",onChange:()=>q("multi")}),G.jsx("span",{children:"Vector"})]})]}),H==="multi"&&ne.length>0&&G.jsx("div",{className:"mapping-scale-picker",children:ne.map(ee=>G.jsxs("label",{className:"mapping-checkbox",children:[G.jsx("input",{type:"checkbox",checked:F.includes(ee),onChange:()=>le(ee)}),G.jsx("span",{children:ee})]},ee))}),G.jsx("button",{"data-testid":"mapping-apply",className:"metric-button",disabled:M||!Z,onClick:se,children:"Apply mapping"})]})]})}function OVn({initializations:g,disabled:E,onCommand:M}){const x=Pe.useMemo(()=>{const O=new Map;for(const P of g){const k=O.get(P.scale)??[];k.push(P),O.set(P.scale,k)}return O},[g]);return g.length===0?G.jsx("div",{className:"empty-state",children:"No explicit status initialization is required by the current ModelMapping."}):G.jsx("div",{className:"initialization-editor",children:[...x.entries()].map(([O,P])=>G.jsxs("section",{className:"initialization-editor-group",children:[G.jsx("h3",{children:O}),P.map(k=>G.jsx(NVn,{item:k,disabled:E,onCommand:M},`${k.scale}:${k.name}`))]},O))})}function NVn({item:g,disabled:E,onCommand:M}){const[x,O]=Pe.useState(g.value),[P,k]=Pe.useState(g.type);return Pe.useEffect(()=>{O(g.value),k(g.type)},[g]),G.jsxs("div",{className:`initialization-editor-row ${g.provided?"provided":""}`,children:[G.jsx("label",{children:g.name}),G.jsx("input",{value:x,onChange:H=>O(H.target.value),placeholder:g.provided?"":"initial value"}),G.jsx("select",{value:P,onChange:H=>k(H.target.value),children:gVn.map(H=>G.jsx("option",{value:H,children:H},H))}),G.jsx("button",{className:"metric-button",disabled:E,onClick:()=>M({action:"edit",kind:"set_initialization",scale:g.scale,variable:g.name,value:{type:P,value:x}}),children:"Apply"}),G.jsx("small",{children:g.provided?"Stored in Status":"Missing from Status"})]})}function DVn({code:g,savePath:E,lastSavedPath:M,saveTargetPath:x,autosavePath:O,lastAutosavedPath:P,onSavePathChange:k,onSave:H,disabled:q}){const F=Pe.useCallback(async()=>{g&&await navigator.clipboard.writeText(g)},[g]);return G.jsxs("div",{className:"mapping-code-panel",children:[G.jsxs("div",{className:"row-with-actions",children:[G.jsx("strong",{children:"Current Julia mapping"}),G.jsx("button",{className:"metric-button",onClick:()=>{F()},children:"Copy"})]}),G.jsx("textarea",{"data-testid":"mapping-code",className:"mapping-code",readOnly:!0,value:g}),G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Write to file"}),G.jsx("input",{value:E,onChange:W=>k(W.target.value),placeholder:"mapping.generated.jl"})]}),G.jsx("button",{className:"metric-button",disabled:q,onClick:H,children:"Save mapping code"}),G.jsxs("div",{className:"storage-grid",children:[x?G.jsx(X7e,{label:"Auto-save target",path:x}):G.jsx("div",{className:"empty-state compact",children:"No file target selected."}),M?G.jsx(X7e,{label:"Last saved",path:M}):null,O?G.jsx(X7e,{label:P?"Recovery autosave":"Recovery target",path:O}):null]})]})}function X7e({label:g,path:E}){return G.jsxs("div",{className:"path-status",children:[G.jsx("span",{children:g}),G.jsx("strong",{children:E})]})}function _Vn(g){const E=g.split(/[\\/]/);return E[E.length-1]||g}function IVn({models:g,scales:E,selection:M,focusRequestId:x,onAddScale:O,onCommand:P,disabled:k}){const[H,q]=Pe.useState(g[0]?.type??""),[F,W]=Pe.useState(E[0]??"Default"),[Z,ne]=Pe.useState(""),le=g.find(se=>se.type===H)??g[0];return Pe.useEffect(()=>{g.some(se=>se.type===H)||q(g[0]?.type??"")},[H,g]),Pe.useEffect(()=>{E.includes(F)||W(E[0]??"Default")},[F,E]),Pe.useEffect(()=>{M&&(g.some(se=>se.type===M.modelType)&&q(M.modelType),M.scale&&W(M.scale))},[g,M]),le?G.jsxs("div",{className:"model-browser","data-testid":"add-model-panel",children:[G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Define scale"}),G.jsxs("div",{className:"inline-field",children:[G.jsx("input",{value:Z,onChange:se=>ne(se.target.value),placeholder:"Leaf, Plant, Scene"}),G.jsx("button",{className:"metric-button",onClick:()=>{O(Z),Z.trim()&&W(Z.trim()),ne("")},children:"Add scale"})]})]}),G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Scale"}),G.jsx("select",{"data-testid":"add-model-scale",value:F,onChange:se=>W(se.target.value),children:E.map(se=>G.jsx("option",{value:se,children:se},se))})]}),G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Model"}),G.jsx("select",{"data-testid":"add-model-type",value:le.type,onChange:se=>q(se.target.value),children:g.map(se=>G.jsxs("option",{value:se.type,children:[se.name," (",se.process??"unknown",")"]},se.type))})]}),G.jsx(LVn,{model:le,scale:F,focusRequestId:x,disabled:k,onCommand:P},le.type)]}):G.jsx("div",{className:"empty-state",children:"No model type is available."})}function LVn({model:g,scale:E,focusRequestId:M,disabled:x,onCommand:O}){const P=Pe.useMemo(()=>Object.fromEntries(g.constructor.fields.map(rn=>[rn.name,abn(rn.default)])),[g]),k=Pe.useMemo(()=>Object.fromEntries(g.constructor.fields.map(rn=>[rn.name,rn.inferredChoice])),[g]),[H,q]=Pe.useState(P),[F,W]=Pe.useState(k),[Z,ne]=Pe.useState("default"),[le,se]=Pe.useState("1.0"),[ee,Ce]=Pe.useState("0.0"),je=Pe.useRef(null),ze=Pe.useRef(null),be=Pe.useCallback((rn,an)=>{const un=g.constructor.fields.find(Dn=>Dn.name===rn),An=un?.typeParameter?g.constructor.parameterGroups[un.typeParameter]??[rn]:[rn];W(Dn=>({...Dn,...Object.fromEntries(An.map($t=>[$t,an]))}))},[g]),De=Pe.useCallback(()=>{const rn=Object.fromEntries(g.constructor.fields.map(un=>[un.name,{type:F[un.name]??un.inferredChoice,value:H[un.name]??""}])),an=Z==="clock"?{mode:"clock",dt:le,phase:ee}:{mode:"default"};O({action:"edit",kind:"add_model",scale:E,modelType:g.type,parameters:rn,timestep:an})},[g,O,le,Z,ee,E,F,H]);return Pe.useEffect(()=>{M&&window.setTimeout(()=>{(je.current??ze.current)?.focus({preventScroll:!0})},80)},[M,g.type]),G.jsxs("div",{className:"model-browser-item add-model-config",children:[G.jsxs("div",{className:"model-browser-title",children:[G.jsx("strong",{children:g.name}),G.jsxs("span",{children:[g.process??"unknown process"," at :",E]})]}),G.jsxs("div",{className:"rate-editor",children:[G.jsxs("label",{className:"model-browser-control",children:[G.jsx("span",{children:"Rate"}),G.jsxs("select",{value:Z,onChange:rn=>ne(rn.target.value),children:[G.jsx("option",{value:"default",children:"Default rate"}),G.jsx("option",{value:"clock",children:"Custom ClockSpec"})]})]}),Z==="default"?G.jsxs("div",{className:"rate-summary",children:["Uses model default: ",g.timespec??"default rate"]}):G.jsxs("div",{className:"rate-clock-row",children:[G.jsxs("label",{children:[G.jsx("span",{children:"dt"}),G.jsx("input",{value:le,onChange:rn=>se(rn.target.value),inputMode:"decimal"})]}),G.jsxs("label",{children:[G.jsx("span",{children:"phase"}),G.jsx("input",{value:ee,onChange:rn=>Ce(rn.target.value),inputMode:"decimal"})]})]})]}),g.constructor.fields.map((rn,an)=>G.jsxs("div",{className:"parameter-row",children:[G.jsx("label",{children:rn.name}),G.jsx("input",{"data-testid":`add-param-${rn.name}`,ref:an===0?je:void 0,value:H[rn.name]??"",onChange:un=>q(An=>({...An,[rn.name]:un.target.value}))}),G.jsx("select",{value:F[rn.name]??rn.inferredChoice,onChange:un=>be(rn.name,un.target.value),children:rn.choices.map(un=>G.jsx("option",{value:un,children:un},un))})]},rn.name)),G.jsx("div",{className:"add-model-footer",children:G.jsxs("button",{"data-testid":"add-model-submit",ref:ze,className:"metric-button accent-button",disabled:x,onClick:De,children:["Add ",g.name]})})]})}function abn(g){return g===null||typeof g>"u"?"":typeof g=="string"&&g.startsWith(":")?g.slice(1):String(g)}function adn(){const g=document.getElementById("pse-graph-data");return g?.textContent?JSON.parse(g.textContent):window.PlantSimEngineGraph??fVn}function hdn(g){return g.nodes.length>45||g.edges.length>110?"overview":"detail"}function ddn(g,E){return g==="overview"?"overview":E==="overview"?"data_flow":E}function bdn(){const g=document.getElementById("pse-editor-config");return g?.textContent?JSON.parse(g.textContent):null}function gdn(g,E){return{...g,viewMode:E.viewMode,cyclic:E.cycleNodeIds.has(g.id),activePortId:E.activePort?.id??null,highlightedPortIds:[...E.highlightedPortIds],focusedPortIds:[...E.focusedPortIds],requiredInputPortIds:[...E.requiredInputPortIds],candidatePortIds:[...E.candidatePortIds],cycleBreakPortIds:[...E.cycleBreakPortIds],cycleBreakActive:E.cycleBreakMode,focused:E.focusedNodeIds.has(g.id),dimmed:E.hasActiveFocus&&!E.focusedNodeIds.has(g.id),onPortEnter:E.setActivePort,onPortLeave:M=>{E.activeCandidatePortId!==M.id&&E.setActivePort(null)},onCandidateClick:E.setCandidatePopover,onCycleBreakClick:E.breakCycleAtPort,onRemoveModel:E.removeGraphModel}}function PVn(g,E){let M=g;const x=new Set;for(;M&&!x.has(M.id);){if(M.role==="model")return M;x.add(M.id),M=M.parent?E.get(M.parent):void 0}return null}function $Vn(g){const E=new Set(g.edges.map(O=>O.targetPort).filter(rKn)),M=new Set,x=new Set;for(const O of g.nodes)for(const P of O.inputs){if(E.has(P.id))continue;const k=hbn(g,O,P,E);if(!k)continue;const H=GVn(k.node,k.port);x.has(H)||(x.add(H),M.add(k.port.id))}return M}function RVn(g,E,M){const x=[],O=new Set;for(const P of g.edges){if(!C4(P)||!P.targetPort)continue;const k=E.get(P.target),H=M.get(P.targetPort);!k||!H||H.port.role!=="input"||O.has(H.port.id)||(O.add(H.port.id),x.push({edge:P,node:k,port:H.port}))}return x}function BVn(g,E,M){const x=new Set,O=new Set;for(const k of E)Object.keys(xue(k,"outputs")).forEach(H=>x.add(H)),Object.keys(xue(k,"inputs")).forEach(H=>O.add(H));const P=new Set;for(const k of g.nodes){for(const H of k.inputs)(M.get(H.id)??[]).length===0&&x.has(H.name)&&P.add(H.id);for(const H of k.outputs)O.has(H.name)&&P.add(H.id)}return P}function zVn(g,E,M){return g.nodes.flatMap(x=>x.inputs.filter(O=>E.has(O.id)).map(O=>({node:x,port:O,reason:FVn(O,M.get(O.id)??[])})))}function FVn(g,E){return g.previousTimeStep?"previous_time_step":g.mappingMode&&E.length===0?"mapped_unresolved":"user_initialization"}function hbn(g,E,M,x,O=new Set){if(O.has(M.id))return{node:E,port:M};if(O.add(M.id),!M.sourceScale)return{node:E,port:M};const P=M.sourceVariable??M.name,k=HVn(g,M.sourceScale,P);return k?x.has(k.port.id)?null:hbn(g,k.node,k.port,x,O):JVn(g,M.sourceScale,P)?null:{node:E,port:M}}function HVn(g,E,M){let x=null;for(const O of g.nodes){if(O.scale!==E)continue;const P=O.inputs.find(k=>k.name===M);if(P&&(x||(x={node:O,port:P}),!P.sourceScale))return{node:O,port:P}}return x}function JVn(g,E,M){for(const x of g.nodes){if(x.scale!==E)continue;const O=x.outputs.find(P=>P.name===M);if(O)return{node:x,port:O}}return null}function GVn(g,E){return`${g.scale}:${E.name}`}function wdn(g){const E=new Map;for(const M of g){const x=`${M.node.scale}.${M.node.process}`,O=E.get(x)??[];O.push(M),E.set(x,O)}return E}function qVn(g){return g==="previous_time_step"?"previous step":g==="mapped_unresolved"?"unresolved mapping":"user init"}function pdn(g,E,M,x,O){const P=E.has(g.id),k=M.has(g.id),H=oq(g),q=x&&!P||O&&!k&&!P;return{id:g.id,source:g.source,target:g.target,sourceHandle:g.sourcePort??(H?`${g.source}:call-source`:void 0),targetHandle:g.targetPort??(H?`${g.target}:call-target`:void 0),markerEnd:H?void 0:UVn(mdn(g,P||k)),type:"dependency",animated:!H&&(g.scaleRelation==="multiscale"||C4(g)),className:`${g.kind} ${H?"call_edge":"variable_edge"} ${g.scaleRelation} ${C4(g)?"cycle_edge":""} ${k?"focused":""} ${P?"highlighted":q?"dimmed":""}`,style:XVn(mdn(g,P||k),P||k||C4(g),C4(g)),selected:P||k,zIndex:P?120:k?90:H?3:5,data:{...g,highlighted:P,focused:k,dimmed:q}}}function mdn(g,E){return E?lue.accent:C4(g)?"#d3422f":g.kind==="hard_dependency"?lue.hard:g.kind==="mapped_variable"||g.scaleRelation==="multiscale"?lue.mapped:lue.base}function UVn(g){return{type:KG.ArrowClosed,color:g,width:9,height:9,markerUnits:"userSpaceOnUse",strokeWidth:1.2}}function XVn(g,E,M=!1){return{stroke:g,strokeWidth:M?4:E?3:2.2}}function VVn(g,E){const M=Tue();if(!E)return M;M.ports.add(E.id);const x=new Set([E.id]),O=[E.id];for(;O.length>0;){const P=O.shift();for(const k of g.edges){const H=k.sourcePort,q=k.targetPort;if(!H||!q||H!==P&&q!==P)continue;M.edges.add(k.id),M.nodes.add(k.source),M.nodes.add(k.target),M.ports.add(H),M.ports.add(q);const F=H===P?q:H;x.has(F)||(x.add(F),O.push(F))}}return M}function KVn(g,E,M,x){const O=Tue();if(x==="none")return O;const P=new Set;if(M&&P.add(M.id),E){const q=g.nodes.find(F=>F.id===E);q?.inputs.forEach(F=>P.add(F.id)),q?.outputs.forEach(F=>P.add(F.id)),O.nodes.add(E)}if(P.size===0)return O;O.active=!0;const k=new Set(P),H=[...P];for(P.forEach(q=>O.ports.add(q));H.length>0;){const q=H.shift();for(const F of g.edges){if(!F.sourcePort||!F.targetPort)continue;const W=x==="upstream"||x==="neighborhood",ne=(x==="downstream"||x==="neighborhood")&&F.sourcePort===q?F.targetPort:W&&F.targetPort===q?F.sourcePort:null;ne&&(O.edges.add(F.id),O.nodes.add(F.source),O.nodes.add(F.target),O.ports.add(F.sourcePort),O.ports.add(F.targetPort),k.has(ne)||(k.add(ne),H.push(ne)))}}for(const q of g.edges)oq(q)&&(O.nodes.has(q.source)||O.nodes.has(q.target))&&(O.edges.add(q.id),O.nodes.add(q.source),O.nodes.add(q.target));return O}function QVn(g,E){const M=E.trim().toLowerCase();if(!M)return[];const x=[];for(const O of g.nodes){`${O.scale} ${O.process} ${O.modelType} ${O.rate}`.toLowerCase().includes(M)&&x.push({id:`model:${O.id}`,kind:"model",node:O,label:`${O.scale}.${O.process}`,detail:O.modelType});for(const k of[...O.inputs,...O.outputs])`${O.scale} ${O.process} ${O.modelType} ${k.name} ${k.role}`.toLowerCase().includes(M)&&x.push({id:`port:${k.id}`,kind:k.role,node:O,port:k,label:`${k.name}`,detail:`${k.role} in ${O.scale}.${O.process}`})}return x.slice(0,18)}function YVn(g,E,M){const x=[],O=new Map,P=new Map(g.nodes.map(k=>[k.id,k]));for(const k of g.nodes){for(const H of k.outputs){if(!ZVn(k,H))continue;const q=`${k.scale}:${H.name}`,F=O.get(q)??[];F.push({node:k,port:H}),O.set(q,F)}for(const H of k.inputs){const q=M.get(H.id)??[];E.has(H.id)&&q.length>0&&x.push({id:`required-with-edge:${H.id}`,severity:"error",category:"init",title:"Input marked init but connected",detail:`${k.scale}.${k.process}.${H.name} has incoming data-flow edges and should not be required.`,nodeId:k.id,portId:H.id}),H.mappingMode&&E.has(H.id)&&!H.previousTimeStep&&x.push({id:`unresolved-mapping:${H.id}`,severity:"warning",category:"mapping",title:"Mapped input has no producer",detail:`${k.scale}.${k.process}.${H.name} declares mapping metadata but no source output was found.`,nodeId:k.id,portId:H.id})}}for(const[k,H]of O){if(H.length<=1)continue;const[q,F]=k.split(":"),W=H.map(({node:Z})=>`${Z.scale}.${Z.process}`).join(", ");x.push({id:`multiple-producers:${k}`,severity:"warning",category:"ownership",title:"Multiple producers",detail:`${q}.${F} is output by ${H.length} models at the same scale: ${W}.`,nodeId:H[0].node.id,nodeIds:H.map(({node:Z})=>Z.id),portId:H[0].port.id,portIds:H.map(({port:Z})=>Z.id)})}for(const k of g.edges){k.diagnostics.some(W=>W.includes("Forwarded to a hard dependency"))&&x.push({id:`hard-forward:${k.id}`,severity:"info",category:"hard_dependency",title:"Hard input forwarding",detail:`${k.targetVariable??"input"} is satisfied through the owning model status before a hard dependency call. This is expected for declared hard dependencies.`,edgeId:k.id});const H=P.get(k.source),q=P.get(k.target);H&&q&&H.scale!==q.scale&&k.kind!=="mapped_variable"&&!oq(k)&&!WVn(k,q,P,M)&&x.push({id:`implicit-cross-scale:${k.id}`,severity:"info",category:"cross_scale",title:"Inferred cross-scale edge",detail:`${H?.scale}.${H?.process}.${k.sourceVariable??"source"} -> ${q?.scale}.${q?.process}.${k.targetVariable??"target"} crosses scales through graph inference rather than a direct mapped-variable edge.`,edgeId:k.id})}return x}function WVn(g,E,M,x){return!E||!g.targetPort?!1:(x.get(g.targetPort)??[]).some(P=>P.id===g.id||!P.sourcePort||!P.targetPort?!1:M.get(P.source)?.scale===E.scale)}function ZVn(g,E){return!g.ownOutputIds||g.ownOutputIds.includes(E.id)}function eKn(g){const E=new Map;for(const M of g){const x=E.get(M.severity)??[];x.push(M),E.set(M.severity,x)}return E}function nKn(g){return g==="error"?"Likely bugs":g==="warning"?"Review":"Information"}function tKn(g){const E=new Map;for(const M of g.nodes)for(const x of[...M.inputs,...M.outputs])E.set(x.id,{node:M,port:x});return E}function vdn(g,E){const M=new Map;for(const x of g){const O=x[E];if(!O)continue;const P=M.get(O)??[];P.push(x),M.set(O,P)}return M}function iKn(g,E){return oq(g)?E.callStack:C4(g)?E.dataFlow:g.kind==="mapped_variable"||g.scaleRelation==="multiscale"?E.mapped:E.dataFlow}function dbn(g){return C4(g)?"cycle dependency":oq(g)?"call stack":g.kind==="mapped_variable"?"mapped variable":g.diagnostics.some(E=>E.includes("Forwarded to a hard dependency"))?"hard input forwarding":g.diagnostics.some(E=>E.includes("Computed by a hard dependency"))?"hard output":"soft dependency"}function oq(g){return g.kind==="hard_dependency"&&!g.sourcePort&&!g.targetPort}function C4(g){return g.kind==="cycle_dependency"||g.diagnostics.some(E=>E.includes("Cycle edge"))}function Tue(){return{active:!1,edges:new Set,nodes:new Set,ports:new Set}}function rKn(g){return typeof g=="string"}jzn.createRoot(document.getElementById("root")).render(G.jsx(Pe.StrictMode,{children:G.jsx(wVn,{})})); diff --git a/frontend/dist/assets/index-CfC2_AOV.js b/frontend/dist/assets/index-CfC2_AOV.js new file mode 100644 index 000000000..b3b405c92 --- /dev/null +++ b/frontend/dist/assets/index-CfC2_AOV.js @@ -0,0 +1,38 @@ +(function(){const E=document.createElement("link").relList;if(E&&E.supports&&E.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))M(N);new MutationObserver(N=>{for(const $ of N)if($.type==="childList")for(const k of $.addedNodes)k.tagName==="LINK"&&k.rel==="modulepreload"&&M(k)}).observe(document,{childList:!0,subtree:!0});function x(N){const $={};return N.integrity&&($.integrity=N.integrity),N.referrerPolicy&&($.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?$.credentials="include":N.crossOrigin==="anonymous"?$.credentials="omit":$.credentials="same-origin",$}function M(N){if(N.ep)return;N.ep=!0;const $=x(N);fetch(N.href,$)}})();var Lhn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bke(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var C7e={exports:{}},IG={};var Phn;function izn(){if(Phn)return IG;Phn=1;var g=Symbol.for("react.transitional.element"),E=Symbol.for("react.fragment");function x(M,N,$){var k=null;if($!==void 0&&(k=""+$),N.key!==void 0&&(k=""+N.key),"key"in N){$={};for(var H in N)H!=="key"&&($[H]=N[H])}else $=N;return N=$.ref,{$$typeof:g,type:M,key:k,ref:N!==void 0?N:null,props:$}}return IG.Fragment=E,IG.jsx=x,IG.jsxs=x,IG}var $hn;function rzn(){return $hn||($hn=1,C7e.exports=izn()),C7e.exports}var L=rzn(),T7e={exports:{}},Mc={};var Rhn;function czn(){if(Rhn)return Mc;Rhn=1;var g=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),k=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),G=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),Z=Symbol.iterator;function le(ye){return ye===null||typeof ye!="object"?null:(ye=Z&&ye[Z]||ye["@@iterator"],typeof ye=="function"?ye:null)}var oe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ee=Object.assign,Ce={};function pe(ye,Re,tt){this.props=ye,this.context=Re,this.refs=Ce,this.updater=tt||oe}pe.prototype.isReactComponent={},pe.prototype.setState=function(ye,Re){if(typeof ye!="object"&&typeof ye!="function"&&ye!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ye,Re,"setState")},pe.prototype.forceUpdate=function(ye){this.updater.enqueueForceUpdate(this,ye,"forceUpdate")};function $e(){}$e.prototype=pe.prototype;function ae(ye,Re,tt){this.props=ye,this.context=Re,this.refs=Ce,this.updater=tt||oe}var Ne=ae.prototype=new $e;Ne.constructor=ae,ee(Ne,pe.prototype),Ne.isPureReactComponent=!0;var Ue=Array.isArray;function ln(){}var un={H:null,A:null,T:null,S:null},An=Object.prototype.hasOwnProperty;function xn(ye,Re,tt){var ut=tt.ref;return{$$typeof:g,type:ye,key:Re,ref:ut!==void 0?ut:null,props:tt}}function nt(ye,Re){return xn(ye.type,Re,ye.props)}function dn(ye){return typeof ye=="object"&&ye!==null&&ye.$$typeof===g}function bn(ye){var Re={"=":"=0",":":"=2"};return"$"+ye.replace(/[=:]/g,function(tt){return Re[tt]})}var Y=/\/+/g;function Je(ye,Re){return typeof ye=="object"&&ye!==null&&ye.key!=null?bn(""+ye.key):Re.toString(36)}function pn(ye){switch(ye.status){case"fulfilled":return ye.value;case"rejected":throw ye.reason;default:switch(typeof ye.status=="string"?ye.then(ln,ln):(ye.status="pending",ye.then(function(Re){ye.status==="pending"&&(ye.status="fulfilled",ye.value=Re)},function(Re){ye.status==="pending"&&(ye.status="rejected",ye.reason=Re)})),ye.status){case"fulfilled":return ye.value;case"rejected":throw ye.reason}}throw ye}function Ae(ye,Re,tt,ut,Jt){var di=typeof ye;(di==="undefined"||di==="boolean")&&(ye=null);var Gt=!1;if(ye===null)Gt=!0;else switch(di){case"bigint":case"string":case"number":Gt=!0;break;case"object":switch(ye.$$typeof){case g:case E:Gt=!0;break;case ie:return Gt=ye._init,Ae(Gt(ye._payload),Re,tt,ut,Jt)}}if(Gt)return Jt=Jt(ye),Gt=ut===""?"."+Je(ye,0):ut,Ue(Jt)?(tt="",Gt!=null&&(tt=Gt.replace(Y,"$&/")+"/"),Ae(Jt,Re,tt,"",function(Kr){return Kr})):Jt!=null&&(dn(Jt)&&(Jt=nt(Jt,tt+(Jt.key==null||ye&&ye.key===Jt.key?"":(""+Jt.key).replace(Y,"$&/")+"/")+Gt)),Re.push(Jt)),1;Gt=0;var xt=ut===""?".":ut+":";if(Ue(ye))for(var si=0;si>>1,Pn=Ae[yn];if(0>>1;ynN(tt,nn))utN(Jt,tt)?(Ae[yn]=Jt,Ae[ut]=nn,yn=ut):(Ae[yn]=tt,Ae[Re]=nn,yn=Re);else if(utN(Jt,nn))Ae[yn]=Jt,Ae[ut]=nn,yn=ut;else break e}}return ve}function N(Ae,ve){var nn=Ae.sortIndex-ve.sortIndex;return nn!==0?nn:Ae.id-ve.id}if(g.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var $=performance;g.unstable_now=function(){return $.now()}}else{var k=Date,H=k.now();g.unstable_now=function(){return k.now()-H}}var U=[],G=[],ie=1,W=null,Z=3,le=!1,oe=!1,ee=!1,Ce=!1,pe=typeof setTimeout=="function"?setTimeout:null,$e=typeof clearTimeout=="function"?clearTimeout:null,ae=typeof setImmediate<"u"?setImmediate:null;function Ne(Ae){for(var ve=x(G);ve!==null;){if(ve.callback===null)M(G);else if(ve.startTime<=Ae)M(G),ve.sortIndex=ve.expirationTime,E(U,ve);else break;ve=x(G)}}function Ue(Ae){if(ee=!1,Ne(Ae),!oe)if(x(U)!==null)oe=!0,ln||(ln=!0,bn());else{var ve=x(G);ve!==null&&pn(Ue,ve.startTime-Ae)}}var ln=!1,un=-1,An=5,xn=-1;function nt(){return Ce?!0:!(g.unstable_now()-xnAe&&nt());){var yn=W.callback;if(typeof yn=="function"){W.callback=null,Z=W.priorityLevel;var Pn=yn(W.expirationTime<=Ae);if(Ae=g.unstable_now(),typeof Pn=="function"){W.callback=Pn,Ne(Ae),ve=!0;break n}W===x(U)&&M(U),Ne(Ae)}else M(U);W=x(U)}if(W!==null)ve=!0;else{var ye=x(G);ye!==null&&pn(Ue,ye.startTime-Ae),ve=!1}}break e}finally{W=null,Z=nn,le=!1}ve=void 0}}finally{ve?bn():ln=!1}}}var bn;if(typeof ae=="function")bn=function(){ae(dn)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,Je=Y.port2;Y.port1.onmessage=dn,bn=function(){Je.postMessage(null)}}else bn=function(){pe(dn,0)};function pn(Ae,ve){un=pe(function(){Ae(g.unstable_now())},ve)}g.unstable_IdlePriority=5,g.unstable_ImmediatePriority=1,g.unstable_LowPriority=4,g.unstable_NormalPriority=3,g.unstable_Profiling=null,g.unstable_UserBlockingPriority=2,g.unstable_cancelCallback=function(Ae){Ae.callback=null},g.unstable_forceFrameRate=function(Ae){0>Ae||125yn?(Ae.sortIndex=nn,E(G,Ae),x(U)===null&&Ae===x(G)&&(ee?($e(un),un=-1):ee=!0,pn(Ue,nn-yn))):(Ae.sortIndex=Pn,E(U,Ae),oe||le||(oe=!0,ln||(ln=!0,bn()))),Ae},g.unstable_shouldYield=nt,g.unstable_wrapCallback=function(Ae){var ve=Z;return function(){var nn=Z;Z=ve;try{return Ae.apply(this,arguments)}finally{Z=nn}}}})(I7e)),I7e}var Fhn;function szn(){return Fhn||(Fhn=1,N7e.exports=ozn()),N7e.exports}var D7e={exports:{}},rd={};var Jhn;function lzn(){if(Jhn)return rd;Jhn=1;var g=ZG();function E(U){var G="https://react.dev/errors/"+U;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g)}catch(E){console.error(E)}}return g(),D7e.exports=lzn(),D7e.exports}var Ghn;function fzn(){if(Ghn)return DG;Ghn=1;var g=szn(),E=ZG(),x=sdn();function M(a){var d="https://react.dev/errors/"+a;if(1Pn||(a.current=yn[Pn],yn[Pn]=null,Pn--)}function tt(a,d){Pn++,yn[Pn]=a.current,a.current=d}var ut=ye(null),Jt=ye(null),di=ye(null),Gt=ye(null);function xt(a,d){switch(tt(di,d),tt(Jt,a),tt(ut,null),d.nodeType){case 9:case 11:a=(a=d.documentElement)&&(a=a.namespaceURI)?fP(a):0;break;default:if(a=d.tagName,d=d.namespaceURI)d=fP(d),a=aP(d,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Re(ut),tt(ut,a)}function si(){Re(ut),Re(Jt),Re(di)}function Kr(a){a.memoizedState!==null&&tt(Gt,a);var d=ut.current,w=aP(d,a.type);d!==w&&(tt(Jt,a),tt(ut,w))}function Er(a){Jt.current===a&&(Re(ut),Re(Jt)),Gt.current===a&&(Re(Gt),n4._currentValue=nn)}var Mt,bi;function zi(a){if(Mt===void 0)try{throw Error()}catch(w){var d=w.stack.trim().match(/\n( *(at )?)/);Mt=d&&d[1]||"",bi=-1)":-1T||tn[j]!==Ln[T]){var it=` +`+tn[j].replace(" at new "," at ");return a.displayName&&it.includes("")&&(it=it.replace("",a.displayName)),it}while(1<=j&&0<=T);break}}}finally{cu=!1,Error.prepareStackTrace=w}return(w=a?a.displayName||a.name:"")?zi(w):""}function Rs(a,d){switch(a.tag){case 26:case 27:case 5:return zi(a.type);case 16:return zi("Lazy");case 13:return a.child!==d&&d!==null?zi("Suspense Fallback"):zi("Suspense");case 19:return zi("SuspenseList");case 0:case 15:return Fu(a.type,!1);case 11:return Fu(a.type.render,!1);case 1:return Fu(a.type,!0);case 31:return zi("Activity");default:return""}}function ia(a){try{var d="",w=null;do d+=Rs(a,w),w=a,a=a.return;while(a);return d}catch(j){return` +Error generating stack: `+j.message+` +`+j.stack}}var ef=Object.prototype.hasOwnProperty,Oa=g.unstable_scheduleCallback,Cc=g.unstable_cancelCallback,o0=g.unstable_shouldYield,xb=g.unstable_requestPaint,Sl=g.unstable_now,cd=g.unstable_getCurrentPriorityLevel,s0=g.unstable_ImmediatePriority,uh=g.unstable_UserBlockingPriority,ud=g.unstable_NormalPriority,b5=g.unstable_LowPriority,l0=g.unstable_IdlePriority,Cp=g.log,l6=g.unstable_setDisableYieldValue,Ab=null,ra=null;function od(a){if(typeof Cp=="function"&&l6(a),ra&&typeof ra.setStrictMode=="function")try{ra.setStrictMode(Ab,a)}catch{}}var Sf=Math.clz32?Math.clz32:Tp,f6=Math.log,oh=Math.LN2;function Tp(a){return a>>>=0,a===0?32:31-(f6(a)/oh|0)|0}var Gg=256,qg=262144,Ug=4194304;function sd(a){var d=a&42;if(d!==0)return d;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Xg(a,d,w){var j=a.pendingLanes;if(j===0)return 0;var T=0,I=a.suspendedLanes,Q=a.pingedLanes;a=a.warmLanes;var de=j&134217727;return de!==0?(j=de&~I,j!==0?T=sd(j):(Q&=de,Q!==0?T=sd(Q):w||(w=de&~a,w!==0&&(T=sd(w))))):(de=j&~I,de!==0?T=sd(de):Q!==0?T=sd(Q):w||(w=j&~a,w!==0&&(T=sd(w)))),T===0?0:d!==0&&d!==T&&(d&I)===0&&(I=T&-T,w=d&-d,I>=w||I===32&&(w&4194048)!==0)?d:T}function Mb(a,d){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&d)===0}function g5(a,d){switch(a){case 1:case 2:case 4:case 8:case 64:return d+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Op(){var a=Ug;return Ug<<=1,(Ug&62914560)===0&&(Ug=4194304),a}function Np(a){for(var d=[],w=0;31>w;w++)d.push(a);return d}function uu(a,d){a.pendingLanes|=d,d!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function w5(a,d,w,j,T,I){var Q=a.pendingLanes;a.pendingLanes=w,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=w,a.entangledLanes&=w,a.errorRecoveryDisabledLanes&=w,a.shellSuspendCounter=0;var de=a.entanglements,tn=a.expirationTimes,Ln=a.hiddenUpdates;for(w=Q&~w;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var IA=/[\n"\\]/g;function Lh(a){return a.replace(IA,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function sv(a,d,w,j,T,I,Q,de){a.name="",Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?a.type=Q:a.removeAttribute("type"),d!=null?Q==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+_h(d)):a.value!==""+_h(d)&&(a.value=""+_h(d)):Q!=="submit"&&Q!=="reset"||a.removeAttribute("value"),d!=null?d6(a,Q,_h(d)):w!=null?d6(a,Q,_h(w)):j!=null&&a.removeAttribute("value"),T==null&&I!=null&&(a.defaultChecked=!!I),T!=null&&(a.checked=T&&typeof T!="function"&&typeof T!="symbol"),de!=null&&typeof de!="function"&&typeof de!="symbol"&&typeof de!="boolean"?a.name=""+_h(de):a.removeAttribute("name")}function sk(a,d,w,j,T,I,Q,de){if(I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(a.type=I),d!=null||w!=null){if(!(I!=="submit"&&I!=="reset"||d!=null)){j5(a);return}w=w!=null?""+_h(w):"",d=d!=null?""+_h(d):w,de||d===a.value||(a.value=d),a.defaultValue=d}j=j??T,j=typeof j!="function"&&typeof j!="symbol"&&!!j,a.checked=de?a.checked:!!j,a.defaultChecked=!!j,Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"&&(a.name=Q),j5(a)}function d6(a,d,w){d==="number"&&ov(a.ownerDocument)===a||a.defaultValue===""+w||(a.defaultValue=""+w)}function Wg(a,d,w,j){if(a=a.options,d){d={};for(var T=0;T"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$A=!1;if(ew)try{var g6={};Object.defineProperty(g6,"passive",{get:function(){$A=!0}}),window.addEventListener("test",g6,g6),window.removeEventListener("test",g6,g6)}catch{$A=!1}var $p=null,RA=null,fk=null;function MD(){if(fk)return fk;var a,d=RA,w=d.length,j,T="value"in $p?$p.value:$p.textContent,I=T.length;for(a=0;a=m6),DD=" ",_D=!1;function LD(a,d){switch(a){case"keyup":return _q.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function PD(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var A5=!1;function Pq(a,d){switch(a){case"compositionend":return PD(d);case"keypress":return d.which!==32?null:(_D=!0,DD);case"textInput":return a=d.data,a===DD&&_D?null:a;default:return null}}function $q(a,d){if(A5)return a==="compositionend"||!HA&&LD(a,d)?(a=MD(),fk=RA=$p=null,A5=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:w,offset:d-a};a=j}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=HD(w)}}function qD(a,d){return a&&d?a===d?!0:a&&a.nodeType===3?!1:d&&d.nodeType===3?qD(a,d.parentNode):"contains"in a?a.contains(d):a.compareDocumentPosition?!!(a.compareDocumentPosition(d)&16):!1:!1}function UD(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var d=ov(a.document);d instanceof a.HTMLIFrameElement;){try{var w=typeof d.contentWindow.location.href=="string"}catch{w=!1}if(w)a=d.contentWindow;else break;d=ov(a.document)}return d}function XA(a){var d=a&&a.nodeName&&a.nodeName.toLowerCase();return d&&(d==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||d==="textarea"||a.contentEditable==="true")}var qq=ew&&"documentMode"in document&&11>=document.documentMode,M5=null,KA=null,j6=null,VA=!1;function XD(a,d,w){var j=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;VA||M5==null||M5!==ov(j)||(j=M5,"selectionStart"in j&&XA(j)?j={start:j.selectionStart,end:j.selectionEnd}:(j=(j.ownerDocument&&j.ownerDocument.defaultView||window).getSelection(),j={anchorNode:j.anchorNode,anchorOffset:j.anchorOffset,focusNode:j.focusNode,focusOffset:j.focusOffset}),j6&&k6(j6,j)||(j6=j,j=tj(KA,"onSelect"),0>=Q,T-=Q,Cb=1<<32-Sf(d)+T|w<Hr?(ic=Xi,Xi=null):ic=Xi.sibling;var qc=Hn(Sn,Xi,Dn[Hr],ot);if(qc===null){Xi===null&&(Xi=ic);break}a&&Xi&&qc.alternate===null&&d(Sn,Xi),sn=I(qc,sn,Hr),_u===null?Hi=qc:_u.sibling=qc,_u=qc,Xi=ic}if(Hr===Dn.length)return w(Sn,Xi),ou&&tw(Sn,Hr),Hi;if(Xi===null){for(;HrHr?(ic=Xi,Xi=null):ic=Xi.sibling;var At=Hn(Sn,Xi,qc.value,ot);if(At===null){Xi===null&&(Xi=ic);break}a&&Xi&&At.alternate===null&&d(Sn,Xi),sn=I(At,sn,Hr),_u===null?Hi=At:_u.sibling=At,_u=At,Xi=ic}if(qc.done)return w(Sn,Xi),ou&&tw(Sn,Hr),Hi;if(Xi===null){for(;!qc.done;Hr++,qc=Dn.next())qc=gt(Sn,qc.value,ot),qc!==null&&(sn=I(qc,sn,Hr),_u===null?Hi=qc:_u.sibling=qc,_u=qc);return ou&&tw(Sn,Hr),Hi}for(Xi=j(Xi);!qc.done;Hr++,qc=Dn.next())qc=Zn(Xi,Sn,Hr,qc.value,ot),qc!==null&&(a&&qc.alternate!==null&&Xi.delete(qc.key===null?Hr:qc.key),sn=I(qc,sn,Hr),_u===null?Hi=qc:_u.sibling=qc,_u=qc);return a&&Xi.forEach(function(fX){return d(Sn,fX)}),ou&&tw(Sn,Hr),Hi}function co(Sn,sn,Dn,ot){if(typeof Dn=="object"&&Dn!==null&&Dn.type===ee&&Dn.key===null&&(Dn=Dn.props.children),typeof Dn=="object"&&Dn!==null){switch(Dn.$$typeof){case le:e:{for(var Hi=Dn.key;sn!==null;){if(sn.key===Hi){if(Hi=Dn.type,Hi===ee){if(sn.tag===7){w(Sn,sn.sibling),ot=T(sn,Dn.props.children),ot.return=Sn,Sn=ot;break e}}else if(sn.elementType===Hi||typeof Hi=="object"&&Hi!==null&&Hi.$$typeof===An&&wv(Hi)===sn.type){w(Sn,sn.sibling),ot=T(sn,Dn.props),O6(ot,Dn),ot.return=Sn,Sn=ot;break e}w(Sn,sn);break}else d(Sn,sn);sn=sn.sibling}Dn.type===ee?(ot=dv(Dn.props.children,Sn.mode,ot,Dn.key),ot.return=Sn,Sn=ot):(ot=yk(Dn.type,Dn.key,Dn.props,null,Sn.mode,ot),O6(ot,Dn),ot.return=Sn,Sn=ot)}return Q(Sn);case oe:e:{for(Hi=Dn.key;sn!==null;){if(sn.key===Hi)if(sn.tag===4&&sn.stateNode.containerInfo===Dn.containerInfo&&sn.stateNode.implementation===Dn.implementation){w(Sn,sn.sibling),ot=T(sn,Dn.children||[]),ot.return=Sn,Sn=ot;break e}else{w(Sn,sn);break}else d(Sn,sn);sn=sn.sibling}ot=tM(Dn,Sn.mode,ot),ot.return=Sn,Sn=ot}return Q(Sn);case An:return Dn=wv(Dn),co(Sn,sn,Dn,ot)}if(pn(Dn))return Di(Sn,sn,Dn,ot);if(bn(Dn)){if(Hi=bn(Dn),typeof Hi!="function")throw Error(M(150));return Dn=Hi.call(Dn),Cr(Sn,sn,Dn,ot)}if(typeof Dn.then=="function")return co(Sn,sn,xk(Dn),ot);if(Dn.$$typeof===ae)return co(Sn,sn,x6(Sn,Dn),ot);Ak(Sn,Dn)}return typeof Dn=="string"&&Dn!==""||typeof Dn=="number"||typeof Dn=="bigint"?(Dn=""+Dn,sn!==null&&sn.tag===6?(w(Sn,sn.sibling),ot=T(sn,Dn),ot.return=Sn,Sn=ot):(w(Sn,sn),ot=nM(Dn,Sn.mode,ot),ot.return=Sn,Sn=ot),Q(Sn)):w(Sn,sn)}return function(Sn,sn,Dn,ot){try{T6=0;var Hi=co(Sn,sn,Dn,ot);return B5=null,Hi}catch(Xi){if(Xi===R5||Xi===Ek)throw Xi;var _u=w1(29,Xi,null,Sn.mode);return _u.lanes=ot,_u.return=Sn,_u}}}var mv=b_(!0),g_=b_(!1),qp=!1;function gM(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wM(a,d){a=a.updateQueue,d.updateQueue===a&&(d.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Up(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Xp(a,d,w){var j=a.updateQueue;if(j===null)return null;if(j=j.shared,(Ju&2)!==0){var T=j.pending;return T===null?d.next=d:(d.next=T.next,T.next=d),j.pending=d,d=vk(a),e_(a,null,w),d}return mk(a,j,d,w),vk(a)}function N6(a,d,w){if(d=d.updateQueue,d!==null&&(d=d.shared,(w&4194048)!==0)){var j=d.lanes;j&=a.pendingLanes,w|=j,d.lanes=w,rv(a,w)}}function pM(a,d){var w=a.updateQueue,j=a.alternate;if(j!==null&&(j=j.updateQueue,w===j)){var T=null,I=null;if(w=w.firstBaseUpdate,w!==null){do{var Q={lane:w.lane,tag:w.tag,payload:w.payload,callback:null,next:null};I===null?T=I=Q:I=I.next=Q,w=w.next}while(w!==null);I===null?T=I=d:I=I.next=d}else T=I=d;w={baseState:j.baseState,firstBaseUpdate:T,lastBaseUpdate:I,shared:j.shared,callbacks:j.callbacks},a.updateQueue=w;return}a=w.lastBaseUpdate,a===null?w.firstBaseUpdate=d:a.next=d,w.lastBaseUpdate=d}var mM=!1;function I6(){if(mM){var a=$5;if(a!==null)throw a}}function D6(a,d,w,j){mM=!1;var T=a.updateQueue;qp=!1;var I=T.firstBaseUpdate,Q=T.lastBaseUpdate,de=T.shared.pending;if(de!==null){T.shared.pending=null;var tn=de,Ln=tn.next;tn.next=null,Q===null?I=Ln:Q.next=Ln,Q=tn;var it=a.alternate;it!==null&&(it=it.updateQueue,de=it.lastBaseUpdate,de!==Q&&(de===null?it.firstBaseUpdate=Ln:de.next=Ln,it.lastBaseUpdate=tn))}if(I!==null){var gt=T.baseState;Q=0,it=Ln=tn=null,de=I;do{var Hn=de.lane&-536870913,Zn=Hn!==de.lane;if(Zn?(nu&Hn)===Hn:(j&Hn)===Hn){Hn!==0&&Hn===P5&&(mM=!0),it!==null&&(it=it.next={lane:0,tag:de.tag,payload:de.payload,callback:null,next:null});e:{var Di=a,Cr=de;Hn=d;var co=w;switch(Cr.tag){case 1:if(Di=Cr.payload,typeof Di=="function"){gt=Di.call(co,gt,Hn);break e}gt=Di;break e;case 3:Di.flags=Di.flags&-65537|128;case 0:if(Di=Cr.payload,Hn=typeof Di=="function"?Di.call(co,gt,Hn):Di,Hn==null)break e;gt=W({},gt,Hn);break e;case 2:qp=!0}}Hn=de.callback,Hn!==null&&(a.flags|=64,Zn&&(a.flags|=8192),Zn=T.callbacks,Zn===null?T.callbacks=[Hn]:Zn.push(Hn))}else Zn={lane:Hn,tag:de.tag,payload:de.payload,callback:de.callback,next:null},it===null?(Ln=it=Zn,tn=gt):it=it.next=Zn,Q|=Hn;if(de=de.next,de===null){if(de=T.shared.pending,de===null)break;Zn=de,de=Zn.next,Zn.next=null,T.lastBaseUpdate=Zn,T.shared.pending=null}}while(!0);it===null&&(tn=gt),T.baseState=tn,T.firstBaseUpdate=Ln,T.lastBaseUpdate=it,I===null&&(T.shared.lanes=0),Wp|=Q,a.lanes=Q,a.memoizedState=gt}}function w_(a,d){if(typeof a!="function")throw Error(M(191,a));a.call(d)}function p_(a,d){var w=a.callbacks;if(w!==null)for(a.callbacks=null,a=0;aI?I:8;var Q=Ae.T,de={};Ae.T=de,$M(a,!1,d,w);try{var tn=T(),Ln=Ae.S;if(Ln!==null&&Ln(de,tn),tn!==null&&typeof tn=="object"&&typeof tn.then=="function"){var it=Zq(tn,j);$6(a,d,it,k1(a))}else $6(a,d,j,k1(a))}catch(gt){$6(a,d,{then:function(){},status:"rejected",reason:gt},k1())}finally{ve.p=I,Q!==null&&de.types!==null&&(Q.types=de.types),Ae.T=Q}}function LM(){}function P6(a,d,w,j){if(a.tag!==5)throw Error(M(476));var T=K_(a).queue;X_(a,T,d,nn,w===null?LM:function(){return Pk(a),w(j)})}function K_(a){var d=a.memoizedState;if(d!==null)return d;d={memoizedState:nn,baseState:nn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:uw,lastRenderedState:nn},next:null};var w={};return d.next={memoizedState:w,baseState:w,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:uw,lastRenderedState:w},next:null},a.memoizedState=d,a=a.alternate,a!==null&&(a.memoizedState=d),d}function Pk(a){var d=K_(a);d.next===null&&(d=a.alternate.memoizedState),$6(a,d.next.queue,{},k1())}function PM(){return ua(n4)}function V_(){return el().memoizedState}function Y_(){return el().memoizedState}function uU(a){for(var d=a.return;d!==null;){switch(d.tag){case 24:case 3:var w=k1();a=Up(w);var j=Xp(d,a,w);j!==null&&(zh(j,d,w),N6(j,d,w)),d={cache:fM()},a.payload=d;return}d=d.return}}function oU(a,d,w){var j=k1();w={lane:j,revertLane:0,gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null},$k(a)?W_(d,w):(w=ZA(a,d,w,j),w!==null&&(zh(w,a,j),RM(w,d,j)))}function Q_(a,d,w){var j=k1();$6(a,d,w,j)}function $6(a,d,w,j){var T={lane:j,revertLane:0,gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null};if($k(a))W_(d,T);else{var I=a.alternate;if(a.lanes===0&&(I===null||I.lanes===0)&&(I=d.lastRenderedReducer,I!==null))try{var Q=d.lastRenderedState,de=I(Q,w);if(T.hasEagerState=!0,T.eagerState=de,g1(de,Q))return mk(a,d,T,0),Do===null&&pk(),!1}catch{}if(w=ZA(a,d,T,j),w!==null)return zh(w,a,j),RM(w,d,j),!0}return!1}function $M(a,d,w,j){if(j={lane:2,revertLane:vC(),gesture:null,action:j,hasEagerState:!1,eagerState:null,next:null},$k(a)){if(d)throw Error(M(479))}else d=ZA(a,w,j,2),d!==null&&zh(d,a,2)}function $k(a){var d=a.alternate;return a===bc||d!==null&&d===bc}function W_(a,d){F5=Tk=!0;var w=a.pending;w===null?d.next=d:(d.next=w.next,w.next=d),a.pending=d}function RM(a,d,w){if((w&4194048)!==0){var j=d.lanes;j&=a.pendingLanes,w|=j,d.lanes=w,rv(a,w)}}var R6={readContext:ua,use:Ik,useCallback:Bs,useContext:Bs,useEffect:Bs,useImperativeHandle:Bs,useLayoutEffect:Bs,useInsertionEffect:Bs,useMemo:Bs,useReducer:Bs,useRef:Bs,useState:Bs,useDebugValue:Bs,useDeferredValue:Bs,useTransition:Bs,useSyncExternalStore:Bs,useId:Bs,useHostTransitionStatus:Bs,useFormState:Bs,useActionState:Bs,useOptimistic:Bs,useMemoCache:Bs,useCacheRefresh:Bs};R6.useEffectEvent=Bs;var sU={readContext:ua,use:Ik,useCallback:function(a,d){return sh().memoizedState=[a,d===void 0?null:d],a},useContext:ua,useEffect:R_,useImperativeHandle:function(a,d,w){w=w!=null?w.concat([a]):null,_k(4194308,4,J_.bind(null,d,a),w)},useLayoutEffect:function(a,d){return _k(4194308,4,a,d)},useInsertionEffect:function(a,d){_k(4,2,a,d)},useMemo:function(a,d){var w=sh();d=d===void 0?null:d;var j=a();if(vv){od(!0);try{a()}finally{od(!1)}}return w.memoizedState=[j,d],j},useReducer:function(a,d,w){var j=sh();if(w!==void 0){var T=w(d);if(vv){od(!0);try{w(d)}finally{od(!1)}}}else T=d;return j.memoizedState=j.baseState=T,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:T},j.queue=a,a=a.dispatch=oU.bind(null,bc,a),[j.memoizedState,a]},useRef:function(a){var d=sh();return a={current:a},d.memoizedState=a},useState:function(a){a=OM(a);var d=a.queue,w=Q_.bind(null,bc,d);return d.dispatch=w,[a.memoizedState,w]},useDebugValue:DM,useDeferredValue:function(a,d){var w=sh();return _M(w,a,d)},useTransition:function(){var a=OM(!1);return a=X_.bind(null,bc,a.queue,!0,!1),sh().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,d,w){var j=bc,T=sh();if(ou){if(w===void 0)throw Error(M(407));w=w()}else{if(w=d(),Do===null)throw Error(M(349));(nu&127)!==0||E_(j,d,w)}T.memoizedState=w;var I={value:w,getSnapshot:d};return T.queue=I,R_(tU.bind(null,j,I,a),[a]),j.flags|=2048,H5(9,{destroy:void 0},S_.bind(null,j,I,w,d),null),w},useId:function(){var a=sh(),d=Do.identifierPrefix;if(ou){var w=Tb,j=Cb;w=(j&~(1<<32-Sf(j)-1)).toString(32)+w,d="_"+d+"R_"+w,w=Ok++,0<\/script>",I=I.removeChild(I.firstChild);break;case"select":I=typeof j.is=="string"?Q.createElement("select",{is:j.is}):Q.createElement("select"),j.multiple?I.multiple=!0:j.size&&(I.size=j.size);break;default:I=typeof j.is=="string"?Q.createElement(T,{is:j.is}):Q.createElement(T)}}I[Ws]=d,I[xf]=j;e:for(Q=d.child;Q!==null;){if(Q.tag===5||Q.tag===6)I.appendChild(Q.stateNode);else if(Q.tag!==4&&Q.tag!==27&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===d)break e;for(;Q.sibling===null;){if(Q.return===null||Q.return===d)break e;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}d.stateNode=I;e:switch(sa(I,T,j),T){case"button":case"input":case"select":case"textarea":j=!!j.autoFocus;break e;case"img":j=!0;break e;default:j=!1}j&&b0(d)}}return yo(d),WM(d,d.type,a===null?null:a.memoizedProps,d.pendingProps,w),null;case 6:if(a&&d.stateNode!=null)a.memoizedProps!==j&&b0(d);else{if(typeof j!="string"&&d.stateNode===null)throw Error(M(166));if(a=di.current,D5(d)){if(a=d.stateNode,w=d.memoizedProps,j=null,T=ca,T!==null)switch(T.tag){case 27:case 5:j=T.memoizedProps}a[Ws]=d,a=!!(a.nodeValue===w||j!==null&&j.suppressHydrationWarning===!0||sP(a.nodeValue,w)),a||zp(d,!0)}else a=ij(a).createTextNode(j),a[Ws]=d,d.stateNode=a}return yo(d),null;case 31:if(w=d.memoizedState,a===null||a.memoizedState!==null){if(j=D5(d),w!==null){if(a===null){if(!j)throw Error(M(318));if(a=d.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(M(557));a[Ws]=d}else bv(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;yo(d),a=!1}else w=_5(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=w),a=!0;if(!a)return d.flags&256?(m1(d),d):(m1(d),null);if((d.flags&128)!==0)throw Error(M(558))}return yo(d),null;case 13:if(j=d.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(T=D5(d),j!==null&&j.dehydrated!==null){if(a===null){if(!T)throw Error(M(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(M(317));T[Ws]=d}else bv(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;yo(d),T=!1}else T=_5(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=T),T=!0;if(!T)return d.flags&256?(m1(d),d):(m1(d),null)}return m1(d),(d.flags&128)!==0?(d.lanes=w,d):(w=j!==null,a=a!==null&&a.memoizedState!==null,w&&(j=d.child,T=null,j.alternate!==null&&j.alternate.memoizedState!==null&&j.alternate.memoizedState.cachePool!==null&&(T=j.alternate.memoizedState.cachePool.pool),I=null,j.memoizedState!==null&&j.memoizedState.cachePool!==null&&(I=j.memoizedState.cachePool.pool),I!==T&&(j.flags|=2048)),w!==a&&w&&(d.child.flags|=8192),Fk(d,d.updateQueue),yo(d),null);case 4:return si(),a===null&&EC(d.stateNode.containerInfo),yo(d),null;case 10:return rw(d.type),yo(d),null;case 19:if(Re(Zs),j=d.memoizedState,j===null)return yo(d),null;if(T=(d.flags&128)!==0,I=j.rendering,I===null)if(T)kv(j,!1);else{if(zs!==0||a!==null&&(a.flags&128)!==0)for(a=d.child;a!==null;){if(I=Ck(a),I!==null){for(d.flags|=128,kv(j,!1),a=I.updateQueue,d.updateQueue=a,Fk(d,a),d.subtreeFlags=0,a=w,w=d.child;w!==null;)n_(w,a),w=w.sibling;return tt(Zs,Zs.current&1|2),ou&&tw(d,j.treeForkCount),d.child}a=a.sibling}j.tail!==null&&Sl()>Xk&&(d.flags|=128,T=!0,kv(j,!1),d.lanes=4194304)}else{if(!T)if(a=Ck(I),a!==null){if(d.flags|=128,T=!0,a=a.updateQueue,d.updateQueue=a,Fk(d,a),kv(j,!0),j.tail===null&&j.tailMode==="hidden"&&!I.alternate&&!ou)return yo(d),null}else 2*Sl()-j.renderingStartTime>Xk&&w!==536870912&&(d.flags|=128,T=!0,kv(j,!1),d.lanes=4194304);j.isBackwards?(I.sibling=d.child,d.child=I):(a=j.last,a!==null?a.sibling=I:d.child=I,j.last=I)}return j.tail!==null?(a=j.tail,j.rendering=a,j.tail=a.sibling,j.renderingStartTime=Sl(),a.sibling=null,w=Zs.current,tt(Zs,T?w&1|2:w&1),ou&&tw(d,j.treeForkCount),a):(yo(d),null);case 22:case 23:return m1(d),yM(),j=d.memoizedState!==null,a!==null?a.memoizedState!==null!==j&&(d.flags|=8192):j&&(d.flags|=8192),j?(w&536870912)!==0&&(d.flags&128)===0&&(yo(d),d.subtreeFlags&6&&(d.flags|=8192)):yo(d),w=d.updateQueue,w!==null&&Fk(d,w.retryQueue),w=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(w=a.memoizedState.cachePool.pool),j=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(j=d.memoizedState.cachePool.pool),j!==w&&(d.flags|=2048),a!==null&&Re(gv),null;case 24:return w=null,a!==null&&(w=a.memoizedState.cache),d.memoizedState.cache!==w&&(d.flags|=2048),rw(Al),yo(d),null;case 25:return null;case 30:return null}throw Error(M(156,d.tag))}function hU(a,d){switch(rM(d),d.tag){case 1:return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 3:return rw(Al),si(),a=d.flags,(a&65536)!==0&&(a&128)===0?(d.flags=a&-65537|128,d):null;case 26:case 27:case 5:return Er(d),null;case 31:if(d.memoizedState!==null){if(m1(d),d.alternate===null)throw Error(M(340));bv()}return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 13:if(m1(d),a=d.memoizedState,a!==null&&a.dehydrated!==null){if(d.alternate===null)throw Error(M(340));bv()}return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 19:return Re(Zs),null;case 4:return si(),null;case 10:return rw(d.type),null;case 22:case 23:return m1(d),yM(),a!==null&&Re(gv),a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 24:return rw(Al),null;case 25:return null;default:return null}}function ZM(a,d){switch(rM(d),d.tag){case 3:rw(Al),si();break;case 26:case 27:case 5:Er(d);break;case 4:si();break;case 31:d.memoizedState!==null&&m1(d);break;case 13:m1(d);break;case 19:Re(Zs);break;case 10:rw(d.type);break;case 22:case 23:m1(d),yM(),a!==null&&Re(gv);break;case 24:rw(Al)}}function F6(a,d){try{var w=d.updateQueue,j=w!==null?w.lastEffect:null;if(j!==null){var T=j.next;w=T;do{if((w.tag&a)===a){j=void 0;var I=w.create,Q=w.inst;j=I(),Q.destroy=j}w=w.next}while(w!==T)}}catch(de){ro(d,d.return,de)}}function Yp(a,d,w){try{var j=d.updateQueue,T=j!==null?j.lastEffect:null;if(T!==null){var I=T.next;j=I;do{if((j.tag&a)===a){var Q=j.inst,de=Q.destroy;if(de!==void 0){Q.destroy=void 0,T=d;var tn=w,Ln=de;try{Ln()}catch(it){ro(T,tn,it)}}}j=j.next}while(j!==I)}}catch(it){ro(d,d.return,it)}}function J6(a){var d=a.updateQueue;if(d!==null){var w=a.stateNode;try{p_(d,w)}catch(j){ro(a,a.return,j)}}}function vL(a,d,w){w.props=yv(a.type,a.memoizedProps),w.state=a.memoizedState;try{w.componentWillUnmount()}catch(j){ro(a,d,j)}}function H6(a,d){try{var w=a.ref;if(w!==null){switch(a.tag){case 26:case 27:case 5:var j=a.stateNode;break;case 30:j=a.stateNode;break;default:j=a.stateNode}typeof w=="function"?a.refCleanup=w(j):w.current=j}}catch(T){ro(a,d,T)}}function Ob(a,d){var w=a.ref,j=a.refCleanup;if(w!==null)if(typeof j=="function")try{j()}catch(T){ro(a,d,T)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof w=="function")try{w(null)}catch(T){ro(a,d,T)}else w.current=null}function G6(a){var d=a.type,w=a.memoizedProps,j=a.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":w.autoFocus&&j.focus();break e;case"img":w.src?j.src=w.src:w.srcSet&&(j.srcset=w.srcSet)}}catch(T){ro(a,a.return,T)}}function eC(a,d,w){try{var j=a.stateNode;DU(j,a.type,w,d),j[xf]=d}catch(T){ro(a,a.return,T)}}function yL(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&i2(a.type)||a.tag===4}function nC(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||yL(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&i2(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function tC(a,d,w){var j=a.tag;if(j===5||j===6)a=a.stateNode,d?(w.nodeType===9?w.body:w.nodeName==="HTML"?w.ownerDocument.body:w).insertBefore(a,d):(d=w.nodeType===9?w.body:w.nodeName==="HTML"?w.ownerDocument.body:w,d.appendChild(a),w=w._reactRootContainer,w!=null||d.onclick!==null||(d.onclick=Zg));else if(j!==4&&(j===27&&i2(a.type)&&(w=a.stateNode,d=null),a=a.child,a!==null))for(tC(a,d,w),a=a.sibling;a!==null;)tC(a,d,w),a=a.sibling}function jv(a,d,w){var j=a.tag;if(j===5||j===6)a=a.stateNode,d?w.insertBefore(a,d):w.appendChild(a);else if(j!==4&&(j===27&&i2(a.type)&&(w=a.stateNode),a=a.child,a!==null))for(jv(a,d,w),a=a.sibling;a!==null;)jv(a,d,w),a=a.sibling}function kL(a){var d=a.stateNode,w=a.memoizedProps;try{for(var j=a.type,T=d.attributes;T.length;)d.removeAttributeNode(T[0]);sa(d,j,w),d[Ws]=a,d[xf]=w}catch(I){ro(a,a.return,I)}}var Nb=!1,Tl=!1,q6=!1,iC=typeof WeakSet=="function"?WeakSet:Set,Af=null;function dU(a,d){if(a=a.containerInfo,AC=Mf,a=UD(a),XA(a)){if("selectionStart"in a)var w={start:a.selectionStart,end:a.selectionEnd};else e:{w=(w=a.ownerDocument)&&w.defaultView||window;var j=w.getSelection&&w.getSelection();if(j&&j.rangeCount!==0){w=j.anchorNode;var T=j.anchorOffset,I=j.focusNode;j=j.focusOffset;try{w.nodeType,I.nodeType}catch{w=null;break e}var Q=0,de=-1,tn=-1,Ln=0,it=0,gt=a,Hn=null;n:for(;;){for(var Zn;gt!==w||T!==0&>.nodeType!==3||(de=Q+T),gt!==I||j!==0&>.nodeType!==3||(tn=Q+j),gt.nodeType===3&&(Q+=gt.nodeValue.length),(Zn=gt.firstChild)!==null;)Hn=gt,gt=Zn;for(;;){if(gt===a)break n;if(Hn===w&&++Ln===T&&(de=Q),Hn===I&&++it===j&&(tn=Q),(Zn=gt.nextSibling)!==null)break;gt=Hn,Hn=gt.parentNode}gt=Zn}w=de===-1||tn===-1?null:{start:de,end:tn}}else w=null}w=w||{start:0,end:0}}else w=null;for(MC={focusedElem:a,selectionRange:w},Mf=!1,Af=d;Af!==null;)if(d=Af,a=d.child,(d.subtreeFlags&1028)!==0&&a!==null)a.return=d,Af=a;else for(;Af!==null;){switch(d=Af,I=d.alternate,a=d.flags,d.tag){case 0:if((a&4)!==0&&(a=d.updateQueue,a=a!==null?a.events:null,a!==null))for(w=0;w title"))),sa(I,j,w),I[Ws]=a,xl(I),j=I;break e;case"link":var Q=kP("link","href",T).get(j+(w.href||""));if(Q){for(var de=0;deco&&(Q=co,co=Cr,Cr=Q);var Sn=GD(de,Cr),sn=GD(de,co);if(Sn&&sn&&(Zn.rangeCount!==1||Zn.anchorNode!==Sn.node||Zn.anchorOffset!==Sn.offset||Zn.focusNode!==sn.node||Zn.focusOffset!==sn.offset)){var Dn=gt.createRange();Dn.setStart(Sn.node,Sn.offset),Zn.removeAllRanges(),Cr>co?(Zn.addRange(Dn),Zn.extend(sn.node,sn.offset)):(Dn.setEnd(sn.node,sn.offset),Zn.addRange(Dn))}}}}for(gt=[],Zn=de;Zn=Zn.parentNode;)Zn.nodeType===1&>.push({element:Zn,left:Zn.scrollLeft,top:Zn.scrollTop});for(typeof de.focus=="function"&&de.focus(),de=0;dew?32:w,Ae.T=null,w=fC,fC=null;var I=e2,Q=hw;if(nf=0,K5=e2=null,hw=0,(Ju&6)!==0)throw Error(M(331));var de=Ju;if(Ju|=4,NL(I.current),CL(I,I.current,Q,w),Ju=de,Q6(0,!1),ra&&typeof ra.onPostCommitFiberRoot=="function")try{ra.onPostCommitFiberRoot(Ab,I)}catch{}return!0}finally{ve.p=T,Ae.T=j,VL(a,d)}}function QL(a,d,w){d=fd(w,d),d=HM(a.stateNode,d,2),a=Xp(a,d,2),a!==null&&(uu(a,2),Ib(a))}function ro(a,d,w){if(a.tag===3)QL(a,a,w);else for(;d!==null;){if(d.tag===3){QL(d,a,w);break}else if(d.tag===1){var j=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof j.componentDidCatch=="function"&&(Zp===null||!Zp.has(j))){a=fd(w,a),w=rL(2),j=Xp(d,w,2),j!==null&&(cL(w,j,d,a),uu(j,2),Ib(j));break}}d=d.return}}function bC(a,d,w){var j=a.pingCache;if(j===null){j=a.pingCache=new wU;var T=new Set;j.set(d,T)}else T=j.get(d),T===void 0&&(T=new Set,j.set(d,T));T.has(w)||(uC=!0,T.add(w),a=kU.bind(null,a,d,w),d.then(a,a))}function kU(a,d,w){var j=a.pingCache;j!==null&&j.delete(d),a.pingedLanes|=a.suspendedLanes&w,a.warmLanes&=~w,Do===a&&(nu&w)===w&&(zs===4||zs===3&&(nu&62914560)===nu&&300>Sl()-Uk?(Ju&2)===0&&V5(a,0):oC|=w,X5===nu&&(X5=0)),Ib(a)}function WL(a,d){d===0&&(d=Op()),a=hv(a,d),a!==null&&(uu(a,d),Ib(a))}function jU(a){var d=a.memoizedState,w=0;d!==null&&(w=d.retryLane),WL(a,w)}function EU(a,d){var w=0;switch(a.tag){case 31:case 13:var j=a.stateNode,T=a.memoizedState;T!==null&&(w=T.retryLane);break;case 19:j=a.stateNode;break;case 22:j=a.stateNode._retryCache;break;default:throw Error(M(314))}j!==null&&j.delete(d),WL(a,w)}function SU(a,d){return Oa(a,d)}var Zk=null,Q5=null,gC=!1,ej=!1,wC=!1,t2=0;function Ib(a){a!==Q5&&a.next===null&&(Q5===null?Zk=Q5=a:Q5=Q5.next=a),ej=!0,gC||(gC=!0,mC())}function Q6(a,d){if(!wC&&ej){wC=!0;do for(var w=!1,j=Zk;j!==null;){if(a!==0){var T=j.pendingLanes;if(T===0)var I=0;else{var Q=j.suspendedLanes,de=j.pingedLanes;I=(1<<31-Sf(42|a)+1)-1,I&=T&~(Q&~de),I=I&201326741?I&201326741|1:I?I|2:0}I!==0&&(w=!0,nP(j,I))}else I=nu,I=Xg(j,j===Do?I:0,j.cancelPendingCommit!==null||j.timeoutHandle!==-1),(I&3)===0||Mb(j,I)||(w=!0,nP(j,I));j=j.next}while(w);wC=!1}}function xU(){ZL()}function ZL(){ej=gC=!1;var a=0;t2!==0&&LU()&&(a=t2);for(var d=Sl(),w=null,j=Zk;j!==null;){var T=j.next,I=pC(j,d);I===0?(j.next=null,w===null?Zk=T:w.next=T,T===null&&(Q5=w)):(w=j,(a!==0||(I&3)!==0)&&(ej=!0)),j=T}nf!==0&&nf!==5||Q6(a),t2!==0&&(t2=0)}function pC(a,d){for(var w=a.suspendedLanes,j=a.pingedLanes,T=a.expirationTimes,I=a.pendingLanes&-62914561;0de)break;var it=tn.transferSize,gt=tn.initiatorType;it&&lP(gt)&&(tn=tn.responseEnd,Q+=it*(tn"u"?null:document;function pP(a,d,w){var j=W5;if(j&&typeof d=="string"&&d){var T=Lh(d);T='link[rel="'+a+'"][href="'+T+'"]',typeof w=="string"&&(T+='[crossorigin="'+w+'"]'),_C.has(T)||(_C.add(T),a={rel:a,crossOrigin:w,href:d},j.querySelector(T)===null&&(d=j.createElement("link"),sa(d,"link",a),xl(d),j.head.appendChild(d)))}}function GU(a){p0.D(a),pP("dns-prefetch",a,null)}function qU(a,d){p0.C(a,d),pP("preconnect",a,d)}function LC(a,d,w){p0.L(a,d,w);var j=W5;if(j&&a&&d){var T='link[rel="preload"][as="'+Lh(d)+'"]';d==="image"&&w&&w.imageSrcSet?(T+='[imagesrcset="'+Lh(w.imageSrcSet)+'"]',typeof w.imageSizes=="string"&&(T+='[imagesizes="'+Lh(w.imageSizes)+'"]')):T+='[href="'+Lh(a)+'"]';var I=T;switch(d){case"style":I=Z5(a);break;case"script":I=e4(a)}E1.has(I)||(a=W({rel:"preload",href:d==="image"&&w&&w.imageSrcSet?void 0:a,as:d},w),E1.set(I,a),j.querySelector(T)!==null||d==="style"&&j.querySelector(xv(I))||d==="script"&&j.querySelector(t9(I))||(d=j.createElement("link"),sa(d,"link",a),xl(d),j.head.appendChild(d)))}}function UU(a,d){p0.m(a,d);var w=W5;if(w&&a){var j=d&&typeof d.as=="string"?d.as:"script",T='link[rel="modulepreload"][as="'+Lh(j)+'"][href="'+Lh(a)+'"]',I=T;switch(j){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":I=e4(a)}if(!E1.has(I)&&(a=W({rel:"modulepreload",href:a},d),E1.set(I,a),w.querySelector(T)===null)){switch(j){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(w.querySelector(t9(I)))return}j=w.createElement("link"),sa(j,"link",a),xl(j),w.head.appendChild(j)}}}function XU(a,d,w){p0.S(a,d,w);var j=W5;if(j&&a){var T=Lp(j).hoistableStyles,I=Z5(a);d=d||"default";var Q=T.get(I);if(!Q){var de={loading:0,preload:null};if(Q=j.querySelector(xv(I)))de.loading=5;else{a=W({rel:"stylesheet",href:a,"data-precedence":d},w),(w=E1.get(I))&&RC(a,w);var tn=Q=j.createElement("link");xl(tn),sa(tn,"link",a),tn._p=new Promise(function(Ln,it){tn.onload=Ln,tn.onerror=it}),tn.addEventListener("load",function(){de.loading|=1}),tn.addEventListener("error",function(){de.loading|=2}),de.loading|=4,uj(Q,d,j)}Q={type:"stylesheet",instance:Q,count:1,state:de},T.set(I,Q)}}}function KU(a,d){p0.X(a,d);var w=W5;if(w&&a){var j=Lp(w).hoistableScripts,T=e4(a),I=j.get(T);I||(I=w.querySelector(t9(T)),I||(a=W({src:a,async:!0},d),(d=E1.get(T))&&BC(a,d),I=w.createElement("script"),xl(I),sa(I,"link",a),w.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},j.set(T,I))}}function PC(a,d){p0.M(a,d);var w=W5;if(w&&a){var j=Lp(w).hoistableScripts,T=e4(a),I=j.get(T);I||(I=w.querySelector(t9(T)),I||(a=W({src:a,async:!0,type:"module"},d),(d=E1.get(T))&&BC(a,d),I=w.createElement("script"),xl(I),sa(I,"link",a),w.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},j.set(T,I))}}function mP(a,d,w,j){var T=(T=di.current)?cj(T):null;if(!T)throw Error(M(446));switch(a){case"meta":case"title":return null;case"style":return typeof w.precedence=="string"&&typeof w.href=="string"?(d=Z5(w.href),w=Lp(T).hoistableStyles,j=w.get(d),j||(j={type:"style",instance:null,count:0,state:null},w.set(d,j)),j):{type:"void",instance:null,count:0,state:null};case"link":if(w.rel==="stylesheet"&&typeof w.href=="string"&&typeof w.precedence=="string"){a=Z5(w.href);var I=Lp(T).hoistableStyles,Q=I.get(a);if(Q||(T=T.ownerDocument||T,Q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},I.set(a,Q),(I=T.querySelector(xv(a)))&&!I._p&&(Q.instance=I,Q.state.loading=5),E1.has(a)||(w={rel:"preload",as:"style",href:w.href,crossOrigin:w.crossOrigin,integrity:w.integrity,media:w.media,hrefLang:w.hrefLang,referrerPolicy:w.referrerPolicy},E1.set(a,w),I||$C(T,a,w,Q.state))),d&&j===null)throw Error(M(528,""));return Q}if(d&&j!==null)throw Error(M(529,""));return null;case"script":return d=w.async,w=w.src,typeof w=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=e4(w),w=Lp(T).hoistableScripts,j=w.get(d),j||(j={type:"script",instance:null,count:0,state:null},w.set(d,j)),j):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,a))}}function Z5(a){return'href="'+Lh(a)+'"'}function xv(a){return'link[rel="stylesheet"]['+a+"]"}function vP(a){return W({},a,{"data-precedence":a.precedence,precedence:null})}function $C(a,d,w,j){a.querySelector('link[rel="preload"][as="style"]['+d+"]")?j.loading=1:(d=a.createElement("link"),j.preload=d,d.addEventListener("load",function(){return j.loading|=1}),d.addEventListener("error",function(){return j.loading|=2}),sa(d,"link",w),xl(d),a.head.appendChild(d))}function e4(a){return'[src="'+Lh(a)+'"]'}function t9(a){return"script[async]"+a}function yP(a,d,w){if(d.count++,d.instance===null)switch(d.type){case"style":var j=a.querySelector('style[data-href~="'+Lh(w.href)+'"]');if(j)return d.instance=j,xl(j),j;var T=W({},w,{"data-href":w.href,"data-precedence":w.precedence,href:null,precedence:null});return j=(a.ownerDocument||a).createElement("style"),xl(j),sa(j,"style",T),uj(j,w.precedence,a),d.instance=j;case"stylesheet":T=Z5(w.href);var I=a.querySelector(xv(T));if(I)return d.state.loading|=4,d.instance=I,xl(I),I;j=vP(w),(T=E1.get(T))&&RC(j,T),I=(a.ownerDocument||a).createElement("link"),xl(I);var Q=I;return Q._p=new Promise(function(de,tn){Q.onload=de,Q.onerror=tn}),sa(I,"link",j),d.state.loading|=4,uj(I,w.precedence,a),d.instance=I;case"script":return I=e4(w.src),(T=a.querySelector(t9(I)))?(d.instance=T,xl(T),T):(j=w,(T=E1.get(I))&&(j=W({},w),BC(j,T)),a=a.ownerDocument||a,T=a.createElement("script"),xl(T),sa(T,"link",j),a.head.appendChild(T),d.instance=T);case"void":return null;default:throw Error(M(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(j=d.instance,d.state.loading|=4,uj(j,w.precedence,a));return d.instance}function uj(a,d,w){for(var j=w.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),T=j.length?j[j.length-1]:null,I=T,Q=0;Q title"):null)}function VU(a,d,w){if(w===1||d.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;return d.rel==="stylesheet"?(a=d.disabled,typeof d.precedence=="string"&&a==null):!0;case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function EP(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function YU(a,d,w,j){if(w.type==="stylesheet"&&(typeof j.media!="string"||matchMedia(j.media).matches!==!1)&&(w.state.loading&4)===0){if(w.instance===null){var T=Z5(j.href),I=d.querySelector(xv(T));if(I){d=I._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(a.count++,a=i9.bind(a),d.then(a,a)),w.state.loading|=4,w.instance=I,xl(I);return}I=d.ownerDocument||d,j=vP(j),(T=E1.get(T))&&RC(j,T),I=I.createElement("link"),xl(I);var Q=I;Q._p=new Promise(function(de,tn){Q.onload=de,Q.onerror=tn}),sa(I,"link",j),w.instance=I}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(w,d),(d=w.state.preload)&&(w.state.loading&3)===0&&(a.count++,w=i9.bind(a),d.addEventListener("load",w),d.addEventListener("error",w))}}var zC=0;function QU(a,d){return a.stylesheets&&a.count===0&&Av(a,a.stylesheets),0zC?50:800)+d);return a.unsuspend=w,function(){a.unsuspend=null,clearTimeout(j),clearTimeout(T)}}:null}function i9(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Av(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var r9=null;function Av(a,d){a.stylesheets=null,a.unsuspend!==null&&(a.count++,r9=new Map,d.forEach(c9,a),r9=null,i9.call(a))}function c9(a,d){if(!(d.state.loading&4)){var w=r9.get(a);if(w)var j=w.get(null);else{w=new Map,r9.set(a,w);for(var T=a.querySelectorAll("link[data-precedence],style[data-precedence]"),I=0;I"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g)}catch(E){console.error(E)}}return g(),O7e.exports=fzn(),O7e.exports}var hzn=azn();function Ta(g){if(typeof g=="string"||typeof g=="number")return""+g;let E="";if(Array.isArray(g))for(let x=0,M;x{}};function Oue(){for(var g=0,E=arguments.length,x={},M;g=0&&(M=x.slice(N+1),x=x.slice(0,N)),x&&!E.hasOwnProperty(x))throw new Error("unknown type: "+x);return{type:x,name:M}})}hue.prototype=Oue.prototype={constructor:hue,on:function(g,E){var x=this._,M=bzn(g+"",x),N,$=-1,k=M.length;if(arguments.length<2){for(;++$0)for(var x=new Array(N),M=0,N,$;M=0&&(E=g.slice(0,x))!=="xmlns"&&(g=g.slice(x+1)),Xhn.hasOwnProperty(E)?{space:Xhn[E],local:g}:g}function wzn(g){return function(){var E=this.ownerDocument,x=this.namespaceURI;return x===Z7e&&E.documentElement.namespaceURI===Z7e?E.createElement(g):E.createElementNS(x,g)}}function pzn(g){return function(){return this.ownerDocument.createElementNS(g.space,g.local)}}function ldn(g){var E=Nue(g);return(E.local?pzn:wzn)(E)}function mzn(){}function gke(g){return g==null?mzn:function(){return this.querySelector(g)}}function vzn(g){typeof g!="function"&&(g=gke(g));for(var E=this._groups,x=E.length,M=new Array(x),N=0;N=ae&&(ae=$e+1);!(Ue=Ce[ae])&&++ae=0;)(k=M[N])&&($&&k.compareDocumentPosition($)^4&&$.parentNode.insertBefore(k,$),$=k);return this}function Gzn(g){g||(g=qzn);function E(W,Z){return W&&Z?g(W.__data__,Z.__data__):!W-!Z}for(var x=this._groups,M=x.length,N=new Array(M),$=0;$E?1:g>=E?0:NaN}function Uzn(){var g=arguments[0];return arguments[0]=this,g.apply(null,arguments),this}function Xzn(){return Array.from(this)}function Kzn(){for(var g=this._groups,E=0,x=g.length;E1?this.each((E==null?cFn:typeof E=="function"?oFn:uFn)(g,E,x??"")):bD(this.node(),g)}function bD(g,E){return g.style.getPropertyValue(E)||bdn(g).getComputedStyle(g,null).getPropertyValue(E)}function lFn(g){return function(){delete this[g]}}function fFn(g,E){return function(){this[g]=E}}function aFn(g,E){return function(){var x=E.apply(this,arguments);x==null?delete this[g]:this[g]=x}}function hFn(g,E){return arguments.length>1?this.each((E==null?lFn:typeof E=="function"?aFn:fFn)(g,E)):this.node()[g]}function gdn(g){return g.trim().split(/^|\s+/)}function wke(g){return g.classList||new wdn(g)}function wdn(g){this._node=g,this._names=gdn(g.getAttribute("class")||"")}wdn.prototype={add:function(g){var E=this._names.indexOf(g);E<0&&(this._names.push(g),this._node.setAttribute("class",this._names.join(" ")))},remove:function(g){var E=this._names.indexOf(g);E>=0&&(this._names.splice(E,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(g){return this._names.indexOf(g)>=0}};function pdn(g,E){for(var x=wke(g),M=-1,N=E.length;++M=0&&(x=E.slice(M+1),E=E.slice(0,M)),{type:E,name:x}})}function zFn(g){return function(){var E=this.__on;if(E){for(var x=0,M=-1,N=E.length,$;x()=>g;function eke(g,{sourceEvent:E,subject:x,target:M,identifier:N,active:$,x:k,y:H,dx:U,dy:G,dispatch:ie}){Object.defineProperties(this,{type:{value:g,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},subject:{value:x,enumerable:!0,configurable:!0},target:{value:M,enumerable:!0,configurable:!0},identifier:{value:N,enumerable:!0,configurable:!0},active:{value:$,enumerable:!0,configurable:!0},x:{value:k,enumerable:!0,configurable:!0},y:{value:H,enumerable:!0,configurable:!0},dx:{value:U,enumerable:!0,configurable:!0},dy:{value:G,enumerable:!0,configurable:!0},_:{value:ie}})}eke.prototype.on=function(){var g=this._.on.apply(this._,arguments);return g===this._?this:g};function YFn(g){return!g.ctrlKey&&!g.button}function QFn(){return this.parentNode}function WFn(g,E){return E??{x:g.x,y:g.y}}function ZFn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Edn(){var g=YFn,E=QFn,x=WFn,M=ZFn,N={},$=Oue("start","drag","end"),k=0,H,U,G,ie,W=0;function Z(Ne){Ne.on("mousedown.drag",le).filter(M).on("touchstart.drag",Ce).on("touchmove.drag",pe,VFn).on("touchend.drag touchcancel.drag",$e).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function le(Ne,Ue){if(!(ie||!g.call(this,Ne,Ue))){var ln=ae(this,E.call(this,Ne,Ue),Ne,Ue,"mouse");ln&&(Fg(Ne.view).on("mousemove.drag",oe,HG).on("mouseup.drag",ee,HG),kdn(Ne.view),_7e(Ne),G=!1,H=Ne.clientX,U=Ne.clientY,ln("start",Ne))}}function oe(Ne){if(hD(Ne),!G){var Ue=Ne.clientX-H,ln=Ne.clientY-U;G=Ue*Ue+ln*ln>W}N.mouse("drag",Ne)}function ee(Ne){Fg(Ne.view).on("mousemove.drag mouseup.drag",null),jdn(Ne.view,G),hD(Ne),N.mouse("end",Ne)}function Ce(Ne,Ue){if(g.call(this,Ne,Ue)){var ln=Ne.changedTouches,un=E.call(this,Ne,Ue),An=ln.length,xn,nt;for(xn=0;xn>8&15|E>>4&240,E>>4&15|E&240,(E&15)<<4|E&15,1):x===8?Wce(E>>24&255,E>>16&255,E>>8&255,(E&255)/255):x===4?Wce(E>>12&15|E>>8&240,E>>8&15|E>>4&240,E>>4&15|E&240,((E&15)<<4|E&15)/255):null):(E=nJn.exec(g))?new Sb(E[1],E[2],E[3],1):(E=tJn.exec(g))?new Sb(E[1]*255/100,E[2]*255/100,E[3]*255/100,1):(E=iJn.exec(g))?Wce(E[1],E[2],E[3],E[4]):(E=rJn.exec(g))?Wce(E[1]*255/100,E[2]*255/100,E[3]*255/100,E[4]):(E=cJn.exec(g))?e1n(E[1],E[2]/100,E[3]/100,1):(E=uJn.exec(g))?e1n(E[1],E[2]/100,E[3]/100,E[4]):Khn.hasOwnProperty(g)?Qhn(Khn[g]):g==="transparent"?new Sb(NaN,NaN,NaN,0):null}function Qhn(g){return new Sb(g>>16&255,g>>8&255,g&255,1)}function Wce(g,E,x,M){return M<=0&&(g=E=x=NaN),new Sb(g,E,x,M)}function lJn(g){return g instanceof nq||(g=xA(g)),g?(g=g.rgb(),new Sb(g.r,g.g,g.b,g.opacity)):new Sb}function nke(g,E,x,M){return arguments.length===1?lJn(g):new Sb(g,E,x,M??1)}function Sb(g,E,x,M){this.r=+g,this.g=+E,this.b=+x,this.opacity=+M}pke(Sb,nke,Sdn(nq,{brighter(g){return g=g==null?mue:Math.pow(mue,g),new Sb(this.r*g,this.g*g,this.b*g,this.opacity)},darker(g){return g=g==null?GG:Math.pow(GG,g),new Sb(this.r*g,this.g*g,this.b*g,this.opacity)},rgb(){return this},clamp(){return new Sb(jA(this.r),jA(this.g),jA(this.b),vue(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Whn,formatHex:Whn,formatHex8:fJn,formatRgb:Zhn,toString:Zhn}));function Whn(){return`#${kA(this.r)}${kA(this.g)}${kA(this.b)}`}function fJn(){return`#${kA(this.r)}${kA(this.g)}${kA(this.b)}${kA((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zhn(){const g=vue(this.opacity);return`${g===1?"rgb(":"rgba("}${jA(this.r)}, ${jA(this.g)}, ${jA(this.b)}${g===1?")":`, ${g})`}`}function vue(g){return isNaN(g)?1:Math.max(0,Math.min(1,g))}function jA(g){return Math.max(0,Math.min(255,Math.round(g)||0))}function kA(g){return g=jA(g),(g<16?"0":"")+g.toString(16)}function e1n(g,E,x,M){return M<=0?g=E=x=NaN:x<=0||x>=1?g=E=NaN:E<=0&&(g=NaN),new ev(g,E,x,M)}function xdn(g){if(g instanceof ev)return new ev(g.h,g.s,g.l,g.opacity);if(g instanceof nq||(g=xA(g)),!g)return new ev;if(g instanceof ev)return g;g=g.rgb();var E=g.r/255,x=g.g/255,M=g.b/255,N=Math.min(E,x,M),$=Math.max(E,x,M),k=NaN,H=$-N,U=($+N)/2;return H?(E===$?k=(x-M)/H+(x0&&U<1?0:k,new ev(k,H,U,g.opacity)}function aJn(g,E,x,M){return arguments.length===1?xdn(g):new ev(g,E,x,M??1)}function ev(g,E,x,M){this.h=+g,this.s=+E,this.l=+x,this.opacity=+M}pke(ev,aJn,Sdn(nq,{brighter(g){return g=g==null?mue:Math.pow(mue,g),new ev(this.h,this.s,this.l*g,this.opacity)},darker(g){return g=g==null?GG:Math.pow(GG,g),new ev(this.h,this.s,this.l*g,this.opacity)},rgb(){var g=this.h%360+(this.h<0)*360,E=isNaN(g)||isNaN(this.s)?0:this.s,x=this.l,M=x+(x<.5?x:1-x)*E,N=2*x-M;return new Sb(L7e(g>=240?g-240:g+120,N,M),L7e(g,N,M),L7e(g<120?g+240:g-120,N,M),this.opacity)},clamp(){return new ev(n1n(this.h),Zce(this.s),Zce(this.l),vue(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const g=vue(this.opacity);return`${g===1?"hsl(":"hsla("}${n1n(this.h)}, ${Zce(this.s)*100}%, ${Zce(this.l)*100}%${g===1?")":`, ${g})`}`}}));function n1n(g){return g=(g||0)%360,g<0?g+360:g}function Zce(g){return Math.max(0,Math.min(1,g||0))}function L7e(g,E,x){return(g<60?E+(x-E)*g/60:g<180?x:g<240?E+(x-E)*(240-g)/60:E)*255}const mke=g=>()=>g;function hJn(g,E){return function(x){return g+x*E}}function dJn(g,E,x){return g=Math.pow(g,x),E=Math.pow(E,x)-g,x=1/x,function(M){return Math.pow(g+M*E,x)}}function bJn(g){return(g=+g)==1?Adn:function(E,x){return x-E?dJn(E,x,g):mke(isNaN(E)?x:E)}}function Adn(g,E){var x=E-g;return x?hJn(g,x):mke(isNaN(g)?E:g)}const yue=(function g(E){var x=bJn(E);function M(N,$){var k=x((N=nke(N)).r,($=nke($)).r),H=x(N.g,$.g),U=x(N.b,$.b),G=Adn(N.opacity,$.opacity);return function(ie){return N.r=k(ie),N.g=H(ie),N.b=U(ie),N.opacity=G(ie),N+""}}return M.gamma=g,M})(1);function gJn(g,E){E||(E=[]);var x=g?Math.min(E.length,g.length):0,M=E.slice(),N;return function($){for(N=0;Nx&&($=E.slice(x,$),H[k]?H[k]+=$:H[++k]=$),(M=M[0])===(N=N[0])?H[k]?H[k]+=N:H[++k]=N:(H[++k]=null,U.push({i:k,x:l5(M,N)})),x=P7e.lastIndex;return x180?ie+=360:ie-G>180&&(G+=360),Z.push({i:W.push(N(W)+"rotate(",null,M)-2,x:l5(G,ie)})):ie&&W.push(N(W)+"rotate("+ie+M)}function H(G,ie,W,Z){G!==ie?Z.push({i:W.push(N(W)+"skewX(",null,M)-2,x:l5(G,ie)}):ie&&W.push(N(W)+"skewX("+ie+M)}function U(G,ie,W,Z,le,oe){if(G!==W||ie!==Z){var ee=le.push(N(le)+"scale(",null,",",null,")");oe.push({i:ee-4,x:l5(G,W)},{i:ee-2,x:l5(ie,Z)})}else(W!==1||Z!==1)&&le.push(N(le)+"scale("+W+","+Z+")")}return function(G,ie){var W=[],Z=[];return G=g(G),ie=g(ie),$(G.translateX,G.translateY,ie.translateX,ie.translateY,W,Z),k(G.rotate,ie.rotate,W,Z),H(G.skewX,ie.skewX,W,Z),U(G.scaleX,G.scaleY,ie.scaleX,ie.scaleY,W,Z),G=ie=null,function(le){for(var oe=-1,ee=Z.length,Ce;++oe=0&&g._call.call(void 0,E),g=g._next;--gD}function r1n(){AA=(jue=UG.now())+Iue,gD=$G=0;try{OJn()}finally{gD=0,IJn(),AA=0}}function NJn(){var g=UG.now(),E=g-jue;E>Odn&&(Iue-=E,jue=g)}function IJn(){for(var g,E=kue,x,M=1/0;E;)E._call?(M>E._time&&(M=E._time),g=E,E=E._next):(x=E._next,E._next=null,E=g?g._next=x:kue=x);RG=g,rke(M)}function rke(g){if(!gD){$G&&($G=clearTimeout($G));var E=g-AA;E>24?(g<1/0&&($G=setTimeout(r1n,g-UG.now()-Iue)),_G&&(_G=clearInterval(_G))):(_G||(jue=UG.now(),_G=setInterval(NJn,Odn)),gD=1,Ndn(r1n))}}function c1n(g,E,x){var M=new Eue;return E=E==null?0:+E,M.restart(N=>{M.stop(),g(N+E)},E,x),M}var DJn=Oue("start","end","cancel","interrupt"),_Jn=[],Ddn=0,u1n=1,cke=2,bue=3,o1n=4,uke=5,gue=6;function Due(g,E,x,M,N,$){var k=g.__transition;if(!k)g.__transition={};else if(x in k)return;LJn(g,x,{name:E,index:M,group:N,on:DJn,tween:_Jn,time:$.time,delay:$.delay,duration:$.duration,ease:$.ease,timer:null,state:Ddn})}function yke(g,E){var x=iv(g,E);if(x.state>Ddn)throw new Error("too late; already scheduled");return x}function d5(g,E){var x=iv(g,E);if(x.state>bue)throw new Error("too late; already running");return x}function iv(g,E){var x=g.__transition;if(!x||!(x=x[E]))throw new Error("transition not found");return x}function LJn(g,E,x){var M=g.__transition,N;M[E]=x,x.timer=Idn($,0,x.time);function $(G){x.state=u1n,x.timer.restart(k,x.delay,x.time),x.delay<=G&&k(G-x.delay)}function k(G){var ie,W,Z,le;if(x.state!==u1n)return U();for(ie in M)if(le=M[ie],le.name===x.name){if(le.state===bue)return c1n(k);le.state===o1n?(le.state=gue,le.timer.stop(),le.on.call("interrupt",g,g.__data__,le.index,le.group),delete M[ie]):+iecke&&M.state=0&&(E=E.slice(0,x)),!E||E==="start"})}function aHn(g,E,x){var M,N,$=fHn(E)?yke:d5;return function(){var k=$(this,g),H=k.on;H!==M&&(N=(M=H).copy()).on(E,x),k.on=N}}function hHn(g,E){var x=this._id;return arguments.length<2?iv(this.node(),x).on.on(g):this.each(aHn(x,g,E))}function dHn(g){return function(){var E=this.parentNode;for(var x in this.__transition)if(+x!==g)return;E&&E.removeChild(this)}}function bHn(){return this.on("end.remove",dHn(this._id))}function gHn(g){var E=this._name,x=this._id;typeof g!="function"&&(g=gke(g));for(var M=this._groups,N=M.length,$=new Array(N),k=0;k()=>g;function zHn(g,{sourceEvent:E,target:x,transform:M,dispatch:N}){Object.defineProperties(this,{type:{value:g,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},target:{value:x,enumerable:!0,configurable:!0},transform:{value:M,enumerable:!0,configurable:!0},_:{value:N}})}function c6(g,E,x){this.k=g,this.x=E,this.y=x}c6.prototype={constructor:c6,scale:function(g){return g===1?this:new c6(this.k*g,this.x,this.y)},translate:function(g,E){return g===0&E===0?this:new c6(this.k,this.x+this.k*g,this.y+this.k*E)},apply:function(g){return[g[0]*this.k+this.x,g[1]*this.k+this.y]},applyX:function(g){return g*this.k+this.x},applyY:function(g){return g*this.k+this.y},invert:function(g){return[(g[0]-this.x)/this.k,(g[1]-this.y)/this.k]},invertX:function(g){return(g-this.x)/this.k},invertY:function(g){return(g-this.y)/this.k},rescaleX:function(g){return g.copy().domain(g.range().map(this.invertX,this).map(g.invert,g))},rescaleY:function(g){return g.copy().domain(g.range().map(this.invertY,this).map(g.invert,g))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var _ue=new c6(1,0,0);$dn.prototype=c6.prototype;function $dn(g){for(;!g.__zoom;)if(!(g=g.parentNode))return _ue;return g.__zoom}function $7e(g){g.stopImmediatePropagation()}function LG(g){g.preventDefault(),g.stopImmediatePropagation()}function FHn(g){return(!g.ctrlKey||g.type==="wheel")&&!g.button}function JHn(){var g=this;return g instanceof SVGElement?(g=g.ownerSVGElement||g,g.hasAttribute("viewBox")?(g=g.viewBox.baseVal,[[g.x,g.y],[g.x+g.width,g.y+g.height]]):[[0,0],[g.width.baseVal.value,g.height.baseVal.value]]):[[0,0],[g.clientWidth,g.clientHeight]]}function s1n(){return this.__zoom||_ue}function HHn(g){return-g.deltaY*(g.deltaMode===1?.05:g.deltaMode?1:.002)*(g.ctrlKey?10:1)}function GHn(){return navigator.maxTouchPoints||"ontouchstart"in this}function qHn(g,E,x){var M=g.invertX(E[0][0])-x[0][0],N=g.invertX(E[1][0])-x[1][0],$=g.invertY(E[0][1])-x[0][1],k=g.invertY(E[1][1])-x[1][1];return g.translate(N>M?(M+N)/2:Math.min(0,M)||Math.max(0,N),k>$?($+k)/2:Math.min(0,$)||Math.max(0,k))}function Rdn(){var g=FHn,E=JHn,x=qHn,M=HHn,N=GHn,$=[0,1/0],k=[[-1/0,-1/0],[1/0,1/0]],H=250,U=due,G=Oue("start","zoom","end"),ie,W,Z,le=500,oe=150,ee=0,Ce=10;function pe(Je){Je.property("__zoom",s1n).on("wheel.zoom",An,{passive:!1}).on("mousedown.zoom",xn).on("dblclick.zoom",nt).filter(N).on("touchstart.zoom",dn).on("touchmove.zoom",bn).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}pe.transform=function(Je,pn,Ae,ve){var nn=Je.selection?Je.selection():Je;nn.property("__zoom",s1n),Je!==nn?Ue(Je,pn,Ae,ve):nn.interrupt().each(function(){ln(this,arguments).event(ve).start().zoom(null,typeof pn=="function"?pn.apply(this,arguments):pn).end()})},pe.scaleBy=function(Je,pn,Ae,ve){pe.scaleTo(Je,function(){var nn=this.__zoom.k,yn=typeof pn=="function"?pn.apply(this,arguments):pn;return nn*yn},Ae,ve)},pe.scaleTo=function(Je,pn,Ae,ve){pe.transform(Je,function(){var nn=E.apply(this,arguments),yn=this.__zoom,Pn=Ae==null?Ne(nn):typeof Ae=="function"?Ae.apply(this,arguments):Ae,ye=yn.invert(Pn),Re=typeof pn=="function"?pn.apply(this,arguments):pn;return x(ae($e(yn,Re),Pn,ye),nn,k)},Ae,ve)},pe.translateBy=function(Je,pn,Ae,ve){pe.transform(Je,function(){return x(this.__zoom.translate(typeof pn=="function"?pn.apply(this,arguments):pn,typeof Ae=="function"?Ae.apply(this,arguments):Ae),E.apply(this,arguments),k)},null,ve)},pe.translateTo=function(Je,pn,Ae,ve,nn){pe.transform(Je,function(){var yn=E.apply(this,arguments),Pn=this.__zoom,ye=ve==null?Ne(yn):typeof ve=="function"?ve.apply(this,arguments):ve;return x(_ue.translate(ye[0],ye[1]).scale(Pn.k).translate(typeof pn=="function"?-pn.apply(this,arguments):-pn,typeof Ae=="function"?-Ae.apply(this,arguments):-Ae),yn,k)},ve,nn)};function $e(Je,pn){return pn=Math.max($[0],Math.min($[1],pn)),pn===Je.k?Je:new c6(pn,Je.x,Je.y)}function ae(Je,pn,Ae){var ve=pn[0]-Ae[0]*Je.k,nn=pn[1]-Ae[1]*Je.k;return ve===Je.x&&nn===Je.y?Je:new c6(Je.k,ve,nn)}function Ne(Je){return[(+Je[0][0]+ +Je[1][0])/2,(+Je[0][1]+ +Je[1][1])/2]}function Ue(Je,pn,Ae,ve){Je.on("start.zoom",function(){ln(this,arguments).event(ve).start()}).on("interrupt.zoom end.zoom",function(){ln(this,arguments).event(ve).end()}).tween("zoom",function(){var nn=this,yn=arguments,Pn=ln(nn,yn).event(ve),ye=E.apply(nn,yn),Re=Ae==null?Ne(ye):typeof Ae=="function"?Ae.apply(nn,yn):Ae,tt=Math.max(ye[1][0]-ye[0][0],ye[1][1]-ye[0][1]),ut=nn.__zoom,Jt=typeof pn=="function"?pn.apply(nn,yn):pn,di=U(ut.invert(Re).concat(tt/ut.k),Jt.invert(Re).concat(tt/Jt.k));return function(Gt){if(Gt===1)Gt=Jt;else{var xt=di(Gt),si=tt/xt[2];Gt=new c6(si,Re[0]-xt[0]*si,Re[1]-xt[1]*si)}Pn.zoom(null,Gt)}})}function ln(Je,pn,Ae){return!Ae&&Je.__zooming||new un(Je,pn)}function un(Je,pn){this.that=Je,this.args=pn,this.active=0,this.sourceEvent=null,this.extent=E.apply(Je,pn),this.taps=0}un.prototype={event:function(Je){return Je&&(this.sourceEvent=Je),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(Je,pn){return this.mouse&&Je!=="mouse"&&(this.mouse[1]=pn.invert(this.mouse[0])),this.touch0&&Je!=="touch"&&(this.touch0[1]=pn.invert(this.touch0[0])),this.touch1&&Je!=="touch"&&(this.touch1[1]=pn.invert(this.touch1[0])),this.that.__zoom=pn,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(Je){var pn=Fg(this.that).datum();G.call(Je,this.that,new zHn(Je,{sourceEvent:this.sourceEvent,target:pe,transform:this.that.__zoom,dispatch:G}),pn)}};function An(Je,...pn){if(!g.apply(this,arguments))return;var Ae=ln(this,pn).event(Je),ve=this.__zoom,nn=Math.max($[0],Math.min($[1],ve.k*Math.pow(2,M.apply(this,arguments)))),yn=Zm(Je);if(Ae.wheel)(Ae.mouse[0][0]!==yn[0]||Ae.mouse[0][1]!==yn[1])&&(Ae.mouse[1]=ve.invert(Ae.mouse[0]=yn)),clearTimeout(Ae.wheel);else{if(ve.k===nn)return;Ae.mouse=[yn,ve.invert(yn)],wue(this),Ae.start()}LG(Je),Ae.wheel=setTimeout(Pn,oe),Ae.zoom("mouse",x(ae($e(ve,nn),Ae.mouse[0],Ae.mouse[1]),Ae.extent,k));function Pn(){Ae.wheel=null,Ae.end()}}function xn(Je,...pn){if(Z||!g.apply(this,arguments))return;var Ae=Je.currentTarget,ve=ln(this,pn,!0).event(Je),nn=Fg(Je.view).on("mousemove.zoom",Re,!0).on("mouseup.zoom",tt,!0),yn=Zm(Je,Ae),Pn=Je.clientX,ye=Je.clientY;kdn(Je.view),$7e(Je),ve.mouse=[yn,this.__zoom.invert(yn)],wue(this),ve.start();function Re(ut){if(LG(ut),!ve.moved){var Jt=ut.clientX-Pn,di=ut.clientY-ye;ve.moved=Jt*Jt+di*di>ee}ve.event(ut).zoom("mouse",x(ae(ve.that.__zoom,ve.mouse[0]=Zm(ut,Ae),ve.mouse[1]),ve.extent,k))}function tt(ut){nn.on("mousemove.zoom mouseup.zoom",null),jdn(ut.view,ve.moved),LG(ut),ve.event(ut).end()}}function nt(Je,...pn){if(g.apply(this,arguments)){var Ae=this.__zoom,ve=Zm(Je.changedTouches?Je.changedTouches[0]:Je,this),nn=Ae.invert(ve),yn=Ae.k*(Je.shiftKey?.5:2),Pn=x(ae($e(Ae,yn),ve,nn),E.apply(this,pn),k);LG(Je),H>0?Fg(this).transition().duration(H).call(Ue,Pn,ve,Je):Fg(this).call(pe.transform,Pn,ve,Je)}}function dn(Je,...pn){if(g.apply(this,arguments)){var Ae=Je.touches,ve=Ae.length,nn=ln(this,pn,Je.changedTouches.length===ve).event(Je),yn,Pn,ye,Re;for($7e(Je),Pn=0;Pn"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:g=>`Node type "${g}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:g=>`The old edge with id=${g} does not exist.`,error009:g=>`Marker type "${g}" doesn't exist.`,error008:(g,{id:E,sourceHandle:x,targetHandle:M})=>`Couldn't create edge for ${g} handle id: "${g==="source"?x:M}", edge id: ${E}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:g=>`Edge type "${g}" not found. Using fallback type "default".`,error012:g=>`Node with id "${g}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(g="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${g}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},XG=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Bdn=["Enter"," ","Escape"],zdn={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:g,x:E,y:x})=>`Moved selected node ${g}. New position, x: ${E}, y: ${x}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var wD;(function(g){g.Strict="strict",g.Loose="loose"})(wD||(wD={}));var EA;(function(g){g.Free="free",g.Vertical="vertical",g.Horizontal="horizontal"})(EA||(EA={}));var KG;(function(g){g.Partial="partial",g.Full="full"})(KG||(KG={}));const Fdn={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ek;(function(g){g.Bezier="default",g.Straight="straight",g.Step="step",g.SmoothStep="smoothstep",g.SimpleBezier="simplebezier"})(ek||(ek={}));var VG;(function(g){g.Arrow="arrow",g.ArrowClosed="arrowclosed"})(VG||(VG={}));var ur;(function(g){g.Left="left",g.Top="top",g.Right="right",g.Bottom="bottom"})(ur||(ur={}));const l1n={[ur.Left]:ur.Right,[ur.Right]:ur.Left,[ur.Top]:ur.Bottom,[ur.Bottom]:ur.Top};function Jdn(g){return g===null?null:g?"valid":"invalid"}const Hdn=g=>"id"in g&&"source"in g&&"target"in g,UHn=g=>"id"in g&&"position"in g&&!("source"in g)&&!("target"in g),jke=g=>"id"in g&&"internals"in g&&!("source"in g)&&!("target"in g),tq=(g,E=[0,0])=>{const{width:x,height:M}=s6(g),N=g.origin??E,$=x*N[0],k=M*N[1];return{x:g.position.x-$,y:g.position.y-k}},XHn=(g,E={nodeOrigin:[0,0]})=>{if(g.length===0)return{x:0,y:0,width:0,height:0};const x=g.reduce((M,N)=>{const $=typeof N=="string";let k=!E.nodeLookup&&!$?N:void 0;E.nodeLookup&&(k=$?E.nodeLookup.get(N):jke(N)?N:E.nodeLookup.get(N.id));const H=k?Sue(k,E.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Lue(M,H)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pue(x)},iq=(g,E={})=>{let x={x:1/0,y:1/0,x2:-1/0,y2:-1/0},M=!1;return g.forEach(N=>{(E.filter===void 0||E.filter(N))&&(x=Lue(x,Sue(N)),M=!0)}),M?Pue(x):{x:0,y:0,width:0,height:0}},Eke=(g,E,[x,M,N]=[0,0,1],$=!1,k=!1)=>{const H={...cq(E,[x,M,N]),width:E.width/N,height:E.height/N},U=[];for(const G of g.values()){const{measured:ie,selectable:W=!0,hidden:Z=!1}=G;if(k&&!W||Z)continue;const le=ie.width??G.width??G.initialWidth??null,oe=ie.height??G.height??G.initialHeight??null,ee=YG(H,mD(G)),Ce=(le??0)*(oe??0),pe=$&&ee>0;(!G.internals.handleBounds||pe||ee>=Ce||G.dragging)&&U.push(G)}return U},KHn=(g,E)=>{const x=new Set;return g.forEach(M=>{x.add(M.id)}),E.filter(M=>x.has(M.source)||x.has(M.target))};function VHn(g,E){const x=new Map,M=E?.nodes?new Set(E.nodes.map(N=>N.id)):null;return g.forEach(N=>{N.measured.width&&N.measured.height&&(E?.includeHiddenNodes||!N.hidden)&&(!M||M.has(N.id))&&x.set(N.id,N)}),x}async function YHn({nodes:g,width:E,height:x,panZoom:M,minZoom:N,maxZoom:$},k){if(g.size===0)return Promise.resolve(!0);const H=VHn(g,k),U=iq(H),G=Ske(U,E,x,k?.minZoom??N,k?.maxZoom??$,k?.padding??.1);return await M.setViewport(G,{duration:k?.duration,ease:k?.ease,interpolate:k?.interpolate}),Promise.resolve(!0)}function Gdn({nodeId:g,nextPosition:E,nodeLookup:x,nodeOrigin:M=[0,0],nodeExtent:N,onError:$}){const k=x.get(g),H=k.parentId?x.get(k.parentId):void 0,{x:U,y:G}=H?H.internals.positionAbsolute:{x:0,y:0},ie=k.origin??M;let W=k.extent||N;if(k.extent==="parent"&&!k.expandParent)if(!H)$?.("005",a5.error005());else{const le=H.measured.width,oe=H.measured.height;le&&oe&&(W=[[U,G],[U+le,G+oe]])}else H&&vD(k.extent)&&(W=[[k.extent[0][0]+U,k.extent[0][1]+G],[k.extent[1][0]+U,k.extent[1][1]+G]]);const Z=vD(W)?MA(E,W,k.measured):E;return(k.measured.width===void 0||k.measured.height===void 0)&&$?.("015",a5.error015()),{position:{x:Z.x-U+(k.measured.width??0)*ie[0],y:Z.y-G+(k.measured.height??0)*ie[1]},positionAbsolute:Z}}async function QHn({nodesToRemove:g=[],edgesToRemove:E=[],nodes:x,edges:M,onBeforeDelete:N}){const $=new Set(g.map(Z=>Z.id)),k=[];for(const Z of x){if(Z.deletable===!1)continue;const le=$.has(Z.id),oe=!le&&Z.parentId&&k.find(ee=>ee.id===Z.parentId);(le||oe)&&k.push(Z)}const H=new Set(E.map(Z=>Z.id)),U=M.filter(Z=>Z.deletable!==!1),ie=KHn(k,U);for(const Z of U)H.has(Z.id)&&!ie.find(oe=>oe.id===Z.id)&&ie.push(Z);if(!N)return{edges:ie,nodes:k};const W=await N({nodes:k,edges:ie});return typeof W=="boolean"?W?{edges:ie,nodes:k}:{edges:[],nodes:[]}:W}const pD=(g,E=0,x=1)=>Math.min(Math.max(g,E),x),MA=(g={x:0,y:0},E,x)=>({x:pD(g.x,E[0][0],E[1][0]-(x?.width??0)),y:pD(g.y,E[0][1],E[1][1]-(x?.height??0))});function qdn(g,E,x){const{width:M,height:N}=s6(x),{x:$,y:k}=x.internals.positionAbsolute;return MA(g,[[$,k],[$+M,k+N]],E)}const f1n=(g,E,x)=>gx?-pD(Math.abs(g-x),1,E)/E:0,Udn=(g,E,x=15,M=40)=>{const N=f1n(g.x,M,E.width-M)*x,$=f1n(g.y,M,E.height-M)*x;return[N,$]},Lue=(g,E)=>({x:Math.min(g.x,E.x),y:Math.min(g.y,E.y),x2:Math.max(g.x2,E.x2),y2:Math.max(g.y2,E.y2)}),oke=({x:g,y:E,width:x,height:M})=>({x:g,y:E,x2:g+x,y2:E+M}),Pue=({x:g,y:E,x2:x,y2:M})=>({x:g,y:E,width:x-g,height:M-E}),mD=(g,E=[0,0])=>{const{x,y:M}=jke(g)?g.internals.positionAbsolute:tq(g,E);return{x,y:M,width:g.measured?.width??g.width??g.initialWidth??0,height:g.measured?.height??g.height??g.initialHeight??0}},Sue=(g,E=[0,0])=>{const{x,y:M}=jke(g)?g.internals.positionAbsolute:tq(g,E);return{x,y:M,x2:x+(g.measured?.width??g.width??g.initialWidth??0),y2:M+(g.measured?.height??g.height??g.initialHeight??0)}},Xdn=(g,E)=>Pue(Lue(oke(g),oke(E))),YG=(g,E)=>{const x=Math.max(0,Math.min(g.x+g.width,E.x+E.width)-Math.max(g.x,E.x)),M=Math.max(0,Math.min(g.y+g.height,E.y+E.height)-Math.max(g.y,E.y));return Math.ceil(x*M)},a1n=g=>nv(g.width)&&nv(g.height)&&nv(g.x)&&nv(g.y),nv=g=>!isNaN(g)&&isFinite(g),WHn=(g,E)=>{},rq=(g,E=[1,1])=>({x:E[0]*Math.round(g.x/E[0]),y:E[1]*Math.round(g.y/E[1])}),cq=({x:g,y:E},[x,M,N],$=!1,k=[1,1])=>{const H={x:(g-x)/N,y:(E-M)/N};return $?rq(H,k):H},xue=({x:g,y:E},[x,M,N])=>({x:g*N+x,y:E*N+M});function sD(g,E){if(typeof g=="number")return Math.floor((E-E/(1+g))*.5);if(typeof g=="string"&&g.endsWith("px")){const x=parseFloat(g);if(!Number.isNaN(x))return Math.floor(x)}if(typeof g=="string"&&g.endsWith("%")){const x=parseFloat(g);if(!Number.isNaN(x))return Math.floor(E*x*.01)}return console.error(`[React Flow] The padding value "${g}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZHn(g,E,x){if(typeof g=="string"||typeof g=="number"){const M=sD(g,x),N=sD(g,E);return{top:M,right:N,bottom:M,left:N,x:N*2,y:M*2}}if(typeof g=="object"){const M=sD(g.top??g.y??0,x),N=sD(g.bottom??g.y??0,x),$=sD(g.left??g.x??0,E),k=sD(g.right??g.x??0,E);return{top:M,right:k,bottom:N,left:$,x:$+k,y:M+N}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function eGn(g,E,x,M,N,$){const{x:k,y:H}=xue(g,[E,x,M]),{x:U,y:G}=xue({x:g.x+g.width,y:g.y+g.height},[E,x,M]),ie=N-U,W=$-G;return{left:Math.floor(k),top:Math.floor(H),right:Math.floor(ie),bottom:Math.floor(W)}}const Ske=(g,E,x,M,N,$)=>{const k=ZHn($,E,x),H=(E-k.x)/g.width,U=(x-k.y)/g.height,G=Math.min(H,U),ie=pD(G,M,N),W=g.x+g.width/2,Z=g.y+g.height/2,le=E/2-W*ie,oe=x/2-Z*ie,ee=eGn(g,le,oe,ie,E,x),Ce={left:Math.min(ee.left-k.left,0),top:Math.min(ee.top-k.top,0),right:Math.min(ee.right-k.right,0),bottom:Math.min(ee.bottom-k.bottom,0)};return{x:le-Ce.left+Ce.right,y:oe-Ce.top+Ce.bottom,zoom:ie}},QG=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function vD(g){return g!=null&&g!=="parent"}function s6(g){return{width:g.measured?.width??g.width??g.initialWidth??0,height:g.measured?.height??g.height??g.initialHeight??0}}function Kdn(g){return(g.measured?.width??g.width??g.initialWidth)!==void 0&&(g.measured?.height??g.height??g.initialHeight)!==void 0}function Vdn(g,E={width:0,height:0},x,M,N){const $={...g},k=M.get(x);if(k){const H=k.origin||N;$.x+=k.internals.positionAbsolute.x-(E.width??0)*H[0],$.y+=k.internals.positionAbsolute.y-(E.height??0)*H[1]}return $}function h1n(g,E){if(g.size!==E.size)return!1;for(const x of g)if(!E.has(x))return!1;return!0}function nGn(){let g,E;return{promise:new Promise((M,N)=>{g=M,E=N}),resolve:g,reject:E}}function tGn(g){return{...zdn,...g||{}}}function JG(g,{snapGrid:E=[0,0],snapToGrid:x=!1,transform:M,containerBounds:N}){const{x:$,y:k}=tv(g),H=cq({x:$-(N?.left??0),y:k-(N?.top??0)},M),{x:U,y:G}=x?rq(H,E):H;return{xSnapped:U,ySnapped:G,...H}}const xke=g=>({width:g.offsetWidth,height:g.offsetHeight}),Ydn=g=>g?.getRootNode?.()||window?.document,iGn=["INPUT","SELECT","TEXTAREA"];function Qdn(g){const E=g.composedPath?.()?.[0]||g.target;return E?.nodeType!==1?!1:iGn.includes(E.nodeName)||E.hasAttribute("contenteditable")||!!E.closest(".nokey")}const Wdn=g=>"clientX"in g,tv=(g,E)=>{const x=Wdn(g),M=x?g.clientX:g.touches?.[0].clientX,N=x?g.clientY:g.touches?.[0].clientY;return{x:M-(E?.left??0),y:N-(E?.top??0)}},d1n=(g,E,x,M,N)=>{const $=E.querySelectorAll(`.${g}`);return!$||!$.length?null:Array.from($).map(k=>{const H=k.getBoundingClientRect();return{id:k.getAttribute("data-handleid"),type:g,nodeId:N,position:k.getAttribute("data-handlepos"),x:(H.left-x.left)/M,y:(H.top-x.top)/M,...xke(k)}})};function Zdn({sourceX:g,sourceY:E,targetX:x,targetY:M,sourceControlX:N,sourceControlY:$,targetControlX:k,targetControlY:H}){const U=g*.125+N*.375+k*.375+x*.125,G=E*.125+$*.375+H*.375+M*.125,ie=Math.abs(U-g),W=Math.abs(G-E);return[U,G,ie,W]}function tue(g,E){return g>=0?.5*g:E*25*Math.sqrt(-g)}function b1n({pos:g,x1:E,y1:x,x2:M,y2:N,c:$}){switch(g){case ur.Left:return[E-tue(E-M,$),x];case ur.Right:return[E+tue(M-E,$),x];case ur.Top:return[E,x-tue(x-N,$)];case ur.Bottom:return[E,x+tue(N-x,$)]}}function e0n({sourceX:g,sourceY:E,sourcePosition:x=ur.Bottom,targetX:M,targetY:N,targetPosition:$=ur.Top,curvature:k=.25}){const[H,U]=b1n({pos:x,x1:g,y1:E,x2:M,y2:N,c:k}),[G,ie]=b1n({pos:$,x1:M,y1:N,x2:g,y2:E,c:k}),[W,Z,le,oe]=Zdn({sourceX:g,sourceY:E,targetX:M,targetY:N,sourceControlX:H,sourceControlY:U,targetControlX:G,targetControlY:ie});return[`M${g},${E} C${H},${U} ${G},${ie} ${M},${N}`,W,Z,le,oe]}function n0n({sourceX:g,sourceY:E,targetX:x,targetY:M}){const N=Math.abs(x-g)/2,$=x0}const uGn=({source:g,sourceHandle:E,target:x,targetHandle:M})=>`xy-edge__${g}${E||""}-${x}${M||""}`,oGn=(g,E)=>E.some(x=>x.source===g.source&&x.target===g.target&&(x.sourceHandle===g.sourceHandle||!x.sourceHandle&&!g.sourceHandle)&&(x.targetHandle===g.targetHandle||!x.targetHandle&&!g.targetHandle)),sGn=(g,E,x={})=>{if(!g.source||!g.target)return E;const M=x.getEdgeId||uGn;let N;return Hdn(g)?N={...g}:N={...g,id:M(g)},oGn(N,E)?E:(N.sourceHandle===null&&delete N.sourceHandle,N.targetHandle===null&&delete N.targetHandle,E.concat(N))};function t0n({sourceX:g,sourceY:E,targetX:x,targetY:M}){const[N,$,k,H]=n0n({sourceX:g,sourceY:E,targetX:x,targetY:M});return[`M ${g},${E}L ${x},${M}`,N,$,k,H]}const g1n={[ur.Left]:{x:-1,y:0},[ur.Right]:{x:1,y:0},[ur.Top]:{x:0,y:-1},[ur.Bottom]:{x:0,y:1}},lGn=({source:g,sourcePosition:E=ur.Bottom,target:x})=>E===ur.Left||E===ur.Right?g.xMath.sqrt(Math.pow(E.x-g.x,2)+Math.pow(E.y-g.y,2));function fGn({source:g,sourcePosition:E=ur.Bottom,target:x,targetPosition:M=ur.Top,center:N,offset:$,stepPosition:k}){const H=g1n[E],U=g1n[M],G={x:g.x+H.x*$,y:g.y+H.y*$},ie={x:x.x+U.x*$,y:x.y+U.y*$},W=lGn({source:G,sourcePosition:E,target:ie}),Z=W.x!==0?"x":"y",le=W[Z];let oe=[],ee,Ce;const pe={x:0,y:0},$e={x:0,y:0},[,,ae,Ne]=n0n({sourceX:g.x,sourceY:g.y,targetX:x.x,targetY:x.y});if(H[Z]*U[Z]===-1){Z==="x"?(ee=N.x??G.x+(ie.x-G.x)*k,Ce=N.y??(G.y+ie.y)/2):(ee=N.x??(G.x+ie.x)/2,Ce=N.y??G.y+(ie.y-G.y)*k);const An=[{x:ee,y:G.y},{x:ee,y:ie.y}],xn=[{x:G.x,y:Ce},{x:ie.x,y:Ce}];H[Z]===le?oe=Z==="x"?An:xn:oe=Z==="x"?xn:An}else{const An=[{x:G.x,y:ie.y}],xn=[{x:ie.x,y:G.y}];if(Z==="x"?oe=H.x===le?xn:An:oe=H.y===le?An:xn,E===M){const Je=Math.abs(g[Z]-x[Z]);if(Je<=$){const pn=Math.min($-1,$-Je);H[Z]===le?pe[Z]=(G[Z]>g[Z]?-1:1)*pn:$e[Z]=(ie[Z]>x[Z]?-1:1)*pn}}if(E!==M){const Je=Z==="x"?"y":"x",pn=H[Z]===U[Je],Ae=G[Je]>ie[Je],ve=G[Je]=Y?(ee=(nt.x+dn.x)/2,Ce=oe[0].y):(ee=oe[0].x,Ce=(nt.y+dn.y)/2)}const Ue={x:G.x+pe.x,y:G.y+pe.y},ln={x:ie.x+$e.x,y:ie.y+$e.y};return[[g,...Ue.x!==oe[0].x||Ue.y!==oe[0].y?[Ue]:[],...oe,...ln.x!==oe[oe.length-1].x||ln.y!==oe[oe.length-1].y?[ln]:[],x],ee,Ce,ae,Ne]}function aGn(g,E,x,M){const N=Math.min(w1n(g,E)/2,w1n(E,x)/2,M),{x:$,y:k}=E;if(g.x===$&&$===x.x||g.y===k&&k===x.y)return`L${$} ${k}`;if(g.y===k){const G=g.xx.id===E):g[0])||null}function ske(g,E){return g?typeof g=="string"?g:`${E?`${E}__`:""}${Object.keys(g).sort().map(M=>`${M}=${g[M]}`).join("&")}`:""}function dGn(g,{id:E,defaultColor:x,defaultMarkerStart:M,defaultMarkerEnd:N}){const $=new Set;return g.reduce((k,H)=>([H.markerStart||M,H.markerEnd||N].forEach(U=>{if(U&&typeof U=="object"){const G=ske(U,E);$.has(G)||(k.push({id:G,color:U.color||x,...U}),$.add(G))}}),k),[]).sort((k,H)=>k.id.localeCompare(H.id))}const i0n=1e3,bGn=10,Ake={nodeOrigin:[0,0],nodeExtent:XG,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},gGn={...Ake,checkEquality:!0};function Mke(g,E){const x={...g};for(const M in E)E[M]!==void 0&&(x[M]=E[M]);return x}function wGn(g,E,x){const M=Mke(Ake,x);for(const N of g.values())if(N.parentId)Tke(N,g,E,M);else{const $=tq(N,M.nodeOrigin),k=vD(N.extent)?N.extent:M.nodeExtent,H=MA($,k,s6(N));N.internals.positionAbsolute=H}}function pGn(g,E){if(!g.handles)return g.measured?E?.internals.handleBounds:void 0;const x=[],M=[];for(const N of g.handles){const $={id:N.id,width:N.width??1,height:N.height??1,nodeId:g.id,x:N.x,y:N.y,position:N.position,type:N.type};N.type==="source"?x.push($):N.type==="target"&&M.push($)}return{source:x,target:M}}function Cke(g){return g==="manual"}function lke(g,E,x,M={}){const N=Mke(gGn,M),$={i:0},k=new Map(E),H=N?.elevateNodesOnSelect&&!Cke(N.zIndexMode)?i0n:0;let U=g.length>0,G=!1;E.clear(),x.clear();for(const ie of g){let W=k.get(ie.id);if(N.checkEquality&&ie===W?.internals.userNode)E.set(ie.id,W);else{const Z=tq(ie,N.nodeOrigin),le=vD(ie.extent)?ie.extent:N.nodeExtent,oe=MA(Z,le,s6(ie));W={...N.defaults,...ie,measured:{width:ie.measured?.width,height:ie.measured?.height},internals:{positionAbsolute:oe,handleBounds:pGn(ie,W),z:r0n(ie,H,N.zIndexMode),userNode:ie}},E.set(ie.id,W)}(W.measured===void 0||W.measured.width===void 0||W.measured.height===void 0)&&!W.hidden&&(U=!1),ie.parentId&&Tke(W,E,x,M,$),G||=ie.selected??!1}return{nodesInitialized:U,hasSelectedNodes:G}}function mGn(g,E){if(!g.parentId)return;const x=E.get(g.parentId);x?x.set(g.id,g):E.set(g.parentId,new Map([[g.id,g]]))}function Tke(g,E,x,M,N){const{elevateNodesOnSelect:$,nodeOrigin:k,nodeExtent:H,zIndexMode:U}=Mke(Ake,M),G=g.parentId,ie=E.get(G);if(!ie){console.warn(`Parent node ${G} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mGn(g,x),N&&!ie.parentId&&ie.internals.rootParentIndex===void 0&&U==="auto"&&(ie.internals.rootParentIndex=++N.i,ie.internals.z=ie.internals.z+N.i*bGn),N&&ie.internals.rootParentIndex!==void 0&&(N.i=ie.internals.rootParentIndex);const W=$&&!Cke(U)?i0n:0,{x:Z,y:le,z:oe}=vGn(g,ie,k,H,W,U),{positionAbsolute:ee}=g.internals,Ce=Z!==ee.x||le!==ee.y;(Ce||oe!==g.internals.z)&&E.set(g.id,{...g,internals:{...g.internals,positionAbsolute:Ce?{x:Z,y:le}:ee,z:oe}})}function r0n(g,E,x){const M=nv(g.zIndex)?g.zIndex:0;return Cke(x)?M:M+(g.selected?E:0)}function vGn(g,E,x,M,N,$){const{x:k,y:H}=E.internals.positionAbsolute,U=s6(g),G=tq(g,x),ie=vD(g.extent)?MA(G,g.extent,U):G;let W=MA({x:k+ie.x,y:H+ie.y},M,U);g.extent==="parent"&&(W=qdn(W,U,E));const Z=r0n(g,N,$),le=E.internals.z??0;return{x:W.x,y:W.y,z:le>=Z?le+1:Z}}function Oke(g,E,x,M=[0,0]){const N=[],$=new Map;for(const k of g){const H=E.get(k.parentId);if(!H)continue;const U=$.get(k.parentId)?.expandedRect??mD(H),G=Xdn(U,k.rect);$.set(k.parentId,{expandedRect:G,parent:H})}return $.size>0&&$.forEach(({expandedRect:k,parent:H},U)=>{const G=H.internals.positionAbsolute,ie=s6(H),W=H.origin??M,Z=k.x0||le>0||Ce||pe)&&(N.push({id:U,type:"position",position:{x:H.position.x-Z+Ce,y:H.position.y-le+pe}}),x.get(U)?.forEach($e=>{g.some(ae=>ae.id===$e.id)||N.push({id:$e.id,type:"position",position:{x:$e.position.x+Z,y:$e.position.y+le}})})),(ie.width0){const le=Oke(Z,E,x,N);G.push(...le)}return{changes:G,updatedInternals:U}}async function kGn({delta:g,panZoom:E,transform:x,translateExtent:M,width:N,height:$}){if(!E||!g.x&&!g.y)return Promise.resolve(!1);const k=await E.setViewportConstrained({x:x[0]+g.x,y:x[1]+g.y,zoom:x[2]},[[0,0],[N,$]],M),H=!!k&&(k.x!==x[0]||k.y!==x[1]||k.k!==x[2]);return Promise.resolve(H)}function y1n(g,E,x,M,N,$){let k=N;const H=M.get(k)||new Map;M.set(k,H.set(x,E)),k=`${N}-${g}`;const U=M.get(k)||new Map;if(M.set(k,U.set(x,E)),$){k=`${N}-${g}-${$}`;const G=M.get(k)||new Map;M.set(k,G.set(x,E))}}function c0n(g,E,x){g.clear(),E.clear();for(const M of x){const{source:N,target:$,sourceHandle:k=null,targetHandle:H=null}=M,U={edgeId:M.id,source:N,target:$,sourceHandle:k,targetHandle:H},G=`${N}-${k}--${$}-${H}`,ie=`${$}-${H}--${N}-${k}`;y1n("source",U,ie,g,N,k),y1n("target",U,G,g,$,H),E.set(M.id,M)}}function u0n(g,E){if(!g.parentId)return!1;const x=E.get(g.parentId);return x?x.selected?!0:u0n(x,E):!1}function k1n(g,E,x){let M=g;do{if(M?.matches?.(E))return!0;if(M===x)return!1;M=M?.parentElement}while(M);return!1}function jGn(g,E,x,M){const N=new Map;for(const[$,k]of g)if((k.selected||k.id===M)&&(!k.parentId||!u0n(k,g))&&(k.draggable||E&&typeof k.draggable>"u")){const H=g.get($);H&&N.set($,{id:$,position:H.position||{x:0,y:0},distance:{x:x.x-H.internals.positionAbsolute.x,y:x.y-H.internals.positionAbsolute.y},extent:H.extent,parentId:H.parentId,origin:H.origin,expandParent:H.expandParent,internals:{positionAbsolute:H.internals.positionAbsolute||{x:0,y:0}},measured:{width:H.measured.width??0,height:H.measured.height??0}})}return N}function R7e({nodeId:g,dragItems:E,nodeLookup:x,dragging:M=!0}){const N=[];for(const[k,H]of E){const U=x.get(k)?.internals.userNode;U&&N.push({...U,position:H.position,dragging:M})}if(!g)return[N[0],N];const $=x.get(g)?.internals.userNode;return[$?{...$,position:E.get(g)?.position||$.position,dragging:M}:N[0],N]}function EGn({dragItems:g,snapGrid:E,x,y:M}){const N=g.values().next().value;if(!N)return null;const $={x:x-N.distance.x,y:M-N.distance.y},k=rq($,E);return{x:k.x-$.x,y:k.y-$.y}}function SGn({onNodeMouseDown:g,getStoreItems:E,onDragStart:x,onDrag:M,onDragStop:N}){let $={x:null,y:null},k=0,H=new Map,U=!1,G={x:0,y:0},ie=null,W=!1,Z=null,le=!1,oe=!1,ee=null;function Ce({noDragClassName:$e,handleSelector:ae,domNode:Ne,isSelectable:Ue,nodeId:ln,nodeClickDistance:un=0}){Z=Fg(Ne);function An({x:bn,y:Y}){const{nodeLookup:Je,nodeExtent:pn,snapGrid:Ae,snapToGrid:ve,nodeOrigin:nn,onNodeDrag:yn,onSelectionDrag:Pn,onError:ye,updateNodePositions:Re}=E();$={x:bn,y:Y};let tt=!1;const ut=H.size>1,Jt=ut&&pn?oke(iq(H)):null,di=ut&&ve?EGn({dragItems:H,snapGrid:Ae,x:bn,y:Y}):null;for(const[Gt,xt]of H){if(!Je.has(Gt))continue;let si={x:bn-xt.distance.x,y:Y-xt.distance.y};ve&&(si=di?{x:Math.round(si.x+di.x),y:Math.round(si.y+di.y)}:rq(si,Ae));let Kr=null;if(ut&&pn&&!xt.extent&&Jt){const{positionAbsolute:bi}=xt.internals,zi=bi.x-Jt.x+pn[0][0],cu=bi.x+xt.measured.width-Jt.x2+pn[1][0],Fu=bi.y-Jt.y+pn[0][1],Rs=bi.y+xt.measured.height-Jt.y2+pn[1][1];Kr=[[zi,Fu],[cu,Rs]]}const{position:Er,positionAbsolute:Mt}=Gdn({nodeId:Gt,nextPosition:si,nodeLookup:Je,nodeExtent:Kr||pn,nodeOrigin:nn,onError:ye});tt=tt||xt.position.x!==Er.x||xt.position.y!==Er.y,xt.position=Er,xt.internals.positionAbsolute=Mt}if(oe=oe||tt,!!tt&&(Re(H,!0),ee&&(M||yn||!ln&&Pn))){const[Gt,xt]=R7e({nodeId:ln,dragItems:H,nodeLookup:Je});M?.(ee,H,Gt,xt),yn?.(ee,Gt,xt),ln||Pn?.(ee,xt)}}async function xn(){if(!ie)return;const{transform:bn,panBy:Y,autoPanSpeed:Je,autoPanOnNodeDrag:pn}=E();if(!pn){U=!1,cancelAnimationFrame(k);return}const[Ae,ve]=Udn(G,ie,Je);(Ae!==0||ve!==0)&&($.x=($.x??0)-Ae/bn[2],$.y=($.y??0)-ve/bn[2],await Y({x:Ae,y:ve})&&An($)),k=requestAnimationFrame(xn)}function nt(bn){const{nodeLookup:Y,multiSelectionActive:Je,nodesDraggable:pn,transform:Ae,snapGrid:ve,snapToGrid:nn,selectNodesOnDrag:yn,onNodeDragStart:Pn,onSelectionDragStart:ye,unselectNodesAndEdges:Re}=E();W=!0,(!yn||!Ue)&&!Je&&ln&&(Y.get(ln)?.selected||Re()),Ue&&yn&&ln&&g?.(ln);const tt=JG(bn.sourceEvent,{transform:Ae,snapGrid:ve,snapToGrid:nn,containerBounds:ie});if($=tt,H=jGn(Y,pn,tt,ln),H.size>0&&(x||Pn||!ln&&ye)){const[ut,Jt]=R7e({nodeId:ln,dragItems:H,nodeLookup:Y});x?.(bn.sourceEvent,H,ut,Jt),Pn?.(bn.sourceEvent,ut,Jt),ln||ye?.(bn.sourceEvent,Jt)}}const dn=Edn().clickDistance(un).on("start",bn=>{const{domNode:Y,nodeDragThreshold:Je,transform:pn,snapGrid:Ae,snapToGrid:ve}=E();ie=Y?.getBoundingClientRect()||null,le=!1,oe=!1,ee=bn.sourceEvent,Je===0&&nt(bn),$=JG(bn.sourceEvent,{transform:pn,snapGrid:Ae,snapToGrid:ve,containerBounds:ie}),G=tv(bn.sourceEvent,ie)}).on("drag",bn=>{const{autoPanOnNodeDrag:Y,transform:Je,snapGrid:pn,snapToGrid:Ae,nodeDragThreshold:ve,nodeLookup:nn}=E(),yn=JG(bn.sourceEvent,{transform:Je,snapGrid:pn,snapToGrid:Ae,containerBounds:ie});if(ee=bn.sourceEvent,(bn.sourceEvent.type==="touchmove"&&bn.sourceEvent.touches.length>1||ln&&!nn.has(ln))&&(le=!0),!le){if(!U&&Y&&W&&(U=!0,xn()),!W){const Pn=tv(bn.sourceEvent,ie),ye=Pn.x-G.x,Re=Pn.y-G.y;Math.sqrt(ye*ye+Re*Re)>ve&&nt(bn)}($.x!==yn.xSnapped||$.y!==yn.ySnapped)&&H&&W&&(G=tv(bn.sourceEvent,ie),An(yn))}}).on("end",bn=>{if(!(!W||le)&&(U=!1,W=!1,cancelAnimationFrame(k),H.size>0)){const{nodeLookup:Y,updateNodePositions:Je,onNodeDragStop:pn,onSelectionDragStop:Ae}=E();if(oe&&(Je(H,!1),oe=!1),N||pn||!ln&&Ae){const[ve,nn]=R7e({nodeId:ln,dragItems:H,nodeLookup:Y,dragging:!1});N?.(bn.sourceEvent,H,ve,nn),pn?.(bn.sourceEvent,ve,nn),ln||Ae?.(bn.sourceEvent,nn)}}}).filter(bn=>{const Y=bn.target;return!bn.button&&(!$e||!k1n(Y,`.${$e}`,Ne))&&(!ae||k1n(Y,ae,Ne))});Z.call(dn)}function pe(){Z?.on(".drag",null)}return{update:Ce,destroy:pe}}function xGn(g,E,x){const M=[],N={x:g.x-x,y:g.y-x,width:x*2,height:x*2};for(const $ of E.values())YG(N,mD($))>0&&M.push($);return M}const AGn=250;function MGn(g,E,x,M){let N=[],$=1/0;const k=xGn(g,x,E+AGn);for(const H of k){const U=[...H.internals.handleBounds?.source??[],...H.internals.handleBounds?.target??[]];for(const G of U){if(M.nodeId===G.nodeId&&M.type===G.type&&M.id===G.id)continue;const{x:ie,y:W}=CA(H,G,G.position,!0),Z=Math.sqrt(Math.pow(ie-g.x,2)+Math.pow(W-g.y,2));Z>E||(Z<$?(N=[{...G,x:ie,y:W}],$=Z):Z===$&&N.push({...G,x:ie,y:W}))}}if(!N.length)return null;if(N.length>1){const H=M.type==="source"?"target":"source";return N.find(U=>U.type===H)??N[0]}return N[0]}function o0n(g,E,x,M,N,$=!1){const k=M.get(g);if(!k)return null;const H=N==="strict"?k.internals.handleBounds?.[E]:[...k.internals.handleBounds?.source??[],...k.internals.handleBounds?.target??[]],U=(x?H?.find(G=>G.id===x):H?.[0])??null;return U&&$?{...U,...CA(k,U,U.position,!0)}:U}function s0n(g,E){return g||(E?.classList.contains("target")?"target":E?.classList.contains("source")?"source":null)}function CGn(g,E){let x=null;return E?x=!0:g&&!E&&(x=!1),x}const l0n=()=>!0;function TGn(g,{connectionMode:E,connectionRadius:x,handleId:M,nodeId:N,edgeUpdaterType:$,isTarget:k,domNode:H,nodeLookup:U,lib:G,autoPanOnConnect:ie,flowId:W,panBy:Z,cancelConnection:le,onConnectStart:oe,onConnect:ee,onConnectEnd:Ce,isValidConnection:pe=l0n,onReconnectEnd:$e,updateConnection:ae,getTransform:Ne,getFromHandle:Ue,autoPanSpeed:ln,dragThreshold:un=1,handleDomNode:An}){const xn=Ydn(g.target);let nt=0,dn;const{x:bn,y:Y}=tv(g),Je=s0n($,An),pn=H?.getBoundingClientRect();let Ae=!1;if(!pn||!Je)return;const ve=o0n(N,Je,M,U,E);if(!ve)return;let nn=tv(g,pn),yn=!1,Pn=null,ye=!1,Re=null;function tt(){if(!ie||!pn)return;const[Er,Mt]=Udn(nn,pn,ln);Z({x:Er,y:Mt}),nt=requestAnimationFrame(tt)}const ut={...ve,nodeId:N,type:Je,position:ve.position},Jt=U.get(N);let Gt={inProgress:!0,isValid:null,from:CA(Jt,ut,ur.Left,!0),fromHandle:ut,fromPosition:ut.position,fromNode:Jt,to:nn,toHandle:null,toPosition:l1n[ut.position],toNode:null,pointer:nn};function xt(){Ae=!0,ae(Gt),oe?.(g,{nodeId:N,handleId:M,handleType:Je})}un===0&&xt();function si(Er){if(!Ae){const{x:Rs,y:ia}=tv(Er),ef=Rs-bn,Oa=ia-Y;if(!(ef*ef+Oa*Oa>un*un))return;xt()}if(!Ue()||!ut){Kr(Er);return}const Mt=Ne();nn=tv(Er,pn),dn=MGn(cq(nn,Mt,!1,[1,1]),x,U,ut),yn||(tt(),yn=!0);const bi=f0n(Er,{handle:dn,connectionMode:E,fromNodeId:N,fromHandleId:M,fromType:k?"target":"source",isValidConnection:pe,doc:xn,lib:G,flowId:W,nodeLookup:U});Re=bi.handleDomNode,Pn=bi.connection,ye=CGn(!!dn,bi.isValid);const zi=U.get(N),cu=zi?CA(zi,ut,ur.Left,!0):Gt.from,Fu={...Gt,from:cu,isValid:ye,to:bi.toHandle&&ye?xue({x:bi.toHandle.x,y:bi.toHandle.y},Mt):nn,toHandle:bi.toHandle,toPosition:ye&&bi.toHandle?bi.toHandle.position:l1n[ut.position],toNode:bi.toHandle?U.get(bi.toHandle.nodeId):null,pointer:nn};ae(Fu),Gt=Fu}function Kr(Er){if(!("touches"in Er&&Er.touches.length>0)){if(Ae){(dn||Re)&&Pn&&ye&&ee?.(Pn);const{inProgress:Mt,...bi}=Gt,zi={...bi,toPosition:Gt.toHandle?Gt.toPosition:null};Ce?.(Er,zi),$&&$e?.(Er,zi)}le(),cancelAnimationFrame(nt),yn=!1,ye=!1,Pn=null,Re=null,xn.removeEventListener("mousemove",si),xn.removeEventListener("mouseup",Kr),xn.removeEventListener("touchmove",si),xn.removeEventListener("touchend",Kr)}}xn.addEventListener("mousemove",si),xn.addEventListener("mouseup",Kr),xn.addEventListener("touchmove",si),xn.addEventListener("touchend",Kr)}function f0n(g,{handle:E,connectionMode:x,fromNodeId:M,fromHandleId:N,fromType:$,doc:k,lib:H,flowId:U,isValidConnection:G=l0n,nodeLookup:ie}){const W=$==="target",Z=E?k.querySelector(`.${H}-flow__handle[data-id="${U}-${E?.nodeId}-${E?.id}-${E?.type}"]`):null,{x:le,y:oe}=tv(g),ee=k.elementFromPoint(le,oe),Ce=ee?.classList.contains(`${H}-flow__handle`)?ee:Z,pe={handleDomNode:Ce,isValid:!1,connection:null,toHandle:null};if(Ce){const $e=s0n(void 0,Ce),ae=Ce.getAttribute("data-nodeid"),Ne=Ce.getAttribute("data-handleid"),Ue=Ce.classList.contains("connectable"),ln=Ce.classList.contains("connectableend");if(!ae||!$e)return pe;const un={source:W?ae:M,sourceHandle:W?Ne:N,target:W?M:ae,targetHandle:W?N:Ne};pe.connection=un;const xn=Ue&&ln&&(x===wD.Strict?W&&$e==="source"||!W&&$e==="target":ae!==M||Ne!==N);pe.isValid=xn&&G(un),pe.toHandle=o0n(ae,$e,Ne,ie,x,!0)}return pe}const fke={onPointerDown:TGn,isValid:f0n};function OGn({domNode:g,panZoom:E,getTransform:x,getViewScale:M}){const N=Fg(g);function $({translateExtent:H,width:U,height:G,zoomStep:ie=1,pannable:W=!0,zoomable:Z=!0,inversePan:le=!1}){const oe=ae=>{if(ae.sourceEvent.type!=="wheel"||!E)return;const Ne=x(),Ue=ae.sourceEvent.ctrlKey&&QG()?10:1,ln=-ae.sourceEvent.deltaY*(ae.sourceEvent.deltaMode===1?.05:ae.sourceEvent.deltaMode?1:.002)*ie,un=Ne[2]*Math.pow(2,ln*Ue);E.scaleTo(un)};let ee=[0,0];const Ce=ae=>{(ae.sourceEvent.type==="mousedown"||ae.sourceEvent.type==="touchstart")&&(ee=[ae.sourceEvent.clientX??ae.sourceEvent.touches[0].clientX,ae.sourceEvent.clientY??ae.sourceEvent.touches[0].clientY])},pe=ae=>{const Ne=x();if(ae.sourceEvent.type!=="mousemove"&&ae.sourceEvent.type!=="touchmove"||!E)return;const Ue=[ae.sourceEvent.clientX??ae.sourceEvent.touches[0].clientX,ae.sourceEvent.clientY??ae.sourceEvent.touches[0].clientY],ln=[Ue[0]-ee[0],Ue[1]-ee[1]];ee=Ue;const un=M()*Math.max(Ne[2],Math.log(Ne[2]))*(le?-1:1),An={x:Ne[0]-ln[0]*un,y:Ne[1]-ln[1]*un},xn=[[0,0],[U,G]];E.setViewportConstrained({x:An.x,y:An.y,zoom:Ne[2]},xn,H)},$e=Rdn().on("start",Ce).on("zoom",W?pe:null).on("zoom.wheel",Z?oe:null);N.call($e,{})}function k(){N.on("zoom",null)}return{update:$,destroy:k,pointer:Zm}}const $ue=g=>({x:g.x,y:g.y,zoom:g.k}),B7e=({x:g,y:E,zoom:x})=>_ue.translate(g,E).scale(x),fD=(g,E)=>g.target.closest(`.${E}`),a0n=(g,E)=>E===2&&Array.isArray(g)&&g.includes(2),NGn=g=>((g*=2)<=1?g*g*g:(g-=2)*g*g+2)/2,z7e=(g,E=0,x=NGn,M=()=>{})=>{const N=typeof E=="number"&&E>0;return N||M(),N?g.transition().duration(E).ease(x).on("end",M):g},h0n=g=>{const E=g.ctrlKey&&QG()?10:1;return-g.deltaY*(g.deltaMode===1?.05:g.deltaMode?1:.002)*E};function IGn({zoomPanValues:g,noWheelClassName:E,d3Selection:x,d3Zoom:M,panOnScrollMode:N,panOnScrollSpeed:$,zoomOnPinch:k,onPanZoomStart:H,onPanZoom:U,onPanZoomEnd:G}){return ie=>{if(fD(ie,E))return ie.ctrlKey&&ie.preventDefault(),!1;ie.preventDefault(),ie.stopImmediatePropagation();const W=x.property("__zoom").k||1;if(ie.ctrlKey&&k){const Ce=Zm(ie),pe=h0n(ie),$e=W*Math.pow(2,pe);M.scaleTo(x,$e,Ce,ie);return}const Z=ie.deltaMode===1?20:1;let le=N===EA.Vertical?0:ie.deltaX*Z,oe=N===EA.Horizontal?0:ie.deltaY*Z;!QG()&&ie.shiftKey&&N!==EA.Vertical&&(le=ie.deltaY*Z,oe=0),M.translateBy(x,-(le/W)*$,-(oe/W)*$,{internal:!0});const ee=$ue(x.property("__zoom"));clearTimeout(g.panScrollTimeout),g.isPanScrolling?(U?.(ie,ee),g.panScrollTimeout=setTimeout(()=>{G?.(ie,ee),g.isPanScrolling=!1},150)):(g.isPanScrolling=!0,H?.(ie,ee))}}function DGn({noWheelClassName:g,preventScrolling:E,d3ZoomHandler:x}){return function(M,N){const $=M.type==="wheel",k=!E&&$&&!M.ctrlKey,H=fD(M,g);if(M.ctrlKey&&$&&H&&M.preventDefault(),k||H)return null;M.preventDefault(),x.call(this,M,N)}}function _Gn({zoomPanValues:g,onDraggingChange:E,onPanZoomStart:x}){return M=>{if(M.sourceEvent?.internal)return;const N=$ue(M.transform);g.mouseButton=M.sourceEvent?.button||0,g.isZoomingOrPanning=!0,g.prevViewport=N,M.sourceEvent?.type==="mousedown"&&E(!0),x&&x?.(M.sourceEvent,N)}}function LGn({zoomPanValues:g,panOnDrag:E,onPaneContextMenu:x,onTransformChange:M,onPanZoom:N}){return $=>{g.usedRightMouseButton=!!(x&&a0n(E,g.mouseButton??0)),$.sourceEvent?.sync||M([$.transform.x,$.transform.y,$.transform.k]),N&&!$.sourceEvent?.internal&&N?.($.sourceEvent,$ue($.transform))}}function PGn({zoomPanValues:g,panOnDrag:E,panOnScroll:x,onDraggingChange:M,onPanZoomEnd:N,onPaneContextMenu:$}){return k=>{if(!k.sourceEvent?.internal&&(g.isZoomingOrPanning=!1,$&&a0n(E,g.mouseButton??0)&&!g.usedRightMouseButton&&k.sourceEvent&&$(k.sourceEvent),g.usedRightMouseButton=!1,M(!1),N)){const H=$ue(k.transform);g.prevViewport=H,clearTimeout(g.timerId),g.timerId=setTimeout(()=>{N?.(k.sourceEvent,H)},x?150:0)}}}function $Gn({zoomActivationKeyPressed:g,zoomOnScroll:E,zoomOnPinch:x,panOnDrag:M,panOnScroll:N,zoomOnDoubleClick:$,userSelectionActive:k,noWheelClassName:H,noPanClassName:U,lib:G,connectionInProgress:ie}){return W=>{const Z=g||E,le=x&&W.ctrlKey,oe=W.type==="wheel";if(W.button===1&&W.type==="mousedown"&&(fD(W,`${G}-flow__node`)||fD(W,`${G}-flow__edge`)))return!0;if(!M&&!Z&&!N&&!$&&!x||k||ie&&!oe||fD(W,H)&&oe||fD(W,U)&&(!oe||N&&oe&&!g)||!x&&W.ctrlKey&&oe)return!1;if(!x&&W.type==="touchstart"&&W.touches?.length>1)return W.preventDefault(),!1;if(!Z&&!N&&!le&&oe||!M&&(W.type==="mousedown"||W.type==="touchstart")||Array.isArray(M)&&!M.includes(W.button)&&W.type==="mousedown")return!1;const ee=Array.isArray(M)&&M.includes(W.button)||!W.button||W.button<=1;return(!W.ctrlKey||oe)&&ee}}function RGn({domNode:g,minZoom:E,maxZoom:x,translateExtent:M,viewport:N,onPanZoom:$,onPanZoomStart:k,onPanZoomEnd:H,onDraggingChange:U}){const G={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},ie=g.getBoundingClientRect(),W=Rdn().scaleExtent([E,x]).translateExtent(M),Z=Fg(g).call(W);$e({x:N.x,y:N.y,zoom:pD(N.zoom,E,x)},[[0,0],[ie.width,ie.height]],M);const le=Z.on("wheel.zoom"),oe=Z.on("dblclick.zoom");W.wheelDelta(h0n);function ee(dn,bn){return Z?new Promise(Y=>{W?.interpolate(bn?.interpolate==="linear"?FG:due).transform(z7e(Z,bn?.duration,bn?.ease,()=>Y(!0)),dn)}):Promise.resolve(!1)}function Ce({noWheelClassName:dn,noPanClassName:bn,onPaneContextMenu:Y,userSelectionActive:Je,panOnScroll:pn,panOnDrag:Ae,panOnScrollMode:ve,panOnScrollSpeed:nn,preventScrolling:yn,zoomOnPinch:Pn,zoomOnScroll:ye,zoomOnDoubleClick:Re,zoomActivationKeyPressed:tt,lib:ut,onTransformChange:Jt,connectionInProgress:di,paneClickDistance:Gt,selectionOnDrag:xt}){Je&&!G.isZoomingOrPanning&&pe();const si=pn&&!tt&&!Je;W.clickDistance(xt?1/0:!nv(Gt)||Gt<0?0:Gt);const Kr=si?IGn({zoomPanValues:G,noWheelClassName:dn,d3Selection:Z,d3Zoom:W,panOnScrollMode:ve,panOnScrollSpeed:nn,zoomOnPinch:Pn,onPanZoomStart:k,onPanZoom:$,onPanZoomEnd:H}):DGn({noWheelClassName:dn,preventScrolling:yn,d3ZoomHandler:le});if(Z.on("wheel.zoom",Kr,{passive:!1}),!Je){const Mt=_Gn({zoomPanValues:G,onDraggingChange:U,onPanZoomStart:k});W.on("start",Mt);const bi=LGn({zoomPanValues:G,panOnDrag:Ae,onPaneContextMenu:!!Y,onPanZoom:$,onTransformChange:Jt});W.on("zoom",bi);const zi=PGn({zoomPanValues:G,panOnDrag:Ae,panOnScroll:pn,onPaneContextMenu:Y,onPanZoomEnd:H,onDraggingChange:U});W.on("end",zi)}const Er=$Gn({zoomActivationKeyPressed:tt,panOnDrag:Ae,zoomOnScroll:ye,panOnScroll:pn,zoomOnDoubleClick:Re,zoomOnPinch:Pn,userSelectionActive:Je,noPanClassName:bn,noWheelClassName:dn,lib:ut,connectionInProgress:di});W.filter(Er),Re?Z.on("dblclick.zoom",oe):Z.on("dblclick.zoom",null)}function pe(){W.on("zoom",null)}async function $e(dn,bn,Y){const Je=B7e(dn),pn=W?.constrain()(Je,bn,Y);return pn&&await ee(pn),new Promise(Ae=>Ae(pn))}async function ae(dn,bn){const Y=B7e(dn);return await ee(Y,bn),new Promise(Je=>Je(Y))}function Ne(dn){if(Z){const bn=B7e(dn),Y=Z.property("__zoom");(Y.k!==dn.zoom||Y.x!==dn.x||Y.y!==dn.y)&&W?.transform(Z,bn,null,{sync:!0})}}function Ue(){const dn=Z?$dn(Z.node()):{x:0,y:0,k:1};return{x:dn.x,y:dn.y,zoom:dn.k}}function ln(dn,bn){return Z?new Promise(Y=>{W?.interpolate(bn?.interpolate==="linear"?FG:due).scaleTo(z7e(Z,bn?.duration,bn?.ease,()=>Y(!0)),dn)}):Promise.resolve(!1)}function un(dn,bn){return Z?new Promise(Y=>{W?.interpolate(bn?.interpolate==="linear"?FG:due).scaleBy(z7e(Z,bn?.duration,bn?.ease,()=>Y(!0)),dn)}):Promise.resolve(!1)}function An(dn){W?.scaleExtent(dn)}function xn(dn){W?.translateExtent(dn)}function nt(dn){const bn=!nv(dn)||dn<0?0:dn;W?.clickDistance(bn)}return{update:Ce,destroy:pe,setViewport:ae,setViewportConstrained:$e,getViewport:Ue,scaleTo:ln,scaleBy:un,setScaleExtent:An,setTranslateExtent:xn,syncViewport:Ne,setClickDistance:nt}}var yD;(function(g){g.Line="line",g.Handle="handle"})(yD||(yD={}));function BGn({width:g,prevWidth:E,height:x,prevHeight:M,affectsX:N,affectsY:$}){const k=g-E,H=x-M,U=[k>0?1:k<0?-1:0,H>0?1:H<0?-1:0];return k&&N&&(U[0]=U[0]*-1),H&&$&&(U[1]=U[1]*-1),U}function j1n(g){const E=g.includes("right")||g.includes("left"),x=g.includes("bottom")||g.includes("top"),M=g.includes("left"),N=g.includes("top");return{isHorizontal:E,isVertical:x,affectsX:M,affectsY:N}}function W7(g,E){return Math.max(0,E-g)}function Z7(g,E){return Math.max(0,g-E)}function iue(g,E,x){return Math.max(0,E-g,g-x)}function E1n(g,E){return g?!E:E}function zGn(g,E,x,M,N,$,k,H){let{affectsX:U,affectsY:G}=E;const{isHorizontal:ie,isVertical:W}=E,Z=ie&&W,{xSnapped:le,ySnapped:oe}=x,{minWidth:ee,maxWidth:Ce,minHeight:pe,maxHeight:$e}=M,{x:ae,y:Ne,width:Ue,height:ln,aspectRatio:un}=g;let An=Math.floor(ie?le-g.pointerX:0),xn=Math.floor(W?oe-g.pointerY:0);const nt=Ue+(U?-An:An),dn=ln+(G?-xn:xn),bn=-$[0]*Ue,Y=-$[1]*ln;let Je=iue(nt,ee,Ce),pn=iue(dn,pe,$e);if(k){let nn=0,yn=0;U&&An<0?nn=W7(ae+An+bn,k[0][0]):!U&&An>0&&(nn=Z7(ae+nt+bn,k[1][0])),G&&xn<0?yn=W7(Ne+xn+Y,k[0][1]):!G&&xn>0&&(yn=Z7(Ne+dn+Y,k[1][1])),Je=Math.max(Je,nn),pn=Math.max(pn,yn)}if(H){let nn=0,yn=0;U&&An>0?nn=Z7(ae+An,H[0][0]):!U&&An<0&&(nn=W7(ae+nt,H[1][0])),G&&xn>0?yn=Z7(Ne+xn,H[0][1]):!G&&xn<0&&(yn=W7(Ne+dn,H[1][1])),Je=Math.max(Je,nn),pn=Math.max(pn,yn)}if(N){if(ie){const nn=iue(nt/un,pe,$e)*un;if(Je=Math.max(Je,nn),k){let yn=0;!U&&!G||U&&!G&&Z?yn=Z7(Ne+Y+nt/un,k[1][1])*un:yn=W7(Ne+Y+(U?An:-An)/un,k[0][1])*un,Je=Math.max(Je,yn)}if(H){let yn=0;!U&&!G||U&&!G&&Z?yn=W7(Ne+nt/un,H[1][1])*un:yn=Z7(Ne+(U?An:-An)/un,H[0][1])*un,Je=Math.max(Je,yn)}}if(W){const nn=iue(dn*un,ee,Ce)/un;if(pn=Math.max(pn,nn),k){let yn=0;!U&&!G||G&&!U&&Z?yn=Z7(ae+dn*un+bn,k[1][0])/un:yn=W7(ae+(G?xn:-xn)*un+bn,k[0][0])/un,pn=Math.max(pn,yn)}if(H){let yn=0;!U&&!G||G&&!U&&Z?yn=W7(ae+dn*un,H[1][0])/un:yn=Z7(ae+(G?xn:-xn)*un,H[0][0])/un,pn=Math.max(pn,yn)}}}xn=xn+(xn<0?pn:-pn),An=An+(An<0?Je:-Je),N&&(Z?nt>dn*un?xn=(E1n(U,G)?-An:An)/un:An=(E1n(U,G)?-xn:xn)*un:ie?(xn=An/un,G=U):(An=xn*un,U=G));const Ae=U?ae+An:ae,ve=G?Ne+xn:Ne;return{width:Ue+(U?-An:An),height:ln+(G?-xn:xn),x:$[0]*An*(U?-1:1)+Ae,y:$[1]*xn*(G?-1:1)+ve}}const d0n={width:0,height:0,x:0,y:0},FGn={...d0n,pointerX:0,pointerY:0,aspectRatio:1};function JGn(g){return[[0,0],[g.measured.width,g.measured.height]]}function HGn(g,E,x){const M=E.position.x+g.position.x,N=E.position.y+g.position.y,$=g.measured.width??0,k=g.measured.height??0,H=x[0]*$,U=x[1]*k;return[[M-H,N-U],[M+$-H,N+k-U]]}function GGn({domNode:g,nodeId:E,getStoreItems:x,onChange:M,onEnd:N}){const $=Fg(g);let k={controlDirection:j1n("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function H({controlPosition:G,boundaries:ie,keepAspectRatio:W,resizeDirection:Z,onResizeStart:le,onResize:oe,onResizeEnd:ee,shouldResize:Ce}){let pe={...d0n},$e={...FGn};k={boundaries:ie,resizeDirection:Z,keepAspectRatio:W,controlDirection:j1n(G)};let ae,Ne=null,Ue=[],ln,un,An,xn=!1;const nt=Edn().on("start",dn=>{const{nodeLookup:bn,transform:Y,snapGrid:Je,snapToGrid:pn,nodeOrigin:Ae,paneDomNode:ve}=x();if(ae=bn.get(E),!ae)return;Ne=ve?.getBoundingClientRect()??null;const{xSnapped:nn,ySnapped:yn}=JG(dn.sourceEvent,{transform:Y,snapGrid:Je,snapToGrid:pn,containerBounds:Ne});pe={width:ae.measured.width??0,height:ae.measured.height??0,x:ae.position.x??0,y:ae.position.y??0},$e={...pe,pointerX:nn,pointerY:yn,aspectRatio:pe.width/pe.height},ln=void 0,ae.parentId&&(ae.extent==="parent"||ae.expandParent)&&(ln=bn.get(ae.parentId),un=ln&&ae.extent==="parent"?JGn(ln):void 0),Ue=[],An=void 0;for(const[Pn,ye]of bn)if(ye.parentId===E&&(Ue.push({id:Pn,position:{...ye.position},extent:ye.extent}),ye.extent==="parent"||ye.expandParent)){const Re=HGn(ye,ae,ye.origin??Ae);An?An=[[Math.min(Re[0][0],An[0][0]),Math.min(Re[0][1],An[0][1])],[Math.max(Re[1][0],An[1][0]),Math.max(Re[1][1],An[1][1])]]:An=Re}le?.(dn,{...pe})}).on("drag",dn=>{const{transform:bn,snapGrid:Y,snapToGrid:Je,nodeOrigin:pn}=x(),Ae=JG(dn.sourceEvent,{transform:bn,snapGrid:Y,snapToGrid:Je,containerBounds:Ne}),ve=[];if(!ae)return;const{x:nn,y:yn,width:Pn,height:ye}=pe,Re={},tt=ae.origin??pn,{width:ut,height:Jt,x:di,y:Gt}=zGn($e,k.controlDirection,Ae,k.boundaries,k.keepAspectRatio,tt,un,An),xt=ut!==Pn,si=Jt!==ye,Kr=di!==nn&&xt,Er=Gt!==yn&&si;if(!Kr&&!Er&&!xt&&!si)return;if((Kr||Er||tt[0]===1||tt[1]===1)&&(Re.x=Kr?di:pe.x,Re.y=Er?Gt:pe.y,pe.x=Re.x,pe.y=Re.y,Ue.length>0)){const cu=di-nn,Fu=Gt-yn;for(const Rs of Ue)Rs.position={x:Rs.position.x-cu+tt[0]*(ut-Pn),y:Rs.position.y-Fu+tt[1]*(Jt-ye)},ve.push(Rs)}if((xt||si)&&(Re.width=xt&&(!k.resizeDirection||k.resizeDirection==="horizontal")?ut:pe.width,Re.height=si&&(!k.resizeDirection||k.resizeDirection==="vertical")?Jt:pe.height,pe.width=Re.width,pe.height=Re.height),ln&&ae.expandParent){const cu=tt[0]*(Re.width??0);Re.x&&Re.x{xn&&(ee?.(dn,{...pe}),N?.({...pe}),xn=!1)});$.call(nt)}function U(){$.on(".drag",null)}return{update:H,destroy:U}}var F7e={exports:{}},J7e={},H7e={exports:{}},G7e={};var S1n;function qGn(){if(S1n)return G7e;S1n=1;var g=ZG();function E(W,Z){return W===Z&&(W!==0||1/W===1/Z)||W!==W&&Z!==Z}var x=typeof Object.is=="function"?Object.is:E,M=g.useState,N=g.useEffect,$=g.useLayoutEffect,k=g.useDebugValue;function H(W,Z){var le=Z(),oe=M({inst:{value:le,getSnapshot:Z}}),ee=oe[0].inst,Ce=oe[1];return $(function(){ee.value=le,ee.getSnapshot=Z,U(ee)&&Ce({inst:ee})},[W,le,Z]),N(function(){return U(ee)&&Ce({inst:ee}),W(function(){U(ee)&&Ce({inst:ee})})},[W]),k(le),le}function U(W){var Z=W.getSnapshot;W=W.value;try{var le=Z();return!x(W,le)}catch{return!0}}function G(W,Z){return Z()}var ie=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?G:H;return G7e.useSyncExternalStore=g.useSyncExternalStore!==void 0?g.useSyncExternalStore:ie,G7e}var x1n;function UGn(){return x1n||(x1n=1,H7e.exports=qGn()),H7e.exports}var A1n;function XGn(){if(A1n)return J7e;A1n=1;var g=ZG(),E=UGn();function x(G,ie){return G===ie&&(G!==0||1/G===1/ie)||G!==G&&ie!==ie}var M=typeof Object.is=="function"?Object.is:x,N=E.useSyncExternalStore,$=g.useRef,k=g.useEffect,H=g.useMemo,U=g.useDebugValue;return J7e.useSyncExternalStoreWithSelector=function(G,ie,W,Z,le){var oe=$(null);if(oe.current===null){var ee={hasValue:!1,value:null};oe.current=ee}else ee=oe.current;oe=H(function(){function pe(ln){if(!$e){if($e=!0,ae=ln,ln=Z(ln),le!==void 0&&ee.hasValue){var un=ee.value;if(le(un,ln))return Ne=un}return Ne=ln}if(un=Ne,M(ae,ln))return un;var An=Z(ln);return le!==void 0&&le(un,An)?(ae=ln,un):(ae=ln,Ne=An)}var $e=!1,ae,Ne,Ue=W===void 0?null:W;return[function(){return pe(ie())},Ue===null?void 0:function(){return pe(Ue())}]},[ie,W,Z,le]);var Ce=N(G,oe[0],oe[1]);return k(function(){ee.hasValue=!0,ee.value=Ce},[Ce]),U(Ce),Ce},J7e}var M1n;function KGn(){return M1n||(M1n=1,F7e.exports=XGn()),F7e.exports}var VGn=KGn();const YGn=bke(VGn),QGn={},C1n=g=>{let E;const x=new Set,M=(ie,W)=>{const Z=typeof ie=="function"?ie(E):ie;if(!Object.is(Z,E)){const le=E;E=W??(typeof Z!="object"||Z===null)?Z:Object.assign({},E,Z),x.forEach(oe=>oe(E,le))}},N=()=>E,U={setState:M,getState:N,getInitialState:()=>G,subscribe:ie=>(x.add(ie),()=>x.delete(ie)),destroy:()=>{(QGn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),x.clear()}},G=E=g(M,N,U);return U},WGn=g=>g?C1n(g):C1n,{useDebugValue:ZGn}=uzn,{useSyncExternalStoreWithSelector:eqn}=YGn,nqn=g=>g;function b0n(g,E=nqn,x){const M=eqn(g.subscribe,g.getState,g.getServerState||g.getInitialState,E,x);return ZGn(M),M}const T1n=(g,E)=>{const x=WGn(g),M=(N,$=E)=>b0n(x,N,$);return Object.assign(M,x),M},tqn=(g,E)=>g?T1n(g,E):T1n;function jl(g,E){if(Object.is(g,E))return!0;if(typeof g!="object"||g===null||typeof E!="object"||E===null)return!1;if(g instanceof Map&&E instanceof Map){if(g.size!==E.size)return!1;for(const[M,N]of g)if(!Object.is(N,E.get(M)))return!1;return!0}if(g instanceof Set&&E instanceof Set){if(g.size!==E.size)return!1;for(const M of g)if(!E.has(M))return!1;return!0}const x=Object.keys(g);if(x.length!==Object.keys(E).length)return!1;for(const M of x)if(!Object.prototype.hasOwnProperty.call(E,M)||!Object.is(g[M],E[M]))return!1;return!0}var iqn=sdn();const Rue=Be.createContext(null),rqn=Rue.Provider,g0n=a5.error001();function zu(g,E){const x=Be.useContext(Rue);if(x===null)throw new Error(g0n);return b0n(x,g,E)}function El(){const g=Be.useContext(Rue);if(g===null)throw new Error(g0n);return Be.useMemo(()=>({getState:g.getState,setState:g.setState,subscribe:g.subscribe}),[g])}const O1n={display:"none"},cqn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},w0n="react-flow__node-desc",p0n="react-flow__edge-desc",uqn="react-flow__aria-live",oqn=g=>g.ariaLiveMessage,sqn=g=>g.ariaLabelConfig;function lqn({rfId:g}){const E=zu(oqn);return L.jsx("div",{id:`${uqn}-${g}`,"aria-live":"assertive","aria-atomic":"true",style:cqn,children:E})}function fqn({rfId:g,disableKeyboardA11y:E}){const x=zu(sqn);return L.jsxs(L.Fragment,{children:[L.jsx("div",{id:`${w0n}-${g}`,style:O1n,children:E?x["node.a11yDescription.default"]:x["node.a11yDescription.keyboardDisabled"]}),L.jsx("div",{id:`${p0n}-${g}`,style:O1n,children:x["edge.a11yDescription.default"]}),!E&&L.jsx(lqn,{rfId:g})]})}const Bue=Be.forwardRef(({position:g="top-left",children:E,className:x,style:M,...N},$)=>{const k=`${g}`.split("-");return L.jsx("div",{className:Ta(["react-flow__panel",x,...k]),style:M,ref:$,...N,children:E})});Bue.displayName="Panel";function aqn({proOptions:g,position:E="bottom-right"}){return g?.hideAttribution?null:L.jsx(Bue,{position:E,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:L.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const hqn=g=>{const E=[],x=[];for(const[,M]of g.nodeLookup)M.selected&&E.push(M.internals.userNode);for(const[,M]of g.edgeLookup)M.selected&&x.push(M);return{selectedNodes:E,selectedEdges:x}},rue=g=>g.id;function dqn(g,E){return jl(g.selectedNodes.map(rue),E.selectedNodes.map(rue))&&jl(g.selectedEdges.map(rue),E.selectedEdges.map(rue))}function bqn({onSelectionChange:g}){const E=El(),{selectedNodes:x,selectedEdges:M}=zu(hqn,dqn);return Be.useEffect(()=>{const N={nodes:x,edges:M};g?.(N),E.getState().onSelectionChangeHandlers.forEach($=>$(N))},[x,M,g]),null}const gqn=g=>!!g.onSelectionChangeHandlers;function wqn({onSelectionChange:g}){const E=zu(gqn);return g||E?L.jsx(bqn,{onSelectionChange:g}):null}const ake=typeof window<"u"?Be.useLayoutEffect:Be.useEffect,m0n=[0,0],pqn={x:0,y:0,zoom:1},mqn=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],N1n=[...mqn,"rfId"],vqn=g=>({setNodes:g.setNodes,setEdges:g.setEdges,setMinZoom:g.setMinZoom,setMaxZoom:g.setMaxZoom,setTranslateExtent:g.setTranslateExtent,setNodeExtent:g.setNodeExtent,reset:g.reset,setDefaultNodesAndEdges:g.setDefaultNodesAndEdges}),I1n={translateExtent:XG,nodeOrigin:m0n,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function yqn(g){const{setNodes:E,setEdges:x,setMinZoom:M,setMaxZoom:N,setTranslateExtent:$,setNodeExtent:k,reset:H,setDefaultNodesAndEdges:U}=zu(vqn,jl),G=El();ake(()=>(U(g.defaultNodes,g.defaultEdges),()=>{ie.current=I1n,H()}),[]);const ie=Be.useRef(I1n);return ake(()=>{for(const W of N1n){const Z=g[W],le=ie.current[W];Z!==le&&(typeof g[W]>"u"||(W==="nodes"?E(Z):W==="edges"?x(Z):W==="minZoom"?M(Z):W==="maxZoom"?N(Z):W==="translateExtent"?$(Z):W==="nodeExtent"?k(Z):W==="ariaLabelConfig"?G.setState({ariaLabelConfig:tGn(Z)}):W==="fitView"?G.setState({fitViewQueued:Z}):W==="fitViewOptions"?G.setState({fitViewOptions:Z}):G.setState({[W]:Z})))}ie.current=g},N1n.map(W=>g[W])),null}function D1n(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function kqn(g){const[E,x]=Be.useState(g==="system"?null:g);return Be.useEffect(()=>{if(g!=="system"){x(g);return}const M=D1n(),N=()=>x(M?.matches?"dark":"light");return N(),M?.addEventListener("change",N),()=>{M?.removeEventListener("change",N)}},[g]),E!==null?E:D1n()?.matches?"dark":"light"}const _1n=typeof document<"u"?document:null;function WG(g=null,E={target:_1n,actInsideInputWithModifier:!0}){const[x,M]=Be.useState(!1),N=Be.useRef(!1),$=Be.useRef(new Set([])),[k,H]=Be.useMemo(()=>{if(g!==null){const G=(Array.isArray(g)?g:[g]).filter(W=>typeof W=="string").map(W=>W.replace("+",` +`).replace(` + +`,` ++`).split(` +`)),ie=G.reduce((W,Z)=>W.concat(...Z),[]);return[G,ie]}return[[],[]]},[g]);return Be.useEffect(()=>{const U=E?.target??_1n,G=E?.actInsideInputWithModifier??!0;if(g!==null){const ie=le=>{if(N.current=le.ctrlKey||le.metaKey||le.shiftKey||le.altKey,(!N.current||N.current&&!G)&&Qdn(le))return!1;const ee=P1n(le.code,H);if($.current.add(le[ee]),L1n(k,$.current,!1)){const Ce=le.composedPath?.()?.[0]||le.target,pe=Ce?.nodeName==="BUTTON"||Ce?.nodeName==="A";E.preventDefault!==!1&&(N.current||!pe)&&le.preventDefault(),M(!0)}},W=le=>{const oe=P1n(le.code,H);L1n(k,$.current,!0)?(M(!1),$.current.clear()):$.current.delete(le[oe]),le.key==="Meta"&&$.current.clear(),N.current=!1},Z=()=>{$.current.clear(),M(!1)};return U?.addEventListener("keydown",ie),U?.addEventListener("keyup",W),window.addEventListener("blur",Z),window.addEventListener("contextmenu",Z),()=>{U?.removeEventListener("keydown",ie),U?.removeEventListener("keyup",W),window.removeEventListener("blur",Z),window.removeEventListener("contextmenu",Z)}}},[g,M]),x}function L1n(g,E,x){return g.filter(M=>x||M.length===E.size).some(M=>M.every(N=>E.has(N)))}function P1n(g,E){return E.includes(g)?"code":"key"}const jqn=()=>{const g=El();return Be.useMemo(()=>({zoomIn:E=>{const{panZoom:x}=g.getState();return x?x.scaleBy(1.2,E):Promise.resolve(!1)},zoomOut:E=>{const{panZoom:x}=g.getState();return x?x.scaleBy(1/1.2,E):Promise.resolve(!1)},zoomTo:(E,x)=>{const{panZoom:M}=g.getState();return M?M.scaleTo(E,x):Promise.resolve(!1)},getZoom:()=>g.getState().transform[2],setViewport:async(E,x)=>{const{transform:[M,N,$],panZoom:k}=g.getState();return k?(await k.setViewport({x:E.x??M,y:E.y??N,zoom:E.zoom??$},x),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[E,x,M]=g.getState().transform;return{x:E,y:x,zoom:M}},setCenter:async(E,x,M)=>g.getState().setCenter(E,x,M),fitBounds:async(E,x)=>{const{width:M,height:N,minZoom:$,maxZoom:k,panZoom:H}=g.getState(),U=Ske(E,M,N,$,k,x?.padding??.1);return H?(await H.setViewport(U,{duration:x?.duration,ease:x?.ease,interpolate:x?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(E,x={})=>{const{transform:M,snapGrid:N,snapToGrid:$,domNode:k}=g.getState();if(!k)return E;const{x:H,y:U}=k.getBoundingClientRect(),G={x:E.x-H,y:E.y-U},ie=x.snapGrid??N,W=x.snapToGrid??$;return cq(G,M,W,ie)},flowToScreenPosition:E=>{const{transform:x,domNode:M}=g.getState();if(!M)return E;const{x:N,y:$}=M.getBoundingClientRect(),k=xue(E,x);return{x:k.x+N,y:k.y+$}}}),[])};function v0n(g,E){const x=[],M=new Map,N=[];for(const $ of g)if($.type==="add"){N.push($);continue}else if($.type==="remove"||$.type==="replace")M.set($.id,[$]);else{const k=M.get($.id);k?k.push($):M.set($.id,[$])}for(const $ of E){const k=M.get($.id);if(!k){x.push($);continue}if(k[0].type==="remove")continue;if(k[0].type==="replace"){x.push({...k[0].item});continue}const H={...$};for(const U of k)Eqn(U,H);x.push(H)}return N.length&&N.forEach($=>{$.index!==void 0?x.splice($.index,0,{...$.item}):x.push({...$.item})}),x}function Eqn(g,E){switch(g.type){case"select":{E.selected=g.selected;break}case"position":{typeof g.position<"u"&&(E.position=g.position),typeof g.dragging<"u"&&(E.dragging=g.dragging);break}case"dimensions":{typeof g.dimensions<"u"&&(E.measured={...g.dimensions},g.setAttributes&&((g.setAttributes===!0||g.setAttributes==="width")&&(E.width=g.dimensions.width),(g.setAttributes===!0||g.setAttributes==="height")&&(E.height=g.dimensions.height))),typeof g.resizing=="boolean"&&(E.resizing=g.resizing);break}}}function y0n(g,E){return v0n(g,E)}function k0n(g,E){return v0n(g,E)}function yA(g,E){return{id:g,type:"select",selected:E}}function aD(g,E=new Set,x=!1){const M=[];for(const[N,$]of g){const k=E.has(N);!($.selected===void 0&&!k)&&$.selected!==k&&(x&&($.selected=k),M.push(yA($.id,k)))}return M}function $1n({items:g=[],lookup:E}){const x=[],M=new Map(g.map(N=>[N.id,N]));for(const[N,$]of g.entries()){const k=E.get($.id),H=k?.internals?.userNode??k;H!==void 0&&H!==$&&x.push({id:$.id,item:$,type:"replace"}),H===void 0&&x.push({item:$,type:"add",index:N})}for(const[N]of E)M.get(N)===void 0&&x.push({id:N,type:"remove"});return x}function R1n(g){return{id:g.id,type:"remove"}}const B1n=g=>UHn(g),Sqn=g=>Hdn(g);function j0n(g){return Be.forwardRef(g)}function z1n(g){const[E,x]=Be.useState(BigInt(0)),[M]=Be.useState(()=>xqn(()=>x(N=>N+BigInt(1))));return ake(()=>{const N=M.get();N.length&&(g(N),M.reset())},[E]),M}function xqn(g){let E=[];return{get:()=>E,reset:()=>{E=[]},push:x=>{E.push(x),g()}}}const E0n=Be.createContext(null);function Aqn({children:g}){const E=El(),x=Be.useCallback(H=>{const{nodes:U=[],setNodes:G,hasDefaultNodes:ie,onNodesChange:W,nodeLookup:Z,fitViewQueued:le,onNodesChangeMiddlewareMap:oe}=E.getState();let ee=U;for(const pe of H)ee=typeof pe=="function"?pe(ee):pe;let Ce=$1n({items:ee,lookup:Z});for(const pe of oe.values())Ce=pe(Ce);ie&&G(ee),Ce.length>0?W?.(Ce):le&&window.requestAnimationFrame(()=>{const{fitViewQueued:pe,nodes:$e,setNodes:ae}=E.getState();pe&&ae($e)})},[]),M=z1n(x),N=Be.useCallback(H=>{const{edges:U=[],setEdges:G,hasDefaultEdges:ie,onEdgesChange:W,edgeLookup:Z}=E.getState();let le=U;for(const oe of H)le=typeof oe=="function"?oe(le):oe;ie?G(le):W&&W($1n({items:le,lookup:Z}))},[]),$=z1n(N),k=Be.useMemo(()=>({nodeQueue:M,edgeQueue:$}),[]);return L.jsx(E0n.Provider,{value:k,children:g})}function Mqn(){const g=Be.useContext(E0n);if(!g)throw new Error("useBatchContext must be used within a BatchProvider");return g}const Cqn=g=>!!g.panZoom;function Nke(){const g=jqn(),E=El(),x=Mqn(),M=zu(Cqn),N=Be.useMemo(()=>{const $=W=>E.getState().nodeLookup.get(W),k=W=>{x.nodeQueue.push(W)},H=W=>{x.edgeQueue.push(W)},U=W=>{const{nodeLookup:Z,nodeOrigin:le}=E.getState(),oe=B1n(W)?W:Z.get(W.id),ee=oe.parentId?Vdn(oe.position,oe.measured,oe.parentId,Z,le):oe.position,Ce={...oe,position:ee,width:oe.measured?.width??oe.width,height:oe.measured?.height??oe.height};return mD(Ce)},G=(W,Z,le={replace:!1})=>{k(oe=>oe.map(ee=>{if(ee.id===W){const Ce=typeof Z=="function"?Z(ee):Z;return le.replace&&B1n(Ce)?Ce:{...ee,...Ce}}return ee}))},ie=(W,Z,le={replace:!1})=>{H(oe=>oe.map(ee=>{if(ee.id===W){const Ce=typeof Z=="function"?Z(ee):Z;return le.replace&&Sqn(Ce)?Ce:{...ee,...Ce}}return ee}))};return{getNodes:()=>E.getState().nodes.map(W=>({...W})),getNode:W=>$(W)?.internals.userNode,getInternalNode:$,getEdges:()=>{const{edges:W=[]}=E.getState();return W.map(Z=>({...Z}))},getEdge:W=>E.getState().edgeLookup.get(W),setNodes:k,setEdges:H,addNodes:W=>{const Z=Array.isArray(W)?W:[W];x.nodeQueue.push(le=>[...le,...Z])},addEdges:W=>{const Z=Array.isArray(W)?W:[W];x.edgeQueue.push(le=>[...le,...Z])},toObject:()=>{const{nodes:W=[],edges:Z=[],transform:le}=E.getState(),[oe,ee,Ce]=le;return{nodes:W.map(pe=>({...pe})),edges:Z.map(pe=>({...pe})),viewport:{x:oe,y:ee,zoom:Ce}}},deleteElements:async({nodes:W=[],edges:Z=[]})=>{const{nodes:le,edges:oe,onNodesDelete:ee,onEdgesDelete:Ce,triggerNodeChanges:pe,triggerEdgeChanges:$e,onDelete:ae,onBeforeDelete:Ne}=E.getState(),{nodes:Ue,edges:ln}=await QHn({nodesToRemove:W,edgesToRemove:Z,nodes:le,edges:oe,onBeforeDelete:Ne}),un=ln.length>0,An=Ue.length>0;if(un){const xn=ln.map(R1n);Ce?.(ln),$e(xn)}if(An){const xn=Ue.map(R1n);ee?.(Ue),pe(xn)}return(An||un)&&ae?.({nodes:Ue,edges:ln}),{deletedNodes:Ue,deletedEdges:ln}},getIntersectingNodes:(W,Z=!0,le)=>{const oe=a1n(W),ee=oe?W:U(W),Ce=le!==void 0;return ee?(le||E.getState().nodes).filter(pe=>{const $e=E.getState().nodeLookup.get(pe.id);if($e&&!oe&&(pe.id===W.id||!$e.internals.positionAbsolute))return!1;const ae=mD(Ce?pe:$e),Ne=YG(ae,ee);return Z&&Ne>0||Ne>=ae.width*ae.height||Ne>=ee.width*ee.height}):[]},isNodeIntersecting:(W,Z,le=!0)=>{const ee=a1n(W)?W:U(W);if(!ee)return!1;const Ce=YG(ee,Z);return le&&Ce>0||Ce>=Z.width*Z.height||Ce>=ee.width*ee.height},updateNode:G,updateNodeData:(W,Z,le={replace:!1})=>{G(W,oe=>{const ee=typeof Z=="function"?Z(oe):Z;return le.replace?{...oe,data:ee}:{...oe,data:{...oe.data,...ee}}},le)},updateEdge:ie,updateEdgeData:(W,Z,le={replace:!1})=>{ie(W,oe=>{const ee=typeof Z=="function"?Z(oe):Z;return le.replace?{...oe,data:ee}:{...oe,data:{...oe.data,...ee}}},le)},getNodesBounds:W=>{const{nodeLookup:Z,nodeOrigin:le}=E.getState();return XHn(W,{nodeLookup:Z,nodeOrigin:le})},getHandleConnections:({type:W,id:Z,nodeId:le})=>Array.from(E.getState().connectionLookup.get(`${le}-${W}${Z?`-${Z}`:""}`)?.values()??[]),getNodeConnections:({type:W,handleId:Z,nodeId:le})=>Array.from(E.getState().connectionLookup.get(`${le}${W?Z?`-${W}-${Z}`:`-${W}`:""}`)?.values()??[]),fitView:async W=>{const Z=E.getState().fitViewResolver??nGn();return E.setState({fitViewQueued:!0,fitViewOptions:W,fitViewResolver:Z}),x.nodeQueue.push(le=>[...le]),Z.promise}}},[]);return Be.useMemo(()=>({...N,...g,viewportInitialized:M}),[M])}const F1n=g=>g.selected,Tqn=typeof window<"u"?window:void 0;function Oqn({deleteKeyCode:g,multiSelectionKeyCode:E}){const x=El(),{deleteElements:M}=Nke(),N=WG(g,{actInsideInputWithModifier:!1}),$=WG(E,{target:Tqn});Be.useEffect(()=>{if(N){const{edges:k,nodes:H}=x.getState();M({nodes:H.filter(F1n),edges:k.filter(F1n)}),x.setState({nodesSelectionActive:!1})}},[N]),Be.useEffect(()=>{x.setState({multiSelectionActive:$})},[$])}function Nqn(g){const E=El();Be.useEffect(()=>{const x=()=>{if(!g.current||!(g.current.checkVisibility?.()??!0))return!1;const M=xke(g.current);(M.height===0||M.width===0)&&E.getState().onError?.("004",a5.error004()),E.setState({width:M.width||500,height:M.height||500})};if(g.current){x(),window.addEventListener("resize",x);const M=new ResizeObserver(()=>x());return M.observe(g.current),()=>{window.removeEventListener("resize",x),M&&g.current&&M.unobserve(g.current)}}},[])}const zue={position:"absolute",width:"100%",height:"100%",top:0,left:0},Iqn=g=>({userSelectionActive:g.userSelectionActive,lib:g.lib,connectionInProgress:g.connection.inProgress});function Dqn({onPaneContextMenu:g,zoomOnScroll:E=!0,zoomOnPinch:x=!0,panOnScroll:M=!1,panOnScrollSpeed:N=.5,panOnScrollMode:$=EA.Free,zoomOnDoubleClick:k=!0,panOnDrag:H=!0,defaultViewport:U,translateExtent:G,minZoom:ie,maxZoom:W,zoomActivationKeyCode:Z,preventScrolling:le=!0,children:oe,noWheelClassName:ee,noPanClassName:Ce,onViewportChange:pe,isControlledViewport:$e,paneClickDistance:ae,selectionOnDrag:Ne}){const Ue=El(),ln=Be.useRef(null),{userSelectionActive:un,lib:An,connectionInProgress:xn}=zu(Iqn,jl),nt=WG(Z),dn=Be.useRef();Nqn(ln);const bn=Be.useCallback(Y=>{pe?.({x:Y[0],y:Y[1],zoom:Y[2]}),$e||Ue.setState({transform:Y})},[pe,$e]);return Be.useEffect(()=>{if(ln.current){dn.current=RGn({domNode:ln.current,minZoom:ie,maxZoom:W,translateExtent:G,viewport:U,onDraggingChange:Ae=>Ue.setState(ve=>ve.paneDragging===Ae?ve:{paneDragging:Ae}),onPanZoomStart:(Ae,ve)=>{const{onViewportChangeStart:nn,onMoveStart:yn}=Ue.getState();yn?.(Ae,ve),nn?.(ve)},onPanZoom:(Ae,ve)=>{const{onViewportChange:nn,onMove:yn}=Ue.getState();yn?.(Ae,ve),nn?.(ve)},onPanZoomEnd:(Ae,ve)=>{const{onViewportChangeEnd:nn,onMoveEnd:yn}=Ue.getState();yn?.(Ae,ve),nn?.(ve)}});const{x:Y,y:Je,zoom:pn}=dn.current.getViewport();return Ue.setState({panZoom:dn.current,transform:[Y,Je,pn],domNode:ln.current.closest(".react-flow")}),()=>{dn.current?.destroy()}}},[]),Be.useEffect(()=>{dn.current?.update({onPaneContextMenu:g,zoomOnScroll:E,zoomOnPinch:x,panOnScroll:M,panOnScrollSpeed:N,panOnScrollMode:$,zoomOnDoubleClick:k,panOnDrag:H,zoomActivationKeyPressed:nt,preventScrolling:le,noPanClassName:Ce,userSelectionActive:un,noWheelClassName:ee,lib:An,onTransformChange:bn,connectionInProgress:xn,selectionOnDrag:Ne,paneClickDistance:ae})},[g,E,x,M,N,$,k,H,nt,le,Ce,un,ee,An,bn,xn,Ne,ae]),L.jsx("div",{className:"react-flow__renderer",ref:ln,style:zue,children:oe})}const _qn=g=>({userSelectionActive:g.userSelectionActive,userSelectionRect:g.userSelectionRect});function Lqn(){const{userSelectionActive:g,userSelectionRect:E}=zu(_qn,jl);return g&&E?L.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:E.width,height:E.height,transform:`translate(${E.x}px, ${E.y}px)`}}):null}const q7e=(g,E)=>x=>{x.target===E.current&&g?.(x)},Pqn=g=>({userSelectionActive:g.userSelectionActive,elementsSelectable:g.elementsSelectable,connectionInProgress:g.connection.inProgress,dragging:g.paneDragging});function $qn({isSelecting:g,selectionKeyPressed:E,selectionMode:x=KG.Full,panOnDrag:M,paneClickDistance:N,selectionOnDrag:$,onSelectionStart:k,onSelectionEnd:H,onPaneClick:U,onPaneContextMenu:G,onPaneScroll:ie,onPaneMouseEnter:W,onPaneMouseMove:Z,onPaneMouseLeave:le,children:oe}){const ee=El(),{userSelectionActive:Ce,elementsSelectable:pe,dragging:$e,connectionInProgress:ae}=zu(Pqn,jl),Ne=pe&&(g||Ce),Ue=Be.useRef(null),ln=Be.useRef(),un=Be.useRef(new Set),An=Be.useRef(new Set),xn=Be.useRef(!1),nt=nn=>{if(xn.current||ae){xn.current=!1;return}U?.(nn),ee.getState().resetSelectedElements(),ee.setState({nodesSelectionActive:!1})},dn=nn=>{if(Array.isArray(M)&&M?.includes(2)){nn.preventDefault();return}G?.(nn)},bn=ie?nn=>ie(nn):void 0,Y=nn=>{xn.current&&(nn.stopPropagation(),xn.current=!1)},Je=nn=>{const{domNode:yn}=ee.getState();if(ln.current=yn?.getBoundingClientRect(),!ln.current)return;const Pn=nn.target===Ue.current;if(!Pn&&!!nn.target.closest(".nokey")||!g||!($&&Pn||E)||nn.button!==0||!nn.isPrimary)return;nn.target?.setPointerCapture?.(nn.pointerId),xn.current=!1;const{x:tt,y:ut}=tv(nn.nativeEvent,ln.current);ee.setState({userSelectionRect:{width:0,height:0,startX:tt,startY:ut,x:tt,y:ut}}),Pn||(nn.stopPropagation(),nn.preventDefault())},pn=nn=>{const{userSelectionRect:yn,transform:Pn,nodeLookup:ye,edgeLookup:Re,connectionLookup:tt,triggerNodeChanges:ut,triggerEdgeChanges:Jt,defaultEdgeOptions:di,resetSelectedElements:Gt}=ee.getState();if(!ln.current||!yn)return;const{x:xt,y:si}=tv(nn.nativeEvent,ln.current),{startX:Kr,startY:Er}=yn;if(!xn.current){const Fu=E?0:N;if(Math.hypot(xt-Kr,si-Er)<=Fu)return;Gt(),k?.(nn)}xn.current=!0;const Mt={startX:Kr,startY:Er,x:xtFu.id)),An.current=new Set;const cu=di?.selectable??!0;for(const Fu of un.current){const Rs=tt.get(Fu);if(Rs)for(const{edgeId:ia}of Rs.values()){const ef=Re.get(ia);ef&&(ef.selectable??cu)&&An.current.add(ia)}}if(!h1n(bi,un.current)){const Fu=aD(ye,un.current,!0);ut(Fu)}if(!h1n(zi,An.current)){const Fu=aD(Re,An.current);Jt(Fu)}ee.setState({userSelectionRect:Mt,userSelectionActive:!0,nodesSelectionActive:!1})},Ae=nn=>{nn.button===0&&(nn.target?.releasePointerCapture?.(nn.pointerId),!Ce&&nn.target===Ue.current&&ee.getState().userSelectionRect&&nt?.(nn),ee.setState({userSelectionActive:!1,userSelectionRect:null}),xn.current&&(H?.(nn),ee.setState({nodesSelectionActive:un.current.size>0})))},ve=M===!0||Array.isArray(M)&&M.includes(0);return L.jsxs("div",{className:Ta(["react-flow__pane",{draggable:ve,dragging:$e,selection:g}]),onClick:Ne?void 0:q7e(nt,Ue),onContextMenu:q7e(dn,Ue),onWheel:q7e(bn,Ue),onPointerEnter:Ne?void 0:W,onPointerMove:Ne?pn:Z,onPointerUp:Ne?Ae:void 0,onPointerDownCapture:Ne?Je:void 0,onClickCapture:Ne?Y:void 0,onPointerLeave:le,ref:Ue,style:zue,children:[oe,L.jsx(Lqn,{})]})}function hke({id:g,store:E,unselect:x=!1,nodeRef:M}){const{addSelectedNodes:N,unselectNodesAndEdges:$,multiSelectionActive:k,nodeLookup:H,onError:U}=E.getState(),G=H.get(g);if(!G){U?.("012",a5.error012(g));return}E.setState({nodesSelectionActive:!1}),G.selected?(x||G.selected&&k)&&($({nodes:[G],edges:[]}),requestAnimationFrame(()=>M?.current?.blur())):N([g])}function S0n({nodeRef:g,disabled:E=!1,noDragClassName:x,handleSelector:M,nodeId:N,isSelectable:$,nodeClickDistance:k}){const H=El(),[U,G]=Be.useState(!1),ie=Be.useRef();return Be.useEffect(()=>{ie.current=SGn({getStoreItems:()=>H.getState(),onNodeMouseDown:W=>{hke({id:W,store:H,nodeRef:g})},onDragStart:()=>{G(!0)},onDragStop:()=>{G(!1)}})},[]),Be.useEffect(()=>{if(!(E||!g.current||!ie.current))return ie.current.update({noDragClassName:x,handleSelector:M,domNode:g.current,isSelectable:$,nodeId:N,nodeClickDistance:k}),()=>{ie.current?.destroy()}},[x,M,E,$,g,N,k]),U}const Rqn=g=>E=>E.selected&&(E.draggable||g&&typeof E.draggable>"u");function x0n(){const g=El();return Be.useCallback(x=>{const{nodeExtent:M,snapToGrid:N,snapGrid:$,nodesDraggable:k,onError:H,updateNodePositions:U,nodeLookup:G,nodeOrigin:ie}=g.getState(),W=new Map,Z=Rqn(k),le=N?$[0]:5,oe=N?$[1]:5,ee=x.direction.x*le*x.factor,Ce=x.direction.y*oe*x.factor;for(const[,pe]of G){if(!Z(pe))continue;let $e={x:pe.internals.positionAbsolute.x+ee,y:pe.internals.positionAbsolute.y+Ce};N&&($e=rq($e,$));const{position:ae,positionAbsolute:Ne}=Gdn({nodeId:pe.id,nextPosition:$e,nodeLookup:G,nodeExtent:M,nodeOrigin:ie,onError:H});pe.position=ae,pe.internals.positionAbsolute=Ne,W.set(pe.id,pe)}U(W)},[])}const Ike=Be.createContext(null),Bqn=Ike.Provider;Ike.Consumer;const A0n=()=>Be.useContext(Ike),zqn=g=>({connectOnClick:g.connectOnClick,noPanClassName:g.noPanClassName,rfId:g.rfId}),Fqn=(g,E,x)=>M=>{const{connectionClickStartHandle:N,connectionMode:$,connection:k}=M,{fromHandle:H,toHandle:U,isValid:G}=k,ie=U?.nodeId===g&&U?.id===E&&U?.type===x;return{connectingFrom:H?.nodeId===g&&H?.id===E&&H?.type===x,connectingTo:ie,clickConnecting:N?.nodeId===g&&N?.id===E&&N?.type===x,isPossibleEndHandle:$===wD.Strict?H?.type!==x:g!==H?.nodeId||E!==H?.id,connectionInProcess:!!H,clickConnectionInProcess:!!N,valid:ie&&G}};function Jqn({type:g="source",position:E=ur.Top,isValidConnection:x,isConnectable:M=!0,isConnectableStart:N=!0,isConnectableEnd:$=!0,id:k,onConnect:H,children:U,className:G,onMouseDown:ie,onTouchStart:W,...Z},le){const oe=k||null,ee=g==="target",Ce=El(),pe=A0n(),{connectOnClick:$e,noPanClassName:ae,rfId:Ne}=zu(zqn,jl),{connectingFrom:Ue,connectingTo:ln,clickConnecting:un,isPossibleEndHandle:An,connectionInProcess:xn,clickConnectionInProcess:nt,valid:dn}=zu(Fqn(pe,oe,g),jl);pe||Ce.getState().onError?.("010",a5.error010());const bn=pn=>{const{defaultEdgeOptions:Ae,onConnect:ve,hasDefaultEdges:nn}=Ce.getState(),yn={...Ae,...pn};if(nn){const{edges:Pn,setEdges:ye}=Ce.getState();ye(sGn(yn,Pn))}ve?.(yn),H?.(yn)},Y=pn=>{if(!pe)return;const Ae=Wdn(pn.nativeEvent);if(N&&(Ae&&pn.button===0||!Ae)){const ve=Ce.getState();fke.onPointerDown(pn.nativeEvent,{handleDomNode:pn.currentTarget,autoPanOnConnect:ve.autoPanOnConnect,connectionMode:ve.connectionMode,connectionRadius:ve.connectionRadius,domNode:ve.domNode,nodeLookup:ve.nodeLookup,lib:ve.lib,isTarget:ee,handleId:oe,nodeId:pe,flowId:ve.rfId,panBy:ve.panBy,cancelConnection:ve.cancelConnection,onConnectStart:ve.onConnectStart,onConnectEnd:(...nn)=>Ce.getState().onConnectEnd?.(...nn),updateConnection:ve.updateConnection,onConnect:bn,isValidConnection:x||((...nn)=>Ce.getState().isValidConnection?.(...nn)??!0),getTransform:()=>Ce.getState().transform,getFromHandle:()=>Ce.getState().connection.fromHandle,autoPanSpeed:ve.autoPanSpeed,dragThreshold:ve.connectionDragThreshold})}Ae?ie?.(pn):W?.(pn)},Je=pn=>{const{onClickConnectStart:Ae,onClickConnectEnd:ve,connectionClickStartHandle:nn,connectionMode:yn,isValidConnection:Pn,lib:ye,rfId:Re,nodeLookup:tt,connection:ut}=Ce.getState();if(!pe||!nn&&!N)return;if(!nn){Ae?.(pn.nativeEvent,{nodeId:pe,handleId:oe,handleType:g}),Ce.setState({connectionClickStartHandle:{nodeId:pe,type:g,id:oe}});return}const Jt=Ydn(pn.target),di=x||Pn,{connection:Gt,isValid:xt}=fke.isValid(pn.nativeEvent,{handle:{nodeId:pe,id:oe,type:g},connectionMode:yn,fromNodeId:nn.nodeId,fromHandleId:nn.id||null,fromType:nn.type,isValidConnection:di,flowId:Re,doc:Jt,lib:ye,nodeLookup:tt});xt&&Gt&&bn(Gt);const si=structuredClone(ut);delete si.inProgress,si.toPosition=si.toHandle?si.toHandle.position:null,ve?.(pn,si),Ce.setState({connectionClickStartHandle:null})};return L.jsx("div",{"data-handleid":oe,"data-nodeid":pe,"data-handlepos":E,"data-id":`${Ne}-${pe}-${oe}-${g}`,className:Ta(["react-flow__handle",`react-flow__handle-${E}`,"nodrag",ae,G,{source:!ee,target:ee,connectable:M,connectablestart:N,connectableend:$,clickconnecting:un,connectingfrom:Ue,connectingto:ln,valid:dn,connectionindicator:M&&(!xn||An)&&(xn||nt?$:N)}]),onMouseDown:Y,onTouchStart:Y,onClick:$e?Je:void 0,ref:le,...Z,children:U})}const h5=Be.memo(j0n(Jqn));function Hqn({data:g,isConnectable:E,sourcePosition:x=ur.Bottom}){return L.jsxs(L.Fragment,{children:[g?.label,L.jsx(h5,{type:"source",position:x,isConnectable:E})]})}function Gqn({data:g,isConnectable:E,targetPosition:x=ur.Top,sourcePosition:M=ur.Bottom}){return L.jsxs(L.Fragment,{children:[L.jsx(h5,{type:"target",position:x,isConnectable:E}),g?.label,L.jsx(h5,{type:"source",position:M,isConnectable:E})]})}function qqn(){return null}function Uqn({data:g,isConnectable:E,targetPosition:x=ur.Top}){return L.jsxs(L.Fragment,{children:[L.jsx(h5,{type:"target",position:x,isConnectable:E}),g?.label]})}const Mue={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},J1n={input:Hqn,default:Gqn,output:Uqn,group:qqn};function Xqn(g){return g.internals.handleBounds===void 0?{width:g.width??g.initialWidth??g.style?.width,height:g.height??g.initialHeight??g.style?.height}:{width:g.width??g.style?.width,height:g.height??g.style?.height}}const Kqn=g=>{const{width:E,height:x,x:M,y:N}=iq(g.nodeLookup,{filter:$=>!!$.selected});return{width:nv(E)?E:null,height:nv(x)?x:null,userSelectionActive:g.userSelectionActive,transformString:`translate(${g.transform[0]}px,${g.transform[1]}px) scale(${g.transform[2]}) translate(${M}px,${N}px)`}};function Vqn({onSelectionContextMenu:g,noPanClassName:E,disableKeyboardA11y:x}){const M=El(),{width:N,height:$,transformString:k,userSelectionActive:H}=zu(Kqn,jl),U=x0n(),G=Be.useRef(null);Be.useEffect(()=>{x||G.current?.focus({preventScroll:!0})},[x]);const ie=!H&&N!==null&&$!==null;if(S0n({nodeRef:G,disabled:!ie}),!ie)return null;const W=g?le=>{const oe=M.getState().nodes.filter(ee=>ee.selected);g(le,oe)}:void 0,Z=le=>{Object.prototype.hasOwnProperty.call(Mue,le.key)&&(le.preventDefault(),U({direction:Mue[le.key],factor:le.shiftKey?4:1}))};return L.jsx("div",{className:Ta(["react-flow__nodesselection","react-flow__container",E]),style:{transform:k},children:L.jsx("div",{ref:G,className:"react-flow__nodesselection-rect",onContextMenu:W,tabIndex:x?void 0:-1,onKeyDown:x?void 0:Z,style:{width:N,height:$}})})}const H1n=typeof window<"u"?window:void 0,Yqn=g=>({nodesSelectionActive:g.nodesSelectionActive,userSelectionActive:g.userSelectionActive});function M0n({children:g,onPaneClick:E,onPaneMouseEnter:x,onPaneMouseMove:M,onPaneMouseLeave:N,onPaneContextMenu:$,onPaneScroll:k,paneClickDistance:H,deleteKeyCode:U,selectionKeyCode:G,selectionOnDrag:ie,selectionMode:W,onSelectionStart:Z,onSelectionEnd:le,multiSelectionKeyCode:oe,panActivationKeyCode:ee,zoomActivationKeyCode:Ce,elementsSelectable:pe,zoomOnScroll:$e,zoomOnPinch:ae,panOnScroll:Ne,panOnScrollSpeed:Ue,panOnScrollMode:ln,zoomOnDoubleClick:un,panOnDrag:An,defaultViewport:xn,translateExtent:nt,minZoom:dn,maxZoom:bn,preventScrolling:Y,onSelectionContextMenu:Je,noWheelClassName:pn,noPanClassName:Ae,disableKeyboardA11y:ve,onViewportChange:nn,isControlledViewport:yn}){const{nodesSelectionActive:Pn,userSelectionActive:ye}=zu(Yqn,jl),Re=WG(G,{target:H1n}),tt=WG(ee,{target:H1n}),ut=tt||An,Jt=tt||Ne,di=ie&&ut!==!0,Gt=Re||ye||di;return Oqn({deleteKeyCode:U,multiSelectionKeyCode:oe}),L.jsx(Dqn,{onPaneContextMenu:$,elementsSelectable:pe,zoomOnScroll:$e,zoomOnPinch:ae,panOnScroll:Jt,panOnScrollSpeed:Ue,panOnScrollMode:ln,zoomOnDoubleClick:un,panOnDrag:!Re&&ut,defaultViewport:xn,translateExtent:nt,minZoom:dn,maxZoom:bn,zoomActivationKeyCode:Ce,preventScrolling:Y,noWheelClassName:pn,noPanClassName:Ae,onViewportChange:nn,isControlledViewport:yn,paneClickDistance:H,selectionOnDrag:di,children:L.jsxs($qn,{onSelectionStart:Z,onSelectionEnd:le,onPaneClick:E,onPaneMouseEnter:x,onPaneMouseMove:M,onPaneMouseLeave:N,onPaneContextMenu:$,onPaneScroll:k,panOnDrag:ut,isSelecting:!!Gt,selectionMode:W,selectionKeyPressed:Re,paneClickDistance:H,selectionOnDrag:di,children:[g,Pn&&L.jsx(Vqn,{onSelectionContextMenu:Je,noPanClassName:Ae,disableKeyboardA11y:ve})]})})}M0n.displayName="FlowRenderer";const Qqn=Be.memo(M0n),Wqn=g=>E=>g?Eke(E.nodeLookup,{x:0,y:0,width:E.width,height:E.height},E.transform,!0).map(x=>x.id):Array.from(E.nodeLookup.keys());function Zqn(g){return zu(Be.useCallback(Wqn(g),[g]),jl)}const eUn=g=>g.updateNodeInternals;function nUn(){const g=zu(eUn),[E]=Be.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(x=>{const M=new Map;x.forEach(N=>{const $=N.target.getAttribute("data-id");M.set($,{id:$,nodeElement:N.target,force:!0})}),g(M)}));return Be.useEffect(()=>()=>{E?.disconnect()},[E]),E}function tUn({node:g,nodeType:E,hasDimensions:x,resizeObserver:M}){const N=El(),$=Be.useRef(null),k=Be.useRef(null),H=Be.useRef(g.sourcePosition),U=Be.useRef(g.targetPosition),G=Be.useRef(E),ie=x&&!!g.internals.handleBounds;return Be.useEffect(()=>{$.current&&!g.hidden&&(!ie||k.current!==$.current)&&(k.current&&M?.unobserve(k.current),M?.observe($.current),k.current=$.current)},[ie,g.hidden]),Be.useEffect(()=>()=>{k.current&&(M?.unobserve(k.current),k.current=null)},[]),Be.useEffect(()=>{if($.current){const W=G.current!==E,Z=H.current!==g.sourcePosition,le=U.current!==g.targetPosition;(W||Z||le)&&(G.current=E,H.current=g.sourcePosition,U.current=g.targetPosition,N.getState().updateNodeInternals(new Map([[g.id,{id:g.id,nodeElement:$.current,force:!0}]])))}},[g.id,E,g.sourcePosition,g.targetPosition]),$}function iUn({id:g,onClick:E,onMouseEnter:x,onMouseMove:M,onMouseLeave:N,onContextMenu:$,onDoubleClick:k,nodesDraggable:H,elementsSelectable:U,nodesConnectable:G,nodesFocusable:ie,resizeObserver:W,noDragClassName:Z,noPanClassName:le,disableKeyboardA11y:oe,rfId:ee,nodeTypes:Ce,nodeClickDistance:pe,onError:$e}){const{node:ae,internals:Ne,isParent:Ue}=zu(xt=>{const si=xt.nodeLookup.get(g),Kr=xt.parentLookup.has(g);return{node:si,internals:si.internals,isParent:Kr}},jl);let ln=ae.type||"default",un=Ce?.[ln]||J1n[ln];un===void 0&&($e?.("003",a5.error003(ln)),ln="default",un=Ce?.default||J1n.default);const An=!!(ae.draggable||H&&typeof ae.draggable>"u"),xn=!!(ae.selectable||U&&typeof ae.selectable>"u"),nt=!!(ae.connectable||G&&typeof ae.connectable>"u"),dn=!!(ae.focusable||ie&&typeof ae.focusable>"u"),bn=El(),Y=Kdn(ae),Je=tUn({node:ae,nodeType:ln,hasDimensions:Y,resizeObserver:W}),pn=S0n({nodeRef:Je,disabled:ae.hidden||!An,noDragClassName:Z,handleSelector:ae.dragHandle,nodeId:g,isSelectable:xn,nodeClickDistance:pe}),Ae=x0n();if(ae.hidden)return null;const ve=s6(ae),nn=Xqn(ae),yn=xn||An||E||x||M||N,Pn=x?xt=>x(xt,{...Ne.userNode}):void 0,ye=M?xt=>M(xt,{...Ne.userNode}):void 0,Re=N?xt=>N(xt,{...Ne.userNode}):void 0,tt=$?xt=>$(xt,{...Ne.userNode}):void 0,ut=k?xt=>k(xt,{...Ne.userNode}):void 0,Jt=xt=>{const{selectNodesOnDrag:si,nodeDragThreshold:Kr}=bn.getState();xn&&(!si||!An||Kr>0)&&hke({id:g,store:bn,nodeRef:Je}),E&&E(xt,{...Ne.userNode})},di=xt=>{if(!(Qdn(xt.nativeEvent)||oe)){if(Bdn.includes(xt.key)&&xn){const si=xt.key==="Escape";hke({id:g,store:bn,unselect:si,nodeRef:Je})}else if(An&&ae.selected&&Object.prototype.hasOwnProperty.call(Mue,xt.key)){xt.preventDefault();const{ariaLabelConfig:si}=bn.getState();bn.setState({ariaLiveMessage:si["node.a11yDescription.ariaLiveMessage"]({direction:xt.key.replace("Arrow","").toLowerCase(),x:~~Ne.positionAbsolute.x,y:~~Ne.positionAbsolute.y})}),Ae({direction:Mue[xt.key],factor:xt.shiftKey?4:1})}}},Gt=()=>{if(oe||!Je.current?.matches(":focus-visible"))return;const{transform:xt,width:si,height:Kr,autoPanOnNodeFocus:Er,setCenter:Mt}=bn.getState();if(!Er)return;Eke(new Map([[g,ae]]),{x:0,y:0,width:si,height:Kr},xt,!0).length>0||Mt(ae.position.x+ve.width/2,ae.position.y+ve.height/2,{zoom:xt[2]})};return L.jsx("div",{className:Ta(["react-flow__node",`react-flow__node-${ln}`,{[le]:An},ae.className,{selected:ae.selected,selectable:xn,parent:Ue,draggable:An,dragging:pn}]),ref:Je,style:{zIndex:Ne.z,transform:`translate(${Ne.positionAbsolute.x}px,${Ne.positionAbsolute.y}px)`,pointerEvents:yn?"all":"none",visibility:Y?"visible":"hidden",...ae.style,...nn},"data-id":g,"data-testid":`rf__node-${g}`,onMouseEnter:Pn,onMouseMove:ye,onMouseLeave:Re,onContextMenu:tt,onClick:Jt,onDoubleClick:ut,onKeyDown:dn?di:void 0,tabIndex:dn?0:void 0,onFocus:dn?Gt:void 0,role:ae.ariaRole??(dn?"group":void 0),"aria-roledescription":"node","aria-describedby":oe?void 0:`${w0n}-${ee}`,"aria-label":ae.ariaLabel,...ae.domAttributes,children:L.jsx(Bqn,{value:g,children:L.jsx(un,{id:g,data:ae.data,type:ln,positionAbsoluteX:Ne.positionAbsolute.x,positionAbsoluteY:Ne.positionAbsolute.y,selected:ae.selected??!1,selectable:xn,draggable:An,deletable:ae.deletable??!0,isConnectable:nt,sourcePosition:ae.sourcePosition,targetPosition:ae.targetPosition,dragging:pn,dragHandle:ae.dragHandle,zIndex:Ne.z,parentId:ae.parentId,...ve})})})}var rUn=Be.memo(iUn);const cUn=g=>({nodesDraggable:g.nodesDraggable,nodesConnectable:g.nodesConnectable,nodesFocusable:g.nodesFocusable,elementsSelectable:g.elementsSelectable,onError:g.onError});function C0n(g){const{nodesDraggable:E,nodesConnectable:x,nodesFocusable:M,elementsSelectable:N,onError:$}=zu(cUn,jl),k=Zqn(g.onlyRenderVisibleElements),H=nUn();return L.jsx("div",{className:"react-flow__nodes",style:zue,children:k.map(U=>L.jsx(rUn,{id:U,nodeTypes:g.nodeTypes,nodeExtent:g.nodeExtent,onClick:g.onNodeClick,onMouseEnter:g.onNodeMouseEnter,onMouseMove:g.onNodeMouseMove,onMouseLeave:g.onNodeMouseLeave,onContextMenu:g.onNodeContextMenu,onDoubleClick:g.onNodeDoubleClick,noDragClassName:g.noDragClassName,noPanClassName:g.noPanClassName,rfId:g.rfId,disableKeyboardA11y:g.disableKeyboardA11y,resizeObserver:H,nodesDraggable:E,nodesConnectable:x,nodesFocusable:M,elementsSelectable:N,nodeClickDistance:g.nodeClickDistance,onError:$},U))})}C0n.displayName="NodeRenderer";const uUn=Be.memo(C0n);function oUn(g){return zu(Be.useCallback(x=>{if(!g)return x.edges.map(N=>N.id);const M=[];if(x.width&&x.height)for(const N of x.edges){const $=x.nodeLookup.get(N.source),k=x.nodeLookup.get(N.target);$&&k&&cGn({sourceNode:$,targetNode:k,width:x.width,height:x.height,transform:x.transform})&&M.push(N.id)}return M},[g]),jl)}const sUn=({color:g="none",strokeWidth:E=1})=>{const x={strokeWidth:E,...g&&{stroke:g}};return L.jsx("polyline",{className:"arrow",style:x,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lUn=({color:g="none",strokeWidth:E=1})=>{const x={strokeWidth:E,...g&&{stroke:g,fill:g}};return L.jsx("polyline",{className:"arrowclosed",style:x,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},G1n={[VG.Arrow]:sUn,[VG.ArrowClosed]:lUn};function fUn(g){const E=El();return Be.useMemo(()=>Object.prototype.hasOwnProperty.call(G1n,g)?G1n[g]:(E.getState().onError?.("009",a5.error009(g)),null),[g])}const aUn=({id:g,type:E,color:x,width:M=12.5,height:N=12.5,markerUnits:$="strokeWidth",strokeWidth:k,orient:H="auto-start-reverse"})=>{const U=fUn(E);return U?L.jsx("marker",{className:"react-flow__arrowhead",id:g,markerWidth:`${M}`,markerHeight:`${N}`,viewBox:"-10 -10 20 20",markerUnits:$,orient:H,refX:"0",refY:"0",children:L.jsx(U,{color:x,strokeWidth:k})}):null},T0n=({defaultColor:g,rfId:E})=>{const x=zu($=>$.edges),M=zu($=>$.defaultEdgeOptions),N=Be.useMemo(()=>dGn(x,{id:E,defaultColor:g,defaultMarkerStart:M?.markerStart,defaultMarkerEnd:M?.markerEnd}),[x,M,E,g]);return N.length?L.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:L.jsx("defs",{children:N.map($=>L.jsx(aUn,{id:$.id,type:$.type,color:$.color,width:$.width,height:$.height,markerUnits:$.markerUnits,strokeWidth:$.strokeWidth,orient:$.orient},$.id))})}):null};T0n.displayName="MarkerDefinitions";var hUn=Be.memo(T0n);function O0n({x:g,y:E,label:x,labelStyle:M,labelShowBg:N=!0,labelBgStyle:$,labelBgPadding:k=[2,4],labelBgBorderRadius:H=2,children:U,className:G,...ie}){const[W,Z]=Be.useState({x:1,y:0,width:0,height:0}),le=Ta(["react-flow__edge-textwrapper",G]),oe=Be.useRef(null);return Be.useEffect(()=>{if(oe.current){const ee=oe.current.getBBox();Z({x:ee.x,y:ee.y,width:ee.width,height:ee.height})}},[x]),x?L.jsxs("g",{transform:`translate(${g-W.width/2} ${E-W.height/2})`,className:le,visibility:W.width?"visible":"hidden",...ie,children:[N&&L.jsx("rect",{width:W.width+2*k[0],x:-k[0],y:-k[1],height:W.height+2*k[1],className:"react-flow__edge-textbg",style:$,rx:H,ry:H}),L.jsx("text",{className:"react-flow__edge-text",y:W.height/2,dy:"0.3em",ref:oe,style:M,children:x}),U]}):null}O0n.displayName="EdgeText";const dUn=Be.memo(O0n);function uq({path:g,labelX:E,labelY:x,label:M,labelStyle:N,labelShowBg:$,labelBgStyle:k,labelBgPadding:H,labelBgBorderRadius:U,interactionWidth:G=20,...ie}){return L.jsxs(L.Fragment,{children:[L.jsx("path",{...ie,d:g,fill:"none",className:Ta(["react-flow__edge-path",ie.className])}),G?L.jsx("path",{d:g,fill:"none",strokeOpacity:0,strokeWidth:G,className:"react-flow__edge-interaction"}):null,M&&nv(E)&&nv(x)?L.jsx(dUn,{x:E,y:x,label:M,labelStyle:N,labelShowBg:$,labelBgStyle:k,labelBgPadding:H,labelBgBorderRadius:U}):null]})}function q1n({pos:g,x1:E,y1:x,x2:M,y2:N}){return g===ur.Left||g===ur.Right?[.5*(E+M),x]:[E,.5*(x+N)]}function N0n({sourceX:g,sourceY:E,sourcePosition:x=ur.Bottom,targetX:M,targetY:N,targetPosition:$=ur.Top}){const[k,H]=q1n({pos:x,x1:g,y1:E,x2:M,y2:N}),[U,G]=q1n({pos:$,x1:M,y1:N,x2:g,y2:E}),[ie,W,Z,le]=Zdn({sourceX:g,sourceY:E,targetX:M,targetY:N,sourceControlX:k,sourceControlY:H,targetControlX:U,targetControlY:G});return[`M${g},${E} C${k},${H} ${U},${G} ${M},${N}`,ie,W,Z,le]}function I0n(g){return Be.memo(({id:E,sourceX:x,sourceY:M,targetX:N,targetY:$,sourcePosition:k,targetPosition:H,label:U,labelStyle:G,labelShowBg:ie,labelBgStyle:W,labelBgPadding:Z,labelBgBorderRadius:le,style:oe,markerEnd:ee,markerStart:Ce,interactionWidth:pe})=>{const[$e,ae,Ne]=N0n({sourceX:x,sourceY:M,sourcePosition:k,targetX:N,targetY:$,targetPosition:H}),Ue=g.isInternal?void 0:E;return L.jsx(uq,{id:Ue,path:$e,labelX:ae,labelY:Ne,label:U,labelStyle:G,labelShowBg:ie,labelBgStyle:W,labelBgPadding:Z,labelBgBorderRadius:le,style:oe,markerEnd:ee,markerStart:Ce,interactionWidth:pe})})}const bUn=I0n({isInternal:!1}),D0n=I0n({isInternal:!0});bUn.displayName="SimpleBezierEdge";D0n.displayName="SimpleBezierEdgeInternal";function _0n(g){return Be.memo(({id:E,sourceX:x,sourceY:M,targetX:N,targetY:$,label:k,labelStyle:H,labelShowBg:U,labelBgStyle:G,labelBgPadding:ie,labelBgBorderRadius:W,style:Z,sourcePosition:le=ur.Bottom,targetPosition:oe=ur.Top,markerEnd:ee,markerStart:Ce,pathOptions:pe,interactionWidth:$e})=>{const[ae,Ne,Ue]=Aue({sourceX:x,sourceY:M,sourcePosition:le,targetX:N,targetY:$,targetPosition:oe,borderRadius:pe?.borderRadius,offset:pe?.offset,stepPosition:pe?.stepPosition}),ln=g.isInternal?void 0:E;return L.jsx(uq,{id:ln,path:ae,labelX:Ne,labelY:Ue,label:k,labelStyle:H,labelShowBg:U,labelBgStyle:G,labelBgPadding:ie,labelBgBorderRadius:W,style:Z,markerEnd:ee,markerStart:Ce,interactionWidth:$e})})}const L0n=_0n({isInternal:!1}),P0n=_0n({isInternal:!0});L0n.displayName="SmoothStepEdge";P0n.displayName="SmoothStepEdgeInternal";function $0n(g){return Be.memo(({id:E,...x})=>{const M=g.isInternal?void 0:E;return L.jsx(L0n,{...x,id:M,pathOptions:Be.useMemo(()=>({borderRadius:0,offset:x.pathOptions?.offset}),[x.pathOptions?.offset])})})}const gUn=$0n({isInternal:!1}),R0n=$0n({isInternal:!0});gUn.displayName="StepEdge";R0n.displayName="StepEdgeInternal";function B0n(g){return Be.memo(({id:E,sourceX:x,sourceY:M,targetX:N,targetY:$,label:k,labelStyle:H,labelShowBg:U,labelBgStyle:G,labelBgPadding:ie,labelBgBorderRadius:W,style:Z,markerEnd:le,markerStart:oe,interactionWidth:ee})=>{const[Ce,pe,$e]=t0n({sourceX:x,sourceY:M,targetX:N,targetY:$}),ae=g.isInternal?void 0:E;return L.jsx(uq,{id:ae,path:Ce,labelX:pe,labelY:$e,label:k,labelStyle:H,labelShowBg:U,labelBgStyle:G,labelBgPadding:ie,labelBgBorderRadius:W,style:Z,markerEnd:le,markerStart:oe,interactionWidth:ee})})}const wUn=B0n({isInternal:!1}),z0n=B0n({isInternal:!0});wUn.displayName="StraightEdge";z0n.displayName="StraightEdgeInternal";function F0n(g){return Be.memo(({id:E,sourceX:x,sourceY:M,targetX:N,targetY:$,sourcePosition:k=ur.Bottom,targetPosition:H=ur.Top,label:U,labelStyle:G,labelShowBg:ie,labelBgStyle:W,labelBgPadding:Z,labelBgBorderRadius:le,style:oe,markerEnd:ee,markerStart:Ce,pathOptions:pe,interactionWidth:$e})=>{const[ae,Ne,Ue]=e0n({sourceX:x,sourceY:M,sourcePosition:k,targetX:N,targetY:$,targetPosition:H,curvature:pe?.curvature}),ln=g.isInternal?void 0:E;return L.jsx(uq,{id:ln,path:ae,labelX:Ne,labelY:Ue,label:U,labelStyle:G,labelShowBg:ie,labelBgStyle:W,labelBgPadding:Z,labelBgBorderRadius:le,style:oe,markerEnd:ee,markerStart:Ce,interactionWidth:$e})})}const pUn=F0n({isInternal:!1}),J0n=F0n({isInternal:!0});pUn.displayName="BezierEdge";J0n.displayName="BezierEdgeInternal";const U1n={default:J0n,straight:z0n,step:R0n,smoothstep:P0n,simplebezier:D0n},X1n={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},mUn=(g,E,x)=>x===ur.Left?g-E:x===ur.Right?g+E:g,vUn=(g,E,x)=>x===ur.Top?g-E:x===ur.Bottom?g+E:g,K1n="react-flow__edgeupdater";function V1n({position:g,centerX:E,centerY:x,radius:M=10,onMouseDown:N,onMouseEnter:$,onMouseOut:k,type:H}){return L.jsx("circle",{onMouseDown:N,onMouseEnter:$,onMouseOut:k,className:Ta([K1n,`${K1n}-${H}`]),cx:mUn(E,M,g),cy:vUn(x,M,g),r:M,stroke:"transparent",fill:"transparent"})}function yUn({isReconnectable:g,reconnectRadius:E,edge:x,sourceX:M,sourceY:N,targetX:$,targetY:k,sourcePosition:H,targetPosition:U,onReconnect:G,onReconnectStart:ie,onReconnectEnd:W,setReconnecting:Z,setUpdateHover:le}){const oe=El(),ee=(Ne,Ue)=>{if(Ne.button!==0)return;const{autoPanOnConnect:ln,domNode:un,connectionMode:An,connectionRadius:xn,lib:nt,onConnectStart:dn,cancelConnection:bn,nodeLookup:Y,rfId:Je,panBy:pn,updateConnection:Ae}=oe.getState(),ve=Ue.type==="target",nn=(ye,Re)=>{Z(!1),W?.(ye,x,Ue.type,Re)},yn=ye=>G?.(x,ye),Pn=(ye,Re)=>{Z(!0),ie?.(Ne,x,Ue.type),dn?.(ye,Re)};fke.onPointerDown(Ne.nativeEvent,{autoPanOnConnect:ln,connectionMode:An,connectionRadius:xn,domNode:un,handleId:Ue.id,nodeId:Ue.nodeId,nodeLookup:Y,isTarget:ve,edgeUpdaterType:Ue.type,lib:nt,flowId:Je,cancelConnection:bn,panBy:pn,isValidConnection:(...ye)=>oe.getState().isValidConnection?.(...ye)??!0,onConnect:yn,onConnectStart:Pn,onConnectEnd:(...ye)=>oe.getState().onConnectEnd?.(...ye),onReconnectEnd:nn,updateConnection:Ae,getTransform:()=>oe.getState().transform,getFromHandle:()=>oe.getState().connection.fromHandle,dragThreshold:oe.getState().connectionDragThreshold,handleDomNode:Ne.currentTarget})},Ce=Ne=>ee(Ne,{nodeId:x.target,id:x.targetHandle??null,type:"target"}),pe=Ne=>ee(Ne,{nodeId:x.source,id:x.sourceHandle??null,type:"source"}),$e=()=>le(!0),ae=()=>le(!1);return L.jsxs(L.Fragment,{children:[(g===!0||g==="source")&&L.jsx(V1n,{position:H,centerX:M,centerY:N,radius:E,onMouseDown:Ce,onMouseEnter:$e,onMouseOut:ae,type:"source"}),(g===!0||g==="target")&&L.jsx(V1n,{position:U,centerX:$,centerY:k,radius:E,onMouseDown:pe,onMouseEnter:$e,onMouseOut:ae,type:"target"})]})}function kUn({id:g,edgesFocusable:E,edgesReconnectable:x,elementsSelectable:M,onClick:N,onDoubleClick:$,onContextMenu:k,onMouseEnter:H,onMouseMove:U,onMouseLeave:G,reconnectRadius:ie,onReconnect:W,onReconnectStart:Z,onReconnectEnd:le,rfId:oe,edgeTypes:ee,noPanClassName:Ce,onError:pe,disableKeyboardA11y:$e}){let ae=zu(Mt=>Mt.edgeLookup.get(g));const Ne=zu(Mt=>Mt.defaultEdgeOptions);ae=Ne?{...Ne,...ae}:ae;let Ue=ae.type||"default",ln=ee?.[Ue]||U1n[Ue];ln===void 0&&(pe?.("011",a5.error011(Ue)),Ue="default",ln=ee?.default||U1n.default);const un=!!(ae.focusable||E&&typeof ae.focusable>"u"),An=typeof W<"u"&&(ae.reconnectable||x&&typeof ae.reconnectable>"u"),xn=!!(ae.selectable||M&&typeof ae.selectable>"u"),nt=Be.useRef(null),[dn,bn]=Be.useState(!1),[Y,Je]=Be.useState(!1),pn=El(),{zIndex:Ae,sourceX:ve,sourceY:nn,targetX:yn,targetY:Pn,sourcePosition:ye,targetPosition:Re}=zu(Be.useCallback(Mt=>{const bi=Mt.nodeLookup.get(ae.source),zi=Mt.nodeLookup.get(ae.target);if(!bi||!zi)return{zIndex:ae.zIndex,...X1n};const cu=hGn({id:g,sourceNode:bi,targetNode:zi,sourceHandle:ae.sourceHandle||null,targetHandle:ae.targetHandle||null,connectionMode:Mt.connectionMode,onError:pe});return{zIndex:rGn({selected:ae.selected,zIndex:ae.zIndex,sourceNode:bi,targetNode:zi,elevateOnSelect:Mt.elevateEdgesOnSelect,zIndexMode:Mt.zIndexMode}),...cu||X1n}},[ae.source,ae.target,ae.sourceHandle,ae.targetHandle,ae.selected,ae.zIndex]),jl),tt=Be.useMemo(()=>ae.markerStart?`url('#${ske(ae.markerStart,oe)}')`:void 0,[ae.markerStart,oe]),ut=Be.useMemo(()=>ae.markerEnd?`url('#${ske(ae.markerEnd,oe)}')`:void 0,[ae.markerEnd,oe]);if(ae.hidden||ve===null||nn===null||yn===null||Pn===null)return null;const Jt=Mt=>{const{addSelectedEdges:bi,unselectNodesAndEdges:zi,multiSelectionActive:cu}=pn.getState();xn&&(pn.setState({nodesSelectionActive:!1}),ae.selected&&cu?(zi({nodes:[],edges:[ae]}),nt.current?.blur()):bi([g])),N&&N(Mt,ae)},di=$?Mt=>{$(Mt,{...ae})}:void 0,Gt=k?Mt=>{k(Mt,{...ae})}:void 0,xt=H?Mt=>{H(Mt,{...ae})}:void 0,si=U?Mt=>{U(Mt,{...ae})}:void 0,Kr=G?Mt=>{G(Mt,{...ae})}:void 0,Er=Mt=>{if(!$e&&Bdn.includes(Mt.key)&&xn){const{unselectNodesAndEdges:bi,addSelectedEdges:zi}=pn.getState();Mt.key==="Escape"?(nt.current?.blur(),bi({edges:[ae]})):zi([g])}};return L.jsx("svg",{style:{zIndex:Ae},children:L.jsxs("g",{className:Ta(["react-flow__edge",`react-flow__edge-${Ue}`,ae.className,Ce,{selected:ae.selected,animated:ae.animated,inactive:!xn&&!N,updating:dn,selectable:xn}]),onClick:Jt,onDoubleClick:di,onContextMenu:Gt,onMouseEnter:xt,onMouseMove:si,onMouseLeave:Kr,onKeyDown:un?Er:void 0,tabIndex:un?0:void 0,role:ae.ariaRole??(un?"group":"img"),"aria-roledescription":"edge","data-id":g,"data-testid":`rf__edge-${g}`,"aria-label":ae.ariaLabel===null?void 0:ae.ariaLabel||`Edge from ${ae.source} to ${ae.target}`,"aria-describedby":un?`${p0n}-${oe}`:void 0,ref:nt,...ae.domAttributes,children:[!Y&&L.jsx(ln,{id:g,source:ae.source,target:ae.target,type:ae.type,selected:ae.selected,animated:ae.animated,selectable:xn,deletable:ae.deletable??!0,label:ae.label,labelStyle:ae.labelStyle,labelShowBg:ae.labelShowBg,labelBgStyle:ae.labelBgStyle,labelBgPadding:ae.labelBgPadding,labelBgBorderRadius:ae.labelBgBorderRadius,sourceX:ve,sourceY:nn,targetX:yn,targetY:Pn,sourcePosition:ye,targetPosition:Re,data:ae.data,style:ae.style,sourceHandleId:ae.sourceHandle,targetHandleId:ae.targetHandle,markerStart:tt,markerEnd:ut,pathOptions:"pathOptions"in ae?ae.pathOptions:void 0,interactionWidth:ae.interactionWidth}),An&&L.jsx(yUn,{edge:ae,isReconnectable:An,reconnectRadius:ie,onReconnect:W,onReconnectStart:Z,onReconnectEnd:le,sourceX:ve,sourceY:nn,targetX:yn,targetY:Pn,sourcePosition:ye,targetPosition:Re,setUpdateHover:bn,setReconnecting:Je})]})})}var jUn=Be.memo(kUn);const EUn=g=>({edgesFocusable:g.edgesFocusable,edgesReconnectable:g.edgesReconnectable,elementsSelectable:g.elementsSelectable,connectionMode:g.connectionMode,onError:g.onError});function H0n({defaultMarkerColor:g,onlyRenderVisibleElements:E,rfId:x,edgeTypes:M,noPanClassName:N,onReconnect:$,onEdgeContextMenu:k,onEdgeMouseEnter:H,onEdgeMouseMove:U,onEdgeMouseLeave:G,onEdgeClick:ie,reconnectRadius:W,onEdgeDoubleClick:Z,onReconnectStart:le,onReconnectEnd:oe,disableKeyboardA11y:ee}){const{edgesFocusable:Ce,edgesReconnectable:pe,elementsSelectable:$e,onError:ae}=zu(EUn,jl),Ne=oUn(E);return L.jsxs("div",{className:"react-flow__edges",children:[L.jsx(hUn,{defaultColor:g,rfId:x}),Ne.map(Ue=>L.jsx(jUn,{id:Ue,edgesFocusable:Ce,edgesReconnectable:pe,elementsSelectable:$e,noPanClassName:N,onReconnect:$,onContextMenu:k,onMouseEnter:H,onMouseMove:U,onMouseLeave:G,onClick:ie,reconnectRadius:W,onDoubleClick:Z,onReconnectStart:le,onReconnectEnd:oe,rfId:x,onError:ae,edgeTypes:M,disableKeyboardA11y:ee},Ue))]})}H0n.displayName="EdgeRenderer";const SUn=Be.memo(H0n),xUn=g=>`translate(${g.transform[0]}px,${g.transform[1]}px) scale(${g.transform[2]})`;function AUn({children:g}){const E=zu(xUn);return L.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:E},children:g})}function MUn(g){const E=Nke(),x=Be.useRef(!1);Be.useEffect(()=>{!x.current&&E.viewportInitialized&&g&&(setTimeout(()=>g(E),1),x.current=!0)},[g,E.viewportInitialized])}const CUn=g=>g.panZoom?.syncViewport;function TUn(g){const E=zu(CUn),x=El();return Be.useEffect(()=>{g&&(E?.(g),x.setState({transform:[g.x,g.y,g.zoom]}))},[g,E]),null}function OUn(g){return g.connection.inProgress?{...g.connection,to:cq(g.connection.to,g.transform)}:{...g.connection}}function NUn(g){return OUn}function IUn(g){const E=NUn();return zu(E,jl)}const DUn=g=>({nodesConnectable:g.nodesConnectable,isValid:g.connection.isValid,inProgress:g.connection.inProgress,width:g.width,height:g.height});function _Un({containerStyle:g,style:E,type:x,component:M}){const{nodesConnectable:N,width:$,height:k,isValid:H,inProgress:U}=zu(DUn,jl);return!($&&N&&U)?null:L.jsx("svg",{style:g,width:$,height:k,className:"react-flow__connectionline react-flow__container",children:L.jsx("g",{className:Ta(["react-flow__connection",Jdn(H)]),children:L.jsx(G0n,{style:E,type:x,CustomComponent:M,isValid:H})})})}const G0n=({style:g,type:E=ek.Bezier,CustomComponent:x,isValid:M})=>{const{inProgress:N,from:$,fromNode:k,fromHandle:H,fromPosition:U,to:G,toNode:ie,toHandle:W,toPosition:Z,pointer:le}=IUn();if(!N)return;if(x)return L.jsx(x,{connectionLineType:E,connectionLineStyle:g,fromNode:k,fromHandle:H,fromX:$.x,fromY:$.y,toX:G.x,toY:G.y,fromPosition:U,toPosition:Z,connectionStatus:Jdn(M),toNode:ie,toHandle:W,pointer:le});let oe="";const ee={sourceX:$.x,sourceY:$.y,sourcePosition:U,targetX:G.x,targetY:G.y,targetPosition:Z};switch(E){case ek.Bezier:[oe]=e0n(ee);break;case ek.SimpleBezier:[oe]=N0n(ee);break;case ek.Step:[oe]=Aue({...ee,borderRadius:0});break;case ek.SmoothStep:[oe]=Aue(ee);break;default:[oe]=t0n(ee)}return L.jsx("path",{d:oe,fill:"none",className:"react-flow__connection-path",style:g})};G0n.displayName="ConnectionLine";const LUn={};function Y1n(g=LUn){Be.useRef(g),El(),Be.useEffect(()=>{},[g])}function PUn(){El(),Be.useRef(!1),Be.useEffect(()=>{},[])}function q0n({nodeTypes:g,edgeTypes:E,onInit:x,onNodeClick:M,onEdgeClick:N,onNodeDoubleClick:$,onEdgeDoubleClick:k,onNodeMouseEnter:H,onNodeMouseMove:U,onNodeMouseLeave:G,onNodeContextMenu:ie,onSelectionContextMenu:W,onSelectionStart:Z,onSelectionEnd:le,connectionLineType:oe,connectionLineStyle:ee,connectionLineComponent:Ce,connectionLineContainerStyle:pe,selectionKeyCode:$e,selectionOnDrag:ae,selectionMode:Ne,multiSelectionKeyCode:Ue,panActivationKeyCode:ln,zoomActivationKeyCode:un,deleteKeyCode:An,onlyRenderVisibleElements:xn,elementsSelectable:nt,defaultViewport:dn,translateExtent:bn,minZoom:Y,maxZoom:Je,preventScrolling:pn,defaultMarkerColor:Ae,zoomOnScroll:ve,zoomOnPinch:nn,panOnScroll:yn,panOnScrollSpeed:Pn,panOnScrollMode:ye,zoomOnDoubleClick:Re,panOnDrag:tt,onPaneClick:ut,onPaneMouseEnter:Jt,onPaneMouseMove:di,onPaneMouseLeave:Gt,onPaneScroll:xt,onPaneContextMenu:si,paneClickDistance:Kr,nodeClickDistance:Er,onEdgeContextMenu:Mt,onEdgeMouseEnter:bi,onEdgeMouseMove:zi,onEdgeMouseLeave:cu,reconnectRadius:Fu,onReconnect:Rs,onReconnectStart:ia,onReconnectEnd:ef,noDragClassName:Oa,noWheelClassName:Cc,noPanClassName:o0,disableKeyboardA11y:xb,nodeExtent:Sl,rfId:cd,viewport:s0,onViewportChange:uh}){return Y1n(g),Y1n(E),PUn(),MUn(x),TUn(s0),L.jsx(Qqn,{onPaneClick:ut,onPaneMouseEnter:Jt,onPaneMouseMove:di,onPaneMouseLeave:Gt,onPaneContextMenu:si,onPaneScroll:xt,paneClickDistance:Kr,deleteKeyCode:An,selectionKeyCode:$e,selectionOnDrag:ae,selectionMode:Ne,onSelectionStart:Z,onSelectionEnd:le,multiSelectionKeyCode:Ue,panActivationKeyCode:ln,zoomActivationKeyCode:un,elementsSelectable:nt,zoomOnScroll:ve,zoomOnPinch:nn,zoomOnDoubleClick:Re,panOnScroll:yn,panOnScrollSpeed:Pn,panOnScrollMode:ye,panOnDrag:tt,defaultViewport:dn,translateExtent:bn,minZoom:Y,maxZoom:Je,onSelectionContextMenu:W,preventScrolling:pn,noDragClassName:Oa,noWheelClassName:Cc,noPanClassName:o0,disableKeyboardA11y:xb,onViewportChange:uh,isControlledViewport:!!s0,children:L.jsxs(AUn,{children:[L.jsx(SUn,{edgeTypes:E,onEdgeClick:N,onEdgeDoubleClick:k,onReconnect:Rs,onReconnectStart:ia,onReconnectEnd:ef,onlyRenderVisibleElements:xn,onEdgeContextMenu:Mt,onEdgeMouseEnter:bi,onEdgeMouseMove:zi,onEdgeMouseLeave:cu,reconnectRadius:Fu,defaultMarkerColor:Ae,noPanClassName:o0,disableKeyboardA11y:xb,rfId:cd}),L.jsx(_Un,{style:ee,type:oe,component:Ce,containerStyle:pe}),L.jsx("div",{className:"react-flow__edgelabel-renderer"}),L.jsx(uUn,{nodeTypes:g,onNodeClick:M,onNodeDoubleClick:$,onNodeMouseEnter:H,onNodeMouseMove:U,onNodeMouseLeave:G,onNodeContextMenu:ie,nodeClickDistance:Er,onlyRenderVisibleElements:xn,noPanClassName:o0,noDragClassName:Oa,disableKeyboardA11y:xb,nodeExtent:Sl,rfId:cd}),L.jsx("div",{className:"react-flow__viewport-portal"})]})})}q0n.displayName="GraphView";const $Un=Be.memo(q0n),Q1n=({nodes:g,edges:E,defaultNodes:x,defaultEdges:M,width:N,height:$,fitView:k,fitViewOptions:H,minZoom:U=.5,maxZoom:G=2,nodeOrigin:ie,nodeExtent:W,zIndexMode:Z="basic"}={})=>{const le=new Map,oe=new Map,ee=new Map,Ce=new Map,pe=M??E??[],$e=x??g??[],ae=ie??[0,0],Ne=W??XG;c0n(ee,Ce,pe);const{nodesInitialized:Ue}=lke($e,le,oe,{nodeOrigin:ae,nodeExtent:Ne,zIndexMode:Z});let ln=[0,0,1];if(k&&N&&$){const un=iq(le,{filter:dn=>!!((dn.width||dn.initialWidth)&&(dn.height||dn.initialHeight))}),{x:An,y:xn,zoom:nt}=Ske(un,N,$,U,G,H?.padding??.1);ln=[An,xn,nt]}return{rfId:"1",width:N??0,height:$??0,transform:ln,nodes:$e,nodesInitialized:Ue,nodeLookup:le,parentLookup:oe,edges:pe,edgeLookup:Ce,connectionLookup:ee,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:x!==void 0,hasDefaultEdges:M!==void 0,panZoom:null,minZoom:U,maxZoom:G,translateExtent:XG,nodeExtent:Ne,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:wD.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:ae,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:k??!1,fitViewOptions:H,fitViewResolver:null,connection:{...Fdn},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:WHn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:zdn,zIndexMode:Z,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},RUn=({nodes:g,edges:E,defaultNodes:x,defaultEdges:M,width:N,height:$,fitView:k,fitViewOptions:H,minZoom:U,maxZoom:G,nodeOrigin:ie,nodeExtent:W,zIndexMode:Z})=>tqn((le,oe)=>{async function ee(){const{nodeLookup:Ce,panZoom:pe,fitViewOptions:$e,fitViewResolver:ae,width:Ne,height:Ue,minZoom:ln,maxZoom:un}=oe();pe&&(await YHn({nodes:Ce,width:Ne,height:Ue,panZoom:pe,minZoom:ln,maxZoom:un},$e),ae?.resolve(!0),le({fitViewResolver:null}))}return{...Q1n({nodes:g,edges:E,width:N,height:$,fitView:k,fitViewOptions:H,minZoom:U,maxZoom:G,nodeOrigin:ie,nodeExtent:W,defaultNodes:x,defaultEdges:M,zIndexMode:Z}),setNodes:Ce=>{const{nodeLookup:pe,parentLookup:$e,nodeOrigin:ae,elevateNodesOnSelect:Ne,fitViewQueued:Ue,zIndexMode:ln,nodesSelectionActive:un}=oe(),{nodesInitialized:An,hasSelectedNodes:xn}=lke(Ce,pe,$e,{nodeOrigin:ae,nodeExtent:W,elevateNodesOnSelect:Ne,checkEquality:!0,zIndexMode:ln}),nt=un&&xn;Ue&&An?(ee(),le({nodes:Ce,nodesInitialized:An,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:nt})):le({nodes:Ce,nodesInitialized:An,nodesSelectionActive:nt})},setEdges:Ce=>{const{connectionLookup:pe,edgeLookup:$e}=oe();c0n(pe,$e,Ce),le({edges:Ce})},setDefaultNodesAndEdges:(Ce,pe)=>{if(Ce){const{setNodes:$e}=oe();$e(Ce),le({hasDefaultNodes:!0})}if(pe){const{setEdges:$e}=oe();$e(pe),le({hasDefaultEdges:!0})}},updateNodeInternals:Ce=>{const{triggerNodeChanges:pe,nodeLookup:$e,parentLookup:ae,domNode:Ne,nodeOrigin:Ue,nodeExtent:ln,debug:un,fitViewQueued:An,zIndexMode:xn}=oe(),{changes:nt,updatedInternals:dn}=yGn(Ce,$e,ae,Ne,Ue,ln,xn);dn&&(wGn($e,ae,{nodeOrigin:Ue,nodeExtent:ln,zIndexMode:xn}),An?(ee(),le({fitViewQueued:!1,fitViewOptions:void 0})):le({}),nt?.length>0&&(un&&console.log("React Flow: trigger node changes",nt),pe?.(nt)))},updateNodePositions:(Ce,pe=!1)=>{const $e=[];let ae=[];const{nodeLookup:Ne,triggerNodeChanges:Ue,connection:ln,updateConnection:un,onNodesChangeMiddlewareMap:An}=oe();for(const[xn,nt]of Ce){const dn=Ne.get(xn),bn=!!(dn?.expandParent&&dn?.parentId&&nt?.position),Y={id:xn,type:"position",position:bn?{x:Math.max(0,nt.position.x),y:Math.max(0,nt.position.y)}:nt.position,dragging:pe};if(dn&&ln.inProgress&&ln.fromNode.id===dn.id){const Je=CA(dn,ln.fromHandle,ur.Left,!0);un({...ln,from:Je})}bn&&dn.parentId&&$e.push({id:xn,parentId:dn.parentId,rect:{...nt.internals.positionAbsolute,width:nt.measured.width??0,height:nt.measured.height??0}}),ae.push(Y)}if($e.length>0){const{parentLookup:xn,nodeOrigin:nt}=oe(),dn=Oke($e,Ne,xn,nt);ae.push(...dn)}for(const xn of An.values())ae=xn(ae);Ue(ae)},triggerNodeChanges:Ce=>{const{onNodesChange:pe,setNodes:$e,nodes:ae,hasDefaultNodes:Ne,debug:Ue}=oe();if(Ce?.length){if(Ne){const ln=y0n(Ce,ae);$e(ln)}Ue&&console.log("React Flow: trigger node changes",Ce),pe?.(Ce)}},triggerEdgeChanges:Ce=>{const{onEdgesChange:pe,setEdges:$e,edges:ae,hasDefaultEdges:Ne,debug:Ue}=oe();if(Ce?.length){if(Ne){const ln=k0n(Ce,ae);$e(ln)}Ue&&console.log("React Flow: trigger edge changes",Ce),pe?.(Ce)}},addSelectedNodes:Ce=>{const{multiSelectionActive:pe,edgeLookup:$e,nodeLookup:ae,triggerNodeChanges:Ne,triggerEdgeChanges:Ue}=oe();if(pe){const ln=Ce.map(un=>yA(un,!0));Ne(ln);return}Ne(aD(ae,new Set([...Ce]),!0)),Ue(aD($e))},addSelectedEdges:Ce=>{const{multiSelectionActive:pe,edgeLookup:$e,nodeLookup:ae,triggerNodeChanges:Ne,triggerEdgeChanges:Ue}=oe();if(pe){const ln=Ce.map(un=>yA(un,!0));Ue(ln);return}Ue(aD($e,new Set([...Ce]))),Ne(aD(ae,new Set,!0))},unselectNodesAndEdges:({nodes:Ce,edges:pe}={})=>{const{edges:$e,nodes:ae,nodeLookup:Ne,triggerNodeChanges:Ue,triggerEdgeChanges:ln}=oe(),un=Ce||ae,An=pe||$e,xn=[];for(const dn of un){if(!dn.selected)continue;const bn=Ne.get(dn.id);bn&&(bn.selected=!1),xn.push(yA(dn.id,!1))}const nt=[];for(const dn of An)dn.selected&&nt.push(yA(dn.id,!1));Ue(xn),ln(nt)},setMinZoom:Ce=>{const{panZoom:pe,maxZoom:$e}=oe();pe?.setScaleExtent([Ce,$e]),le({minZoom:Ce})},setMaxZoom:Ce=>{const{panZoom:pe,minZoom:$e}=oe();pe?.setScaleExtent([$e,Ce]),le({maxZoom:Ce})},setTranslateExtent:Ce=>{oe().panZoom?.setTranslateExtent(Ce),le({translateExtent:Ce})},resetSelectedElements:()=>{const{edges:Ce,nodes:pe,triggerNodeChanges:$e,triggerEdgeChanges:ae,elementsSelectable:Ne}=oe();if(!Ne)return;const Ue=pe.reduce((un,An)=>An.selected?[...un,yA(An.id,!1)]:un,[]),ln=Ce.reduce((un,An)=>An.selected?[...un,yA(An.id,!1)]:un,[]);$e(Ue),ae(ln)},setNodeExtent:Ce=>{const{nodes:pe,nodeLookup:$e,parentLookup:ae,nodeOrigin:Ne,elevateNodesOnSelect:Ue,nodeExtent:ln,zIndexMode:un}=oe();Ce[0][0]===ln[0][0]&&Ce[0][1]===ln[0][1]&&Ce[1][0]===ln[1][0]&&Ce[1][1]===ln[1][1]||(lke(pe,$e,ae,{nodeOrigin:Ne,nodeExtent:Ce,elevateNodesOnSelect:Ue,checkEquality:!1,zIndexMode:un}),le({nodeExtent:Ce}))},panBy:Ce=>{const{transform:pe,width:$e,height:ae,panZoom:Ne,translateExtent:Ue}=oe();return kGn({delta:Ce,panZoom:Ne,transform:pe,translateExtent:Ue,width:$e,height:ae})},setCenter:async(Ce,pe,$e)=>{const{width:ae,height:Ne,maxZoom:Ue,panZoom:ln}=oe();if(!ln)return Promise.resolve(!1);const un=typeof $e?.zoom<"u"?$e.zoom:Ue;return await ln.setViewport({x:ae/2-Ce*un,y:Ne/2-pe*un,zoom:un},{duration:$e?.duration,ease:$e?.ease,interpolate:$e?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{le({connection:{...Fdn}})},updateConnection:Ce=>{le({connection:Ce})},reset:()=>le({...Q1n()})}},Object.is);function BUn({initialNodes:g,initialEdges:E,defaultNodes:x,defaultEdges:M,initialWidth:N,initialHeight:$,initialMinZoom:k,initialMaxZoom:H,initialFitViewOptions:U,fitView:G,nodeOrigin:ie,nodeExtent:W,zIndexMode:Z,children:le}){const[oe]=Be.useState(()=>RUn({nodes:g,edges:E,defaultNodes:x,defaultEdges:M,width:N,height:$,fitView:G,minZoom:k,maxZoom:H,fitViewOptions:U,nodeOrigin:ie,nodeExtent:W,zIndexMode:Z}));return L.jsx(rqn,{value:oe,children:L.jsx(Aqn,{children:le})})}function zUn({children:g,nodes:E,edges:x,defaultNodes:M,defaultEdges:N,width:$,height:k,fitView:H,fitViewOptions:U,minZoom:G,maxZoom:ie,nodeOrigin:W,nodeExtent:Z,zIndexMode:le}){return Be.useContext(Rue)?L.jsx(L.Fragment,{children:g}):L.jsx(BUn,{initialNodes:E,initialEdges:x,defaultNodes:M,defaultEdges:N,initialWidth:$,initialHeight:k,fitView:H,initialFitViewOptions:U,initialMinZoom:G,initialMaxZoom:ie,nodeOrigin:W,nodeExtent:Z,zIndexMode:le,children:g})}const FUn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function JUn({nodes:g,edges:E,defaultNodes:x,defaultEdges:M,className:N,nodeTypes:$,edgeTypes:k,onNodeClick:H,onEdgeClick:U,onInit:G,onMove:ie,onMoveStart:W,onMoveEnd:Z,onConnect:le,onConnectStart:oe,onConnectEnd:ee,onClickConnectStart:Ce,onClickConnectEnd:pe,onNodeMouseEnter:$e,onNodeMouseMove:ae,onNodeMouseLeave:Ne,onNodeContextMenu:Ue,onNodeDoubleClick:ln,onNodeDragStart:un,onNodeDrag:An,onNodeDragStop:xn,onNodesDelete:nt,onEdgesDelete:dn,onDelete:bn,onSelectionChange:Y,onSelectionDragStart:Je,onSelectionDrag:pn,onSelectionDragStop:Ae,onSelectionContextMenu:ve,onSelectionStart:nn,onSelectionEnd:yn,onBeforeDelete:Pn,connectionMode:ye,connectionLineType:Re=ek.Bezier,connectionLineStyle:tt,connectionLineComponent:ut,connectionLineContainerStyle:Jt,deleteKeyCode:di="Backspace",selectionKeyCode:Gt="Shift",selectionOnDrag:xt=!1,selectionMode:si=KG.Full,panActivationKeyCode:Kr="Space",multiSelectionKeyCode:Er=QG()?"Meta":"Control",zoomActivationKeyCode:Mt=QG()?"Meta":"Control",snapToGrid:bi,snapGrid:zi,onlyRenderVisibleElements:cu=!1,selectNodesOnDrag:Fu,nodesDraggable:Rs,autoPanOnNodeFocus:ia,nodesConnectable:ef,nodesFocusable:Oa,nodeOrigin:Cc=m0n,edgesFocusable:o0,edgesReconnectable:xb,elementsSelectable:Sl=!0,defaultViewport:cd=pqn,minZoom:s0=.5,maxZoom:uh=2,translateExtent:ud=XG,preventScrolling:b5=!0,nodeExtent:l0,defaultMarkerColor:Cp="#b1b1b7",zoomOnScroll:l6=!0,zoomOnPinch:Ab=!0,panOnScroll:ra=!1,panOnScrollSpeed:od=.5,panOnScrollMode:Sf=EA.Free,zoomOnDoubleClick:f6=!0,panOnDrag:oh=!0,onPaneClick:Tp,onPaneMouseEnter:Gg,onPaneMouseMove:qg,onPaneMouseLeave:Ug,onPaneScroll:sd,onPaneContextMenu:Xg,paneClickDistance:Mb=1,nodeClickDistance:g5=0,children:Op,onReconnect:Np,onReconnectStart:uu,onReconnectEnd:w5,onEdgeContextMenu:Kg,onEdgeDoubleClick:rv,onEdgeMouseEnter:p5,onEdgeMouseMove:Vg,onEdgeMouseLeave:cv,reconnectRadius:m5=10,onNodesChange:v5,onEdgesChange:b1,noDragClassName:Ws="nodrag",noWheelClassName:xf="nowheel",noPanClassName:vt="nopan",fitView:kc,fitViewOptions:tc,connectOnClick:tk,attributionPosition:f0,proOptions:Yg,defaultEdgeOptions:a6,elevateNodesOnSelect:Ip=!0,elevateEdgesOnSelect:Dp=!1,disableKeyboardA11y:_p=!1,autoPanOnConnect:Lp,autoPanOnNodeDrag:xl,autoPanSpeed:y5,connectionRadius:ik,isValidConnection:Qg,onError:Pp,style:OA,id:h6,nodeDragThreshold:rk,connectionDragThreshold:ck,viewport:uv,onViewportChange:k5,width:a0,height:_h,colorMode:uk="light",debug:NA,onScroll:j5,ariaLabelConfig:ok,zIndexMode:ov="basic",...IA},Lh){const sv=h6||"1",sk=kqn(uk),d6=Be.useCallback(Wg=>{Wg.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),j5?.(Wg)},[j5]);return L.jsx("div",{"data-testid":"rf__wrapper",...IA,onScroll:d6,style:{...OA,...FUn},ref:Lh,className:Ta(["react-flow",N,sk]),id:h6,role:"application",children:L.jsxs(zUn,{nodes:g,edges:E,width:a0,height:_h,fitView:kc,fitViewOptions:tc,minZoom:s0,maxZoom:uh,nodeOrigin:Cc,nodeExtent:l0,zIndexMode:ov,children:[L.jsx(yqn,{nodes:g,edges:E,defaultNodes:x,defaultEdges:M,onConnect:le,onConnectStart:oe,onConnectEnd:ee,onClickConnectStart:Ce,onClickConnectEnd:pe,nodesDraggable:Rs,autoPanOnNodeFocus:ia,nodesConnectable:ef,nodesFocusable:Oa,edgesFocusable:o0,edgesReconnectable:xb,elementsSelectable:Sl,elevateNodesOnSelect:Ip,elevateEdgesOnSelect:Dp,minZoom:s0,maxZoom:uh,nodeExtent:l0,onNodesChange:v5,onEdgesChange:b1,snapToGrid:bi,snapGrid:zi,connectionMode:ye,translateExtent:ud,connectOnClick:tk,defaultEdgeOptions:a6,fitView:kc,fitViewOptions:tc,onNodesDelete:nt,onEdgesDelete:dn,onDelete:bn,onNodeDragStart:un,onNodeDrag:An,onNodeDragStop:xn,onSelectionDrag:pn,onSelectionDragStart:Je,onSelectionDragStop:Ae,onMove:ie,onMoveStart:W,onMoveEnd:Z,noPanClassName:vt,nodeOrigin:Cc,rfId:sv,autoPanOnConnect:Lp,autoPanOnNodeDrag:xl,autoPanSpeed:y5,onError:Pp,connectionRadius:ik,isValidConnection:Qg,selectNodesOnDrag:Fu,nodeDragThreshold:rk,connectionDragThreshold:ck,onBeforeDelete:Pn,debug:NA,ariaLabelConfig:ok,zIndexMode:ov}),L.jsx($Un,{onInit:G,onNodeClick:H,onEdgeClick:U,onNodeMouseEnter:$e,onNodeMouseMove:ae,onNodeMouseLeave:Ne,onNodeContextMenu:Ue,onNodeDoubleClick:ln,nodeTypes:$,edgeTypes:k,connectionLineType:Re,connectionLineStyle:tt,connectionLineComponent:ut,connectionLineContainerStyle:Jt,selectionKeyCode:Gt,selectionOnDrag:xt,selectionMode:si,deleteKeyCode:di,multiSelectionKeyCode:Er,panActivationKeyCode:Kr,zoomActivationKeyCode:Mt,onlyRenderVisibleElements:cu,defaultViewport:cd,translateExtent:ud,minZoom:s0,maxZoom:uh,preventScrolling:b5,zoomOnScroll:l6,zoomOnPinch:Ab,zoomOnDoubleClick:f6,panOnScroll:ra,panOnScrollSpeed:od,panOnScrollMode:Sf,panOnDrag:oh,onPaneClick:Tp,onPaneMouseEnter:Gg,onPaneMouseMove:qg,onPaneMouseLeave:Ug,onPaneScroll:sd,onPaneContextMenu:Xg,paneClickDistance:Mb,nodeClickDistance:g5,onSelectionContextMenu:ve,onSelectionStart:nn,onSelectionEnd:yn,onReconnect:Np,onReconnectStart:uu,onReconnectEnd:w5,onEdgeContextMenu:Kg,onEdgeDoubleClick:rv,onEdgeMouseEnter:p5,onEdgeMouseMove:Vg,onEdgeMouseLeave:cv,reconnectRadius:m5,defaultMarkerColor:Cp,noDragClassName:Ws,noWheelClassName:xf,noPanClassName:vt,rfId:sv,disableKeyboardA11y:_p,nodeExtent:l0,viewport:uv,onViewportChange:k5}),L.jsx(wqn,{onSelectionChange:Y}),Op,L.jsx(aqn,{proOptions:Yg,position:f0}),L.jsx(fqn,{rfId:sv,disableKeyboardA11y:_p})]})})}var HUn=j0n(JUn);const GUn=g=>g.domNode?.querySelector(".react-flow__edgelabel-renderer");function qUn({children:g}){const E=zu(GUn);return E?iqn.createPortal(g,E):null}function UUn(g){const[E,x]=Be.useState(g),M=Be.useCallback(N=>x($=>y0n(N,$)),[]);return[E,x,M]}function XUn(g){const[E,x]=Be.useState(g),M=Be.useCallback(N=>x($=>k0n(N,$)),[]);return[E,x,M]}function KUn({dimensions:g,lineWidth:E,variant:x,className:M}){return L.jsx("path",{strokeWidth:E,d:`M${g[0]/2} 0 V${g[1]} M0 ${g[1]/2} H${g[0]}`,className:Ta(["react-flow__background-pattern",x,M])})}function VUn({radius:g,className:E}){return L.jsx("circle",{cx:g,cy:g,r:g,className:Ta(["react-flow__background-pattern","dots",E])})}var nk;(function(g){g.Lines="lines",g.Dots="dots",g.Cross="cross"})(nk||(nk={}));const YUn={[nk.Dots]:1,[nk.Lines]:1,[nk.Cross]:6},QUn=g=>({transform:g.transform,patternId:`pattern-${g.rfId}`});function U0n({id:g,variant:E=nk.Dots,gap:x=20,size:M,lineWidth:N=1,offset:$=0,color:k,bgColor:H,style:U,className:G,patternClassName:ie}){const W=Be.useRef(null),{transform:Z,patternId:le}=zu(QUn,jl),oe=M||YUn[E],ee=E===nk.Dots,Ce=E===nk.Cross,pe=Array.isArray(x)?x:[x,x],$e=[pe[0]*Z[2]||1,pe[1]*Z[2]||1],ae=oe*Z[2],Ne=Array.isArray($)?$:[$,$],Ue=Ce?[ae,ae]:$e,ln=[Ne[0]*Z[2]||1+Ue[0]/2,Ne[1]*Z[2]||1+Ue[1]/2],un=`${le}${g||""}`;return L.jsxs("svg",{className:Ta(["react-flow__background",G]),style:{...U,...zue,"--xy-background-color-props":H,"--xy-background-pattern-color-props":k},ref:W,"data-testid":"rf__background",children:[L.jsx("pattern",{id:un,x:Z[0]%$e[0],y:Z[1]%$e[1],width:$e[0],height:$e[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${ln[0]},-${ln[1]})`,children:ee?L.jsx(VUn,{radius:ae/2,className:ie}):L.jsx(KUn,{dimensions:Ue,lineWidth:N,variant:E,className:ie})}),L.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${un})`})]})}U0n.displayName="Background";const WUn=Be.memo(U0n);function ZUn(){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:L.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function eXn(){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:L.jsx("path",{d:"M0 0h32v4.2H0z"})})}function nXn(){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:L.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"})})}function tXn(){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:L.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"})})}function iXn(){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:L.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"})})}function cue({children:g,className:E,...x}){return L.jsx("button",{type:"button",className:Ta(["react-flow__controls-button",E]),...x,children:g})}const rXn=g=>({isInteractive:g.nodesDraggable||g.nodesConnectable||g.elementsSelectable,minZoomReached:g.transform[2]<=g.minZoom,maxZoomReached:g.transform[2]>=g.maxZoom,ariaLabelConfig:g.ariaLabelConfig});function X0n({style:g,showZoom:E=!0,showFitView:x=!0,showInteractive:M=!0,fitViewOptions:N,onZoomIn:$,onZoomOut:k,onFitView:H,onInteractiveChange:U,className:G,children:ie,position:W="bottom-left",orientation:Z="vertical","aria-label":le}){const oe=El(),{isInteractive:ee,minZoomReached:Ce,maxZoomReached:pe,ariaLabelConfig:$e}=zu(rXn,jl),{zoomIn:ae,zoomOut:Ne,fitView:Ue}=Nke(),ln=()=>{ae(),$?.()},un=()=>{Ne(),k?.()},An=()=>{Ue(N),H?.()},xn=()=>{oe.setState({nodesDraggable:!ee,nodesConnectable:!ee,elementsSelectable:!ee}),U?.(!ee)},nt=Z==="horizontal"?"horizontal":"vertical";return L.jsxs(Bue,{className:Ta(["react-flow__controls",nt,G]),position:W,style:g,"data-testid":"rf__controls","aria-label":le??$e["controls.ariaLabel"],children:[E&&L.jsxs(L.Fragment,{children:[L.jsx(cue,{onClick:ln,className:"react-flow__controls-zoomin",title:$e["controls.zoomIn.ariaLabel"],"aria-label":$e["controls.zoomIn.ariaLabel"],disabled:pe,children:L.jsx(ZUn,{})}),L.jsx(cue,{onClick:un,className:"react-flow__controls-zoomout",title:$e["controls.zoomOut.ariaLabel"],"aria-label":$e["controls.zoomOut.ariaLabel"],disabled:Ce,children:L.jsx(eXn,{})})]}),x&&L.jsx(cue,{className:"react-flow__controls-fitview",onClick:An,title:$e["controls.fitView.ariaLabel"],"aria-label":$e["controls.fitView.ariaLabel"],children:L.jsx(nXn,{})}),M&&L.jsx(cue,{className:"react-flow__controls-interactive",onClick:xn,title:$e["controls.interactive.ariaLabel"],"aria-label":$e["controls.interactive.ariaLabel"],children:ee?L.jsx(iXn,{}):L.jsx(tXn,{})}),ie]})}X0n.displayName="Controls";const cXn=Be.memo(X0n);function uXn({id:g,x:E,y:x,width:M,height:N,style:$,color:k,strokeColor:H,strokeWidth:U,className:G,borderRadius:ie,shapeRendering:W,selected:Z,onClick:le}){const{background:oe,backgroundColor:ee}=$||{},Ce=k||oe||ee;return L.jsx("rect",{className:Ta(["react-flow__minimap-node",{selected:Z},G]),x:E,y:x,rx:ie,ry:ie,width:M,height:N,style:{fill:Ce,stroke:H,strokeWidth:U},shapeRendering:W,onClick:le?pe=>le(pe,g):void 0})}const oXn=Be.memo(uXn),sXn=g=>g.nodes.map(E=>E.id),U7e=g=>g instanceof Function?g:()=>g;function lXn({nodeStrokeColor:g,nodeColor:E,nodeClassName:x="",nodeBorderRadius:M=5,nodeStrokeWidth:N,nodeComponent:$=oXn,onClick:k}){const H=zu(sXn,jl),U=U7e(E),G=U7e(g),ie=U7e(x),W=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return L.jsx(L.Fragment,{children:H.map(Z=>L.jsx(aXn,{id:Z,nodeColorFunc:U,nodeStrokeColorFunc:G,nodeClassNameFunc:ie,nodeBorderRadius:M,nodeStrokeWidth:N,NodeComponent:$,onClick:k,shapeRendering:W},Z))})}function fXn({id:g,nodeColorFunc:E,nodeStrokeColorFunc:x,nodeClassNameFunc:M,nodeBorderRadius:N,nodeStrokeWidth:$,shapeRendering:k,NodeComponent:H,onClick:U}){const{node:G,x:ie,y:W,width:Z,height:le}=zu(oe=>{const ee=oe.nodeLookup.get(g);if(!ee)return{node:void 0,x:0,y:0,width:0,height:0};const Ce=ee.internals.userNode,{x:pe,y:$e}=ee.internals.positionAbsolute,{width:ae,height:Ne}=s6(Ce);return{node:Ce,x:pe,y:$e,width:ae,height:Ne}},jl);return!G||G.hidden||!Kdn(G)?null:L.jsx(H,{x:ie,y:W,width:Z,height:le,style:G.style,selected:!!G.selected,className:M(G),color:E(G),borderRadius:N,strokeColor:x(G),strokeWidth:$,shapeRendering:k,onClick:U,id:G.id})}const aXn=Be.memo(fXn);var hXn=Be.memo(lXn);const dXn=200,bXn=150,gXn=g=>!g.hidden,wXn=g=>{const E={x:-g.transform[0]/g.transform[2],y:-g.transform[1]/g.transform[2],width:g.width/g.transform[2],height:g.height/g.transform[2]};return{viewBB:E,boundingRect:g.nodeLookup.size>0?Xdn(iq(g.nodeLookup,{filter:gXn}),E):E,rfId:g.rfId,panZoom:g.panZoom,translateExtent:g.translateExtent,flowWidth:g.width,flowHeight:g.height,ariaLabelConfig:g.ariaLabelConfig}},pXn="react-flow__minimap-desc";function K0n({style:g,className:E,nodeStrokeColor:x,nodeColor:M,nodeClassName:N="",nodeBorderRadius:$=5,nodeStrokeWidth:k,nodeComponent:H,bgColor:U,maskColor:G,maskStrokeColor:ie,maskStrokeWidth:W,position:Z="bottom-right",onClick:le,onNodeClick:oe,pannable:ee=!1,zoomable:Ce=!1,ariaLabel:pe,inversePan:$e,zoomStep:ae=1,offsetScale:Ne=5}){const Ue=El(),ln=Be.useRef(null),{boundingRect:un,viewBB:An,rfId:xn,panZoom:nt,translateExtent:dn,flowWidth:bn,flowHeight:Y,ariaLabelConfig:Je}=zu(wXn,jl),pn=g?.width??dXn,Ae=g?.height??bXn,ve=un.width/pn,nn=un.height/Ae,yn=Math.max(ve,nn),Pn=yn*pn,ye=yn*Ae,Re=Ne*yn,tt=un.x-(Pn-un.width)/2-Re,ut=un.y-(ye-un.height)/2-Re,Jt=Pn+Re*2,di=ye+Re*2,Gt=`${pXn}-${xn}`,xt=Be.useRef(0),si=Be.useRef();xt.current=yn,Be.useEffect(()=>{if(ln.current&&nt)return si.current=OGn({domNode:ln.current,panZoom:nt,getTransform:()=>Ue.getState().transform,getViewScale:()=>xt.current}),()=>{si.current?.destroy()}},[nt]),Be.useEffect(()=>{si.current?.update({translateExtent:dn,width:bn,height:Y,inversePan:$e,pannable:ee,zoomStep:ae,zoomable:Ce})},[ee,Ce,$e,ae,dn,bn,Y]);const Kr=le?bi=>{const[zi,cu]=si.current?.pointer(bi)||[0,0];le(bi,{x:zi,y:cu})}:void 0,Er=oe?Be.useCallback((bi,zi)=>{const cu=Ue.getState().nodeLookup.get(zi).internals.userNode;oe(bi,cu)},[]):void 0,Mt=pe??Je["minimap.ariaLabel"];return L.jsx(Bue,{position:Z,style:{...g,"--xy-minimap-background-color-props":typeof U=="string"?U:void 0,"--xy-minimap-mask-background-color-props":typeof G=="string"?G:void 0,"--xy-minimap-mask-stroke-color-props":typeof ie=="string"?ie:void 0,"--xy-minimap-mask-stroke-width-props":typeof W=="number"?W*yn:void 0,"--xy-minimap-node-background-color-props":typeof M=="string"?M:void 0,"--xy-minimap-node-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-node-stroke-width-props":typeof k=="number"?k:void 0},className:Ta(["react-flow__minimap",E]),"data-testid":"rf__minimap",children:L.jsxs("svg",{width:pn,height:Ae,viewBox:`${tt} ${ut} ${Jt} ${di}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Gt,ref:ln,onClick:Kr,children:[Mt&&L.jsx("title",{id:Gt,children:Mt}),L.jsx(hXn,{onClick:Er,nodeColor:M,nodeStrokeColor:x,nodeBorderRadius:$,nodeClassName:N,nodeStrokeWidth:k,nodeComponent:H}),L.jsx("path",{className:"react-flow__minimap-mask",d:`M${tt-Re},${ut-Re}h${Jt+Re*2}v${di+Re*2}h${-Jt-Re*2}z + M${An.x},${An.y}h${An.width}v${An.height}h${-An.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}K0n.displayName="MiniMap";const mXn=Be.memo(K0n),vXn=g=>E=>g?`${Math.max(1/E.transform[2],1)}`:void 0,yXn={[yD.Line]:"right",[yD.Handle]:"bottom-right"};function kXn({nodeId:g,position:E,variant:x=yD.Handle,className:M,style:N=void 0,children:$,color:k,minWidth:H=10,minHeight:U=10,maxWidth:G=Number.MAX_VALUE,maxHeight:ie=Number.MAX_VALUE,keepAspectRatio:W=!1,resizeDirection:Z,autoScale:le=!0,shouldResize:oe,onResizeStart:ee,onResize:Ce,onResizeEnd:pe}){const $e=A0n(),ae=typeof g=="string"?g:$e,Ne=El(),Ue=Be.useRef(null),ln=x===yD.Handle,un=zu(Be.useCallback(vXn(ln&&le),[ln,le]),jl),An=Be.useRef(null),xn=E??yXn[x];Be.useEffect(()=>{if(!(!Ue.current||!ae))return An.current||(An.current=GGn({domNode:Ue.current,nodeId:ae,getStoreItems:()=>{const{nodeLookup:dn,transform:bn,snapGrid:Y,snapToGrid:Je,nodeOrigin:pn,domNode:Ae}=Ne.getState();return{nodeLookup:dn,transform:bn,snapGrid:Y,snapToGrid:Je,nodeOrigin:pn,paneDomNode:Ae}},onChange:(dn,bn)=>{const{triggerNodeChanges:Y,nodeLookup:Je,parentLookup:pn,nodeOrigin:Ae}=Ne.getState(),ve=[],nn={x:dn.x,y:dn.y},yn=Je.get(ae);if(yn&&yn.expandParent&&yn.parentId){const Pn=yn.origin??Ae,ye=dn.width??yn.measured.width??0,Re=dn.height??yn.measured.height??0,tt={id:yn.id,parentId:yn.parentId,rect:{width:ye,height:Re,...Vdn({x:dn.x??yn.position.x,y:dn.y??yn.position.y},{width:ye,height:Re},yn.parentId,Je,Pn)}},ut=Oke([tt],Je,pn,Ae);ve.push(...ut),nn.x=dn.x?Math.max(Pn[0]*ye,dn.x):void 0,nn.y=dn.y?Math.max(Pn[1]*Re,dn.y):void 0}if(nn.x!==void 0&&nn.y!==void 0){const Pn={id:ae,type:"position",position:{...nn}};ve.push(Pn)}if(dn.width!==void 0&&dn.height!==void 0){const ye={id:ae,type:"dimensions",resizing:!0,setAttributes:Z?Z==="horizontal"?"width":"height":!0,dimensions:{width:dn.width,height:dn.height}};ve.push(ye)}for(const Pn of bn){const ye={...Pn,type:"position"};ve.push(ye)}Y(ve)},onEnd:({width:dn,height:bn})=>{const Y={id:ae,type:"dimensions",resizing:!1,dimensions:{width:dn,height:bn}};Ne.getState().triggerNodeChanges([Y])}})),An.current.update({controlPosition:xn,boundaries:{minWidth:H,minHeight:U,maxWidth:G,maxHeight:ie},keepAspectRatio:W,resizeDirection:Z,onResizeStart:ee,onResize:Ce,onResizeEnd:pe,shouldResize:oe}),()=>{An.current?.destroy()}},[xn,H,U,G,ie,W,ee,Ce,pe,oe]);const nt=xn.split("-");return L.jsx("div",{className:Ta(["react-flow__resize-control","nodrag",...nt,x,M]),ref:Ue,style:{...N,scale:un,...k&&{[ln?"backgroundColor":"borderColor"]:k}},children:$})}Be.memo(kXn);const jXn=g=>g.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V0n=(...g)=>g.filter((E,x,M)=>!!E&&E.trim()!==""&&M.indexOf(E)===x).join(" ").trim();var EXn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const SXn=Be.forwardRef(({color:g="currentColor",size:E=24,strokeWidth:x=2,absoluteStrokeWidth:M,className:N="",children:$,iconNode:k,...H},U)=>Be.createElement("svg",{ref:U,...EXn,width:E,height:E,stroke:g,strokeWidth:M?Number(x)*24/Number(E):x,className:V0n("lucide",N),...H},[...k.map(([G,ie])=>Be.createElement(G,ie)),...Array.isArray($)?$:[$]]));const Ef=(g,E)=>{const x=Be.forwardRef(({className:M,...N},$)=>Be.createElement(SXn,{ref:$,iconNode:E,className:V0n(`lucide-${jXn(g)}`,M),...N}));return x.displayName=`${g}`,x};const xXn=Ef("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const AXn=Ef("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);const TA=Ef("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const MXn=Ef("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const CXn=Ef("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const TXn=Ef("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);const Dke=Ef("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const OXn=Ef("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const NXn=Ef("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);const Y0n=Ef("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const W1n=Ef("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const IXn=Ef("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const SA=Ef("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const DXn=Ef("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);const _Xn=Ef("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const LXn=Ef("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const Q0n=Ef("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);const PXn=Ef("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const BG=Ef("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const dke=Ef("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const $Xn=Ef("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);const Jg=Ef("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function RXn({mode:g,models:E,objects:x,application:M,initialModelType:N,suggestedSelector:$,nameReadOnly:k=!1,preview:H,onPreview:U,onSubmit:G,onClose:ie}){const Z=(M?W0n(E,M):null)?.type||N||E[0]?.type||"",[le,oe]=Be.useState(Z),ee=E.find(Mt=>Mt.type===le)??null,[Ce,pe]=Be.useState(M?.name||M?.applicationId||Z1n(ee)),[$e,ae]=Be.useState(()=>Cue(ee,M)),Ne=M?.selector||$||zXn(x),[Ue,ln]=Be.useState(Ne.multiplicity),[un,An]=Be.useState(uue(Ne,"scale")),[xn,nt]=Be.useState(uue(Ne,"kind")),[dn,bn]=Be.useState(uue(Ne,"species")),[Y,Je]=Be.useState(uue(Ne,"name")),pn=FXn(Ne,"within"),Ae=M?.owner.scope==="template"&&pn?.type==="Scope"&&String(pn.name||"")===M.owner.instance,[ve,nn]=Be.useState(pn?.type==="Scope"&&!Ae?"named_scope":pn?.type==="SceneScope"?"scene":"local"),[yn,Pn]=Be.useState(pn?.type==="Scope"&&!Ae?String(pn.name||""):""),[ye,Re]=Be.useState(M?.cadence.mode==="period"?"period":"default"),[tt,ut]=Be.useState(String(M?.cadence.value??1)),[Jt,di]=Be.useState(M?.cadence.unit||"Hour"),Gt=Mt=>{const bi=E.find(zi=>zi.type===Mt)??null;oe(Mt),ae(Cue(bi,g==="update"?M:void 0)),g==="add"&&pe(Z1n(bi))},xt=Be.useMemo(()=>({scales:zG(x.map(Mt=>Mt.scale)),kinds:zG(x.map(Mt=>Mt.kind)),species:zG(x.map(Mt=>Mt.species)),names:zG(x.map(Mt=>Mt.name))}),[x]),si=Be.useMemo(()=>{const Mt=[un&&`scale ${un}`,xn&&`kind ${xn}`,dn&&`species ${dn}`,Y&&`name ${Y}`].filter(Boolean),bi=Mt.length?Mt.join(", "):"matching objects";return ve==="scene"?`${bi} in the whole scene`:ve==="named_scope"?`${bi} below ${yn||"the named root"}`:`${bi} in the local instance scope`},[xn,Y,un,ve,yn,dn]),Kr=()=>{const Mt={selectors:[]};return ve==="named_scope"&&yn&&(Mt.within={type:"Scope",name:yn}),ve==="scene"&&(Mt.within={type:"SceneScope"}),un&&(Mt.scale=un),xn&&(Mt.kind=xn),dn&&(Mt.species=dn),Y&&(Mt.name=Y),{type:JXn(Ue),multiplicity:Ue,criteria:Mt,julia:""}},Er=()=>{G({applicationRef:M?.owner,modelType:le,name:Ce.trim(),parameters:$e,selector:Kr(),cadence:ye==="period"?{mode:"period",value:Number(tt),unit:Jt,julia:`Dates.${Jt}(${tt})`}:{mode:"default",value:null,unit:null,julia:"nothing"}})};return L.jsx("div",{className:"overlay-backdrop",onMouseDown:ie,children:L.jsxs("section",{className:"overlay-panel application-form",onMouseDown:Mt=>Mt.stopPropagation(),"data-testid":"application-form",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:g==="add"?"Add application":`Update ${M?.applicationId}`}),L.jsx("span",{children:"A configured use of a model on selected scene objects"})]}),L.jsx("button",{onClick:ie,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content application-form-content",children:[L.jsxs("label",{children:["Model",L.jsx("select",{value:le,onChange:Mt=>Gt(Mt.target.value),"data-testid":"application-model-select",children:E.map(Mt=>L.jsxs("option",{value:Mt.type,children:[Mt.package?`${Mt.package} · `:"",Mt.name," (",Mt.process,")"]},Mt.type))})]}),L.jsxs("label",{children:["Application name",L.jsx("input",{value:Ce,disabled:k,onChange:Mt=>pe(Mt.target.value),"data-testid":"application-name"})]}),ee&&ee.constructor.fields.length>0&&L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Model parameters"}),L.jsx(Z0n,{fields:ee.constructor.fields,values:$e,onChange:ae})]}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Target selector"}),L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Multiplicity",L.jsxs("select",{value:Ue,onChange:Mt=>ln(Mt.target.value),children:[L.jsx("option",{value:"one",children:"One"}),L.jsx("option",{value:"optional_one",children:"Optional one"}),L.jsx("option",{value:"many",children:"Many"})]})]}),L.jsxs("label",{children:["Scope",L.jsxs("select",{value:ve,onChange:Mt=>nn(Mt.target.value),children:[L.jsx("option",{value:"local",children:"Default / instance local"}),L.jsx("option",{value:"scene",children:"Explicit whole scene"}),L.jsx("option",{value:"named_scope",children:"Named object subtree"})]})]}),ve==="named_scope"&&L.jsx(PG,{label:"Scope root",value:yn,options:xt.names,onChange:Pn}),L.jsx(PG,{label:"Scale",value:un,options:xt.scales,onChange:An}),L.jsx(PG,{label:"Kind",value:xn,options:xt.kinds,onChange:nt}),L.jsx(PG,{label:"Species",value:dn,options:xt.species,onChange:bn}),L.jsx(PG,{label:"Object name",value:Y,options:xt.names,onChange:Je})]}),L.jsxs("p",{className:"selector-summary",children:["Julia will resolve ",L.jsx("strong",{children:Ue.replace("_"," ")})," target from ",si,"."]}),L.jsxs("button",{className:"selector-preview-button",type:"button",onClick:()=>U(Kr()),"data-testid":"application-target-preview",children:[L.jsx(Dke,{size:15})," Preview targets in Julia"]}),H&&L.jsxs("section",{className:"selector-preview","data-testid":"application-target-preview-result",children:[L.jsxs("strong",{children:[H.count," target object",H.count===1?"":"s"]}),L.jsx("code",{children:H.objectIds.map(String).join(", ")||"No targets"}),H.groups.map(Mt=>L.jsxs("div",{children:[L.jsx("span",{children:Mt.instance}),L.jsx("code",{children:Mt.objectIds.map(String).join(", ")||"No targets"})]},Mt.instance))]})]}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Cadence"}),L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Mode",L.jsxs("select",{value:ye,onChange:Mt=>Re(Mt.target.value),"data-testid":"application-cadence-mode",children:[L.jsx("option",{value:"default",children:"Model or environment default"}),L.jsx("option",{value:"period",children:"Explicit period"})]})]}),ye==="period"&&L.jsxs(L.Fragment,{children:[L.jsxs("label",{children:["Value",L.jsx("input",{type:"number",min:"1",step:"1",value:tt,onChange:Mt=>ut(Mt.target.value),"data-testid":"application-cadence-value"})]}),L.jsxs("label",{children:["Unit",L.jsxs("select",{value:Jt,onChange:Mt=>di(Mt.target.value),"data-testid":"application-cadence-unit",children:[L.jsx("option",{children:"Second"}),L.jsx("option",{children:"Minute"}),L.jsx("option",{children:"Hour"}),L.jsx("option",{children:"Day"})]})]})]})]})]})]}),L.jsxs("footer",{children:[L.jsx("button",{onClick:ie,children:"Cancel"}),L.jsxs("button",{className:"primary",disabled:!le||!Ce.trim()||ye==="period"&&(!Number.isInteger(Number(tt))||Number(tt)<=0),onClick:Er,"data-testid":"application-submit",children:[L.jsx(TA,{size:15})," ",g==="add"?"Add application":"Apply changes"]})]})]})})}function W0n(g,E){return g.find(x=>x.type===E.modelType)??g.find(x=>x.name===E.modelName&&x.module===E.module)??null}function Z0n({fields:g,values:E,onChange:x}){const M=new Map;for(const $ of g)$.typeParameter&&!M.has($.typeParameter)&&M.set($.typeParameter,$.name);const N=($,k)=>{const H=$.typeParameter?g.filter(U=>U.typeParameter===$.typeParameter).map(U=>U.name):[$.name];x(Object.fromEntries(Object.entries(E).map(([U,G])=>[U,H.includes(U)?{...G,type:k}:G])))};return L.jsx("div",{className:"parameter-list",children:g.map($=>{const k=E[$.name]||{type:$.inferredChoice,value:""},H=!$.typeParameter||M.get($.typeParameter)===$.name;return L.jsxs("div",{className:"parameter-row",children:[L.jsxs("label",{children:[L.jsx("span",{children:$.name}),L.jsx("small",{children:$.declaredType}),L.jsx("input",{"data-testid":`application-param-${$.name}`,value:k.value,onChange:U=>x({...E,[$.name]:{...k,value:U.target.value}})})]}),H&&L.jsxs("label",{className:"parameter-type",children:[L.jsx("span",{children:$.typeParameter?`${$.typeParameter} type`:"Value type"}),L.jsx("select",{"data-testid":`application-param-type-${$.name}`,value:k.type,onChange:U=>N($,U.target.value),children:$.choices.map(U=>L.jsx("option",{value:U,children:U},U))})]})]},$.name)})})}function PG({label:g,value:E,options:x,onChange:M}){return L.jsxs("label",{children:[g,L.jsxs("select",{value:E,onChange:N=>M(N.target.value),children:[L.jsx("option",{value:"",children:"Any"}),x.map(N=>L.jsx("option",{value:N,children:N},N))]})]})}function Cue(g,E){return g?Object.fromEntries(g.constructor.fields.map(x=>{const M=E?.modelParameters[x.name],N=M?.type||x.inferredChoice,$=M?M.julia:x.hasDefault?N==="julia"?x.defaultJulia||"":BXn(x.default,N):"";return[x.name,{type:N,value:$}]})):{}}function BXn(g,E){const x=g==null?"":String(g);return E==="symbol"?x.replace(/^:/,""):x}function Z1n(g){return g?.process||g?.name||"application"}function zXn(g){const E=zG(g.map(x=>x.scale))[0];return{type:"Many",multiplicity:"many",criteria:E?{selectors:[],scale:E}:{selectors:[]},julia:""}}function uue(g,E){const x=g.criteria[E];return typeof x=="string"?x:""}function FXn(g,E){const x=g.criteria[E];return x&&typeof x=="object"?x:null}function JXn(g){return g==="one"?"One":g==="optional_one"?"OptionalOne":"Many"}function zG(g){return[...new Set(g.filter(E=>!!E))].sort()}function HXn({application:g,applications:E,environments:x,models:M,onCommand:N,onClose:$}){const k=E.filter(ve=>ve.applicationId!==g.applicationId&&(g.owner.scope==="global"?ve.owner.scope==="global":ve.owner.scope==="template"&&ve.owner.templateId===g.owner.templateId&&ve.owner.instance===g.owner.instance)),[H,U]=Be.useState(""),[G,ie]=Be.useState(k[0]?.applicationId||""),[W,Z]=Be.useState(g.environment?g.environment.backendId||"scene":"default"),[le,oe]=Be.useState(String(g.environment?.provider||"")),[ee,Ce]=Be.useState(()=>({...Object.fromEntries(g.environmentInputs.map(ve=>[ve.name,""])),...g.environment?.sources||{}})),[pe,$e]=Be.useState(String(g.environment?.sink||"")),[ae,Ne]=Be.useState(()=>GXn(g.environment?.extra)),[Ue,ln]=Be.useState(g.updates||[]),[un,An]=Be.useState(g.outputs[0]?.name||""),[xn,nt]=Be.useState(k[0]?.owner.applicationId||""),dn=k.find(ve=>ve.applicationId===G),bn=M.find(ve=>ve.type===g.modelType),Y=Be.useMemo(()=>{const ve=g.owner.scope==="template"&&dn?.owner.scope==="template"&&dn.owner.templateId===g.owner.templateId;return{type:dn?.targetCount===1?"One":"Many",multiplicity:dn?.targetCount===1?"one":"many",criteria:{selectors:[],...ve?{}:{within:{type:"SceneScope"}},application:dn?.owner.applicationId||G},julia:""}},[g.owner.scope,g.owner.templateId,G,dn]),Je=()=>{!H.trim()||!G||(N({action:"edit",kind:"set_call_binding",applicationRef:g.owner,call:H.trim(),selector:Y}),U(""))},pn=()=>{!un||!xn||ln(ve=>[...ve.filter(nn=>!nn.variables.includes(un)),{variables:[un],after:[xn]}])},Ae=()=>{const ve=qXn(W,le,ee,pe,ae);N({action:"edit",kind:"set_application_environment",applicationRef:g.owner,configuration:ve})};return L.jsx("div",{className:"overlay-backdrop",onMouseDown:$,children:L.jsxs("section",{className:"overlay-panel application-configuration-form",onMouseDown:ve=>ve.stopPropagation(),"data-testid":"application-configuration-form",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsxs("strong",{children:["Configure ",g.owner.applicationId]}),L.jsx("span",{children:"Authored coupling and execution policy, validated by Julia"})]}),L.jsx("button",{onClick:$,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content application-configuration-content",children:[L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Explicit input bindings"}),Object.entries(g.inputBindings).length===0&&L.jsx("p",{children:"No authored input bindings. Unique same-object producers may still be inferred."}),L.jsx("div",{className:"configuration-list",children:Object.entries(g.inputBindings).map(([ve,nn])=>L.jsxs("div",{children:[L.jsx("code",{children:ve}),L.jsx("span",{children:nn.julia||nn.type}),L.jsx("button",{className:"danger icon-button",title:`Remove ${ve} binding`,onClick:()=>N({action:"edit",kind:"remove_input_binding",applicationRef:g.owner,input:ve}),children:L.jsx(BG,{size:14})})]},ve))})]}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Manual calls"}),L.jsx("div",{className:"configuration-list",children:Object.entries(g.callBindings).map(([ve,nn])=>L.jsxs("div",{children:[L.jsx("code",{children:ve}),L.jsx("span",{children:nn.julia||nn.type}),L.jsx("button",{className:"danger icon-button",title:`Remove ${ve} call`,onClick:()=>N({action:"edit",kind:"remove_call_binding",applicationRef:g.owner,call:ve}),children:L.jsx(BG,{size:14})})]},ve))}),L.jsxs("div",{className:"form-grid compact-configuration-row",children:[L.jsxs("label",{children:["Call name",L.jsx("input",{"data-testid":"call-name",value:H,onChange:ve=>U(ve.target.value),placeholder:"child"})]}),L.jsxs("label",{children:["Target application",L.jsxs("select",{"data-testid":"call-target",value:G,onChange:ve=>ie(ve.target.value),children:[L.jsx("option",{value:"",children:"Choose application"}),k.map(ve=>L.jsx("option",{value:ve.applicationId,children:ve.owner.applicationId},ve.applicationId))]})]}),L.jsxs("button",{type:"button","data-testid":"add-call-binding",disabled:!H.trim()||!G,onClick:Je,children:[L.jsx(SA,{size:14})," Add call"]})]})]}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Environment"}),bn?.environmentHint&&L.jsxs("p",{className:"environment-hint",children:[L.jsx("strong",{children:"Model hint"})," ",bn.environmentHint]}),L.jsxs("div",{className:"form-grid compact-configuration-row",children:[L.jsxs("label",{children:["Backend",L.jsxs("select",{"data-testid":"environment-backend",value:W,onChange:ve=>Z(ve.target.value),children:[L.jsx("option",{value:"default",children:"No application override"}),L.jsx("option",{value:"scene",children:"Active scene environment"}),x.filter(ve=>ve.source==="catalog").map(ve=>L.jsxs("option",{value:ve.id,children:[ve.name," · ",ve.type]},ve.id))]})]}),L.jsxs("label",{children:["Provider",L.jsx("input",{"data-testid":"environment-provider",value:le,onChange:ve=>oe(ve.target.value),placeholder:"default provider",disabled:W==="default"})]}),L.jsxs("label",{children:["Output sink",L.jsx("input",{"data-testid":"environment-sink",value:pe,onChange:ve=>$e(ve.target.value),placeholder:"default sink",disabled:W==="default"})]})]}),g.environmentInputs.length>0&&L.jsx("div",{className:"configuration-list environment-sources",children:g.environmentInputs.map(ve=>L.jsxs("label",{children:[L.jsx("code",{children:ve.name}),L.jsx("input",{value:ee[ve.name]||"",onChange:nn=>Ce(yn=>({...yn,[ve.name]:nn.target.value})),placeholder:"backend source variable",disabled:W==="default","data-testid":`environment-source-${ve.name}`})]},ve.name))}),L.jsx("div",{className:"configuration-list",children:ae.map((ve,nn)=>L.jsxs("div",{children:[L.jsx("input",{"aria-label":"Backend option",value:ve.key,onChange:yn=>Ne(Pn=>Pn.map((ye,Re)=>Re===nn?{...ye,key:yn.target.value}:ye)),placeholder:"option"}),L.jsxs("select",{value:ve.type,onChange:yn=>Ne(Pn=>Pn.map((ye,Re)=>Re===nn?{...ye,type:yn.target.value}:ye)),children:[L.jsx("option",{value:"float",children:"Float"}),L.jsx("option",{value:"integer",children:"Integer"}),L.jsx("option",{value:"boolean",children:"Boolean"}),L.jsx("option",{value:"symbol",children:"Symbol"}),L.jsx("option",{value:"string",children:"String"}),L.jsx("option",{value:"julia",children:"Julia expression"})]}),L.jsx("input",{"aria-label":"Backend option value",value:ve.value,onChange:yn=>Ne(Pn=>Pn.map((ye,Re)=>Re===nn?{...ye,value:yn.target.value}:ye))}),L.jsx("button",{className:"danger icon-button",onClick:()=>Ne(yn=>yn.filter((Pn,ye)=>ye!==nn)),children:L.jsx(BG,{size:14})})]},nn))}),L.jsxs("div",{className:"compact-actions",children:[L.jsxs("button",{type:"button",disabled:W==="default",onClick:()=>Ne(ve=>[...ve,{key:"",type:"string",value:""}]),children:[L.jsx(SA,{size:14})," Backend option"]}),L.jsxs("button",{type:"button","data-testid":"apply-environment",onClick:Ae,children:[L.jsx(TA,{size:14})," Apply environment"]})]}),L.jsxs("div",{className:"effective-environment",children:[L.jsx("strong",{children:"Effective bindings"}),L.jsx("code",{children:JSON.stringify(g.environmentBindings||{},null,2)}),g.environmentWindow!==null&&g.environmentWindow!==void 0?L.jsx("code",{children:JSON.stringify(g.environmentWindow)}):null]})]}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Output routing"}),L.jsx("div",{className:"configuration-list",children:g.outputs.map(ve=>L.jsxs("label",{children:[L.jsx("code",{children:ve.name}),L.jsxs("select",{"data-testid":`output-routing-${ve.name}`,value:g.outputRouting[ve.name]||"canonical",onChange:nn=>N({action:"edit",kind:"set_output_routing",applicationRef:g.owner,output:ve.name,route:nn.target.value}),children:[L.jsx("option",{value:"canonical",children:"Canonical status owner"}),L.jsx("option",{value:"stream_only",children:"Stream only"})]})]},ve.name))})]}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Duplicate-writer ordering"}),L.jsx("div",{className:"configuration-list",children:Ue.map((ve,nn)=>L.jsxs("div",{children:[L.jsx("code",{children:ve.variables.join(", ")}),L.jsxs("span",{children:["after ",ve.after.join(", ")]}),L.jsx("button",{className:"danger icon-button",title:"Remove update ordering",onClick:()=>ln(yn=>yn.filter((Pn,ye)=>ye!==nn)),children:L.jsx(BG,{size:14})})]},`${ve.variables.join(",")}:${ve.after.join(",")}`))}),L.jsxs("div",{className:"form-grid compact-configuration-row",children:[L.jsxs("label",{children:["Output",L.jsx("select",{value:un,onChange:ve=>An(ve.target.value),children:g.outputs.map(ve=>L.jsx("option",{value:ve.name,children:ve.name},ve.name))})]}),L.jsxs("label",{children:["Run after",L.jsxs("select",{value:xn,onChange:ve=>nt(ve.target.value),children:[L.jsx("option",{value:"",children:"Choose application"}),k.map(ve=>L.jsx("option",{value:ve.owner.applicationId,children:ve.owner.applicationId},ve.applicationId))]})]}),L.jsxs("button",{type:"button",disabled:!un||!xn,onClick:pn,children:[L.jsx(SA,{size:14})," Add rule"]}),L.jsxs("button",{type:"button",onClick:()=>N({action:"edit",kind:"set_update_ordering",applicationRef:g.owner,updates:Ue}),children:[L.jsx(TA,{size:14})," Apply ordering"]})]})]})]}),L.jsx("footer",{children:L.jsx("button",{className:"primary",onClick:$,children:"Done"})})]})})}function GXn(g){return Object.entries(g||{}).map(([E,x])=>({key:E,type:typeof x=="number"?Number.isInteger(x)?"integer":"float":typeof x=="boolean"?"boolean":"string",value:String(x??"")}))}function qXn(g,E,x,M,N){return g==="default"?null:{backendId:g,provider:E.trim()||null,sources:Object.fromEntries(Object.entries(x).filter(([,$])=>$.trim()).map(([$,k])=>[$,k.trim()])),sink:M.trim()||null,extra:Object.fromEntries(N.filter($=>$.key.trim()).map($=>[$.key.trim(),{type:$.type,value:$.value}]))}}function UXn({endpoints:g,objects:E,preview:x,onPreview:M,onSubmit:N,onClose:$}){const k=XXn(g.sourceApplication.targetIds,g.targetApplication.targetIds),[H,U]=Be.useState(g.sourceApplication.targetCount>1&&g.targetApplication.targetCount===1?"many":"one"),[G,ie]=Be.useState(k?"self":""),[W,Z]=Be.useState("local"),[le,oe]=Be.useState(""),[ee,Ce]=Be.useState(""),[pe,$e]=Be.useState(X7e(g.sourceApplication.targetScales)),[ae,Ne]=Be.useState(X7e(g.sourceApplication.targetKinds)),[Ue,ln]=Be.useState(X7e(g.sourceApplication.targetSpecies)),[un,An]=Be.useState(""),[xn,nt]=Be.useState("application"),[dn,bn]=Be.useState("automatic"),[Y,Je]=Be.useState(""),[pn,Ae]=Be.useState("Hour"),ve=oue(E.map(Re=>Re.scale)),nn=oue(E.map(Re=>Re.kind)),yn=oue(E.map(Re=>Re.species)),Pn=oue(E.map(Re=>Re.name)),ye=()=>{const Re={selectors:[],var:g.sourcePort.name};Re[xn]=xn==="application"?g.sourceApplication.owner.applicationId:g.sourceApplication.process;const tt=YXn(W,le,ee);if(tt&&(Re.within=tt),G&&(Re.relation=G),pe&&(Re.scale=pe),ae&&(Re.kind=ae),Ue&&(Re.species=Ue),un&&(Re.name=un),dn!=="automatic"&&(Re.policy={type:VXn(dn)}),Y.trim()){const ut=QXn(Y,pn);ut&&(Re.window=ut)}return{applicationRef:g.targetApplication.owner,input:g.targetPort.name,selector:{type:KXn(H),multiplicity:H,criteria:Re,julia:""}}};return L.jsx("div",{className:"overlay-backdrop",onMouseDown:$,children:L.jsxs("section",{className:"overlay-panel binding-form",onMouseDown:Re=>Re.stopPropagation(),"data-testid":"binding-form",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:"Connect applications"}),L.jsx("span",{children:"Julia resolves this declaration into concrete object bindings"})]}),L.jsx("button",{onClick:$,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content",children:[L.jsxs("div",{className:"binding-route",children:[L.jsxs("div",{children:[L.jsx("small",{children:"Producer"}),L.jsx("strong",{children:g.sourceApplication.applicationId}),L.jsx("code",{children:g.sourcePort.name})]}),L.jsx(W1n,{size:22}),L.jsxs("div",{children:[L.jsx("small",{children:"Consumer"}),L.jsx("strong",{children:g.targetApplication.applicationId}),L.jsx("code",{children:g.targetPort.name})]})]}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Source object selector"}),L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Multiplicity",L.jsxs("select",{value:H,onChange:Re=>U(Re.target.value),children:[L.jsx("option",{value:"one",children:"One"}),L.jsx("option",{value:"optional_one",children:"Optional one"}),L.jsx("option",{value:"many",children:"Many"})]})]}),L.jsxs("label",{children:["Scope",L.jsxs("select",{value:W,onChange:Re=>Z(Re.target.value),children:[L.jsx("option",{value:"local",children:"Default / instance local"}),L.jsx("option",{value:"scene",children:"Explicit whole scene"}),L.jsx("option",{value:"self",children:"Consumer object"}),L.jsx("option",{value:"subtree",children:"Consumer subtree"}),L.jsx("option",{value:"self_plant",children:"Consumer plant"}),L.jsx("option",{value:"ancestor",children:"Ancestor subtree"}),L.jsx("option",{value:"named_scope",children:"Named object subtree"})]})]}),W==="ancestor"&&L.jsx(lD,{label:"Ancestor scale",value:ee,options:ve,onChange:Ce}),W==="named_scope"&&L.jsx(lD,{label:"Scope root",value:le,options:Pn,onChange:oe}),L.jsxs("label",{children:["Relation",L.jsxs("select",{value:G,onChange:Re=>ie(Re.target.value),children:[L.jsx("option",{value:"",children:"Any relation"}),L.jsx("option",{value:"self",children:"Same object"}),L.jsx("option",{value:"parent",children:"Parent"}),L.jsx("option",{value:"children",children:"Children"}),L.jsx("option",{value:"ancestors",children:"Ancestors"}),L.jsx("option",{value:"descendants",children:"Descendants"}),L.jsx("option",{value:"siblings",children:"Siblings"})]})]}),L.jsxs("label",{children:["Producer filter",L.jsxs("select",{value:xn,onChange:Re=>nt(Re.target.value),children:[L.jsx("option",{value:"application",children:"This application"}),L.jsx("option",{value:"process",children:"Any application of this process"})]})]}),L.jsx(lD,{label:"Scale",value:pe,options:ve,onChange:$e}),L.jsx(lD,{label:"Kind",value:ae,options:nn,onChange:Ne}),L.jsx(lD,{label:"Species",value:Ue,options:yn,onChange:ln}),L.jsx(lD,{label:"Object name",value:un,options:Pn,onChange:An}),L.jsxs("label",{children:["Temporal policy",L.jsxs("select",{value:dn,onChange:Re=>bn(Re.target.value),children:[L.jsx("option",{value:"automatic",children:"Automatic"}),L.jsx("option",{value:"hold_last",children:"Hold last"}),L.jsx("option",{value:"interpolate",children:"Interpolate"}),L.jsx("option",{value:"integrate",children:"Integrate"}),L.jsx("option",{value:"aggregate",children:"Aggregate"})]})]}),L.jsxs("label",{children:["Window value",L.jsx("input",{type:"number",min:"1",step:"1",value:Y,onChange:Re=>Je(Re.target.value),placeholder:"Automatic","data-testid":"binding-window-value"})]}),L.jsxs("label",{children:["Window unit",L.jsxs("select",{value:pn,onChange:Re=>Ae(Re.target.value),disabled:!Y.trim(),"data-testid":"binding-window-unit",children:[L.jsx("option",{children:"Second"}),L.jsx("option",{children:"Minute"}),L.jsx("option",{children:"Hour"}),L.jsx("option",{children:"Day"})]})]})]})]}),x&&L.jsxs("section",{className:"selector-preview","data-testid":"binding-preview",children:[L.jsxs("strong",{children:[x.bindingCount," resolved binding",x.bindingCount===1?"":"s"]}),L.jsxs("span",{children:[x.consumerObjectIds.length," consumer object",x.consumerObjectIds.length===1?"":"s"," from ",x.sourceObjectIds.length," source object",x.sourceObjectIds.length===1?"":"s"]}),x.sourceApplicationIds.length>0&&L.jsx("code",{children:x.sourceApplicationIds.join(", ")}),x.diagnostics.map(Re=>L.jsx("p",{children:Re},Re))]})]}),L.jsxs("footer",{children:[L.jsx("button",{onClick:$,children:"Cancel"}),L.jsxs("button",{onClick:()=>M(ye()),"data-testid":"binding-preview-button",children:[L.jsx(Dke,{size:15})," Preview resolution"]}),L.jsxs("button",{className:"primary",onClick:()=>N(ye()),"data-testid":"binding-submit",children:[L.jsx(W1n,{size:15})," Apply binding"]})]})]})})}function lD({label:g,value:E,options:x,onChange:M}){return L.jsxs("label",{children:[g,L.jsxs("select",{value:E,onChange:N=>M(N.target.value),children:[L.jsx("option",{value:"",children:"Any"}),x.map(N=>L.jsx("option",{value:N,children:N},N))]})]})}function XXn(g,E){return g.length===E.length&&g.every(x=>E.some(M=>String(M)===String(x)))}function X7e(g){return g.length===1?g[0]:""}function KXn(g){return g==="one"?"One":g==="optional_one"?"OptionalOne":"Many"}function oue(g){return[...new Set(g.filter(E=>!!E))].sort()}function VXn(g){return g==="hold_last"?"HoldLast":g==="interpolate"?"Interpolate":g==="integrate"?"Integrate":"Aggregate"}function YXn(g,E,x){return g==="local"?null:g==="scene"?{type:"SceneScope"}:g==="self"?{type:"Self"}:g==="subtree"?{type:"Subtree"}:g==="self_plant"?{type:"SelfPlant"}:g==="ancestor"?{type:"Ancestor",scale:x||null}:g==="named_scope"&&E?{type:"Scope",name:E}:null}function QXn(g,E){const x=Number(g);return!Number.isInteger(x)||x<=0?null:{mode:"period",value:x,unit:E,julia:`Dates.${E}(${x})`}}function WXn({environments:g,activeId:E,onSubmit:x,onClose:M}){const[N,$]=Be.useState(E||"none"),k=g.find(H=>H.id===N);return L.jsx("div",{className:"overlay-backdrop",onMouseDown:M,children:L.jsxs("section",{className:"overlay-panel environment-form",onMouseDown:H=>H.stopPropagation(),"data-testid":"environment-form",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:"Scene environment"}),L.jsx("span",{children:"Environment values stay in Julia and are selected by catalog name"})]}),L.jsx("button",{onClick:M,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content",children:[L.jsxs("label",{children:["Environment",L.jsxs("select",{value:N,onChange:H=>$(H.target.value),"data-testid":"scene-environment",children:[L.jsx("option",{value:"none",children:"No environment"}),g.filter(H=>H.source==="catalog").map(H=>L.jsxs("option",{value:H.id,children:[H.name," · ",H.type]},H.id))]})]}),k&&L.jsxs("section",{className:"environment-summary",children:[L.jsx("strong",{children:k.name}),L.jsx("code",{children:k.type}),L.jsx("span",{children:k.variables.length?`Available variables: ${k.variables.join(", ")}`:"Backend variables are discovered by Julia at compile time."})]})]}),L.jsxs("footer",{children:[L.jsx("button",{onClick:M,children:"Cancel"}),L.jsxs("button",{className:"primary",onClick:()=>x(N==="none"?null:N),"data-testid":"environment-submit",children:[L.jsx(TA,{size:15})," Use environment"]})]})]})})}function ZXn({templates:g,instances:E,objects:x,preview:M,onPreview:N,onSubmit:$,onClose:k}){const[H,U]=Be.useState(g[0]?.id||""),[G,ie]=Be.useState(""),[W,Z]=Be.useState("existing"),le=Be.useMemo(()=>eKn(x,E),[E,x]),[oe,ee]=Be.useState(String(le[0]?.objectId??"")),[Ce,pe]=Be.useState(""),[$e,ae]=Be.useState(""),[Ne,Ue]=Be.useState(""),[ln,un]=Be.useState(""),[An,xn]=Be.useState(""),nt=()=>W==="existing"?{name:G.trim(),templateId:H,rootId:oe}:{name:G.trim(),templateId:H,rootObject:{objectId:Ce.trim(),configuration:{parent:$e||null,scale:Ne.trim()||null,kind:ln.trim()||null,species:An.trim()||null,name:G.trim()}}},dn=!!(H&&G.trim()&&(W==="existing"?oe:Ce.trim()));return L.jsx("div",{className:"overlay-backdrop",onMouseDown:k,children:L.jsxs("section",{className:"overlay-panel instance-form",onMouseDown:bn=>bn.stopPropagation(),"data-testid":"instance-form",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:"Add template instance"}),L.jsx("span",{children:"Mount one reusable coupled model set on an object subtree"})]}),L.jsx("button",{onClick:k,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content instance-form-content",children:[L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Template",L.jsx("select",{value:H,onChange:bn=>U(bn.target.value),"data-testid":"instance-template",children:g.map(bn=>L.jsxs("option",{value:bn.id,children:[bn.name," · ",bn.source==="catalog"?"preset":"model-local"," · ",bn.applications.length," applications"]},bn.id))})]}),L.jsxs("label",{children:["Instance name",L.jsx("input",{value:G,onChange:bn=>ie(bn.target.value),placeholder:"plant_1","data-testid":"instance-name"})]})]}),L.jsxs("div",{className:"override-scope-choice",children:[L.jsxs("button",{className:W==="existing"?"active":"",onClick:()=>Z("existing"),children:[L.jsx("strong",{children:"Use existing root"}),L.jsx("span",{children:"All unclaimed descendants are mounted automatically"})]}),L.jsxs("button",{className:W==="new"?"active":"",onClick:()=>Z("new"),children:[L.jsx("strong",{children:"Create minimal root"}),L.jsx("span",{children:"Create the object and mount the template atomically"})]})]}),W==="existing"?L.jsxs("label",{children:["Unclaimed root",L.jsxs("select",{value:oe,onChange:bn=>ee(bn.target.value),"data-testid":"instance-root",children:[L.jsx("option",{value:"",children:"Choose an object"}),le.map(bn=>L.jsxs("option",{value:String(bn.objectId),children:[bn.name||String(bn.objectId)," · ",bn.scale||"unscaled"]},bn.id))]})]}):L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Stable object ID",L.jsx("input",{value:Ce,onChange:bn=>pe(bn.target.value),"data-testid":"instance-new-root-id"})]}),L.jsxs("label",{children:["Parent object",L.jsxs("select",{value:$e,onChange:bn=>ae(bn.target.value),children:[L.jsx("option",{value:"",children:"No parent"}),x.map(bn=>L.jsx("option",{value:String(bn.objectId),children:bn.name||String(bn.objectId)},bn.id))]})]}),L.jsxs("label",{children:["Scale",L.jsx("input",{value:Ne,onChange:bn=>Ue(bn.target.value)})]}),L.jsxs("label",{children:["Kind",L.jsx("input",{value:ln,onChange:bn=>un(bn.target.value)})]}),L.jsxs("label",{children:["Species",L.jsx("input",{value:An,onChange:bn=>xn(bn.target.value)})]})]}),M&&L.jsxs("section",{className:"selector-preview","data-testid":"instance-preview",children:[L.jsxs("strong",{children:[M.objectIds.length," claimed object",M.objectIds.length===1?"":"s"]}),L.jsx("code",{children:M.objectIds.map(String).join(", ")}),M.applications.map(bn=>L.jsxs("div",{children:[L.jsx("code",{children:bn.applicationId}),L.jsxs("span",{children:[bn.targetIds.length," resolved target",bn.targetIds.length===1?"":"s"]})]},bn.applicationId)),M.diagnostics.map(bn=>L.jsx("p",{children:bn},bn))]})]}),L.jsxs("footer",{children:[L.jsx("button",{onClick:k,children:"Cancel"}),L.jsxs("button",{disabled:!dn,onClick:()=>N(nt()),"data-testid":"instance-preview-button",children:[L.jsx(Dke,{size:15})," Preview mount"]}),L.jsxs("button",{className:"primary",disabled:!dn,onClick:()=>$(nt()),"data-testid":"instance-submit",children:[L.jsx(TA,{size:15})," Add instance"]})]})]})})}function eKn(g,E){const x=new Set(E.flatMap(M=>M.objectIds.map(String)));return g.filter(M=>!x.has(String(M.objectId)))}function nKn({mode:g,objects:E,object:x,onSubmit:M,onClose:N}){const[$,k]=Be.useState(String(x?.objectId??"")),[H,U]=Be.useState(tKn(x?.parent)),[G,ie]=Be.useState(x?.scale||""),[W,Z]=Be.useState(x?.kind||""),[le,oe]=Be.useState(x?.species||""),[ee,Ce]=Be.useState(x?.name||""),pe=Be.useMemo(()=>E.filter(ae=>String(ae.objectId)!==$),[$,E]),$e=()=>M({objectId:$.trim(),configuration:{parent:H||null,scale:G.trim()||null,kind:W.trim()||null,species:le.trim()||null,name:ee.trim()||null}});return L.jsx("div",{className:"overlay-backdrop",onMouseDown:N,children:L.jsxs("section",{className:"overlay-panel object-form",onMouseDown:ae=>ae.stopPropagation(),"data-testid":"object-form",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:g==="add"?"Add scene object":`Update object ${String(x?.objectId)}`}),L.jsx("span",{children:"Objects define the concrete entities and topology targeted by applications"})]}),L.jsx("button",{onClick:N,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content object-form-content",children:[L.jsxs("label",{children:["Stable object ID",L.jsx("input",{value:$,disabled:g==="update",onChange:ae=>k(ae.target.value),"data-testid":"object-id"})]}),L.jsxs("label",{children:["Parent object",L.jsxs("select",{value:H,onChange:ae=>U(ae.target.value),children:[L.jsx("option",{value:"",children:"No parent"}),pe.map(ae=>L.jsxs("option",{value:String(ae.objectId),children:[ae.name||String(ae.objectId)," · ",ae.scale||"unscaled"]},ae.id))]})]}),L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Scale",L.jsx("input",{value:G,onChange:ae=>ie(ae.target.value)})]}),L.jsxs("label",{children:["Kind",L.jsx("input",{value:W,onChange:ae=>Z(ae.target.value)})]}),L.jsxs("label",{children:["Species",L.jsx("input",{value:le,onChange:ae=>oe(ae.target.value)})]}),L.jsxs("label",{children:["Name",L.jsx("input",{value:ee,onChange:ae=>Ce(ae.target.value)})]})]})]}),L.jsxs("footer",{children:[L.jsx("button",{onClick:N,children:"Cancel"}),L.jsxs("button",{className:"primary",disabled:!$.trim(),onClick:$e,"data-testid":"object-submit",children:[L.jsx(TA,{size:15})," ",g==="add"?"Add object":"Apply changes"]})]})]})})}function tKn(g){if(g==null||g==="")return"";const E=String(g);return E.startsWith("object:")?E.slice(7):E}function iKn({application:g,models:E,instances:x,onSubmit:M,onRemove:N,onClose:$}){const k=Be.useMemo(()=>E.filter(nt=>nt.process===g.process),[g.process,E]),H=W0n(k,g)||k[0]||null,[U,G]=Be.useState("instance"),[ie,W]=Be.useState(g.targetInstances[0]||x[0]?.name||""),Z=x.find(nt=>nt.name===ie),le=(Z?.objectIds||[]).filter(nt=>g.targetIds.some(dn=>String(dn)===String(nt))),[oe,ee]=Be.useState(le[0]??""),[Ce,pe]=Be.useState(H?.type||g.modelType),$e=k.find(nt=>nt.type===Ce)||H,[ae,Ne]=Be.useState(()=>Cue($e,g)),Ue=g.owner.applicationId,ln=!!Z?.instanceOverrides.includes(Ue),un=!!Z?.objectOverrides.some(nt=>{const dn=nt;return String(dn.object??dn.objectId??"")===String(oe)&&String(dn.application??dn.applicationId??"")===Ue}),An=U==="instance"?ln:un,xn=nt=>{pe(nt),Ne(Cue(k.find(dn=>dn.type===nt)||null))};return L.jsx("div",{className:"overlay-backdrop",onMouseDown:$,children:L.jsxs("section",{className:"overlay-panel override-form",onMouseDown:nt=>nt.stopPropagation(),"data-testid":"override-form",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:"Create a model override"}),L.jsx("span",{children:"The shared template remains unchanged outside the selected scope"})]}),L.jsx("button",{onClick:$,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content override-form-content",children:[L.jsxs("div",{className:"override-scope-choice",children:[L.jsxs("button",{className:U==="instance"?"active":"",onClick:()=>G("instance"),children:[L.jsx("strong",{children:"One instance"}),L.jsx("span",{children:"All targets of this application in one plant or object instance"})]}),L.jsxs("button",{className:U==="object"?"active":"",onClick:()=>G("object"),children:[L.jsx("strong",{children:"One object"}),L.jsx("span",{children:"Only one concrete execution receives the replacement model"})]})]}),L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Instance",L.jsx("select",{value:ie,onChange:nt=>{const dn=nt.target.value,Y=(x.find(Je=>Je.name===dn)?.objectIds||[]).find(Je=>g.targetIds.some(pn=>String(pn)===String(Je)));W(dn),ee(Y??"")},children:x.filter(nt=>g.targetInstances.includes(nt.name)).map(nt=>L.jsx("option",{value:nt.name,children:nt.name},nt.name))})]}),U==="object"&&L.jsxs("label",{children:["Object",L.jsx("select",{value:String(oe),onChange:nt=>ee(nt.target.value),children:le.map(nt=>L.jsx("option",{value:String(nt),children:String(nt)},String(nt)))})]}),L.jsxs("label",{children:["Replacement model",L.jsx("select",{value:Ce,onChange:nt=>xn(nt.target.value),children:k.map(nt=>L.jsxs("option",{value:nt.type,children:[nt.package?`${nt.package} · `:"",nt.name]},nt.type))})]})]}),$e&&$e.constructor.fields.length>0&&L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Model parameters"}),L.jsx(Z0n,{fields:$e.constructor.fields,values:ae,onChange:Ne})]}),L.jsxs("div",{className:"override-warning",children:[L.jsx("strong",{children:U==="instance"?`Override ${ie}`:`Override object ${String(oe)}`}),L.jsx("span",{children:"Julia validates that the replacement keeps the same process and declared variable contract."})]})]}),L.jsxs("footer",{children:[L.jsx("button",{onClick:$,children:"Cancel"}),An&&L.jsxs("button",{className:"danger","data-testid":"remove-override",onClick:()=>N({scope:U,instance:ie,objectId:U==="object"?oe:void 0,applicationRef:g.owner,modelType:Ce,parameters:ae}),children:[L.jsx(BG,{size:15})," Remove override"]}),L.jsxs("button",{className:"primary",disabled:!ie||!Ce||U==="object"&&!String(oe),onClick:()=>M({scope:U,instance:ie,objectId:U==="object"?oe:void 0,applicationRef:g.owner,modelType:Ce,parameters:ae}),children:[L.jsx(TA,{size:15})," Apply override"]})]})]})})}function sue(g){throw new Error('Could not dynamically require "'+g+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var K7e={exports:{}},edn;function rKn(){return edn||(edn=1,(function(g,E){(function(x){g.exports=x()})(function(){return(function(){function x(M,N,$){function k(G,ie){if(!N[G]){if(!M[G]){var W=typeof sue=="function"&&sue;if(!ie&&W)return W(G,!0);if(H)return H(G,!0);var Z=new Error("Cannot find module '"+G+"'");throw Z.code="MODULE_NOT_FOUND",Z}var le=N[G]={exports:{}};M[G][0].call(le.exports,function(oe){var ee=M[G][1][oe];return k(ee||oe)},le,le.exports,x,M,N,$)}return N[G].exports}for(var H=typeof sue=="function"&&sue,U=0;U<$.length;U++)k($[U]);return k}return x})()({1:[function(x,M,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;function $(Z){"@babel/helpers - typeof";return $=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},$(Z)}function k(Z,le){if(!(Z instanceof le))throw new TypeError("Cannot call a class as a function")}function H(Z,le){for(var oe=0;oe0&&arguments[0]!==void 0?arguments[0]:{},ee=oe.defaultLayoutOptions,Ce=ee===void 0?{}:ee,pe=oe.algorithms,$e=pe===void 0?["layered","stress","mrtree","radial","force","disco","sporeOverlap","sporeCompaction","rectpacking"]:pe,ae=oe.workerFactory,Ne=oe.workerUrl;if(k(this,Z),this.defaultLayoutOptions=Ce,this.initialized=!1,typeof Ne>"u"&&typeof ae>"u")throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");var Ue=ae;typeof Ne<"u"&&typeof ae>"u"&&(Ue=function(An){return new Worker(An)});var ln=Ue(Ne);if(typeof ln.postMessage!="function")throw new TypeError("Created worker does not provide the required 'postMessage' function.");this.worker=new W(ln),this.worker.postMessage({cmd:"register",algorithms:$e}).then(function(un){return le.initialized=!0}).catch(console.err)}return U(Z,[{key:"layout",value:function(oe){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ce=ee.layoutOptions,pe=Ce===void 0?this.defaultLayoutOptions:Ce,$e=ee.logging,ae=$e===void 0?!1:$e,Ne=ee.measureExecutionTime,Ue=Ne===void 0?!1:Ne;return oe?this.worker.postMessage({cmd:"layout",graph:oe,layoutOptions:pe,options:{logging:ae,measureExecutionTime:Ue}}):Promise.reject(new Error("Missing mandatory parameter 'graph'."))}},{key:"knownLayoutAlgorithms",value:function(){return this.worker.postMessage({cmd:"algorithms"})}},{key:"knownLayoutOptions",value:function(){return this.worker.postMessage({cmd:"options"})}},{key:"knownLayoutCategories",value:function(){return this.worker.postMessage({cmd:"categories"})}},{key:"terminateWorker",value:function(){this.worker&&this.worker.terminate()}}])})();var W=(function(){function Z(le){var oe=this;if(k(this,Z),le===void 0)throw new Error("Missing mandatory parameter 'worker'.");this.resolvers={},this.worker=le,this.worker.onmessage=function(ee){setTimeout(function(){oe.receive(oe,ee)},0)}}return U(Z,[{key:"postMessage",value:function(oe){var ee=this.id||0;this.id=ee+1,oe.id=ee;var Ce=this;return new Promise(function(pe,$e){Ce.resolvers[ee]=function(ae,Ne){ae?(Ce.convertGwtStyleError(ae),$e(ae)):pe(Ne)},Ce.worker.postMessage(oe)})}},{key:"receive",value:function(oe,ee){var Ce=ee.data,pe=oe.resolvers[Ce.id];pe&&(delete oe.resolvers[Ce.id],Ce.error?pe(Ce.error):pe(null,Ce.data))}},{key:"terminate",value:function(){this.worker&&this.worker.terminate()}},{key:"convertGwtStyleError",value:function(oe){if(oe){var ee=oe.__java$exception;ee&&(ee.cause&&ee.cause.backingJsObject&&(oe.cause=ee.cause.backingJsObject,this.convertGwtStyleError(oe.cause)),delete oe.__java$exception)}}}])})()},{}],2:[function(x,M,N){(function($){(function(){var k;typeof window<"u"?k=window:typeof $<"u"?k=$:typeof self<"u"&&(k=self);var H;function U(){}function G(){}function ie(){}function W(){}function Z(){}function le(){}function oe(){}function ee(){}function Ce(){}function pe(){}function $e(){}function ae(){}function Ne(){}function Ue(){}function ln(){}function un(){}function An(){}function xn(){}function nt(){}function dn(){}function bn(){}function Y(){}function Je(){}function pn(){}function Ae(){}function ve(){}function nn(){}function yn(){}function Pn(){}function ye(){}function Re(){}function tt(){}function ut(){}function Jt(){}function di(){}function Gt(){}function xt(){}function si(){}function Kr(){}function Er(){}function Mt(){}function bi(){}function zi(){}function cu(){}function Fu(){}function Rs(){}function ia(){}function ef(){}function Oa(){}function Cc(){}function o0(){}function xb(){}function Sl(){}function cd(){}function s0(){}function uh(){}function ud(){}function b5(){}function l0(){}function Cp(){}function l6(){}function Ab(){}function ra(){}function od(){}function Sf(){}function f6(){}function oh(){}function Tp(){}function Gg(){}function qg(){}function Ug(){}function sd(){}function Xg(){}function Mb(){}function g5(){}function Op(){}function Np(){}function uu(){}function w5(){}function Kg(){}function rv(){}function p5(){}function Vg(){}function cv(){}function m5(){}function v5(){}function b1(){}function Ws(){}function xf(){}function vt(){}function kc(){}function tc(){}function tk(){}function f0(){}function Yg(){}function a6(){}function Ip(){}function Dp(){}function _p(){}function Lp(){}function xl(){}function y5(){}function ik(){}function Qg(){}function Pp(){}function OA(){}function h6(){}function rk(){}function ck(){}function uv(){}function k5(){}function a0(){}function _h(){}function uk(){}function NA(){}function j5(){}function ok(){}function ov(){}function IA(){}function Lh(){}function sv(){}function sk(){}function d6(){}function Wg(){}function kD(){}function jD(){}function E5(){}function oq(){}function ED(){}function SD(){}function DA(){}function sq(){}function lq(){}function lk(){}function Zg(){}function _A(){}function LA(){}function S5(){}function x5(){}function xD(){}function PA(){}function AD(){}function b6(){}function ew(){}function $A(){}function g6(){}function $p(){}function RA(){}function fk(){}function MD(){}function ak(){}function hk(){}function CD(){}function Ph(){}function lv(){}function dk(){}function w6(){}function fq(){}function BA(){}function zA(){}function p6(){}function bk(){}function TD(){}function aq(){}function hq(){}function dq(){}function FA(){}function bq(){}function gq(){}function wq(){}function pq(){}function mq(){}function OD(){}function vq(){}function yq(){}function kq(){}function jq(){}function JA(){}function Eq(){}function Sq(){}function xq(){}function ND(){}function Aq(){}function Mq(){}function Cq(){}function Tq(){}function Oq(){}function Nq(){}function Iq(){}function Dq(){}function _q(){}function HA(){}function m6(){}function Lq(){}function ID(){}function DD(){}function _D(){}function LD(){}function PD(){}function A5(){}function Pq(){}function $q(){}function Rq(){}function $D(){}function RD(){}function v6(){}function y6(){}function Bq(){}function gk(){}function BD(){}function GA(){}function qA(){}function UA(){}function zD(){}function FD(){}function JD(){}function zq(){}function Fq(){}function Jq(){}function Hq(){}function Gq(){}function g1(){}function k6(){}function HD(){}function GD(){}function qD(){}function UD(){}function XA(){}function qq(){}function M5(){}function KA(){}function j6(){}function VA(){}function XD(){}function fv(){}function C5(){}function YA(){}function KD(){}function av(){}function VD(){}function YD(){}function QD(){}function Uq(){}function Xq(){}function Kq(){}function WD(){}function ZD(){}function QA(){}function h0(){}function wk(){}function ld(){}function T5(){}function WA(){}function pk(){}function mk(){}function ZA(){}function hv(){}function e_(){}function vk(){}function O5(){}function Vq(){}function w1(){}function eM(){}function nw(){}function n_(){}function yk(){}function dv(){}function nM(){}function t_(){}function tM(){}function i_(){}function fd(){}function N5(){}function I5(){}function kk(){}function E6(){}function ad(){}function hd(){}function Rp(){}function Cb(){}function Tb(){}function tw(){}function r_(){}function iM(){}function rM(){}function c_(){}function ca(){}function Jo(){}function ou(){}function Bp(){}function dd(){}function cM(){}function zp(){}function u_(){}function o_(){}function D5(){}function bv(){}function _5(){}function Fp(){}function uM(){}function Jp(){}function iw(){}function Hp(){}function rw(){}function oM(){}function sM(){}function L5(){}function S6(){}function Gp(){}function ua(){}function x6(){}function lM(){}function Yq(){}function Qq(){}function A6(){}function Al(){}function fM(){}function M6(){}function C6(){}function aM(){}function P5(){}function $5(){}function Wq(){}function s_(){}function Zq(){}function l_(){}function gv(){}function hM(){}function jk(){}function f_(){}function R5(){}function dM(){}function Ek(){}function Sk(){}function a_(){}function h_(){}function wv(){}function pv(){}function d_(){}function bM(){}function B5(){}function T6(){}function xk(){}function O6(){}function Ak(){}function b_(){}function mv(){}function g_(){}function qp(){}function gM(){}function wM(){}function Up(){}function Xp(){}function N6(){}function pM(){}function mM(){}function I6(){}function D6(){}function w_(){}function p_(){}function z5(){}function Mk(){}function m_(){}function vM(){}function yM(){}function p1(){}function bd(){}function Kp(){}function kM(){}function v_(){}function Vp(){}function m1(){}function Zs(){}function Ck(){}function cw(){}function bc(){}function vo(){}function Ml(){}function Tk(){}function F5(){}function vv(){}function Ok(){}function _6(){}function J5(){}function eU(){}function Bs(){}function jM(){}function EM(){}function y_(){}function k_(){}function nU(){}function SM(){}function xM(){}function AM(){}function sh(){}function el(){}function Nk(){}function L6(){}function Ik(){}function MM(){}function uw(){}function Dk(){}function CM(){}function TM(){}function j_(){}function E_(){}function S_(){}function tU(){}function x_(){}function A_(){}function OM(){}function M_(){}function iU(){}function C_(){}function T_(){}function O_(){}function NM(){}function N_(){}function I_(){}function D_(){}function __(){}function L_(){}function rU(){}function P_(){}function H5(){}function $_(){}function _k(){}function Lk(){}function R_(){}function IM(){}function cU(){}function B_(){}function z_(){}function F_(){}function J_(){}function H_(){}function DM(){}function G_(){}function q_(){}function _M(){}function U_(){}function X_(){}function LM(){}function P6(){}function K_(){}function Pk(){}function PM(){}function V_(){}function Y_(){}function uU(){}function oU(){}function Q_(){}function $6(){}function $M(){}function $k(){}function W_(){}function RM(){}function R6(){}function sU(){}function BM(){}function Z_(){}function zM(){}function FM(){}function eL(){}function nL(){}function yv(){}function tL(){}function gd(){}function iL(){}function d0(){}function JM(){}function HM(){}function rL(){}function cL(){}function lU(){}function GM(){}function Cl(){}function oa(){}function uL(){}function oL(){}function sL(){}function lL(){}function B6(){}function fL(){}function Rk(){}function aL(){}function fU(){}function Bk(){}function qM(){}function hL(){}function dL(){}function Ge(){}function UM(){}function XM(){}function KM(){}function bL(){}function VM(){}function zk(){}function YM(){}function gL(){}function QM(){}function wL(){}function ow(){}function z6(){}function aU(){}function pL(){}function b0(){}function WM(){}function mL(){}function Fk(){}function kv(){}function yo(){}function Jk(){}function hU(){}function ZM(){}function F6(){}function Yp(){}function J6(){}function vL(){}function H6(){}function Ob(){}function G6(){}function eC(){}function yL(){}function nC(){}function tC(){}function jv(){}function kL(){}function Nb(){}function Tl(){}function q6(){}function iC(){}function Af(){}function dU(){}function jL(){}function EL(){}function Ss(){}function $h(){}function sw(){}function SL(){}function xL(){}function AL(){}function bU(){}function Hk(){}function Rh(){}function g0(){}function ML(){}function Ol(){}function Gk(){}function lw(){}function Ev(){}function fw(){}function rC(){}function cC(){}function w0(){}function CL(){}function G5(){}function U6(){}function X6(){}function q5(){}function TL(){}function OL(){}function K6(){}function NL(){}function qk(){}function IL(){}function gU(){}function wU(){}function Ju(){}function Do(){}function Hc(){}function nu(){}function io(){}function v1(){}function Qp(){}function U5(){}function uC(){}function aw(){}function zs(){}function Wp(){}function Sv(){}function oC(){}function y1(){}function X5(){}function V6(){}function Bh(){}function sC(){}function Uk(){}function DL(){}function Xk(){}function Kk(){}function Zp(){}function nf(){}function e2(){}function K5(){}function hw(){}function lC(){}function fC(){}function _L(){}function Y6(){}function aC(){}function k1(){}function LL(){}function zh(){}function PL(){}function $L(){}function pU(){}function n2(){}function Vk(){}function hC(){}function V5(){}function RL(){}function BL(){}function zL(){}function FL(){}function Yk(){}function dC(){}function mU(){}function vU(){}function yU(){}function JL(){}function HL(){}function Y5(){}function Qk(){}function GL(){}function qL(){}function UL(){}function XL(){}function KL(){}function VL(){}function Wk(){}function YL(){}function QL(){}function ro(){}function bC(){}function kU(){}function WL(){}function jU(){}function EU(){}function SU(){}function Zk(){}function Q5(){}function gC(){}function ej(){}function wC(){}function t2(){}function Ib(){}function Q6(){}function xU(){}function ZL(){}function pC(){}function eP(){}function nP(){}function mC(){vj()}function vC(){C0e()}function tP(){Hf()}function iP(){Rde()}function AU(){RO()}function yC(){IT()}function kC(){cT()}function MU(){rT()}function CU(){TMe()}function W6(){q4()}function TU(){r$e()}function rP(){i8()}function Gc(){G0()}function jC(){Bhe()}function nj(){K_e()}function EC(){Rhe()}function cP(){Y_e()}function SC(){V_e()}function Z6(){Q_e()}function tj(){P$e()}function OU(){W_e()}function uP(){MBe()}function NU(){Ie()}function IU(){ZP()}function oP(){xBe()}function sP(){ABe()}function ko(){YLe()}function xC(){Dge()}function sa(){CBe()}function DU(){eLe()}function lP(){H4()}function _U(){zFe()}function AC(){P1()}function MC(){cbe()}function ij(){HO()}function fP(){YBe()}function aP(){Gbe()}function CC(){THe()}function TC(){Z_e()}function LU(){WXe()}function hP(){Mu()}function PU(){Ha()}function dP(){nge()}function $U(){q0()}function RU(){_W()}function i2(){HQ()}function bP(){rB()}function OC(){Xt()}function NC(){xz()}function BU(){BB()}function zU(){bde()}function IC(){Uz()}function rj(){JY()}function nl(){_Ne()}function FU(){rge()}function j1(e){_n(e)}function DC(e){this.a=e}function e9(e){this.a=e}function gP(e){this.a=e}function wP(e){this.a=e}function n9(e){this.a=e}function E1(e){this.a=e}function _C(e){this.a=e}function cj(e){this.a=e}function p0(e){this.a=e}function JU(e){this.a=e}function HU(e){this.a=e}function W5(e){this.a=e}function pP(e){this.a=e}function GU(e){this.c=e}function qU(e){this.a=e}function LC(e){this.a=e}function UU(e){this.a=e}function XU(e){this.a=e}function KU(e){this.a=e}function PC(e){this.a=e}function mP(e){this.a=e}function Z5(e){this.a=e}function xv(e){this.a=e}function vP(e){this.a=e}function $C(e){this.a=e}function e4(e){this.a=e}function t9(e){this.a=e}function yP(e){this.a=e}function uj(e){this.a=e}function RC(e){this.a=e}function BC(e){this.a=e}function oj(e){this.a=e}function kP(e){this.a=e}function jP(e){this.a=e}function VU(e){this.a=e}function EP(e){this.a=e}function YU(e){this.a=e}function zC(e){this.a=e}function QU(e){this.a=e}function i9(e){this.a=e}function r9(e){this.a=e}function Av(e){this.a=e}function c9(e){this.a=e}function n4(e){this.b=e}function wd(){this.a=[]}function SP(e,n){e.a=n}function WU(e,n){e.a=n}function ZU(e,n){e.b=n}function eX(e,n){e.c=n}function xP(e,n){e.c=n}function nX(e,n){e.d=n}function tX(e,n){e.d=n}function Mf(e,n){e.k=n}function AP(e,n){e.j=n}function Jue(e,n){e.c=n}function sj(e,n){e.c=n}function lj(e,n){e.a=n}function FC(e,n){e.a=n}function MP(e,n){e.f=n}function iX(e,n){e.a=n}function CP(e,n){e.b=n}function Db(e,n){e.d=n}function m0(e,n){e.i=n}function dw(e,n){e.o=n}function fj(e,n){e.r=n}function aj(e,n){e.a=n}function Mv(e,n){e.b=n}function rX(e,n){e.e=n}function cX(e,n){e.f=n}function t4(e,n){e.g=n}function Hue(e,n){e.e=n}function uX(e,n){e.f=n}function JC(e,n){e.f=n}function hj(e,n){e.a=n}function HC(e,n){e.b=n}function GC(e,n){e.n=n}function qC(e,n){e.a=n}function oX(e,n){e.c=n}function u9(e,n){e.c=n}function sX(e,n){e.c=n}function TP(e,n){e.a=n}function UC(e,n){e.a=n}function lX(e,n){e.d=n}function Gue(e,n){e.d=n}function XC(e,n){e.e=n}function a(e,n){e.e=n}function d(e,n){e.g=n}function w(e,n){e.f=n}function j(e,n){e.j=n}function T(e,n){e.a=n}function I(e,n){e.a=n}function Q(e,n){e.b=n}function de(e){e.b=e.a}function tn(e){e.c=e.d.d}function Ln(e){this.a=e}function it(e){this.a=e}function gt(e){this.a=e}function Hn(e){this.a=e}function Zn(e){this.a=e}function Di(e){this.a=e}function Cr(e){this.a=e}function co(e){this.a=e}function Sn(e){this.a=e}function sn(e){this.a=e}function Dn(e){this.a=e}function ot(e){this.a=e}function Hi(e){this.a=e}function _u(e){this.a=e}function Xi(e){this.b=e}function Hr(e){this.b=e}function ic(e){this.b=e}function qc(e){this.d=e}function At(e){this.a=e}function fX(e){this.a=e}function que(e){this.a=e}function Lke(e){this.a=e}function Pke(e){this.a=e}function Uue(e){this.a=e}function Xue(e){this.a=e}function aX(e){this.c=e}function P(e){this.c=e}function $ke(e){this.c=e}function Kue(e){this.a=e}function Vue(e){this.a=e}function Yue(e){this.a=e}function Que(e){this.a=e}function o9(e){this.a=e}function Rke(e){this.a=e}function Bke(e){this.a=e}function s9(e){this.a=e}function zke(e){this.a=e}function Fke(e){this.a=e}function Jke(e){this.a=e}function Hke(e){this.a=e}function Gke(e){this.a=e}function qke(e){this.a=e}function Uke(e){this.a=e}function Xke(e){this.a=e}function Kke(e){this.a=e}function Vke(e){this.a=e}function Yke(e){this.a=e}function dj(e){this.a=e}function Qke(e){this.a=e}function Wke(e){this.a=e}function OP(e){this.a=e}function Zke(e){this.a=e}function eje(e){this.a=e}function Wue(e){this.a=e}function nje(e){this.a=e}function tje(e){this.a=e}function ije(e){this.a=e}function Zue(e){this.a=e}function eoe(e){this.a=e}function noe(e){this.a=e}function bj(e){this.a=e}function l9(e){this.a=e}function rje(e){this.a=e}function i4(e){this.a=e}function toe(e){this.a=e}function cje(e){this.a=e}function uje(e){this.a=e}function oje(e){this.a=e}function sje(e){this.a=e}function lje(e){this.a=e}function fje(e){this.a=e}function aje(e){this.a=e}function hje(e){this.a=e}function dje(e){this.a=e}function bje(e){this.a=e}function gje(e){this.a=e}function ioe(e){this.a=e}function wje(e){this.a=e}function pje(e){this.a=e}function mje(e){this.a=e}function vje(e){this.a=e}function yje(e){this.a=e}function kje(e){this.a=e}function jje(e){this.a=e}function Eje(e){this.a=e}function Sje(e){this.a=e}function xje(e){this.a=e}function Aje(e){this.a=e}function Mje(e){this.a=e}function Cje(e){this.a=e}function Tje(e){this.a=e}function Oje(e){this.a=e}function Nje(e){this.a=e}function Ije(e){this.a=e}function Dje(e){this.a=e}function _je(e){this.a=e}function Lje(e){this.a=e}function Pje(e){this.a=e}function $je(e){this.a=e}function Rje(e){this.a=e}function Bje(e){this.a=e}function zje(e){this.a=e}function Fje(e){this.a=e}function Jje(e){this.a=e}function Hje(e){this.a=e}function Gje(e){this.a=e}function qje(e){this.a=e}function Uje(e){this.a=e}function Xje(e){this.a=e}function Kje(e){this.a=e}function Vje(e){this.a=e}function Yje(e){this.a=e}function Qje(e){this.a=e}function Wje(e){this.b=e}function Zje(e){this.a=e}function eEe(e){this.a=e}function nEe(e){this.a=e}function tEe(e){this.a=e}function iEe(e){this.a=e}function rEe(e){this.a=e}function cEe(e){this.c=e}function uEe(e){this.a=e}function oEe(e){this.a=e}function sEe(e){this.a=e}function lEe(e){this.a=e}function fEe(e){this.a=e}function aEe(e){this.a=e}function hEe(e){this.a=e}function dEe(e){this.a=e}function bEe(e){this.a=e}function gEe(e){this.a=e}function wEe(e){this.a=e}function pEe(e){this.a=e}function mEe(e){this.a=e}function vEe(e){this.a=e}function yEe(e){this.a=e}function kEe(e){this.a=e}function jEe(e){this.a=e}function EEe(e){this.a=e}function SEe(e){this.a=e}function xEe(e){this.a=e}function AEe(e){this.a=e}function MEe(e){this.a=e}function CEe(e){this.a=e}function TEe(e){this.a=e}function OEe(e){this.a=e}function NEe(e){this.a=e}function IEe(e){this.a=e}function S1(e){this.a=e}function Cv(e){this.a=e}function DEe(e){this.a=e}function _Ee(e){this.a=e}function LEe(e){this.a=e}function PEe(e){this.a=e}function $Ee(e){this.a=e}function REe(e){this.a=e}function BEe(e){this.a=e}function zEe(e){this.a=e}function FEe(e){this.a=e}function JEe(e){this.a=e}function HEe(e){this.a=e}function GEe(e){this.a=e}function qEe(e){this.a=e}function UEe(e){this.a=e}function XEe(e){this.a=e}function KEe(e){this.a=e}function VEe(e){this.a=e}function YEe(e){this.a=e}function QEe(e){this.a=e}function WEe(e){this.a=e}function ZEe(e){this.a=e}function eSe(e){this.a=e}function nSe(e){this.a=e}function tSe(e){this.a=e}function iSe(e){this.a=e}function rSe(e){this.a=e}function NP(e){this.a=e}function cSe(e){this.f=e}function uSe(e){this.a=e}function oSe(e){this.a=e}function sSe(e){this.a=e}function lSe(e){this.a=e}function fSe(e){this.a=e}function aSe(e){this.a=e}function hSe(e){this.a=e}function dSe(e){this.a=e}function bSe(e){this.a=e}function gSe(e){this.a=e}function wSe(e){this.a=e}function pSe(e){this.a=e}function mSe(e){this.a=e}function vSe(e){this.a=e}function ySe(e){this.a=e}function kSe(e){this.a=e}function jSe(e){this.a=e}function ESe(e){this.a=e}function SSe(e){this.a=e}function xSe(e){this.a=e}function ASe(e){this.a=e}function MSe(e){this.a=e}function CSe(e){this.a=e}function TSe(e){this.a=e}function OSe(e){this.a=e}function NSe(e){this.a=e}function ISe(e){this.a=e}function hX(e){this.a=e}function roe(e){this.a=e}function ki(e){this.b=e}function DSe(e){this.a=e}function _Se(e){this.a=e}function LSe(e){this.a=e}function PSe(e){this.a=e}function $Se(e){this.a=e}function RSe(e){this.a=e}function BSe(e){this.a=e}function zSe(e){this.b=e}function FSe(e){this.a=e}function KC(e){this.a=e}function JSe(e){this.a=e}function HSe(e){this.a=e}function IP(e){this.a=e}function DP(e){this.a=e}function coe(e){this.c=e}function _P(e){this.e=e}function LP(e){this.e=e}function dX(e){this.a=e}function GSe(e){this.d=e}function qSe(e){this.a=e}function uoe(e){this.a=e}function ooe(e){this.a=e}function bw(e){this.e=e}function ibn(){this.a=0}function Oe(){CK(this)}function wt(){Hu(this)}function bX(){LDe(this)}function USe(){}function gw(){this.c=Q8e}function XSe(e,n){e.b+=n}function rbn(e,n){n.Wb(e)}function cbn(e){return e.a}function ubn(e){return e.a}function obn(e){return e.a}function sbn(e){return e.a}function lbn(e){return e.a}function R(e){return e.e}function fbn(){return null}function abn(){return null}function hbn(e){throw R(e)}function r4(e){this.a=Nt(e)}function KSe(){this.a=this}function _b(){hOe.call(this)}function dbn(e){e.b.Mf(e.e)}function VSe(e){e.b=new NX}function gj(e,n){e.b=n-e.b}function wj(e,n){e.a=n-e.a}function YSe(e,n){n.gd(e.a)}function bbn(e,n){Ar(n,e)}function Gn(e,n){e.push(n)}function QSe(e,n){e.sort(n)}function gbn(e,n,t){e.Wd(t,n)}function VC(e,n){e.e=n,n.b=e}function wbn(){zoe(),RRn()}function WSe(e){B9(),ite.je(e)}function soe(){_b.call(this)}function gX(){_b.call(this)}function loe(){hOe.call(this)}function ZSe(){_b.call(this)}function Nl(){_b.call(this)}function exe(){_b.call(this)}function YC(){_b.call(this)}function is(){_b.call(this)}function c4(){_b.call(this)}function _t(){_b.call(this)}function hu(){_b.call(this)}function nxe(){_b.call(this)}function PP(){this.Bb|=256}function txe(){this.b=new aTe}function foe(){foe=Y,new wt}function r2(e,n){e.length=n}function $P(e,n){Te(e.a,n)}function pbn(e,n){O0e(e.c,n)}function mbn(e,n){hr(e.b,n)}function f9(e,n){hi(e.e,n)}function vbn(e,n){az(e.a,n)}function ybn(e,n){wQ(e.a,n)}function u4(e){Tz(e.c,e.b)}function kbn(e,n){e.kc().Nb(n)}function aoe(e){this.a=Njn(e)}function ar(){this.a=new wt}function ixe(){this.a=new wt}function RP(){this.a=new Oe}function wX(){this.a=new Oe}function hoe(){this.a=new Oe}function Lb(){this.a=new KPe}function pX(){this.a=new jMe}function doe(){this.a=new R_e}function boe(){this.a=new rNe}function tf(){this.a=new l6}function goe(){this.a=new rv}function rxe(){this.a=new pLe}function cxe(){this.a=new Oe}function uxe(){this.a=new Oe}function woe(){this.a=new Oe}function oxe(){this.a=new Oe}function sxe(){this.d=new Oe}function lxe(){this.a=new ar}function fxe(){this.a=new wt}function axe(){this.b=new wt}function hxe(){this.b=new Oe}function poe(){this.e=new Oe}function dxe(){this.a=new Gc}function bxe(){this.d=new Oe}function pj(){USe.call(this)}function mX(){pj.call(this)}function o4(){USe.call(this)}function moe(){o4.call(this)}function gxe(){soe.call(this)}function BP(){RP.call(this)}function wxe(){X$.call(this)}function pxe(){woe.call(this)}function mxe(){Oe.call(this)}function vxe(){g_e.call(this)}function yxe(){g_e.call(this)}function kxe(){joe.call(this)}function jxe(){joe.call(this)}function Exe(){joe.call(this)}function Sxe(){Eoe.call(this)}function mj(){Fk.call(this)}function voe(){Fk.call(this)}function xs(){xi.call(this)}function xxe(){Bxe.call(this)}function Axe(){Bxe.call(this)}function Mxe(){wt.call(this)}function Cxe(){wt.call(this)}function Txe(){wt.call(this)}function vX(){kBe.call(this)}function Oxe(){ar.call(this)}function Nxe(){PP.call(this)}function yX(){cle.call(this)}function yoe(){wt.call(this)}function kX(){cle.call(this)}function jX(){wt.call(this)}function Ixe(){wt.call(this)}function koe(){jv.call(this)}function Dxe(){koe.call(this)}function _xe(){jv.call(this)}function Lxe(){pC.call(this)}function joe(){this.a=new ar}function Pxe(){this.a=new wt}function $xe(){this.a=new Oe}function Rxe(){this.j=new Oe}function Eoe(){this.a=new wt}function s4(){this.a=new xi}function Bxe(){this.a=new eC}function Soe(){this.a=new J_}function zxe(){this.a=new $Ae}function vj(){vj=Y,Vne=new G}function EX(){EX=Y,Yne=new Jxe}function SX(){SX=Y,Qne=new Fxe}function Fxe(){xv.call(this,"")}function Jxe(){xv.call(this,"")}function Hxe(e){QRe.call(this,e)}function Gxe(e){QRe.call(this,e)}function xoe(e){E1.call(this,e)}function Aoe(e){YAe.call(this,e)}function jbn(e){YAe.call(this,e)}function Ebn(e){Aoe.call(this,e)}function Sbn(e){Aoe.call(this,e)}function xbn(e){Aoe.call(this,e)}function qxe(e){uY.call(this,e)}function Uxe(e){uY.call(this,e)}function Xxe(e){VTe.call(this,e)}function Kxe(e){Xoe.call(this,e)}function yj(e){YP.call(this,e)}function Moe(e){YP.call(this,e)}function Vxe(e){YP.call(this,e)}function du(e){HIe.call(this,e)}function Yxe(e){du.call(this,e)}function l4(){c9.call(this,{})}function xX(e){j9(),this.a=e}function Qxe(e){e.b=null,e.c=0}function Abn(e,n){e.e=n,QUe(e,n)}function Mbn(e,n){e.a=n,BCn(e)}function AX(e,n,t){e.a[n.g]=t}function Cbn(e,n,t){uAn(t,e,n)}function Tbn(e,n){u2n(n.i,e.n)}function Wxe(e,n){ykn(e).Ad(n)}function Obn(e,n){return e*e/n}function Zxe(e,n){return e.g-n.g}function Nbn(e,n){e.a.ec().Kc(n)}function Ibn(e){return new Av(e)}function Dbn(e){return new M2(e)}function eAe(){eAe=Y,vme=new U}function Coe(){Coe=Y,yme=new Ue}function zP(){zP=Y,XS=new An}function FP(){FP=Y,Zne=new KTe}function nAe(){nAe=Y,Zen=new nt}function JP(e){n1e(),this.a=e}function MX(e){fV(),this.f=e}function v0(e){fV(),this.f=e}function tAe(e){DNe(),this.a=e}function HP(e){du.call(this,e)}function jo(e){du.call(this,e)}function iAe(e){du.call(this,e)}function CX(e){HIe.call(this,e)}function a9(e){du.call(this,e)}function qn(e){du.call(this,e)}function Uc(e){du.call(this,e)}function rAe(e){du.call(this,e)}function f4(e){du.call(this,e)}function pd(e){du.call(this,e)}function Su(e){_n(e),this.a=e}function kj(e){$fe(e,e.length)}function Toe(e){return ig(e),e}function c2(e){return!!e&&e.b}function _bn(e){return!!e&&e.k}function Lbn(e){return!!e&&e.j}function jj(e){return e.b==e.c}function Fe(e){return _n(e),e}function ne(e){return _n(e),e}function QC(e){return _n(e),e}function Ooe(e){return _n(e),e}function Pbn(e){return _n(e),e}function lh(e){du.call(this,e)}function md(e){du.call(this,e)}function a4(e){du.call(this,e)}function TX(e){du.call(this,e)}function Bt(e){du.call(this,e)}function OX(e){dle.call(this,e,0)}function NX(){Sae.call(this,12,3)}function IX(){this.a=Pt(Nt(To))}function cAe(){throw R(new _t)}function Noe(){throw R(new _t)}function uAe(){throw R(new _t)}function $bn(){throw R(new _t)}function Rbn(){throw R(new _t)}function Bbn(){throw R(new _t)}function GP(){GP=Y,B9()}function vd(){Di.call(this,"")}function Ej(){Di.call(this,"")}function y0(){Di.call(this,"")}function h4(){Di.call(this,"")}function Ioe(e){jo.call(this,e)}function Doe(e){jo.call(this,e)}function fh(e){qn.call(this,e)}function h9(e){Hr.call(this,e)}function oAe(e){h9.call(this,e)}function DX(e){F$.call(this,e)}function zbn(e,n,t){e.c.Cf(n,t)}function Fbn(e,n,t){n.Ad(e.a[t])}function Jbn(e,n,t){n.Ne(e.a[t])}function Hbn(e,n){return e.a-n.a}function Gbn(e,n){return e.a-n.a}function qbn(e,n){return e.a-n.a}function qP(e,n){return yY(e,n)}function z(e,n){return G_e(e,n)}function Ubn(e,n){return n in e.a}function sAe(e){return e.a?e.b:0}function Xbn(e){return e.a?e.b:0}function lAe(e,n){return e.f=n,e}function Kbn(e,n){return e.b=n,e}function fAe(e,n){return e.c=n,e}function Vbn(e,n){return e.g=n,e}function _oe(e,n){return e.a=n,e}function Loe(e,n){return e.f=n,e}function Ybn(e,n){return e.f=n,e}function Poe(e,n){return e.e=n,e}function Qbn(e,n){return e.k=n,e}function $oe(e,n){return e.a=n,e}function Wbn(e,n){return e.e=n,e}function Zbn(e,n){e.b=new wc(n)}function aAe(e,n){e._d(n),n.$d(e)}function egn(e,n){il(),n.n.a+=e}function ngn(e,n){G0(),wu(n,e)}function Roe(e){XDe.call(this,e)}function hAe(e){XDe.call(this,e)}function dAe(){qse.call(this,"")}function bAe(){this.b=0,this.a=0}function gAe(){gAe=Y,hnn=DAn()}function u2(e,n){return e.b=n,e}function UP(e,n){return e.a=n,e}function o2(e,n){return e.c=n,e}function s2(e,n){return e.d=n,e}function l2(e,n){return e.e=n,e}function Boe(e,n){return e.f=n,e}function Sj(e,n){return e.a=n,e}function d9(e,n){return e.b=n,e}function b9(e,n){return e.c=n,e}function Xe(e,n){return e.c=n,e}function an(e,n){return e.b=n,e}function Ke(e,n){return e.d=n,e}function Ve(e,n){return e.e=n,e}function tgn(e,n){return e.f=n,e}function Ye(e,n){return e.g=n,e}function Qe(e,n){return e.a=n,e}function We(e,n){return e.i=n,e}function Ze(e,n){return e.j=n,e}function ign(e,n){return n.pg(e)}function rgn(e,n){return e.b-n.b}function cgn(e,n){return e.g-n.g}function ugn(e,n){return e.s-n.s}function ogn(e,n){return e?0:n-1}function wAe(e,n){return e?0:n-1}function sgn(e,n){return e?n-1:0}function pAe(e,n){return e.k=n,e}function lgn(e,n){return e.j=n,e}function Vr(){this.a=0,this.b=0}function XP(e){XK.call(this,e)}function k0(e){_w.call(this,e)}function mAe(e){$V.call(this,e)}function vAe(e){$V.call(this,e)}function yAe(){yAe=Y,Pr=eMn()}function j0(){j0=Y,kan=Gxn()}function zoe(){zoe=Y,Lg=SE()}function g9(){g9=Y,Y8e=qxn()}function kAe(){kAe=Y,chn=Uxn()}function Foe(){Foe=Y,Bu=PCn()}function la(e){return e.e&&e.e()}function jAe(e,n){return e.c._b(n)}function EAe(e,n){return kFe(e.b,n)}function SAe(e,n){return Lgn(e.a,n)}function xAe(e,n){e.b=0,$2(e,n)}function fgn(e,n){e.c=n,e.b=!0}function Tv(e,n){return e.a+=n,e}function _X(e,n){return e.a+=n,e}function yd(e,n){return e.a+=n,e}function ww(e,n){return e.a+=n,e}function Pb(e){return M1(e),e.o}function Joe(e){CVe(),QRn(this,e)}function AAe(){throw R(new _t)}function MAe(){throw R(new _t)}function CAe(){throw R(new _t)}function TAe(){throw R(new _t)}function OAe(){throw R(new _t)}function NAe(){throw R(new _t)}function KP(e){this.a=new b4(e)}function kd(e){this.a=new gV(e)}function Ov(e,n){for(;e.Pe(n););}function Hoe(e,n){for(;e.zd(n););}function agn(e,n,t){b3n(e.a,n,t)}function Goe(e,n,t){e.splice(n,t)}function hgn(e,n){return XLn(n,e)}function qoe(e,n){return e.d[n.p]}function WC(e){return e.b!=e.d.c}function IAe(e){return e.l|e.m<<22}function LX(e){return e?e.d:null}function dgn(e){return e?e.g:null}function bgn(e){return e?e.i:null}function DAe(e,n){return bIn(e,n)}function w9(e){return T0(e),e.a}function _Ae(e){e.c?dXe(e):bXe(e)}function LAe(){this.b=new iS(iye)}function PAe(){this.b=new iS(Wre)}function $Ae(){this.b=new iS(Wre)}function RAe(){this.a=new iS(Rye)}function BAe(){this.a=new iS(s6e)}function VP(e){this.a=0,this.b=e}function zAe(){throw R(new _t)}function FAe(){throw R(new _t)}function JAe(){throw R(new _t)}function HAe(){throw R(new _t)}function GAe(){throw R(new _t)}function qAe(){throw R(new _t)}function UAe(){throw R(new _t)}function XAe(){throw R(new _t)}function KAe(){throw R(new _t)}function VAe(){throw R(new _t)}function ggn(){throw R(new hu)}function wgn(){throw R(new hu)}function ZC(e){this.a=new pMe(e)}function p9(e,n){this.e=e,this.d=n}function Uoe(e,n){this.b=e,this.c=n}function YAe(e){tle(e.dc()),this.c=e}function eT(e,n){Hv.call(this,e,n)}function m9(e,n){eT.call(this,e,n)}function QAe(e,n){this.a=e,this.b=n}function WAe(e,n){this.a=e,this.b=n}function ZAe(e,n){this.a=e,this.b=n}function eMe(e,n){this.a=e,this.b=n}function nMe(e,n){this.a=e,this.b=n}function tMe(e,n){this.a=e,this.b=n}function iMe(e,n){this.a=e,this.b=n}function rMe(e,n){this.b=e,this.a=n}function cMe(e,n){this.b=e,this.a=n}function pw(e,n){this.g=e,this.i=n}function uMe(e,n){this.a=e,this.b=n}function oMe(e,n){this.b=e,this.a=n}function sMe(e,n){this.a=e,this.b=n}function lMe(e,n){this.b=e,this.a=n}function YP(e){this.b=u(Nt(e),50)}function QP(e){this.b=u(Nt(e),92)}function Ot(e,n){this.f=e,this.g=n}function PX(e,n){this.a=e,this.b=n}function fMe(e,n){this.a=e,this.f=n}function aMe(e){this.a=u(Nt(e),16)}function Xoe(e){this.a=u(Nt(e),16)}function hMe(e,n){this.b=e,this.c=n}function dMe(e){this.a=u(Nt(e),92)}function pgn(e,n){this.a=e,this.b=n}function bMe(e,n){this.a=e,this.b=n}function gMe(e,n){return so(e.b,n)}function wMe(e,n){return e>n&&n0}function HX(e,n){return ao(e,n)<0}function PMe(e,n){return sV(e.a,n)}function $gn(e,n){B_e.call(this,e,n)}function ise(e){OV(),WMn.call(this,e)}function rse(e){OV(),ise.call(this,e)}function cse(e){cV(),VTe.call(this,e)}function use(e,n){NIe(e,e.length,n)}function uT(e,n){uDe(e,e.length,n)}function Dj(e,n){return e.a.get(n)}function $Me(e,n){return so(e.e,n)}function ose(e){return _n(e),!1}function RMe(){return gAe(),new hnn}function oT(e){return at(e.a),e.b}function BMe(e,n){this.b=e,this.a=n}function u$(e,n){this.d=e,this.e=n}function zMe(e,n){this.a=e,this.b=n}function FMe(e,n){this.a=e,this.b=n}function JMe(e,n){this.a=e,this.b=n}function HMe(e,n){this.a=e,this.b=n}function GMe(e,n){this.b=e,this.a=n}function g4(e,n){this.a=e,this.b=n}function o$(e,n){Ot.call(this,e,n)}function GX(e,n){Ot.call(this,e,n)}function qX(e,n){Ot.call(this,e,n)}function UX(e,n){Ot.call(this,e,n)}function XX(e,n){Ot.call(this,e,n)}function s$(e,n){Ot.call(this,e,n)}function l$(e){vn.call(this,e,21)}function qMe(e,n){this.b=e,this.a=n}function sse(e,n){this.b=e,this.a=n}function lse(e,n){this.b=e,this.a=n}function fse(e,n){Ot.call(this,e,n)}function KX(e,n){Ot.call(this,e,n)}function sT(e,n){Ot.call(this,e,n)}function ase(e,n){this.b=e,this.a=n}function k9(e,n){this.c=e,this.d=n}function f$(e,n){Ot.call(this,e,n)}function a$(e,n){Ot.call(this,e,n)}function UMe(e,n){this.e=e,this.d=n}function w4(e,n){Ot.call(this,e,n)}function XMe(e,n){this.a=e,this.b=n}function hse(e,n){Ot.call(this,e,n)}function br(e,n){Ot.call(this,e,n)}function h$(e,n){Ot.call(this,e,n)}function _j(e,n,t){e.splice(n,0,t)}function Rgn(e,n,t){e.Mb(t)&&n.Ad(t)}function Bgn(e,n,t){n.Ne(e.a.We(t))}function zgn(e,n,t){n.Bd(e.a.Xe(t))}function Fgn(e,n,t){n.Ad(e.a.Kb(t))}function Jgn(e,n){return cs(e.c,n)}function Hgn(e,n){return cs(e.e,n)}function KMe(e,n){this.a=e,this.b=n}function VMe(e,n){this.a=e,this.b=n}function YMe(e,n){this.a=e,this.b=n}function QMe(e,n){this.a=e,this.b=n}function WMe(e,n){this.a=e,this.b=n}function ZMe(e,n){this.a=e,this.b=n}function eCe(e,n){this.a=e,this.b=n}function nCe(e,n){this.a=e,this.b=n}function tCe(e,n){this.b=e,this.a=n}function iCe(e,n){this.b=e,this.a=n}function rCe(e,n){this.b=e,this.a=n}function cCe(e,n){this.b=n,this.c=e}function d$(e,n){Ot.call(this,e,n)}function lT(e,n){Ot.call(this,e,n)}function dse(e,n){Ot.call(this,e,n)}function Lj(e,n){Ot.call(this,e,n)}function b$(e,n){Ot.call(this,e,n)}function VX(e,n){Ot.call(this,e,n)}function YX(e,n){Ot.call(this,e,n)}function Pj(e,n){Ot.call(this,e,n)}function $j(e,n){Ot.call(this,e,n)}function bse(e,n){Ot.call(this,e,n)}function Nv(e,n){Ot.call(this,e,n)}function QX(e,n){Ot.call(this,e,n)}function Rj(e,n){Ot.call(this,e,n)}function gse(e,n){Ot.call(this,e,n)}function h2(e,n){Ot.call(this,e,n)}function WX(e,n){Ot.call(this,e,n)}function ZX(e,n){Ot.call(this,e,n)}function eK(e,n){Ot.call(this,e,n)}function wse(e,n){Ot.call(this,e,n)}function fT(e,n){Ot.call(this,e,n)}function pse(e,n){Ot.call(this,e,n)}function Iv(e,n){Ot.call(this,e,n)}function nK(e,n){Ot.call(this,e,n)}function g$(e,n){Ot.call(this,e,n)}function aT(e,n){Ot.call(this,e,n)}function d2(e,n){Ot.call(this,e,n)}function w$(e,n){Ot.call(this,e,n)}function mse(e,n){Ot.call(this,e,n)}function tK(e,n){Ot.call(this,e,n)}function iK(e,n){Ot.call(this,e,n)}function rK(e,n){Ot.call(this,e,n)}function cK(e,n){Ot.call(this,e,n)}function uK(e,n){Ot.call(this,e,n)}function oK(e,n){Ot.call(this,e,n)}function p$(e,n){Ot.call(this,e,n)}function uCe(e,n){this.b=e,this.a=n}function vse(e,n){Ot.call(this,e,n)}function oCe(e,n){this.a=e,this.b=n}function sCe(e,n){this.a=e,this.b=n}function lCe(e,n){this.a=e,this.b=n}function yse(e,n){Ot.call(this,e,n)}function kse(e,n){Ot.call(this,e,n)}function fCe(e,n){this.a=e,this.b=n}function Ggn(e,n){return C9(),n!=e}function sK(e){return GTn(e,e.c),e}function qgn(e){k.clearTimeout(e)}function jse(e,n){Ot.call(this,e,n)}function Ese(e,n){Ot.call(this,e,n)}function aCe(e,n){this.a=e,this.b=n}function hCe(e,n){this.a=e,this.b=n}function dCe(e,n){this.b=e,this.d=n}function bCe(e,n){this.a=e,this.b=n}function gCe(e,n){this.b=e,this.a=n}function m$(e,n){Ot.call(this,e,n)}function mw(e,n){Ot.call(this,e,n)}function lK(e,n){Ot.call(this,e,n)}function v$(e,n){Ot.call(this,e,n)}function Sse(e,n){Ot.call(this,e,n)}function wCe(e,n){this.b=e,this.a=n}function pCe(e,n){this.b=e,this.a=n}function mCe(e,n){this.b=e,this.a=n}function vCe(e,n){this.b=e,this.a=n}function xse(e,n){Ot.call(this,e,n)}function hT(e,n){Ot.call(this,e,n)}function Ase(e,n){Ot.call(this,e,n)}function fK(e,n){Ot.call(this,e,n)}function y$(e,n){Ot.call(this,e,n)}function aK(e,n){Ot.call(this,e,n)}function hK(e,n){Ot.call(this,e,n)}function k$(e,n){Ot.call(this,e,n)}function dK(e,n){Ot.call(this,e,n)}function Mse(e,n){Ot.call(this,e,n)}function bK(e,n){Ot.call(this,e,n)}function gK(e,n){Ot.call(this,e,n)}function dT(e,n){Ot.call(this,e,n)}function wK(e,n){Ot.call(this,e,n)}function Cse(e,n){Ot.call(this,e,n)}function bT(e,n){Ot.call(this,e,n)}function Tse(e,n){Ot.call(this,e,n)}function Ose(e,n){this.a=e,this.b=n}function yCe(e,n){this.a=e,this.b=n}function kCe(e,n){this.a=e,this.b=n}function jCe(){Y$(),this.a=new Lle}function ECe(){Bz(),this.a=new ar}function SCe(){UV(),this.b=new ar}function xCe(){jae(),Afe.call(this)}function ACe(){kae(),b_e.call(this)}function MCe(){kae(),b_e.call(this)}function gT(e,n){Ot.call(this,e,n)}function p4(e,n){Ot.call(this,e,n)}function Bj(e,n){Ot.call(this,e,n)}function zj(e,n){Ot.call(this,e,n)}function wT(e,n){Ot.call(this,e,n)}function j$(e,n){Ot.call(this,e,n)}function pK(e,n){Ot.call(this,e,n)}function E$(e,n){Ot.call(this,e,n)}function Fj(e,n){Ot.call(this,e,n)}function mK(e,n){Ot.call(this,e,n)}function S$(e,n){Ot.call(this,e,n)}function Dv(e,n){Ot.call(this,e,n)}function pT(e,n){Ot.call(this,e,n)}function Jj(e,n){Ot.call(this,e,n)}function Hj(e,n){Ot.call(this,e,n)}function vK(e,n){Ot.call(this,e,n)}function mT(e,n){Ot.call(this,e,n)}function x$(e,n){Ot.call(this,e,n)}function _v(e,n){Ot.call(this,e,n)}function yK(e,n){Ot.call(this,e,n)}function kK(e,n){Ot.call(this,e,n)}function A$(e,n){Ot.call(this,e,n)}function Se(e,n){this.a=e,this.b=n}function CCe(e,n){this.a=e,this.b=n}function TCe(e,n){this.a=e,this.b=n}function OCe(e,n){this.a=e,this.b=n}function NCe(e,n){this.a=e,this.b=n}function ICe(e,n){this.a=e,this.b=n}function DCe(e,n){this.a=e,this.b=n}function jc(e,n){this.a=e,this.b=n}function _Ce(e,n){this.a=e,this.b=n}function LCe(e,n){this.a=e,this.b=n}function PCe(e,n){this.a=e,this.b=n}function $Ce(e,n){this.a=e,this.b=n}function RCe(e,n){this.a=e,this.b=n}function BCe(e,n){this.a=e,this.b=n}function zCe(e,n){this.b=e,this.a=n}function FCe(e,n){this.b=e,this.a=n}function JCe(e,n){this.b=e,this.a=n}function HCe(e,n){this.b=e,this.a=n}function GCe(e,n){this.a=e,this.b=n}function qCe(e,n){this.a=e,this.b=n}function UCe(e,n){this.a=e,this.b=n}function XCe(e,n){this.a=e,this.b=n}function KCe(e,n){this.f=e,this.c=n}function Nse(e,n){this.i=e,this.g=n}function M$(e,n){Ot.call(this,e,n)}function m4(e,n){Ot.call(this,e,n)}function C$(e,n){this.a=e,this.b=n}function VCe(e,n){this.a=e,this.b=n}function Ise(e,n){this.d=e,this.e=n}function YCe(e,n){this.a=e,this.b=n}function QCe(e,n){this.a=e,this.b=n}function WCe(e,n){this.d=e,this.b=n}function ZCe(e,n){this.e=e,this.a=n}function Dse(e,n){e.i=null,xB(e,n)}function Ugn(e,n){e&&ei(eD,e,n)}function eTe(e,n){return xQ(e.a,n)}function _se(e,n){return cs(e.g,n)}function Xgn(e,n){return cs(n.b,e)}function Kgn(e,n){return-e.b.$e(n)}function T$(e){return IO(e.c,e.b)}function Vgn(e,n){l8n(new st(e),n)}function Ygn(e,n,t){VHe(n,vW(e,t))}function Qgn(e,n,t){VHe(n,vW(e,t))}function nTe(e,n){W9n(e.a,u(n,12))}function tTe(e,n){this.a=e,this.b=n}function vT(e,n){this.b=e,this.c=n}function x0(e,n){return e.Pd().Xb(n)}function O$(e,n){return j7n(e.Jc(),n)}function bu(e){return e?e.kd():null}function ue(e){return e??null}function b2(e){return typeof e===ly}function g2(e){return typeof e===Lge}function $r(e){return typeof e===aZ}function Gj(e,n){return ao(e,n)==0}function N$(e,n){return ao(e,n)>=0}function qj(e,n){return ao(e,n)!=0}function Lse(e,n){return e.a+=""+n,e}function Wgn(e){return""+(_n(e),e)}function iTe(e){return Is(e),e.d.gc()}function Pse(e){return kn(e,0),null}function I$(e){return tE(e==null),e}function Uj(e,n){return e.a+=""+n,e}function Bc(e,n){return e.a+=""+n,e}function Xj(e,n){return e.a+=""+n,e}function uo(e,n){return e.a+=""+n,e}function Kt(e,n){return e.a+=""+n,e}function rTe(e,n){e.q.setTime(Qb(n))}function cTe(e,n){Dfe.call(this,e,n)}function uTe(e,n){Dfe.call(this,e,n)}function D$(e,n){Dfe.call(this,e,n)}function gc(e,n){Ki(e,n,e.c.b,e.c)}function Lv(e,n){Ki(e,n,e.a,e.a.a)}function Zgn(e,n){return e.j[n.p]==2}function oTe(e,n){return e.a=n.g+1,e}function fa(e){return e.a=0,e.b=0,e}function sTe(e){Hu(this),AE(this,e)}function lTe(){this.b=0,this.a=!1}function fTe(){this.b=0,this.a=!1}function aTe(){this.b=new b4(z2(12))}function hTe(){hTe=Y,itn=Dt(DQ())}function dTe(){dTe=Y,ain=Dt(JUe())}function bTe(){bTe=Y,isn=Dt(sze())}function $se(){$se=Y,foe(),kme=new wt}function ewn(e){return Nt(e),new Kj(e)}function gTe(e,n){return ue(e)===ue(n)}function _$(e){return e<10?"0"+e:""+e}function wTe(e){return _o(e.l,e.m,e.h)}function su(e){return typeof e===Lge}function jK(e,n){return of(e.a,0,n)}function v4(e){return lc((_n(e),e))}function nwn(e){return lc((_n(e),e))}function twn(e,n){return ji(e.a,n.a)}function Rse(e,n){return oo(e.a,n.a)}function iwn(e,n){return rDe(e.a,n.a)}function ah(e,n){return e.indexOf(n)}function Bse(e,n){G9(e,0,e.length,n)}function ti(e,n){i$(),ei(EG,e,n)}function fn(e,n){Pi.call(this,e,n)}function EK(e,n){k2.call(this,e,n)}function Pv(e,n){Nse.call(this,e,n)}function pTe(e,n){ST.call(this,e,n)}function SK(e,n){W9.call(this,e,n)}function Fh(){Uue.call(this,new D0)}function mTe(){hR.call(this,0,0,0,0)}function zse(e){return pu(e.b.b,e,0)}function vTe(e,n){return oo(e.g,n.g)}function rwn(e){return e==fp||e==gm}function cwn(e){return e==fp||e==bm}function uwn(e,n){return oo(e.g,n.g)}function own(e,n){return il(),n.a+=e}function swn(e,n){return il(),n.a+=e}function lwn(e,n){return il(),n.c+=e}function fwn(e,n){return Te(e.c,n),e}function yTe(e,n){return Te(e.a,n),n}function Fse(e,n){return ll(e.a,n),e}function kTe(e){this.a=RMe(),this.b=e}function jTe(e){this.a=RMe(),this.b=e}function wc(e){this.a=e.a,this.b=e.b}function Kj(e){this.a=e,mC.call(this)}function ETe(e){this.a=e,mC.call(this)}function Fs(e){return e.sh()&&e.th()}function $v(e){return e!=th&&e!=pb}function x1(e){return e==Zc||e==ru}function Rv(e){return e==Vl||e==eh}function STe(e){return e==U3||e==q3}function L$(e){return ll(new or,e)}function xTe(e){return NV(u(e,125))}function awn(e,n){return ji(n.f,e.f)}function ATe(e,n){return new W9(n,e)}function hwn(e,n){return new W9(n,e)}function Il(e,n,t){Os(e,n),Ns(e,t)}function xK(e,n,t){wB(e,n),pB(e,t)}function vw(e,n,t){Pw(e,n),Lw(e,t)}function yT(e,n,t){Wv(e,n),Zv(e,t)}function kT(e,n,t){e3(e,n),n3(e,t)}function AK(e,n){c8(e,n),K9(e,e.D)}function MK(e){KCe.call(this,e,!0)}function y4(){_f.call(this,0,0,0,0)}function MTe(){o$.call(this,"Head",1)}function CTe(){o$.call(this,"Tail",3)}function TTe(e,n,t){Sle.call(this,e,n,t)}function yw(e){hR.call(this,e,e,e,e)}function A0(e){yh(),C7n.call(this,e)}function OTe(e){Ao(e.Qf(),new Wke(e))}function Bv(e){return e!=null?Ni(e):0}function dwn(e,n){return P2(n,_a(e))}function bwn(e,n){return P2(n,_a(e))}function gwn(e,n){return e[e.length]=n}function wwn(e,n){return e[e.length]=n}function pwn(e,n){return jB(AV(e.f),n)}function mwn(e,n){return jB(AV(e.n),n)}function vwn(e,n){return jB(AV(e.p),n)}function Jse(e){return Mvn(e.b.Jc(),e.a)}function ywn(e){return e==null?0:Ni(e)}function CK(e){e.c=se(Mr,On,1,0,5,1)}function NTe(e,n,t){ir(e.c[n.g],n.g,t)}function kwn(e,n,t){u(e.c,72).Ei(n,t)}function jwn(e,n,t){Il(t,t.i+e,t.j+n)}function Yr(e,n){Pi.call(this,e.b,n)}function Ewn(e,n){Et(Vu(e.a),sLe(n))}function Swn(e,n){Et(Ts(e.a),lLe(n))}function xwn(e,n){Va||(e.b=n)}function TK(e,n,t){return ir(e,n,t),t}function Lt(){Lt=Y,new ITe,new Oe}function ITe(){new wt,new wt,new wt}function Awn(){throw R(new pd($en))}function Mwn(){throw R(new pd($en))}function Cwn(){throw R(new pd(Ren))}function Twn(){throw R(new pd(Ren))}function DTe(){DTe=Y,are=new FE(Mce)}function Na(){Na=Y,k.Math.log(2)}function Dl(){Dl=Y,d1=(IMe(),Man)}function Vj(e){ai(),bw.call(this,e)}function _Te(e){this.a=e,rfe.call(this,e)}function OK(e){this.a=e,QP.call(this,e)}function NK(e){this.a=e,QP.call(this,e)}function Tr(e,n){oV(e.c,e.c.length,n)}function gu(e){return e.an?1:0}function Gse(e,n){return ao(e,n)>0?e:n}function _o(e,n,t){return{l:e,m:n,h:t}}function Own(e,n){e.a!=null&&nTe(n,e.a)}function Nwn(e){fc(e,null),Gr(e,null)}function Iwn(e,n,t){return ei(e.g,t,n)}function Dwn(e,n){Nt(n),qv(e).Ic(new $e)}function PTe(){Vde(),this.a=new iS(pve)}function P$(e){this.b=e,this.a=new Oe}function $Te(e){this.b=new w5,this.a=e}function qse(e){Ple.call(this),this.a=e}function RTe(e){hae.call(this),this.b=e}function BTe(){o$.call(this,"Range",2)}function $$(e){e.j=se(_me,Me,324,0,0,1)}function zTe(e){e.a=new Jt,e.c=new Jt}function FTe(e){e.a=new wt,e.e=new wt}function Use(e){return new Se(e.c,e.d)}function _wn(e){return new Se(e.c,e.d)}function pc(e){return new Se(e.a,e.b)}function Lwn(e,n){return ei(e.a,n.a,n)}function Pwn(e,n,t){return ei(e.k,t,n)}function zv(e,n,t){return gde(n,t,e.c)}function Xse(e,n){return re(zn(e.i,n))}function Kse(e,n){return re(zn(e.j,n))}function JTe(e,n){return w$n(e.a,n,null)}function Yj(e,n){return APn(e.c,e.b,n)}function X(e,n){return e!=null&&$Q(e,n)}function HTe(e,n){kt(e),e.Fc(u(n,16))}function $wn(e,n,t){e.c._c(n,u(t,136))}function Rwn(e,n,t){e.c.Si(n,u(t,136))}function Bwn(e,n,t){return b$n(e,n,t),t}function zwn(e,n){return rl(),n.n.b+=e}function IK(e,n){return ikn(e.Jc(),n)!=-1}function Fwn(e,n){return new pOe(e.Jc(),n)}function R$(e){return e.Ob()?e.Pb():null}function GTe(e){return ph(e,0,e.length)}function qTe(e){KV(e,null),VV(e,null)}function UTe(){ST.call(this,null,null)}function XTe(){G$.call(this,null,null)}function KTe(){Ot.call(this,"INSTANCE",0)}function Fv(){this.a=se(Mr,On,1,8,5,1)}function Vse(e){this.a=e,wt.call(this)}function VTe(e){this.a=(En(),new h9(e))}function Jwn(e){this.b=(En(),new aX(e))}function j9(){j9=Y,Gme=new xX(null)}function Yse(){Yse=Y,Yse(),gnn=new xt}function Te(e,n){return Gn(e.c,n),!0}function YTe(e,n){e.c&&(pfe(n),A_e(n))}function Hwn(e,n){e.q.setHours(n),sS(e,n)}function Qse(e,n){return e.a.Ac(n)!=null}function DK(e,n){return e.a.Ac(n)!=null}function Ia(e,n){return e.a[n.c.p][n.p]}function Gwn(e,n){return e.e[n.c.p][n.p]}function qwn(e,n){return e.c[n.c.p][n.p]}function _K(e,n,t){return e.a[n.g][t.g]}function Uwn(e,n){return e.j[n.p]=WOn(n)}function k4(e,n){return e.a*n.a+e.b*n.b}function Xwn(e,n){return e.a=e}function Wwn(e,n,t){return t?n!=0:n!=e-1}function QTe(e,n,t){e.a=n^1502,e.b=t^JZ}function Zwn(e,n,t){return e.a=n,e.b=t,e}function A1(e,n){return e.a*=n,e.b*=n,e}function Qj(e,n,t){return ir(e.g,n,t),t}function epn(e,n,t,i){ir(e.a[n.g],t.g,i)}function mr(e,n,t){PT.call(this,e,n,t)}function B$(e,n,t){mr.call(this,e,n,t)}function rs(e,n,t){mr.call(this,e,n,t)}function WTe(e,n,t){B$.call(this,e,n,t)}function Wse(e,n,t){PT.call(this,e,n,t)}function Jv(e,n,t){PT.call(this,e,n,t)}function ZTe(e,n,t){nR.call(this,e,n,t)}function Zse(e,n,t){nR.call(this,e,n,t)}function eOe(e,n,t){Zse.call(this,e,n,t)}function nOe(e,n,t){Wse.call(this,e,n,t)}function M0(e){this.c=e,this.a=this.c.a}function st(e){this.i=e,this.f=this.i.j}function Hv(e,n){this.a=e,QP.call(this,n)}function tOe(e,n){this.a=e,OX.call(this,n)}function iOe(e,n){this.a=e,OX.call(this,n)}function rOe(e,n){this.a=e,OX.call(this,n)}function ele(e){this.a=e,GU.call(this,e.d)}function cOe(e){e.b.Qb(),--e.d.f.d,bR(e.d)}function uOe(e){e.a=u(Xn(e.b.a,4),129)}function oOe(e){e.a=u(Xn(e.b.a,4),129)}function npn(e){HT(e,fZe),_z(e,aRn(e))}function nle(e,n){return Ijn(e,new y0,n).a}function tpn(e){return WC(e.a)?oLe(e):null}function sOe(e){xv.call(this,u(Nt(e),35))}function lOe(e){xv.call(this,u(Nt(e),35))}function tle(e){if(!e)throw R(new YC)}function ile(e){if(!e)throw R(new is)}function Yn(e,n){return Nt(n),new wOe(e,n)}function fOe(e,n){return new ZGe(e.a,e.b,n)}function ipn(e){return e.l+e.m*dy+e.h*hg}function rpn(e){return e==null?null:e.name}function rle(e,n,t){return e.indexOf(n,t)}function z$(e,n){return e.lastIndexOf(n)}function Wj(e){return e==null?Vo:fu(e)}function $n(){$n=Y,ib=!1,d7=!0}function aOe(){aOe=Y,zX(),thn=new FU}function cle(){this.Bb|=256,this.Bb|=512}function hOe(){$$(this),TR(this),this.he()}function F$(e){Hr.call(this,e),this.a=e}function ule(e){ic.call(this,e),this.a=e}function ole(e){h9.call(this,e),this.a=e}function cf(e){Di.call(this,(_n(e),e))}function tl(e){Di.call(this,(_n(e),e))}function LK(e){Uue.call(this,new lhe(e))}function dOe(e){this.a=e,Xi.call(this,e)}function sle(e,n){this.a=n,OX.call(this,e)}function bOe(e,n){this.a=n,uY.call(this,e)}function gOe(e,n){this.a=e,uY.call(this,n)}function wOe(e,n){this.a=n,YP.call(this,e)}function pOe(e,n){this.a=n,YP.call(this,e)}function lle(e){pX.call(this),ac(this,e)}function Js(e){return at(e.a!=null),e.a}function mOe(e,n){return Te(n.a,e.a),e.a}function vOe(e,n){return Te(n.b,e.a),e.a}function kw(e,n){return Te(n.a,e.a),e.a}function jT(e,n,t){return UY(e,n,n,t),e}function J$(e,n){return++e.b,Te(e.a,n)}function fle(e,n){return++e.b,qo(e.a,n)}function cpn(e,n){return ji(e.c.d,n.c.d)}function upn(e,n){return ji(e.c.c,n.c.c)}function opn(e,n){return ji(e.n.a,n.n.a)}function Ho(e,n){return u(vi(e.b,n),16)}function spn(e,n){return e.n.b=(_n(n),n)}function lpn(e,n){return e.n.b=(_n(n),n)}function cs(e,n){return!!n&&e.b[n.g]==n}function Zj(e){return gu(e.a)||gu(e.b)}function fpn(e,n){return ji(e.e.b,n.e.b)}function apn(e,n){return ji(e.e.a,n.e.a)}function hpn(e,n,t){return rPe(e,n,t,e.b)}function ale(e,n,t){return rPe(e,n,t,e.c)}function dpn(e){return il(),!!e&&!e.dc()}function yOe(){Cj(),this.b=new _je(this)}function H$(){H$=Y,mJ=new Pi(WYe,0)}function j4(e){this.d=e,st.call(this,e)}function E4(e){this.c=e,st.call(this,e)}function ET(e){this.c=e,j4.call(this,e)}function hle(e,n){Sde.call(this,e,n,null)}function S4(e){return e.a!=null?e.a:null}function jw(e){return e.$H||(e.$H=++_Bn)}function Sd(e){var n;n=e.a,e.a=e.b,e.b=n}function ST(e,n){Ij(),this.a=e,this.b=n}function G$(e,n){Ed(),this.b=e,this.c=n}function q$(e,n){fV(),this.f=n,this.d=e}function dle(e,n){Zae(n,e),this.c=e,this.b=n}function bpn(e,n){return dV(e.c).Kd().Xb(n)}function PK(e,n){return new kNe(e,e.gc(),n)}function gpn(e){return FP(),It((nLe(),Uen),e)}function wpn(e){return new D2(3,e)}function Jh(e){return sl(e,rm),new xo(e)}function kOe(e){return B9(),parseInt(e)||-1}function E9(e,n,t){return rle(e,Xo(n),t)}function ble(e,n,t){u(oO(e,n),22).Ec(t)}function ppn(e,n,t){wQ(e.a,t),az(e.a,n)}function S9(e,n,t){var i;i=e.dd(n),i.Rb(t)}function jOe(e,n,t,i){Nfe.call(this,e,n,t,i)}function EOe(e){ufe.call(this,e,null,null)}function $K(e){f2(),this.b=e,this.a=!0}function SOe(e){WP(),this.b=e,this.a=!0}function xOe(e){if(!e)throw R(new Nl)}function gle(e){if(!e)throw R(new YC)}function mpn(e){if(!e)throw R(new gX)}function at(e){if(!e)throw R(new hu)}function w2(e){if(!e)throw R(new is)}function AOe(e){e.d=new EOe(e),e.e=new wt}function x9(e){return at(e.b!=0),e.a.a.c}function If(e){return at(e.b!=0),e.c.b.c}function vpn(e,n){return UY(e,n,n+1,""),e}function MOe(e){lZ(),VSe(this),this.Df(e)}function COe(e){this.c=e,this.a=1,this.b=1}function xT(e){X(e,161)&&u(e,161).mi()}function TOe(e){return e.b=u(oae(e.a),45)}function p2(e,n){return u($a(e.a,n),35)}function wi(e,n){return!!e.q&&so(e.q,n)}function ypn(e,n){return e>0?n/(e*e):n*100}function kpn(e,n){return e>0?n*n/e:n*n*100}function jpn(e){return e.f!=null?e.f:""+e.g}function RK(e){return e.f!=null?e.f:""+e.g}function Epn(e){return P1(),e.e.a+e.f.a/2}function Spn(e){return P1(),e.e.b+e.f.b/2}function xpn(e,n,t){return P1(),t.e.b-e*n}function Apn(e,n,t){return P1(),t.e.a-e*n}function Mpn(e,n,t){return e$(),t.Lg(e,n)}function Cpn(e,n){return G0(),wn(e,n.e,n)}function Tpn(e,n,t){return Te(n,ZFe(e,t))}function Opn(e,n,t){rB(),e.nf(n)&&t.Ad(e)}function m2(e,n,t){return e.a+=n,e.b+=t,e}function OOe(e,n,t){return e.a-=n,e.b-=t,e}function wle(e,n){return e.a=n.a,e.b=n.b,e}function U$(e){return e.a=-e.a,e.b=-e.b,e}function NOe(e){this.c=e,Os(e,0),Ns(e,0)}function IOe(e){xi.call(this),xE(this,e)}function DOe(){Ot.call(this,"GROW_TREE",0)}function Hs(e,n,t){os.call(this,e,n,t,2)}function _Oe(e,n){Ed(),ple.call(this,e,n)}function ple(e,n){Ed(),G$.call(this,e,n)}function LOe(e,n){Ed(),G$.call(this,e,n)}function POe(e,n){Ij(),ST.call(this,e,n)}function BK(e,n){Dl(),fR.call(this,e,n)}function $Oe(e,n){Dl(),BK.call(this,e,n)}function mle(e,n){Dl(),BK.call(this,e,n)}function ROe(e,n){Dl(),mle.call(this,e,n)}function vle(e,n){Dl(),fR.call(this,e,n)}function BOe(e,n){Dl(),vle.call(this,e,n)}function zOe(e,n){Dl(),fR.call(this,e,n)}function Npn(e,n){return e.c.Ec(u(n,136))}function Ipn(e,n){return u(zn(e.e,n),26)}function Dpn(e,n){return u(zn(e.e,n),26)}function yle(e,n,t){return Yz(lO(e,n),t)}function _pn(e,n,t){return n.xl(e.e,e.c,t)}function Lpn(e,n,t){return n.yl(e.e,e.c,t)}function zK(e,n){return z0(e.e,u(n,52))}function Ppn(e,n,t){RE(Vu(e.a),n,sLe(t))}function $pn(e,n,t){RE(Ts(e.a),n,lLe(t))}function FOe(e,n){return _n(e),e+UK(n)}function Rpn(e){return e==null?null:fu(e)}function Bpn(e){return e==null?null:fu(e)}function zpn(e){return e==null?null:sCn(e)}function Fpn(e){return e==null?null:tRn(e)}function M1(e){e.o==null&&MOn(e)}function ze(e){return tE(e==null||b2(e)),e}function re(e){return tE(e==null||g2(e)),e}function Pt(e){return tE(e==null||$r(e)),e}function Jpn(e,n){return qQ(e,n),new IDe(e,n)}function AT(e,n){this.c=e,p9.call(this,e,n)}function eE(e,n){this.a=e,AT.call(this,e,n)}function Hpn(e,n){this.d=e,tn(this),this.b=n}function kle(){kBe.call(this),this.Bb|=Ec}function JOe(){this.a=new Nw,this.b=new Nw}function jle(e){this.q=new k.Date(Qb(e))}function Gv(){Gv=Y,V3=new ki("root")}function A9(){A9=Y,tD=new xxe,new Axe}function v2(){v2=Y,Qme=rn((Vs(),_g))}function Gpn(e,n){n.a?KTn(e,n):DK(e.a,n.b)}function HOe(e,n){Va||Te(e.a,n)}function qpn(e,n){return cT(),Q9(n.d.i,e)}function Upn(e,n){return q4(),new RXe(n,e)}function Xpn(e,n,t){return e.Le(n,t)<=0?t:n}function Kpn(e,n,t){return e.Le(n,t)<=0?n:t}function Vpn(e,n){return u($a(e.b,n),144)}function Ypn(e,n){return u($a(e.c,n),233)}function FK(e){return u(Pe(e.a,e.b),295)}function GOe(e){return new Se(e.c,e.d+e.a)}function qOe(e){return _n(e),e?1231:1237}function UOe(e){return rl(),STe(u(e,203))}function Ele(e,n){return u(zn(e.b,n),278)}function XOe(e,n,t){++e.j,e.oj(n,e.Xi(n,t))}function MT(e,n,t){++e.j,e.rj(),gY(e,n,t)}function Sle(e,n,t){nB.call(this,e,n,t,null)}function KOe(e,n,t){nB.call(this,e,n,t,null)}function xle(e,n){wY.call(this,e),this.a=n}function Ale(e,n){wY.call(this,e),this.a=n}function Pi(e,n){ki.call(this,e),this.a=n}function Mle(e,n){coe.call(this,e),this.a=n}function JK(e,n){coe.call(this,e),this.a=n}function VOe(e,n){this.c=e,_w.call(this,n)}function YOe(e,n){this.a=e,zSe.call(this,n)}function CT(e,n){this.a=e,zSe.call(this,n)}function Cle(e,n,t){return t=hl(e,n,3,t),t}function Tle(e,n,t){return t=hl(e,n,6,t),t}function Ole(e,n,t){return t=hl(e,n,9,t),t}function hh(e,n){return HT(n,ewe),e.f=n,e}function Nle(e,n){return(n&oi)%e.d.length}function QOe(e,n,t){return bge(e.c,e.b,n,t)}function Qpn(e,n,t){return e.apply(n,t)}function WOe(e,n,t){var i;i=e.dd(n),i.Rb(t)}function ZOe(e,n,t){return e.a+=ph(n,0,t),e}function TT(e){return!e.a&&(e.a=new dn),e.a}function Ile(e,n){var t;return t=e.e,e.e=n,t}function Dle(e,n){var t;return t=n,!!e.De(t)}function Bb(e,n){return $n(),e==n?0:e?1:-1}function y2(e,n){e.a._c(e.b,n),++e.b,e.c=-1}function Wpn(e,n){var t;t=e[FZ],t.call(e,n)}function Zpn(e,n){var t;t=e[FZ],t.call(e,n)}function e2n(e,n,t){$b(),SP(e,n.Te(e.a,t))}function _le(e,n,t){return I4(e,u(n,23),t)}function Df(e,n){return qP(new Array(n),e)}function n2n(e){return Rt(Hb(e,32))^Rt(e)}function HK(e){return String.fromCharCode(e)}function t2n(e){return e==null?null:e.message}function GK(e){this.a=(En(),new Dn(Nt(e)))}function eNe(e){this.a=(sl(e,rm),new xo(e))}function nNe(e){this.a=(sl(e,rm),new xo(e))}function tNe(){this.a=new Oe,this.b=new Oe}function iNe(){this.a=new rv,this.b=new txe}function Lle(){this.b=new D0,this.a=new D0}function rNe(){this.b=new Vr,this.c=new Oe}function Ple(){this.n=new Vr,this.o=new Vr}function X$(){this.n=new o4,this.i=new y4}function cNe(){this.b=new ar,this.a=new ar}function uNe(){this.a=new Oe,this.d=new Oe}function oNe(){this.a=new IU,this.b=new o_}function sNe(){this.b=new LAe,this.a=new kM}function lNe(){this.b=new wt,this.a=new wt}function fNe(){X$.call(this),this.a=new Vr}function $le(e,n,t,i){hR.call(this,e,n,t,i)}function i2n(e,n){return e.n.a=(_n(n),n+10)}function r2n(e,n){return e.n.a=(_n(n),n+10)}function c2n(e,n){return cT(),!Q9(n.d.i,e)}function aNe(e){Hu(e.e),e.d.b=e.d,e.d.a=e.d}function OT(e){e.b?OT(e.b):e.f.c.yc(e.e,e.d)}function u2n(e,n){x1(e.f)?vOn(e,n):aMn(e,n)}function hNe(e,n,t){t!=null&&EB(n,KQ(e,t))}function dNe(e,n,t){t!=null&&SB(n,KQ(e,t))}function x4(e,n,t,i){we.call(this,e,n,t,i)}function Rle(e,n,t,i){we.call(this,e,n,t,i)}function bNe(e,n,t,i){Rle.call(this,e,n,t,i)}function gNe(e,n,t,i){yR.call(this,e,n,t,i)}function qK(e,n,t,i){yR.call(this,e,n,t,i)}function wNe(e,n,t,i){qK.call(this,e,n,t,i)}function Ble(e,n,t,i){yR.call(this,e,n,t,i)}function Nn(e,n,t,i){Ble.call(this,e,n,t,i)}function zle(e,n,t,i){qK.call(this,e,n,t,i)}function pNe(e,n,t,i){zle.call(this,e,n,t,i)}function mNe(e,n,t,i){Lfe.call(this,e,n,t,i)}function k2(e,n){jo.call(this,RS+e+pg+n)}function o2n(e,n){return n==e||y8(Dz(n),e)}function Fle(e,n){return e.hk().ti().oi(e,n)}function Jle(e,n){return e.hk().ti().qi(e,n)}function s2n(e,n){return e.e=u(e.d.Kb(n),162)}function vNe(e,n){return ei(e.a,n,"")==null}function yNe(e,n){return _n(e),ue(e)===ue(n)}function gn(e,n){return _n(e),ue(e)===ue(n)}function Hle(e,n,t){return e.lastIndexOf(n,t)}function kNe(e,n,t){this.a=e,dle.call(this,n,t)}function jNe(e){this.c=e,D$.call(this,bN,0)}function ENe(e,n,t){this.c=n,this.b=t,this.a=e}function pi(e,n){return e.a+=n.a,e.b+=n.b,e}function Nr(e,n){return e.a-=n.a,e.b-=n.b,e}function l2n(e){return r2(e.j.c,0),e.a=-1,e}function f2n(e,n){var t;return t=n.ni(e.a),t}function Gle(e,n,t){return t=hl(e,n,11,t),t}function a2n(e,n,t){return ji(e[n.a],e[t.a])}function h2n(e,n){return oo(e.a.d.p,n.a.d.p)}function d2n(e,n){return oo(n.a.d.p,e.a.d.p)}function b2n(e,n){return ji(e.c-e.s,n.c-n.s)}function g2n(e,n){return ji(e.b.e.a,n.b.e.a)}function w2n(e,n){return ji(e.c.e.a,n.c.e.a)}function p2n(e,n){return he(n,(Ie(),hI),e)}function m2n(e,n){return e.b.zd(new FMe(e,n))}function v2n(e,n){return e.b.zd(new JMe(e,n))}function SNe(e,n){return e.b.zd(new HMe(e,n))}function xNe(e,n){return X(n,16)&&mXe(e.c,n)}function ANe(e){return e.c?pu(e.c.a,e,0):-1}function y2n(e){return e<100?null:new k0(e)}function A4(e){return e==Dg||e==a1||e==to}function k2n(e,n,t){return u(e.c,72).Uk(n,t)}function K$(e,n,t){return u(e.c,72).Vk(n,t)}function j2n(e,n,t){return _pn(e,u(n,344),t)}function qle(e,n,t){return Lpn(e,u(n,344),t)}function E2n(e,n,t){return cGe(e,u(n,344),t)}function MNe(e,n,t){return EMn(e,u(n,344),t)}function nE(e,n){return n==null?null:J2(e.b,n)}function S2n(e,n){Va||n&&(e.d=n)}function Ule(e,n){if(!e)throw R(new qn(n))}function M9(e){if(!e)throw R(new Uc(Pge))}function UK(e){return g2(e)?(_n(e),e):e.se()}function V$(e){return!isNaN(e)&&!isFinite(e)}function XK(e){zTe(this),qs(this),ac(this,e)}function bs(e){CK(this),sfe(this.c,0,e.Nc())}function NT(e){C9(),this.d=e,this.a=new Fv}function CNe(e,n,t){this.d=e,this.b=t,this.a=n}function _l(e,n,t){this.a=e,this.b=n,this.c=t}function TNe(e,n,t){this.a=e,this.b=n,this.c=t}function Xle(e,n){this.c=e,yV.call(this,e,n)}function ONe(e,n){Nvn.call(this,e,e.length,n)}function KK(e,n){if(e!=n)throw R(new Nl)}function NNe(e){this.a=e,jd(),Lu(Date.now())}function INe(e){As(e.a),uhe(e.c,e.b),e.b=null}function VK(){VK=Y,Hme=new di,dnn=new Gt}function YK(e){var n;return n=new f6,n.e=e,n}function x2n(e,n,t){return $b(),e.a.Wd(n,t),n}function Kle(e,n,t){this.b=e,this.c=n,this.a=t}function Vle(e){var n;return n=new sxe,n.b=e,n}function A2n(e){return wa(),It((C$e(),Onn),e)}function M2n(e){return q9(),It((J$e(),wnn),e)}function C2n(e){return zl(),It((M$e(),jnn),e)}function T2n(e){return ws(),It((T$e(),Inn),e)}function O2n(e){return Uo(),It((O$e(),_nn),e)}function N2n(e){return nF(),It((hTe(),itn),e)}function I2n(e){return Rw(),It((X$e(),ctn),e)}function D2n(e){return n8(),It((K$e(),Vtn),e)}function _2n(e){return aB(),It((_Pe(),btn),e)}function L2n(e){return kE(),It((A$e(),ztn),e)}function P2n(e){return zr(),It((PRe(),Gtn),e)}function $2n(e){return W4(),It((U$e(),nin),e)}function R2n(e){return Fn(),It((rze(),cin),e)}function B2n(e){return Y9(),It((LPe(),fin),e)}function QK(e){hR.call(this,e.d,e.c,e.a,e.b)}function Yle(e){hR.call(this,e.d,e.c,e.a,e.b)}function z2n(e){return Ur(),It((dTe(),ain),e)}function DNe(){DNe=Y,Ian=se(Mr,On,1,0,5,1)}function _Ne(){_Ne=Y,Yan=se(Mr,On,1,0,5,1)}function Qle(){Qle=Y,Qan=se(Mr,On,1,0,5,1)}function IT(){IT=Y,SJ=new fq,xJ=new BA}function Y$(){Y$=Y,win=new Tq,gin=new Oq}function il(){il=Y,kin=new wk,jin=new ld}function F2n(e){return $w(),It((f$e(),Iin),e)}function J2n(e){return zf(),It((W$e(),xin),e)}function H2n(e){return X2(),It((ORe(),Min),e)}function G2n(e){return Fz(),It((oze(),Din),e)}function q2n(e){return ty(),It((fBe(),_in),e)}function U2n(e){return iB(),It((pPe(),Lin),e)}function X2n(e){return zE(),It((eRe(),Pin),e)}function K2n(e){return vB(),It((c$e(),$in),e)}function V2n(e){return YO(),It((dze(),Rin),e)}function Y2n(e){return hO(),It((mPe(),Bin),e)}function Q2n(e){return tg(),It((u$e(),Fin),e)}function W2n(e){return Az(),It((lBe(),Jin),e)}function Z2n(e){return uO(),It((vPe(),Hin),e)}function emn(e){return JO(),It((oBe(),Gin),e)}function nmn(e){return j8(),It((sBe(),qin),e)}function tmn(e){return Ic(),It((Oze(),Uin),e)}function imn(e){return e8(),It((o$e(),Xin),e)}function rmn(e){return $0(),It((s$e(),Kin),e)}function cmn(e){return _1(),It((l$e(),Yin),e)}function umn(e){return GR(),It((yPe(),Qin),e)}function omn(e){return Xs(),It((IRe(),Zin),e)}function smn(e){return XR(),It((kPe(),ern),e)}function lmn(e){return WO(),It((bze(),Fun),e)}function fmn(e){return _E(),It((a$e(),Jun),e)}function amn(e){return U2(),It((Y$e(),Hun),e)}function hmn(e){return GE(),It((NRe(),Gun),e)}function dmn(e){return X0(),It((Tze(),qun),e)}function bmn(e){return F1(),It((Q$e(),Uun),e)}function gmn(e){return sO(),It((jPe(),Xun),e)}function wmn(e){return Nc(),It((h$e(),Vun),e)}function pmn(e){return _B(),It((d$e(),Yun),e)}function mmn(e){return DE(),It((b$e(),Qun),e)}function vmn(e){return u8(),It((g$e(),Wun),e)}function ymn(e){return mB(),It((w$e(),Zun),e)}function kmn(e){return LB(),It((p$e(),eon),e)}function jmn(e){return $B(),It((q$e(),bin),e)}function Emn(e){return rg(),It((V$e(),von),e)}function Smn(e,n){return _n(e),e+(_n(n),n)}function xmn(e){return vE(),It((EPe(),Son),e)}function Amn(e){return dh(),It((xPe(),Non),e)}function Mmn(e){return Da(),It((SPe(),Don),e)}function Cmn(e){return da(),It((APe(),Kon),e)}function C9(){C9=Y,nye=(De(),Vn),IH=et}function Tmn(e){return Iw(),It((MPe(),nsn),e)}function Omn(e){return ny(),It((iRe(),tsn),e)}function Nmn(e){return uS(),It((bTe(),isn),e)}function Imn(e){return IE(),It((m$e(),rsn),e)}function Dmn(e){return NE(),It((Z$e(),Msn),e)}function _mn(e){return HR(),It((CPe(),Csn),e)}function Lmn(e){return AB(),It((TPe(),Dsn),e)}function Pmn(e){return kz(),It((DRe(),Lsn),e)}function $mn(e){return cB(),It((OPe(),Psn),e)}function Rmn(e){return xO(),It((v$e(),$sn),e)}function Bmn(e){return dz(),It((tRe(),iln),e)}function zmn(e){return DB(),It((y$e(),rln),e)}function Fmn(e){return ez(),It((k$e(),cln),e)}function Jmn(e){return Ez(),It((nRe(),oln),e)}function Hmn(e){return VB(),It((x$e(),fln),e)}function Gmn(e){return!e.e&&(e.e=new Oe),e.e}function Q$(e,n,t){this.e=n,this.b=e,this.d=t}function LNe(e,n,t){this.a=e,this.b=n,this.c=t}function PNe(e,n,t){this.a=e,this.b=n,this.c=t}function Wle(e,n,t){this.a=e,this.b=n,this.c=t}function $Ne(e,n,t){this.a=e,this.b=n,this.c=t}function RNe(e,n,t){this.a=e,this.c=n,this.b=t}function W$(e,n,t){this.b=e,this.a=n,this.c=t}function BNe(e,n,t){this.b=e,this.a=n,this.c=t}function WK(e,n){this.c=e,this.a=n,this.b=n-e}function qmn(e){return GB(),It((E$e(),_ln),e)}function Umn(e){return t$(),It((KLe(),zln),e)}function Xmn(e){return eO(),It((IPe(),Fln),e)}function Kmn(e){return GO(),It((LRe(),Jln),e)}function Vmn(e){return n$(),It((XLe(),Rln),e)}function Ymn(e){return tS(),It((_Re(),Pln),e)}function Qmn(e){return OO(),It((S$e(),$ln),e)}function Wmn(e){return QR(),It((NPe(),Iln),e)}function Zmn(e){return uB(),It((j$e(),Dln),e)}function evn(e){return Tj(),It((VLe(),rfn),e)}function nvn(e){return vO(),It((DPe(),cfn),e)}function tvn(e){return vh(),It((RRe(),afn),e)}function ivn(e){return lg(),It((cze(),dfn),e)}function rvn(e){return z1(),It((cRe(),Vfn),e)}function cvn(e){return vr(),It(($Re(),Ufn),e)}function uvn(e){return s8(),It((rRe(),Xfn),e)}function ovn(e){return Ra(),It((N$e(),Kfn),e)}function svn(e){return Yh(),It((iBe(),bfn),e)}function lvn(e){return sg(),It((rBe(),yfn),e)}function fvn(e){return Q2(),It((wze(),nan),e)}function avn(e){return u3(),It((BRe(),tan),e)}function hvn(e){return Br(),It((uBe(),ian),e)}function dvn(e){return ps(),It((cBe(),ran),e)}function bvn(e){return fl(),It((uRe(),ean),e)}function gvn(e){return Sz(),It((tBe(),Yfn),e)}function wvn(e){return B1(),It((D$e(),Wfn),e)}function pvn(e){return KR(),It((oRe(),ban),e)}function mvn(e){return _s(),It((gze(),han),e)}function vvn(e){return V4(),It((I$e(),dan),e)}function yvn(e){return De(),It((zRe(),can),e)}function kvn(e){return EE(),It((_$e(),fan),e)}function jvn(e){return Vs(),It((sRe(),aan),e)}function Evn(e){return YB(),It((lRe(),gan),e)}function Svn(e){return RB(),It((fRe(),man),e)}function xvn(e){return S8(),It((uze(),Nan),e)}function zNe(e,n,t){Dl(),bae.call(this,e,n,t)}function ZK(e,n,t){Dl(),Vfe.call(this,e,n,t)}function FNe(e,n,t){Dl(),ZK.call(this,e,n,t)}function Zle(e,n,t){Dl(),ZK.call(this,e,n,t)}function JNe(e,n,t){Dl(),Zle.call(this,e,n,t)}function HNe(e,n,t){Dl(),efe.call(this,e,n,t)}function efe(e,n,t){Dl(),Vfe.call(this,e,n,t)}function nfe(e,n,t){Dl(),Vfe.call(this,e,n,t)}function GNe(e,n,t){Dl(),nfe.call(this,e,n,t)}function qNe(e,n,t){this.a=e,this.c=n,this.b=t}function UNe(e,n,t){this.a=e,this.b=n,this.c=t}function tfe(e,n,t){this.a=e,this.b=n,this.c=t}function ife(e,n,t){this.a=e,this.b=n,this.c=t}function eV(e,n,t){this.a=e,this.b=n,this.c=t}function XNe(e,n,t){this.a=e,this.b=n,this.c=t}function xd(e,n,t){this.e=e,this.a=n,this.c=t}function rfe(e){this.d=e,tn(this),this.b=m3n(e.d)}function cfe(e,n){pgn.call(this,e,XB(new Su(n)))}function DT(e,n){return Nt(e),Nt(n),new WAe(e,n)}function M4(e,n){return Nt(e),Nt(n),new rIe(e,n)}function Avn(e,n){return Nt(e),Nt(n),new cIe(e,n)}function Mvn(e,n){return Nt(e),Nt(n),new lMe(e,n)}function nV(e){return at(e.b!=0),$l(e,e.a.a)}function Cvn(e){return at(e.b!=0),$l(e,e.c.b)}function Tvn(e){return!e.c&&(e.c=new Ol),e.c}function _T(e){var n;return n=new xi,BY(n,e),n}function KNe(e){var n;return n=new pX,BY(n,e),n}function Ovn(e){var n;return n=new ar,MY(n,e),n}function T9(e){var n;return n=new Oe,MY(n,e),n}function u(e,n){return tE(e==null||$Q(e,n)),e}function Nvn(e,n,t){XIe.call(this,n,t),this.a=e}function VNe(e,n){this.c=e,this.b=n,this.a=!1}function YNe(){this.a=";,;",this.b="",this.c=""}function QNe(e,n,t){this.b=e,cTe.call(this,n,t)}function ufe(e,n,t){this.c=e,u$.call(this,n,t)}function ofe(e,n,t){k9.call(this,e,n),this.b=t}function sfe(e,n,t){ebe(t,0,e,n,t.length,!1)}function Hh(e,n,t,i,r){e.b=n,e.c=t,e.d=i,e.a=r}function lfe(e,n,t,i,r){e.d=n,e.c=t,e.a=i,e.b=r}function Ivn(e,n){n&&(e.b=n,e.a=(T0(n),n.a))}function LT(e,n){if(!e)throw R(new qn(n))}function C4(e,n){if(!e)throw R(new Uc(n))}function ffe(e,n){if(!e)throw R(new iAe(n))}function Dvn(e,n){return ZP(),oo(e.d.p,n.d.p)}function _vn(e,n){return P1(),ji(e.e.b,n.e.b)}function Lvn(e,n){return P1(),ji(e.e.a,n.e.a)}function Pvn(e,n){return oo(fIe(e.d),fIe(n.d))}function Z$(e,n){return n&&xR(e,n.d)?n:null}function $vn(e,n){return n==(De(),Vn)?e.c:e.d}function Rvn(e){return new Se(e.c+e.b,e.d+e.a)}function WNe(e){return e!=null&&!jQ(e,oA,sA)}function Bvn(e,n){return(_Fe(e)<<4|_Fe(n))&yr}function ZNe(e,n,t,i,r){e.c=n,e.d=t,e.b=i,e.a=r}function afe(e){var n,t;n=e.b,t=e.c,e.b=t,e.c=n}function hfe(e){var n,t;t=e.d,n=e.a,e.d=n,e.a=t}function zvn(e,n){var t;return t=e.c,Jhe(e,n),t}function dfe(e,n){return n<0?e.g=-1:e.g=n,e}function eR(e,n){return N8n(e),e.a*=n,e.b*=n,e}function PT(e,n,t){Ise.call(this,e,n),this.c=t}function nR(e,n,t){Ise.call(this,e,n),this.c=t}function bfe(e){Qle(),jv.call(this),this._h(e)}function eIe(){J9(),W3n.call(this,(E0(),kf))}function nIe(e){return ai(),new Gh(0,e)}function tIe(){tIe=Y,Gce=(En(),new Dn(Bne))}function tR(){tR=Y,new Mde((SX(),Qne),(EX(),Yne))}function iIe(){this.b=ne(re(Le((Hf(),jte))))}function tV(e){this.b=e,this.a=Fb(this.b.a).Md()}function rIe(e,n){this.b=e,this.a=n,mC.call(this)}function cIe(e,n){this.a=e,this.b=n,mC.call(this)}function uIe(e,n,t){this.a=e,Pv.call(this,n,t)}function oIe(e,n,t){this.a=e,Pv.call(this,n,t)}function O9(e,n,t){var i;i=new M2(t),$f(e,n,i)}function gfe(e,n,t){var i;return i=e[n],e[n]=t,i}function iR(e){var n;return n=e.slice(),yY(n,e)}function rR(e){var n;return n=e.n,e.a.b+n.d+n.a}function sIe(e){var n;return n=e.n,e.e.b+n.d+n.a}function wfe(e){var n;return n=e.n,e.e.a+n.b+n.c}function pfe(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function Vt(e,n){return Ki(e,n,e.c.b,e.c),!0}function Fvn(e){return e.a?e.a:IV(e)}function tE(e){if(!e)throw R(new a9(null))}function Ew(e,n){return KE(e,new k9(n.a,n.b))}function Jvn(e){return!uc(e)&&e.c.i.c==e.d.i.c}function Hvn(e,n){return e.c=n)throw R(new gxe)}function Hu(e){e.f=new kTe(e),e.i=new jTe(e),++e.g}function mR(e){this.b=new xo(11),this.a=(Tw(),e)}function gV(e){this.b=null,this.a=(Tw(),e||Fme)}function Dfe(e,n){this.e=e,this.d=(n&64)!=0?n|jh:n}function XIe(e,n){this.c=0,this.d=e,this.b=n|64|jh}function KIe(e){this.a=KJe(e.a),this.b=new bs(e.b)}function Ad(e,n,t,i){var r;r=e.i,r.i=n,r.a=t,r.b=i}function _fe(e){var n;for(n=e;n.f;)n=n.f;return n}function x3n(e){return e.e?ihe(e.e):null}function uE(e){return ps(),!e.Gc(Z1)&&!e.Gc(mb)}function VIe(e,n,t){return M8(),qY(e,n)&&qY(e,t)}function YIe(e,n,t){return rYe(e,u(n,12),u(t,12))}function wV(e,n){return n.Sh()?z0(e.b,u(n,52)):n}function vR(e){return new Se(e.c+e.b/2,e.d+e.a/2)}function A3n(e,n,t){n.of(t,ne(re(zn(e.b,t)))*e.a)}function M3n(e,n){n.Tg("General 'Rotator",1),J$n(e)}function Dr(e,n,t,i,r){mY.call(this,e,n,t,i,r,-1)}function oE(e,n,t,i,r){rO.call(this,e,n,t,i,r,-1)}function we(e,n,t,i){mr.call(this,e,n,t),this.b=i}function yR(e,n,t,i){PT.call(this,e,n,t),this.b=i}function QIe(e){KCe.call(this,e,!1),this.a=!1}function WIe(){kK.call(this,"LOOKAHEAD_LAYOUT",1)}function ZIe(){kK.call(this,"LAYOUT_NEXT_LEVEL",3)}function eDe(e){this.b=e,j4.call(this,e),uOe(this)}function nDe(e){this.b=e,ET.call(this,e),oOe(this)}function tDe(e,n){this.b=e,GU.call(this,e.b),this.a=n}function x2(e,n,t){this.a=e,x4.call(this,n,t,5,6)}function Lfe(e,n,t,i){this.b=e,mr.call(this,n,t,i)}function Gb(e,n,t){yh(),this.e=e,this.d=n,this.a=t}function Zr(e,n){for(_n(n);e.Ob();)n.Ad(e.Pb())}function kR(e,n){return ai(),new Yfe(e,n,0)}function pV(e,n){return ai(),new Yfe(6,e,n)}function C3n(e,n){return gn(e.substr(0,n.length),n)}function so(e,n){return $r(n)?BV(e,n):!!Xc(e.f,n)}function T3n(e){return _o(~e.l&Ls,~e.m&Ls,~e.h&G1)}function mV(e){return typeof e===fN||typeof e===hZ}function Uh(e){return new Un(new sle(e.a.length,e.a))}function vV(e){return new mn(null,$3n(e,e.length))}function iDe(e){if(!e)throw R(new hu);return e.d}function N4(e){var n;return n=OE(e),at(n!=null),n}function O3n(e){var n;return n=pjn(e),at(n!=null),n}function I9(e,n){var t;return t=e.a.gc(),Zae(n,t),t-n}function hr(e,n){var t;return t=e.a.yc(n,e),t==null}function RT(e,n){return e.a.yc(n,($n(),ib))==null}function N3n(e,n){return e>0?k.Math.log(e/n):-100}function Pfe(e,n){return n?ac(e,n):!1}function I4(e,n,t){return Bf(e.a,n),gfe(e.b,n.g,t)}function I3n(e,n,t){N9(t,e.a.c.length),ul(e.a,t,n)}function ce(e,n,t,i){tFe(n,t,e.length),D3n(e,n,t,i)}function D3n(e,n,t,i){var r;for(r=n;r0?1:0}function lE(e){return e.e==0?e:new Gb(-e.e,e.d,e.a)}function L3n(e){return e==Vi?qN:e==Ir?"-INF":""+e}function P3n(e){return e==Vi?qN:e==Ir?"-INF":""+e}function $3n(e,n){return M8n(n,e.length),new bIe(e,n)}function cDe(e,n,t,i,r){for(;n=e.g}function CV(e,n,t){var i;return i=RY(e,n,t),zbe(e,i)}function pDe(e,n){var t;t=console[e],t.call(console,n)}function D4(e,n){var t;t=e.a.length,L2(e,t),tY(e,t,n)}function mDe(e,n){var t;++e.j,t=e.Cj(),e.pj(e.Xi(t,n))}function TV(e,n){for(_n(n);e.c=e?new Yoe:Q8n(e-1)}function uf(e){if(e==null)throw R(new c4);return e}function _n(e){if(e==null)throw R(new c4);return e}function t5n(e){return!e.a&&(e.a=new mr(vb,e,4)),e.a}function Mw(e){return!e.d&&(e.d=new mr(Rc,e,1)),e.d}function i5n(e){if(e.p!=3)throw R(new is);return e.e}function r5n(e){if(e.p!=4)throw R(new is);return e.e}function c5n(e){if(e.p!=6)throw R(new is);return e.f}function u5n(e){if(e.p!=3)throw R(new is);return e.j}function o5n(e){if(e.p!=4)throw R(new is);return e.j}function s5n(e){if(e.p!=6)throw R(new is);return e.k}function or(){Rxe.call(this),r2(this.j.c,0),this.a=-1}function CDe(){Ot.call(this,"DELAUNAY_TRIANGULATION",0)}function l5n(){return FP(),F(z(qen,1),Ee,537,0,[Zne])}function f5n(e,n,t){return X4(),t.Kg(e,u(n.jd(),147))}function a5n(e,n){Et((!e.a&&(e.a=new CT(e,e)),e.a),n)}function Wfe(e,n){e.c<0||e.b.b=0?e.hi(t):q0e(e,n)}function L9(e,n){var t;return t=MV("",e),t.n=n,t.i=1,t}function Cw(e){return e.c==-2&&sX(e,AMn(e.g,e.b)),e.c}function Zfe(e){return!e.b&&(e.b=new IP(new jX)),e.b}function TDe(e,n){return tR(),new Mde(new lOe(e),new sOe(n))}function d5n(e){return sl(e,wZ),hB(mc(mc(5,e),e/10|0))}function OV(){OV=Y,Ken=new rse(F(z(yg,1),tF,45,0,[]))}function ODe(){j0e.call(this,vg,(kAe(),chn)),NPn(this)}function NDe(){j0e.call(this,hf,(g9(),Y8e)),BLn(this)}function IDe(e,n){Jwn.call(this,W8n(Nt(e),Nt(n))),this.a=n}function eae(e,n,t,i){pw.call(this,e,n),this.d=t,this.a=i}function AR(e,n,t,i){pw.call(this,e,t),this.a=n,this.f=i}function DDe(e,n){this.b=e,yV.call(this,e,n),uOe(this)}function _De(e,n){this.b=e,Xle.call(this,e,n),oOe(this)}function dE(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function LDe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function P9(e){return!e.a&&(e.a=new oAe(e.c.vc())),e.a}function PDe(e){return!e.b&&(e.b=new h9(e.c.ec())),e.b}function $De(e){return!e.d&&(e.d=new Hr(e.c.Bc())),e.d}function Xh(e,n){for(;n-- >0;)e=e<<1|(e<0?1:0);return e}function RDe(e,n){var t;return t=new Xu(e),Gn(n.c,t),t}function b5n(e,n){hV(u(n.b,68),e),Ao(n.a,new Wue(e))}function BDe(e,n){e.u.Gc((ps(),Z1))&&jTn(e,n),E9n(e,n)}function Ku(e,n){return ue(e)===ue(n)||e!=null&&gi(e,n)}function ei(e,n,t){return $r(n)?Kc(e,n,t):Ko(e.f,n,t)}function nae(e){return En(),e?e.Me():(Tw(),Tw(),Jme)}function g5n(){return n$(),F(z(P6e,1),Ee,477,0,[Zre])}function w5n(){return t$(),F(z(Bln,1),Ee,546,0,[ece])}function p5n(){return Tj(),F(z(i9e,1),Ee,527,0,[OI])}function zc(e,n){return sV(e.a,n)?e.b[u(n,23).g]:null}function m5n(e){return String.fromCharCode.apply(null,e)}function rc(e,n){return Qn(n,e.length),e.charCodeAt(n)}function zT(e){return e.j.c.length=0,rae(e.c),l2n(e.a),e}function $9(e){return e.e==f7&&a(e,zEn(e.g,e.b)),e.e}function FT(e){return e.f==f7&&w(e,Txn(e.g,e.b)),e.f}function v5n(e){return!e.b&&(e.b=new Nn(mt,e,4,7)),e.b}function tae(e){return!e.c&&(e.c=new Nn(mt,e,5,8)),e.c}function iae(e){return!e.c&&(e.c=new we($s,e,9,9)),e.c}function NV(e){return!e.n&&(e.n=new we(Eu,e,1,7)),e.n}function qv(e){var n;return n=e.b,!n&&(e.b=n=new cj(e)),n}function rae(e){var n;for(n=e.Jc();n.Ob();)n.Pb(),n.Qb()}function y5n(e,n,t){var i;i=u(e.d.Kb(t),162),i&&i.Nb(n)}function k5n(e,n){return new h_e(u(Nt(e),51),u(Nt(n),51))}function li(e,n){return F0(e),new mn(e,new whe(n,e.a))}function So(e,n){return F0(e),new mn(e,new the(n,e.a))}function C2(e,n){return F0(e),new xle(e,new ZPe(n,e.a))}function MR(e,n){return F0(e),new Ale(e,new e$e(n,e.a))}function zDe(e,n){W1e(e,ne($1(n,"x")),ne($1(n,"y")))}function FDe(e,n){W1e(e,ne($1(n,"x")),ne($1(n,"y")))}function j5n(e,n){return Qoe(),ji((_n(e),e),(_n(n),n))}function E5n(e,n){return ji(e.d.c+e.d.b/2,n.d.c+n.d.b/2)}function S5n(e,n){return ji(e.g.c+e.g.b/2,n.g.c+n.g.b/2)}function x5n(e){return e!=null&&xj(SG,e.toLowerCase())}function A5n(e){il();var n;n=u(e.g,9),n.n.a=e.d.c+n.d.b}function IV(e){var n;return n=e7n(e),n||null}function ri(e,n,t,i){return ZBe(e,n,t,!1),HB(e,i),e}function M5n(e,n,t){DLn(e.a,t),W7n(t),cOn(e.b,t),ePn(n,t)}function _4(e,n,t,i){Ot.call(this,e,n),this.a=t,this.b=i}function CR(e,n,t,i){this.a=e,this.c=n,this.b=t,this.d=i}function cae(e,n,t,i){this.c=e,this.b=n,this.a=t,this.d=i}function JDe(e,n,t,i){this.c=e,this.b=n,this.d=t,this.a=i}function DV(e,n,t,i){this.a=e,this.e=n,this.d=t,this.c=i}function HDe(e,n,t,i){this.a=e,this.d=n,this.c=t,this.b=i}function _f(e,n,t,i){this.c=e,this.d=n,this.b=t,this.a=i}function _V(e,n,t){this.a=Jge,this.d=e,this.b=n,this.c=t}function uae(e,n){this.b=e,this.c=n,this.a=new d4(this.b)}function GDe(e,n){this.d=(_n(e),e),this.a=16449,this.c=n}function qDe(e,n,t,i){Kze.call(this,e,t,i,!1),this.f=n}function LV(e,n,t){var i,r;return i=Tge(e),r=n.qi(t,i),r}function T1(e){var n,t;return t=(n=new gw,n),X9(t,e),t}function PV(e){var n,t;return t=(n=new gw,n),x0e(t,e),t}function UDe(e){return!e.b&&(e.b=new we(pr,e,12,3)),e.b}function XDe(e){this.a=new Oe,this.e=se($t,Me,54,e,0,2)}function $V(e){this.f=e,this.c=this.f.e,e.f>0&&HHe(this)}function KDe(e,n,t,i){this.a=e,this.c=n,this.d=t,this.b=i}function VDe(e,n,t,i){this.a=e,this.b=n,this.d=t,this.c=i}function YDe(e,n,t,i){this.a=e,this.b=n,this.c=t,this.d=i}function QDe(e,n,t,i){this.a=e,this.b=n,this.c=t,this.d=i}function Ub(e,n,t,i){this.e=e,this.a=n,this.c=t,this.d=i}function WDe(e,n,t,i){Dl(),WPe.call(this,n,t,i),this.a=e}function ZDe(e,n,t,i){Dl(),WPe.call(this,n,t,i),this.a=e}function e_e(e,n){this.a=e,Hpn.call(this,e,u(e.d,16).dd(n))}function C5n(e,n){return ji(us(e)*Gs(e),us(n)*Gs(n))}function T5n(e,n){return ji(us(e)*Gs(e),us(n)*Gs(n))}function L4(e){var n;return n=e.f,n||(e.f=new p9(e,e.c))}function En(){En=Y,Sc=new Ae,r1=new nn,bJ=new yn}function Tw(){Tw=Y,Fme=new ye,ste=new ye,Jme=new Re}function R9(e){if(Is(e.d),e.d.d!=e.c)throw R(new Nl)}function qs(e){e.a.a=e.c,e.c.b=e.a,e.a.b=e.c.a=null,e.b=0}function oae(e){return at(e.b0?Pf(e):new Oe}function TR(e){return e.n&&(e.e!==mYe&&e.he(),e.j=null),e}function sae(e,n){return e.b=n.b,e.c=n.c,e.d=n.d,e.a=n.a,e}function N5n(e,n,t){return Te(e.a,(qQ(n,t),new pw(n,t))),e}function I5n(e,n){return u(C(e,(me(),Dy)),16).Ec(n),n}function D5n(e,n){return wn(e,u(C(n,(Ie(),xm)),15),n)}function _5n(e){return Uw(e)&&Fe(ze(je(e,(Ie(),xg))))}function L5n(e,n,t){return Cj(),$jn(u(zn(e.e,n),516),t)}function P5n(e,n,t){e.i=0,e.e=0,n!=t&&Gze(e,n,t)}function $5n(e,n,t){e.i=0,e.e=0,n!=t&&qze(e,n,t)}function n_e(e,n,t,i){this.b=e,this.c=i,D$.call(this,n,t)}function t_e(e,n){this.g=e,this.d=F(z(u1,1),Fd,9,0,[n])}function i_e(e,n){e.d&&!e.d.a&&(XSe(e.d,n),i_e(e.d,n))}function r_e(e,n){e.e&&!e.e.a&&(XSe(e.e,n),r_e(e.e,n))}function c_e(e,n){return c3(e.j,n.s,n.c)+c3(n.e,e.s,e.c)}function R5n(e,n){return-ji(us(e)*Gs(e),us(n)*Gs(n))}function B5n(e){return u(e.jd(),147).Og()+":"+fu(e.kd())}function u_e(){bW(this,new IC),this.wb=(C0(),Bn),g9()}function o_e(e){this.b=new s_,this.a=e,k.Math.random()}function s_e(e){this.b=new Oe,Sr(this.b,this.b),this.a=e}function lae(e,n){new xi,this.a=new xs,this.b=e,this.c=n}function l_e(){du.call(this,"There is no more element.")}function z5n(e){GP(),k.setTimeout(function(){throw e},0)}function F5n(e){e.Tg("No crossing minimization",1),e.Ug()}function J5n(e,n){return Us(e),Us(n),Zxe(u(e,23),u(n,23))}function Xb(e,n,t){var i,r;i=UK(t),r=new Av(i),$f(e,n,r)}function RV(e,n,t,i,r,c){rO.call(this,e,n,t,i,r,c?-2:-1)}function f_e(e,n,t,i){Ise.call(this,n,t),this.b=e,this.a=i}function fae(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function OR(e){return!e.a&&(e.a=new we(Ft,e,10,11)),e.a}function yi(e){return!e.q&&(e.q=new we(yf,e,11,10)),e.q}function ge(e){return!e.s&&(e.s=new we(ns,e,21,17)),e.s}function a_e(e){return tE(e==null||mV(e)&&e.Rm!==bn),e}function NR(e,n){if(e==null)throw R(new f4(n));return e}function h_e(e,n){Ebn.call(this,new gV(e)),this.a=e,this.b=n}function BV(e,n){return n==null?!!Xc(e.f,null):a3n(e.i,n)}function zV(e){return X(e,18)?new E2(u(e,18)):Ovn(e.Jc())}function IR(e){return En(),X(e,59)?new DX(e):new F$(e)}function H5n(e){return Nt(e),cHe(new Un(Yn(e.a.Jc(),new ee)))}function G5n(e){return new tOe(e,e.e.Pd().gc()*e.c.Pd().gc())}function q5n(e){return new iOe(e,e.e.Pd().gc()*e.c.Pd().gc())}function aae(e){return e&&e.hashCode?e.hashCode():jw(e)}function U5n(e){e&&_R(e,e.ge())}function X5n(e,n){var t;return t=Qse(e.a,n),t&&(n.d=null),t}function d_e(e,n,t){return e.f?e.f.cf(n,t):!1}function JT(e,n,t,i){ir(e.c[n.g],t.g,i),ir(e.c[t.g],n.g,i)}function FV(e,n,t,i){ir(e.c[n.g],n.g,t),ir(e.b[n.g],n.g,i)}function K5n(e,n,t){return ne(re(t.a))<=e&&ne(re(t.b))>=n}function b_e(){this.d=new xi,this.b=new wt,this.c=new Oe}function g_e(){this.b=new ar,this.d=new xi,this.e=new BP}function hae(){this.c=new Vr,this.d=new Vr,this.e=new Vr}function Ow(){this.a=new xs,this.b=(sl(3,rm),new xo(3))}function w_e(e){this.c=e,this.b=new kd(u(Nt(new ra),51))}function p_e(e){this.c=e,this.b=new kd(u(Nt(new f0),51))}function m_e(e){this.b=e,this.a=new kd(u(Nt(new uu),51))}function Md(e,n){this.e=e,this.a=Mr,this.b=_Xe(n),this.c=n}function DR(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function v_e(e,n,t,i,r,c){this.a=e,DY.call(this,n,t,i,r,c)}function y_e(e,n,t,i,r,c){this.a=e,DY.call(this,n,t,i,r,c)}function O0(e,n,t,i,r,c,o){return new cY(e.e,n,t,i,r,c,o)}function V5n(e,n,t){return t>=0&&gn(e.substr(t,n.length),n)}function k_e(e,n){return X(n,147)&&gn(e.b,u(n,147).Og())}function Y5n(e,n){return e.a?n.Dh().Jc():u(n.Dh(),72).Gi()}function j_e(e,n){var t;return t=e.b.Oc(n),gPe(t,e.b.gc()),t}function HT(e,n){if(e==null)throw R(new f4(n));return e}function tu(e){return e.u||(Ms(e),e.u=new YOe(e,e)),e.u}function Go(e){var n;return n=u(Xn(e,16),29),n||e.fi()}function _R(e,n){var t;return t=Pb(e.Pm),n==null?t:t+": "+n}function of(e,n,t){return Qr(n,t,e.length),e.substr(n,t-n)}function E_e(e,n){X$.call(this),Che(this),this.a=e,this.c=n}function S_e(){kK.call(this,"FIXED_INTEGER_RATIO_BOXES",2)}function Q5n(){return iB(),F(z(g3e,1),Ee,422,0,[b3e,Kte])}function W5n(){return hO(),F(z(S3e,1),Ee,419,0,[VJ,E3e])}function Z5n(){return uO(),F(z(M3e,1),Ee,476,0,[A3e,QJ])}function e4n(){return GR(),F(z(F3e,1),Ee,420,0,[gie,z3e])}function n4n(){return XR(),F(z(n5e,1),Ee,423,0,[xie,Sie])}function t4n(){return sO(),F(z(J4e,1),Ee,421,0,[ire,rre])}function i4n(){return vE(),F(z(Eon,1),Ee,518,0,[Ox,Tx])}function r4n(){return Da(),F(z(Ion,1),Ee,508,0,[Og,Qa])}function c4n(){return dh(),F(z(Oon,1),Ee,509,0,[yp,Kd])}function u4n(){return da(),F(z(Xon,1),Ee,515,0,[Dm,ab])}function o4n(){return Iw(),F(z(esn,1),Ee,454,0,[hb,X3])}function s4n(){return HR(),F(z($ye,1),Ee,425,0,[Are,Pye])}function l4n(){return AB(),F(z(Rye,1),Ee,487,0,[FH,Y3])}function f4n(){return cB(),F(z(zye,1),Ee,426,0,[Bye,Ire])}function a4n(){return aB(),F(z(nve,1),Ee,424,0,[yte,vJ])}function h4n(){return Y9(),F(z(lin,1),Ee,502,0,[ZN,Dte])}function d4n(){return QR(),F(z(T6e,1),Ee,478,0,[Vre,C6e])}function b4n(){return eO(),F(z($6e,1),Ee,428,0,[nce,WH])}function g4n(){return vO(),F(z(c9e,1),Ee,427,0,[eG,r9e])}function LR(e,n,t,i){return t>=0?e.Rh(n,t,i):e.zh(null,t,i)}function GT(e){return e.b.b==0?e.a.uf():nV(e.b)}function w4n(e){if(e.p!=5)throw R(new is);return Rt(e.f)}function p4n(e){if(e.p!=5)throw R(new is);return Rt(e.k)}function dae(e){return ue(e.a)===ue((JY(),Fce))&&xPn(e),e.a}function x_e(e,n){aj(this,new Se(e.a,e.b)),Mv(this,_T(n))}function Nw(){Sbn.call(this,new b4(z2(12))),tle(!0),this.a=2}function JV(e,n,t){ai(),bw.call(this,e),this.b=n,this.a=t}function bae(e,n,t){Dl(),_P.call(this,n),this.a=e,this.b=t}function m4n(e,n){var t=tte[e.charCodeAt(0)];return t??e}function PR(e,n){return NR(e,"set1"),NR(n,"set2"),new bMe(e,n)}function $R(e,n){return dPe(n),B8n(e,se($t,ni,30,n,15,1),n)}function v4n(e,n){e.b=n,e.c>0&&e.b>0&&(e.g=lR(e.c,e.b,e.a))}function y4n(e,n){e.c=n,e.c>0&&e.b>0&&(e.g=lR(e.c,e.b,e.a))}function A_e(e){var n;n=e.c.d.b,e.b=n,e.a=e.c.d,n.a=e.c.d.b=e}function M_e(e){return e.b==0?null:(at(e.b!=0),$l(e,e.a.a))}function lo(e,n){return n==null?bu(Xc(e.f,null)):Dj(e.i,n)}function C_e(e,n,t,i,r){return new wW(e,(q9(),hte),n,t,i,r)}function HV(e,n,t,i){var r;r=new fNe,n.a[t.g]=r,I4(e.b,i,r)}function T_e(e,n){var t,i;return t=n,i=new si,gVe(e,t,i),i.d}function k4n(e,n){var t;return t=D8n(e.f,n),pi(U$(t),e.f.d)}function qT(e){var n;X8n(e.a),OTe(e.a),n=new OP(e.a),ode(n)}function j4n(e,n){EXe(e,!0),Ao(e.e.Pf(),new Kle(e,!0,n))}function E4n(e,n){return P1(),u(C(n,(Mu(),Dh)),15).a==e}function lc(e){return Math.max(Math.min(e,oi),-2147483648)|0}function O_e(e){X$.call(this),Che(this),this.a=e,this.c=!0}function gae(e,n,t){this.a=new Oe,this.e=e,this.f=n,this.c=t}function RR(e,n,t){this.c=new Oe,this.e=e,this.f=n,this.b=t}function N_e(e,n,t){this.i=new Oe,this.b=e,this.g=n,this.a=t}function I_e(e){this.a=u(Nt(e),277),this.b=(En(),new ole(e))}function B9(){B9=Y;var e,n;n=!yEn(),e=new un,ite=n?new ln:e}function wae(){wae=Y,xnn=new uh,Mnn=new xfe,Ann=new Ab}function dh(){dh=Y,yp=new yse(gy,0),Kd=new yse(by,1)}function Da(){Da=Y,Og=new kse(KZ,0),Qa=new kse("UP",1)}function Iw(){Iw=Y,hb=new Ese(by,0),X3=new Ese(gy,1)}function Uv(e,n,t){BR(),e&&ei(Rce,e,n),e&&ei(eD,e,t)}function pae(e,n,t){var i;i=e.Fh(n),i>=0?e.$h(i,t):ybe(e,n,t)}function D_e(e,n){var t;for(Nt(n),t=e.a;t;t=t.c)n.Wd(t.g,t.i)}function UT(e,n){var t;t=e.q.getHours(),e.q.setDate(n),sS(e,t)}function __e(e){var n;return n=new KP(z2(e.length)),m1e(n,e),n}function S4n(e){function n(){}return n.prototype=e||{},new n}function x4n(e,n){return vze(e,n)?(vBe(e),!0):!1}function O1(e,n){if(n==null)throw R(new c4);return xEn(e,n)}function A4n(e){if(e.ye())return null;var n=e.n;return sJ[n]}function T2(e){return e.Db>>16!=3?null:u(e.Cb,26)}function _a(e){return e.Db>>16!=9?null:u(e.Cb,26)}function L_e(e){return e.Db>>16!=6?null:u(e.Cb,85)}function P_e(e,n){var t;return t=e.Fh(n),t>=0?e.Th(t):jW(e,n)}function GV(e,n,t){var i;i=Bze(e,n,t),e.b=new CB(i.c.length)}function $_e(e){this.a=e,this.b=se(yon,Me,2005,e.e.length,0,2)}function R_e(){this.a=new Fh,this.e=new ar,this.g=0,this.i=0}function B_e(e,n){$$(this),this.f=n,this.g=e,TR(this),this.he()}function z_e(e,n){return e.b+=n.b,e.c+=n.c,e.d+=n.d,e.a+=n.a,e}function mae(e){var n;return n=e.d,n=e._i(e.f),Et(e,n),n.Ob()}function F_e(e,n){var t;return t=new kfe(n),pGe(t,e),new bs(t)}function M4n(e){if(e.p!=0)throw R(new is);return qj(e.f,0)}function C4n(e){if(e.p!=0)throw R(new is);return qj(e.k,0)}function J_e(e){return e.Db>>16!=7?null:u(e.Cb,241)}function vae(e){return e.Db>>16!=7?null:u(e.Cb,174)}function H_e(e){return e.Db>>16!=3?null:u(e.Cb,158)}function z9(e){return e.Db>>16!=6?null:u(e.Cb,241)}function Fi(e){return e.Db>>16!=11?null:u(e.Cb,26)}function O2(e){return e.Db>>16!=17?null:u(e.Cb,29)}function bE(e,n,t,i,r,c){return new L1(e.e,n,e.Jj(),t,i,r,c)}function Kc(e,n,t){return n==null?Ko(e.f,null,t):Bw(e.i,n,t)}function qV(e,n){return k.Math.abs(e)0}function yae(e){var n;return F0(e),n=new ar,li(e,new qke(n))}function G_e(e,n){var t=e.a=e.a||[];return t[n]||(t[n]=e.te(n))}function D4n(e,n){var t;t=e.q.getHours(),e.q.setMonth(n),sS(e,t)}function fc(e,n){e.c&&qo(e.c.g,e),e.c=n,e.c&&Te(e.c.g,e)}function Or(e,n){e.c&&qo(e.c.a,e),e.c=n,e.c&&Te(e.c.a,e)}function Gr(e,n){e.d&&qo(e.d.e,e),e.d=n,e.d&&Te(e.d.e,e)}function wu(e,n){e.i&&qo(e.i.j,e),e.i=n,e.i&&Te(e.i.j,e)}function q_e(e,n,t){this.a=n,this.c=e,this.b=(Nt(t),new bs(t))}function U_e(e,n,t){this.a=n,this.c=e,this.b=(Nt(t),new bs(t))}function X_e(e,n){this.a=e,this.c=pc(this.a),this.b=new DR(n)}function N2(e,n){if(e<0||e>n)throw R(new jo(Qge+e+Wge+n))}function K_e(){K_e=Y,uon=Eo(new or,(zr(),Pc),(Ur(),Cy))}function kae(){kae=Y,oon=Eo(new or,(zr(),Pc),(Ur(),Cy))}function V_e(){V_e=Y,non=Eo(new or,(zr(),Pc),(Ur(),Cy))}function Y_e(){Y_e=Y,ton=Eo(new or,(zr(),Pc),(Ur(),Cy))}function Q_e(){Q_e=Y,ion=Eo(new or,(zr(),Pc),(Ur(),Cy))}function jae(){jae=Y,ron=Eo(new or,(zr(),Pc),(Ur(),Cy))}function W_e(){W_e=Y,xon=qt(new or,(zr(),Pc),(Ur(),tx))}function rl(){rl=Y,Con=qt(new or,(zr(),Pc),(Ur(),tx))}function Z_e(){Z_e=Y,Ton=qt(new or,(zr(),Pc),(Ur(),tx))}function UV(){UV=Y,_on=qt(new or,(zr(),Pc),(Ur(),tx))}function eLe(){eLe=Y,Tsn=Eo(new or,(ny(),Ix),(uS(),cye))}function nLe(){nLe=Y,Uen=Dt((FP(),F(z(qen,1),Ee,537,0,[Zne])))}function BR(){BR=Y,Rce=new wt,eD=new wt,Ugn(ann,new H6)}function _4n(e,n){var t,i;t=n.c,i=t!=null,i&&D4(e,new M2(n.c))}function tLe(e,n){Q3n(e,e.b,e.c),u(e.b.b,68),n&&u(n.b,68).b}function zR(e,n){X(e.Cb,184)&&(u(e.Cb,184).tb=null),Mo(e,n)}function XV(e,n){X(e.Cb,88)&&Y2(Ms(u(e.Cb,88)),4),Mo(e,n)}function L4n(e,n){Q1e(e,n),X(e.Cb,88)&&Y2(Ms(u(e.Cb,88)),2)}function P4n(e,n){return ji(u(e.c,65).c.e.b,u(n.c,65).c.e.b)}function $4n(e,n){return ji(u(e.c,65).c.e.a,u(n.c,65).c.e.a)}function fo(e,n){return Tc(),AY(n)?new uR(n,e):new vT(n,e)}function KV(e,n){e.a&&qo(e.a.k,e),e.a=n,e.a&&Te(e.a.k,e)}function VV(e,n){e.b&&qo(e.b.f,e),e.b=n,e.b&&Te(e.b.f,e)}function N0(e,n,t){NFe(n,t,e.gc()),this.c=e,this.a=n,this.b=t-n}function P4(e){this.c=new xi,this.b=e.b,this.d=e.c,this.a=e.a}function YV(e){this.a=k.Math.cos(e),this.b=k.Math.sin(e)}function Kb(e,n,t,i){this.c=e,this.d=i,KV(this,n),VV(this,t)}function vn(e,n){this.b=(_n(e),e),this.a=(n&cm)==0?n|64|jh:n}function R4n(e,n){QTe(e,Rt(Rr(Sw(n,24),uF)),Rt(Rr(n,uF)))}function XT(e){return yh(),ao(e,0)>=0?J0(e):lE(J0(Od(e)))}function B4n(){return zl(),F(z(Qo,1),Ee,130,0,[Kme,Yo,Vme])}function iLe(e,n,t){return new wW(e,(q9(),ate),null,!1,n,t)}function rLe(e,n,t){return new wW(e,(q9(),dte),n,t,null,!1)}function cLe(e,n,t){var i;NFe(n,t,e.c.length),i=t-n,Goe(e.c,n,i)}function uLe(e,n){var t;return t=u(J2(L4(e.a),n),18),t?t.gc():0}function Eae(e){var n;return F0(e),n=(Tw(),Tw(),ste),dB(e,n)}function oLe(e){for(var n;;)if(n=e.Pb(),!e.Ob())return n}function sLe(e){var n,t;return t=(g9(),n=new gw,n),X9(t,e),t}function lLe(e){var n,t;return t=(g9(),n=new gw,n),X9(t,e),t}function Xv(e){return Cj(),X(e.g,9)?u(e.g,9):null}function z4n(){return $w(),F(z(Bte,1),Ee,368,0,[hp,ub,ap])}function F4n(){return vB(),F(z(y3e,1),Ee,350,0,[v3e,KJ,Vte])}function J4n(){return tg(),F(z(zin,1),Ee,449,0,[iie,E7,L3])}function H4n(){return e8(),F(z(die,1),Ee,302,0,[aie,hie,rI])}function G4n(){return $0(),F(z(bie,1),Ee,329,0,[cI,B3e,ym])}function q4n(){return _1(),F(z(Vin,1),Ee,315,0,[uI,$3,Ty])}function U4n(){return _E(),F(z(I4e,1),Ee,352,0,[Yie,N4e,AH])}function X4n(){return Nc(),F(z(Kun,1),Ee,452,0,[Ax,ys,Io])}function K4n(){return _B(),F(z(q4e,1),Ee,381,0,[H4e,cre,G4e])}function V4n(){return DE(),F(z(U4e,1),Ee,348,0,[ore,ure,vI])}function Y4n(){return u8(),F(z(K4e,1),Ee,349,0,[sre,X4e,Mx])}function Q4n(){return mB(),F(z(Q4e,1),Ee,351,0,[Y4e,lre,V4e])}function W4n(){return LB(),F(z(W4e,1),Ee,382,0,[fre,L7,Im])}function Z4n(){return kE(),F(z(wve,1),Ee,384,0,[Ste,Ete,xte])}function eyn(){return wa(),F(z(dm,1),Ee,237,0,[Ou,No,Nu])}function nyn(){return ws(),F(z(Nnn,1),Ee,461,0,[Oh,rb,qf])}function tyn(){return Uo(),F(z(Dnn,1),Ee,462,0,[ja,cb,Uf])}function iyn(){return IE(),F(z(gye,1),Ee,385,0,[bye,dre,jI])}function ryn(){return xO(),F(z(Hye,1),Ee,386,0,[JH,Fye,Jye])}function cyn(){return VB(),F(z(a6e,1),Ee,387,0,[f6e,qre,l6e])}function uyn(){return DB(),F(z(o6e,1),Ee,303,0,[$re,u6e,c6e])}function oyn(){return ez(),F(z(s6e,1),Ee,436,0,[$x,qH,Rre])}function syn(){return GB(),F(z(L6e,1),Ee,430,0,[D6e,_6e,Qre])}function lyn(){return OO(),F(z(Wre,1),Ee,435,0,[VH,YH,QH])}function fyn(){return uB(),F(z(I6e,1),Ee,429,0,[Yre,N6e,O6e])}function ayn(){return Ra(),F(z(t8e,1),Ee,279,0,[H7,Fm,G7])}function hyn(){return B1(),F(z(b8e,1),Ee,347,0,[lG,Wd,Wx])}function dyn(){return EE(),F(z(y8e,1),Ee,300,0,[qI,Tce,v8e])}function byn(){return V4(),F(z(E8e,1),Ee,281,0,[j8e,Hm,gG])}function La(e){return mu(F(z(Lr,1),Me,8,0,[e.i.n,e.n,e.a]))}function gyn(e,n,t){var i;i=new wc(t.d),pi(i,e),W1e(n,i.a,i.b)}function fLe(e,n,t){var i;i=new gM,i.b=n,i.a=t,++n.b,Te(e.d,i)}function wyn(e,n,t){var i;return i=aS(e,n,!1),i.b<=n&&i.a<=t}function pyn(e){if(e.p!=2)throw R(new is);return Rt(e.f)&yr}function myn(e){if(e.p!=2)throw R(new is);return Rt(e.k)&yr}function kn(e,n){if(e<0||e>=n)throw R(new jo(Qge+e+Wge+n))}function Qn(e,n){if(e<0||e>=n)throw R(new Ioe(Qge+e+Wge+n))}function vyn(e){return e.Db>>16!=6?null:u(xW(e),241)}function aLe(e,n){var t,i;return i=I9(e,n),t=e.a.dd(i),new hMe(e,t)}function yyn(e,n){var t;return t=(_n(e),e).g,gle(!!t),_n(n),t(n)}function kyn(e){return e.a==(J9(),CG)&&UC(e,QIn(e.g,e.b)),e.a}function $4(e){return e.d==(J9(),CG)&&Gue(e,V_n(e.g,e.b)),e.d}function Sae(e,n){jbn.call(this,new b4(z2(e))),sl(n,hYe),this.a=n}function hLe(e,n,t){bw.call(this,25),this.b=e,this.a=n,this.c=t}function cl(e){ai(),bw.call(this,e),this.c=!1,this.a=!1}function dLe(e,n){Gb.call(this,1,2,F(z($t,1),ni,30,15,[e,n]))}function Rr(e,n){return P0(y3n(su(e)?sf(e):e,su(n)?sf(n):n))}function bh(e,n){return P0(k3n(su(e)?sf(e):e,su(n)?sf(n):n))}function QV(e,n){return P0(j3n(su(e)?sf(e):e,su(n)?sf(n):n))}function xae(e,n){return IIe(e.a,n)?gfe(e.b,u(n,23).g,null):null}function Vb(e){return Nt(e),X(e,18)?new bs(u(e,18)):T9(e.Jc())}function WV(e){oR(),this.a=(En(),X(e,59)?new DX(e):new F$(e))}function jyn(e){var n;return n=u(iR(e.b),10),new _l(e.a,n,e.c)}function Eyn(e,n){var t;t=ne(re(e.a.mf((Xt(),cG)))),RVe(e,n,t)}function Syn(e,n){return jE(),e.c==n.c?ji(n.d,e.d):ji(e.c,n.c)}function xyn(e,n){return jE(),e.c==n.c?ji(e.d,n.d):ji(e.c,n.c)}function Ayn(e,n){return jE(),e.c==n.c?ji(e.d,n.d):ji(n.c,e.c)}function Myn(e,n){return jE(),e.c==n.c?ji(n.d,e.d):ji(n.c,e.c)}function Cyn(e,n){e.b=e.b|n.b,e.c=e.c|n.c,e.d=e.d|n.d,e.a=e.a|n.a}function _(e){return at(e.ai?1:0}function gLe(e,n){var t,i;return t=kY(n),i=t,u(zn(e.c,i),15).a}function ZV(e,n,t){var i;i=e.d[n.p],e.d[n.p]=e.d[t.p],e.d[t.p]=i}function Iyn(e,n,t){var i;e.n&&n&&t&&(i=new pL,Te(e.e,i))}function eY(e,n){if(hr(e.a,n),n.d)throw R(new du(PYe));n.d=e}function Cae(e,n){this.a=new Oe,this.d=new Oe,this.f=e,this.c=n}function wLe(){X4(),this.b=new wt,this.a=new wt,this.c=new Oe}function pLe(){this.c=new PTe,this.a=new VPe,this.b=new axe,CMe()}function mLe(e,n,t){this.d=e,this.j=n,this.e=t,this.o=-1,this.p=3}function vLe(e,n,t){this.d=e,this.k=n,this.f=t,this.o=-1,this.p=5}function yLe(e,n,t,i,r,c){The.call(this,e,n,t,i,r),c&&(this.o=-2)}function kLe(e,n,t,i,r,c){Ohe.call(this,e,n,t,i,r),c&&(this.o=-2)}function jLe(e,n,t,i,r,c){Gae.call(this,e,n,t,i,r),c&&(this.o=-2)}function ELe(e,n,t,i,r,c){Dhe.call(this,e,n,t,i,r),c&&(this.o=-2)}function SLe(e,n,t,i,r,c){qae.call(this,e,n,t,i,r),c&&(this.o=-2)}function xLe(e,n,t,i,r,c){Nhe.call(this,e,n,t,i,r),c&&(this.o=-2)}function ALe(e,n,t,i,r,c){Ihe.call(this,e,n,t,i,r),c&&(this.o=-2)}function MLe(e,n,t,i,r,c){Uae.call(this,e,n,t,i,r),c&&(this.o=-2)}function CLe(e,n,t,i){_P.call(this,t),this.b=e,this.c=n,this.d=i}function TLe(e,n){this.f=e,this.a=(J9(),MG),this.c=MG,this.b=n}function OLe(e,n){this.g=e,this.d=(J9(),CG),this.a=CG,this.b=n}function Tae(e,n){!e.c&&(e.c=new tr(e,0)),Vz(e.c,(Si(),fA),n)}function Dyn(e,n){return TOn(e,n,X(n,103)&&(u(n,19).Bb&Ec)!=0)}function _yn(e,n){return rDe(Lu(e.q.getTime()),Lu(n.q.getTime()))}function NLe(e){return rV(e.e.Pd().gc()*e.c.Pd().gc(),16,new W5(e))}function Lyn(e){return!!e.u&&Vu(e.u.a).i!=0&&!(e.n&&FQ(e.n))}function Pyn(e){return!!e.a&&Ts(e.a.a).i!=0&&!(e.b&&JQ(e.b))}function Oae(e,n){return n==0?!!e.o&&e.o.f!=0:LQ(e,n)}function ILe(e){return at(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function gE(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function DLe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(""+e.e):e.c}function qr(e,n){this.a=e,qc.call(this,e),N2(n,e.gc()),this.b=n}function _Le(e){this.a=se(Mr,On,1,b1e(k.Math.max(8,e))<<1,5,1)}function LLe(e){FY.call(this,e,(q9(),fte),null,!1,null,!1)}function PLe(e,n){var t;return t=1-n,e.a[t]=MB(e.a[t],t),MB(e,n)}function $Le(e,n){var t,i;return i=Rr(e,Dc),t=qh(n,32),bh(t,i)}function $yn(e,n,t){var i;return i=u(e.Zb().xc(n),18),!!i&&i.Gc(t)}function RLe(e,n,t){var i;return i=u(e.Zb().xc(n),18),!!i&&i.Kc(t)}function BLe(e,n,t){var i;i=(Nt(e),new bs(e)),pxn(new q_e(i,n,t))}function VT(e,n,t){var i;i=(Nt(e),new bs(e)),mxn(new U_e(i,n,t))}function Ryn(e,n,t){e.a=n,e.c=t,e.b.a.$b(),qs(e.d),r2(e.e.a.c,0)}function zLe(e,n){var t;e.e=new Soe,t=W2(n),Tr(t,e.c),aXe(e,t,0)}function Byn(e,n){return new eV(n,OOe(pc(n.e),e,e),($n(),!0))}function zyn(e,n){return H4(),u(C(n,(Mu(),K3)),15).a>=e.gc()}function Fyn(e){return rl(),!uc(e)&&!(!uc(e)&&e.c.i.c==e.d.i.c)}function gh(e){return u(Ba(e,se(w7,Y8,17,e.c.length,0,1)),323)}function Jyn(e){XFe((!e.a&&(e.a=new we(Ft,e,10,11)),e.a),new _M)}function Nae(){var e,n,t;return n=(t=(e=new gw,e),t),Te(u7e,n),n}function xu(e,n,t,i,r,c){return ZBe(e,n,t,c),H1e(e,i),G1e(e,r),e}function FLe(e,n,t,i){return e.a+=""+of(n==null?Vo:fu(n),t,i),e}function YT(e,n){if(e<0||e>=n)throw R(new jo(nTn(e,n)));return e}function JLe(e,n,t){if(e<0||nt)throw R(new jo(jCn(e,n,t)))}function xe(e,n,t,i){var r;r=new JM,r.a=n,r.b=t,r.c=i,Vt(e.b,r)}function qi(e,n,t,i){var r;r=new JM,r.a=n,r.b=t,r.c=i,Vt(e.a,r)}function Hyn(e,n,t){var i;i=GEn();try{return Qpn(e,n,t)}finally{u9n(i)}}function Qb(e){var n;return su(e)?(n=e,n==-0?0:n):i8n(e)}function HLe(e,n){return X(n,45)?XQ(e.a,u(n,45)):!1}function GLe(e,n){return X(n,45)?XQ(e.a,u(n,45)):!1}function qLe(e,n){return X(n,45)?XQ(e.a,u(n,45)):!1}function Gyn(e,n){return e.a<=e.b?(n.Bd(e.a++),!0):!1}function qyn(e){return qv(e).dc()?!1:(Dwn(e,new ae),!0)}function Iae(e){var n;return T0(e),n=new tt,Ov(e.a,new Jke(n)),n}function FR(e){var n;return T0(e),n=new ut,Ov(e.a,new Hke(n)),n}function Uyn(e){if(!("stack"in e))try{throw e}catch{}return e}function JR(e){return new xo((sl(e,wZ),hB(mc(mc(5,e),e/10|0))))}function ULe(e){return u(Ba(e,se(uin,fQe,12,e.c.length,0,1)),2004)}function Xyn(e){return rV(e.e.Pd().gc()*e.c.Pd().gc(),273,new HU(e))}function XLe(){XLe=Y,Rln=Dt((n$(),F(z(P6e,1),Ee,477,0,[Zre])))}function KLe(){KLe=Y,zln=Dt((t$(),F(z(Bln,1),Ee,546,0,[ece])))}function VLe(){VLe=Y,rfn=Dt((Tj(),F(z(i9e,1),Ee,527,0,[OI])))}function YLe(){YLe=Y,eye=TDe(ke(1),ke(4)),Z4e=TDe(ke(1),ke(2))}function HR(){HR=Y,Are=new Sse("DFS",0),Pye=new Sse("BFS",1)}function GR(){GR=Y,gie=new wse(H8,0),z3e=new wse("TOP_LEFT",1)}function Dae(e,n,t){this.d=new iEe(this),this.e=e,this.i=n,this.f=t}function _ae(e,n,t,i){this.d=e,this.n=n,this.g=t,this.o=i,this.p=-1}function Kyn(e,n,t){e.d&&qo(e.d.e,e),e.d=n,e.d&&zb(e.d.e,t,e)}function Vyn(e,n,t){var i;return i=g8(t),Hz(e.n,i,n),Hz(e.o,n,t),n}function F9(e,n){var t,i;return t=L2(e,n),i=null,t&&(i=t.qe()),i}function wE(e,n){var t,i;return t=O1(e,n),i=null,t&&(i=t.qe()),i}function Dw(e,n){var t,i;return t=O1(e,n),i=null,t&&(i=t.ne()),i}function N1(e,n){var t,i;return t=O1(e,n),i=null,t&&(i=I0e(t)),i}function pE(e,n){zRn(n,e),afe(e.d),afe(u(C(e,(Ie(),vH)),213))}function nY(e,n){FRn(n,e),hfe(e.d),hfe(u(C(e,(Ie(),vH)),213))}function I0(e,n){_n(n),e.b=e.b-1&e.a.length-1,ir(e.a,e.b,n),jHe(e)}function Lae(e,n){_n(n),ir(e.a,e.c,n),e.c=e.c+1&e.a.length-1,jHe(e)}function jt(e){return at(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function QLe(e){if(e.e.g!=e.b)throw R(new Nl);return!!e.c&&e.d>0}function I2(e){return X(e,18)?u(e,18).dc():!e.Jc().Ob()}function Yyn(e){return new vn(_8n(u(e.a.kd(),18).gc(),e.a.jd()),16)}function WLe(e){var n;n=e.Dh(),this.a=X(n,72)?u(n,72).Gi():n.Jc()}function Pae(e,n){var t;return t=u($a(e.b,n),66),!t&&(t=new xi),t}function Qyn(e,n){var t;t=n.a,fc(t,n.c.d),Gr(t,n.d.d),R2(t.a,e.n)}function ZLe(e,n,t,i){return X(t,59)?new jOe(e,n,t,i):new Nfe(e,n,t,i)}function Wyn(){return zf(),F(z(Sin,1),Ee,413,0,[mm,m7,v7,Rte])}function Zyn(){return Rw(),F(z(rtn,1),Ee,409,0,[VN,KN,mte,vte])}function e6n(){return n8(),F(z(Ktn,1),Ee,408,0,[fp,gm,bm,O3])}function n6n(){return q9(),F(z(gJ,1),Ee,309,0,[fte,ate,hte,dte])}function t6n(){return W4(),F(z(yve,1),Ee,383,0,[ex,vve,Ote,Nte])}function i6n(){return $B(),F(z(din,1),Ee,367,0,[$te,JJ,HJ,eI])}function r6n(){return zE(),F(z(m3e,1),Ee,301,0,[rx,w3e,tI,p3e])}function c6n(){return U2(),F(z(Wie,1),Ee,203,0,[MH,Qie,U3,q3])}function u6n(){return F1(),F(z(F4e,1),Ee,269,0,[fb,z4e,nre,tre])}function o6n(){return rg(),F(z(mon,1),Ee,404,0,[yI,Cx,NH,OH])}function s6n(e){var n;return e.j==(De(),bt)&&(n=Zqe(e),cs(n,et))}function l6n(){return ny(),F(z(iye,1),Ee,398,0,[LH,Nx,Ix,Dx])}function ePe(e,n){return u(Js(S2(u(vi(e.k,n),16).Mc(),I3)),113)}function nPe(e,n){return u(Js(O4(u(vi(e.k,n),16).Mc(),I3)),113)}function f6n(e,n){return k4(new Se(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)}function a6n(){return Ez(),F(z(uln,1),Ee,401,0,[Jre,Bre,Fre,zre])}function h6n(){return dz(),F(z(r6e,1),Ee,354,0,[Pre,t6e,i6e,n6e])}function d6n(){return NE(),F(z(Lye,1),Ee,353,0,[xre,zH,Sre,Ere])}function b6n(){return s8(),F(z(n8e,1),Ee,278,0,[BI,sG,Z9e,e8e])}function g6n(){return z1(),F(z(Mce,1),Ee,222,0,[Ace,zI,q7,Vy])}function w6n(){return fl(),F(z(Zfn,1),Ee,292,0,[JI,l1,gb,FI])}function p6n(){return KR(),F(z(YI,1),Ee,288,0,[S8e,A8e,Nce,x8e])}function m6n(){return Vs(),F(z(iA,1),Ee,380,0,[XI,_g,UI,Jm])}function v6n(){return YB(),F(z(O8e,1),Ee,326,0,[Ice,M8e,T8e,C8e])}function y6n(){return RB(),F(z(pan,1),Ee,407,0,[Dce,I8e,N8e,D8e])}function Ll(e,n,t){return n<0?jW(e,t):u(t,69).uk().zk(e,e.ei(),n)}function k6n(e,n,t){var i;return i=g8(t),Hz(e.f,i,n),ei(e.g,n,t),n}function j6n(e,n,t){var i;return i=g8(t),Hz(e.p,i,n),ei(e.q,n,t),n}function tPe(e){var n,t;return n=(j0(),t=new kv,t),e&&_z(n,e),n}function $ae(e){var n;return n=e.$i(e.i),e.i>0&&Wu(e.g,0,n,0,e.i),n}function R4(e){return Cj(),X(e.g,156)?u(e.g,156):null}function E6n(e){return BR(),so(Rce,e)?u(zn(Rce,e),342).Pg():null}function S6n(e){e.a=null,e.e=null,r2(e.b.c,0),r2(e.f.c,0),e.c=null}function iPe(e,n){var t;for(t=e.j.c.length;t>24}function A6n(e){if(e.p!=1)throw R(new is);return Rt(e.k)<<24>>24}function M6n(e){if(e.p!=7)throw R(new is);return Rt(e.k)<<16>>16}function C6n(e){if(e.p!=7)throw R(new is);return Rt(e.f)<<16>>16}function Kv(e,n){return n.e==0||e.e==0?VS:(C8(),TW(e,n))}function uPe(e,n){return ue(n)===ue(e)?"(this Map)":n==null?Vo:fu(n)}function T6n(e,n,t){return bV(re(bu(Xc(e.f,n))),re(bu(Xc(e.f,t))))}function O6n(e,n,t){var i;i=u(zn(e.g,t),60),Te(e.a.c,new jc(n,i))}function oPe(e,n){var t;return t=new h4,e.Ed(t),t.a+="..",n.Fd(t),t.a}function ha(e){var n;for(n=0;e.Ob();)e.Pb(),n=mc(n,1);return hB(n)}function N6n(e,n,t,i,r){var c;c=HOn(r,t,i),Te(n,XCn(r,c)),FMn(e,r,n)}function sPe(e,n,t){e.i=0,e.e=0,n!=t&&(qze(e,n,t),Gze(e,n,t))}function lPe(e,n,t,i){this.e=null,this.c=e,this.d=n,this.a=t,this.b=i}function Rae(e,n,t,i,r){this.i=e,this.a=n,this.e=t,this.j=i,this.f=r}function fPe(e,n){hae.call(this),this.a=e,this.b=n,Te(this.a.b,this)}function I1(e,n){yh(),Gb.call(this,e,1,F(z($t,1),ni,30,15,[n]))}function I6n(e,n,t){return N8(e,n,t,X(n,103)&&(u(n,19).Bb&Ec)!=0)}function qR(e,n,t){return qz(e,n,t,X(n,103)&&(u(n,19).Bb&Ec)!=0)}function D6n(e,n,t){return LOn(e,n,t,X(n,103)&&(u(n,19).Bb&Ec)!=0)}function Bae(e,n){return e==(Fn(),Wi)&&n==Wi?4:e==Wi||n==Wi?8:32}function _6n(e,n){return u(n==null?bu(Xc(e.f,null)):Dj(e.i,n),290)}function aPe(e,n){var t;for(t=n;t;)m2(e,t.i,t.j),t=Fi(t);return e}function Vu(e){return e.n||(Ms(e),e.n=new RIe(e,Rc,e),tu(e)),e.n}function Kh(e,n){Tc();var t;return t=u(e,69).tk(),eCn(t,n),t.vl(n)}function mE(e){return at(e.a"+Aae(e.d):"e_"+jw(e)}function P6n(e,n){var t;return t=n!=null?lo(e,n):bu(Xc(e.f,n)),I$(t)}function $6n(e,n){var t;return t=n!=null?lo(e,n):bu(Xc(e.f,n)),I$(t)}function gPe(e,n){var t;for(t=0;t=0&&e.a[t]===n[t];t--);return t<0}function J6n(e,n){var t,i;i=!1;do t=Dze(e,n),i=i|t;while(t);return i}function vE(){vE=Y,Ox=new vse("UPPER",0),Tx=new vse("LOWER",1)}function XR(){XR=Y,xie=new pse(va,0),Sie=new pse("ALTERNATING",1)}function KR(){KR=Y,S8e=new wIe,A8e=new WIe,Nce=new S_e,x8e=new ZIe}function pPe(){pPe=Y,Lin=Dt((iB(),F(z(g3e,1),Ee,422,0,[b3e,Kte])))}function mPe(){mPe=Y,Bin=Dt((hO(),F(z(S3e,1),Ee,419,0,[VJ,E3e])))}function vPe(){vPe=Y,Hin=Dt((uO(),F(z(M3e,1),Ee,476,0,[A3e,QJ])))}function yPe(){yPe=Y,Qin=Dt((GR(),F(z(F3e,1),Ee,420,0,[gie,z3e])))}function kPe(){kPe=Y,ern=Dt((XR(),F(z(n5e,1),Ee,423,0,[xie,Sie])))}function jPe(){jPe=Y,Xun=Dt((sO(),F(z(J4e,1),Ee,421,0,[ire,rre])))}function EPe(){EPe=Y,Son=Dt((vE(),F(z(Eon,1),Ee,518,0,[Ox,Tx])))}function SPe(){SPe=Y,Don=Dt((Da(),F(z(Ion,1),Ee,508,0,[Og,Qa])))}function xPe(){xPe=Y,Non=Dt((dh(),F(z(Oon,1),Ee,509,0,[yp,Kd])))}function APe(){APe=Y,Kon=Dt((da(),F(z(Xon,1),Ee,515,0,[Dm,ab])))}function MPe(){MPe=Y,nsn=Dt((Iw(),F(z(esn,1),Ee,454,0,[hb,X3])))}function CPe(){CPe=Y,Csn=Dt((HR(),F(z($ye,1),Ee,425,0,[Are,Pye])))}function TPe(){TPe=Y,Dsn=Dt((AB(),F(z(Rye,1),Ee,487,0,[FH,Y3])))}function OPe(){OPe=Y,Psn=Dt((cB(),F(z(zye,1),Ee,426,0,[Bye,Ire])))}function NPe(){NPe=Y,Iln=Dt((QR(),F(z(T6e,1),Ee,478,0,[Vre,C6e])))}function IPe(){IPe=Y,Fln=Dt((eO(),F(z($6e,1),Ee,428,0,[nce,WH])))}function DPe(){DPe=Y,cfn=Dt((vO(),F(z(c9e,1),Ee,427,0,[eG,r9e])))}function _Pe(){_Pe=Y,btn=Dt((aB(),F(z(nve,1),Ee,424,0,[yte,vJ])))}function LPe(){LPe=Y,fin=Dt((Y9(),F(z(lin,1),Ee,502,0,[ZN,Dte])))}function VR(e){w0e(),QTe(this,Rt(Rr(Sw(e,24),uF)),Rt(Rr(e,uF)))}function H6n(e){return(e.k==(Fn(),Wi)||e.k==wr)&&wi(e,(me(),sx))}function G6n(e,n,t){return u(n==null?Ko(e.f,null,t):Bw(e.i,n,t),290)}function q6n(){return vr(),F(z(Yx,1),Ee,86,0,[nh,ru,Zc,eh,Vl])}function U6n(){return De(),F(z(xc,1),qu,64,0,[ju,Kn,et,bt,Vn])}function X6n(e){return GP(),function(){return Hyn(e,this,arguments)}}function PPe(e,n){var t;return t=n.jd(),new pw(t,e.e.pc(t,u(n.kd(),18)))}function $Pe(e,n){var t,i;return t=n.jd(),i=e.De(t),!!i&&Ku(i.e,n.kd())}function cc(e,n){var t,i;for(_n(n),i=e.Jc();i.Ob();)t=i.Pb(),n.Ad(t)}function ul(e,n,t){var i;return i=(kn(n,e.c.length),e.c[n]),e.c[n]=t,i}function Hae(e,n){var t,i;for(t=n,i=0;t>0;)i+=e.a[t],t-=t&-t;return i}function RPe(e,n){var t;for(t=n;t;)m2(e,-t.i,-t.j),t=Fi(t);return e}function K6n(e,n){var t;return t=e.a.get(n),t??se(Mr,On,1,0,5,1)}function Vv(e,n){return(F0(e),w9(new mn(e,new whe(n,e.a)))).zd(Sy)}function V6n(){return zr(),F(z(pve,1),Ee,363,0,[Xf,c1,eo,no,Pc])}function BPe(e){nYe(),VSe(this),this.a=new xi,x1e(this,e),Vt(this.a,e)}function zPe(){CK(this),this.b=new Se(Vi,Vi),this.a=new Se(Ir,Ir)}function oY(e){YR(),!Va&&(this.c=e,this.e=!0,this.a=new Oe)}function YR(){YR=Y,Va=!0,mnn=!1,vnn=!1,knn=!1,ynn=!1}function QR(){QR=Y,Vre=new Mse(bwe,0),C6e=new Mse("TARGET_WIDTH",1)}function Y6n(){return kz(),F(z(_sn,1),Ee,364,0,[Ore,Mre,Nre,Cre,Tre])}function Q6n(){return X2(),F(z(Ain,1),Ee,371,0,[nI,UJ,XJ,qJ,GJ])}function W6n(){return GE(),F(z(_4e,1),Ee,328,0,[D4e,Zie,ere,Ex,Sx])}function Z6n(){return Xs(),F(z(e5e,1),Ee,165,0,[fI,ax,V1,hx,Sg])}function e9n(){return tS(),F(z(Lln,1),Ee,369,0,[Q3,Jy,Hx,Jx,TI])}function n9n(){return GO(),F(z(F6e,1),Ee,330,0,[R6e,tce,z6e,ice,B6e])}function t9n(){return vh(),F(z(Wa,1),Ee,160,0,[Cn,fr,xa,Yd,Q1])}function i9n(){return u3(),F(z(eA,1),Ee,257,0,[wb,HI,g8e,Zx,w8e])}function sY(e,n){var t;return t=u($a(e.d,n),21),t||u($a(e.e,n),21)}function FPe(e){this.b=e,st.call(this,e),this.a=u(Xn(this.b.a,4),129)}function JPe(e){this.b=e,E4.call(this,e),this.a=u(Xn(this.b.a,4),129)}function HPe(e,n){this.c=0,this.b=n,uTe.call(this,e,17493),this.a=this.c}function Lf(e,n,t,i,r){YPe.call(this,n,i,r),this.c=e,this.b=t}function Gae(e,n,t,i,r){mLe.call(this,n,i,r),this.c=e,this.a=t}function qae(e,n,t,i,r){vLe.call(this,n,i,r),this.c=e,this.a=t}function Uae(e,n,t,i,r){YPe.call(this,n,i,r),this.c=e,this.a=t}function Xae(e,n,t){e.a.c.length=0,OPn(e,n,t),e.a.c.length==0||t_n(e,n)}function QT(e){e.i=0,uT(e.b,null),uT(e.c,null),e.a=null,e.e=null,++e.g}function r9n(e){return e.e=3,e.d=e.Yb(),e.e!=2?(e.e=0,!0):!1}function Kae(e,n){return X(n,144)?gn(e.c,u(n,144).c):!1}function GPe(e){var n;return e.c||(n=e.r,X(n,88)&&(e.c=u(n,29))),e.c}function Ms(e){return e.t||(e.t=new RSe(e),RE(new tAe(e),0,e.t)),e.t}function uc(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function B4(e,n){return n==0||e.e==0?e:n>0?aJe(e,n):WUe(e,-n)}function Vae(e,n){return n==0||e.e==0?e:n>0?WUe(e,n):aJe(e,-n)}function rt(e){if(ht(e))return e.c=e.a,e.a.Pb();throw R(new hu)}function qPe(e){var n;return n=e.length,gn(Rn.substr(Rn.length-n,n),e)}function UPe(e){var n,t;return n=e.c.i,t=e.d.i,n.k==(Fn(),wr)&&t.k==wr}function lY(e){var n,t,i;return n=e&Ls,t=e>>22&Ls,i=e<0?G1:0,_o(n,t,i)}function c9n(e,n){var t,i;t=u(Zkn(e.c,n),18),t&&(i=t.gc(),t.$b(),e.d-=i)}function u9n(e){e&&s8n((Coe(),yme)),--lJ,e&&fJ!=-1&&(qgn(fJ),fJ=-1)}function Yae(e){$gn.call(this,e==null?Vo:fu(e),X(e,80)?u(e,80):null)}function fY(e){var n;return n=new Ow,Pu(n,e),he(n,(Ie(),Wc),null),n}function aY(e,n,t){var i;return i=e.Fh(n),i>=0?e.Ih(i,t,!0):Xw(e,n,t)}function o9n(e,n,t){return ji(k4(w8(e),pc(n.b)),k4(w8(e),pc(t.b)))}function s9n(e,n,t){return ji(k4(w8(e),pc(n.e)),k4(w8(e),pc(t.e)))}function l9n(e,n){return k.Math.min(_0(n.a,e.d.d.c),_0(n.b,e.d.d.c))}function XPe(e,n,t){var i;i=new Vse(e.a),AE(i,e.a.a),Ko(i.f,n,t),e.a.a=i}function Qae(e,n,t,i){var r;for(r=0;rn)throw R(new jo(F0e(e,n,"index")));return e}function ehe(e){var n;return n=e.e+e.f,isNaN(n)&&V$(e.d)?e.d:n}function a9n(e,n){var t;t=e.q.getHours()+(n/60|0),e.q.setMinutes(n),sS(e,t)}function nhe(e,n){var t,i;return t=(_n(e),e),i=(_n(n),n),t==i?0:tn.p?-1:0}function t$e(e,n){return so(e.a,n)?(z4(e.a,n),!0):!1}function g9n(e){var n,t;return n=e.jd(),t=u(e.kd(),18),DT(t.Lc(),new n9(n))}function dY(e){var n;return n=e.b,n.b==0?null:u(Yu(n,0),65).b}function eB(e,n){return _n(n),e.c=0,"Initial capacity must not be negative")}function tB(){tB=Y,Gx=new ki("org.eclipse.elk.labels.labelManager")}function r$e(){r$e=Y,l3e=new Pi("separateLayerConnections",($B(),$te))}function da(){da=Y,Dm=new jse("REGULAR",0),ab=new jse("CRITICAL",1)}function eO(){eO=Y,nce=new Cse("FIXED",0),WH=new Cse("CENTER_NODE",1)}function iB(){iB=Y,b3e=new dse("QUADRATIC",0),Kte=new dse("SCANLINE",1)}function c$e(){c$e=Y,$in=Dt((vB(),F(z(y3e,1),Ee,350,0,[v3e,KJ,Vte])))}function u$e(){u$e=Y,Fin=Dt((tg(),F(z(zin,1),Ee,449,0,[iie,E7,L3])))}function o$e(){o$e=Y,Xin=Dt((e8(),F(z(die,1),Ee,302,0,[aie,hie,rI])))}function s$e(){s$e=Y,Kin=Dt(($0(),F(z(bie,1),Ee,329,0,[cI,B3e,ym])))}function l$e(){l$e=Y,Yin=Dt((_1(),F(z(Vin,1),Ee,315,0,[uI,$3,Ty])))}function f$e(){f$e=Y,Iin=Dt(($w(),F(z(Bte,1),Ee,368,0,[hp,ub,ap])))}function a$e(){a$e=Y,Jun=Dt((_E(),F(z(I4e,1),Ee,352,0,[Yie,N4e,AH])))}function h$e(){h$e=Y,Vun=Dt((Nc(),F(z(Kun,1),Ee,452,0,[Ax,ys,Io])))}function d$e(){d$e=Y,Yun=Dt((_B(),F(z(q4e,1),Ee,381,0,[H4e,cre,G4e])))}function b$e(){b$e=Y,Qun=Dt((DE(),F(z(U4e,1),Ee,348,0,[ore,ure,vI])))}function g$e(){g$e=Y,Wun=Dt((u8(),F(z(K4e,1),Ee,349,0,[sre,X4e,Mx])))}function w$e(){w$e=Y,Zun=Dt((mB(),F(z(Q4e,1),Ee,351,0,[Y4e,lre,V4e])))}function p$e(){p$e=Y,eon=Dt((LB(),F(z(W4e,1),Ee,382,0,[fre,L7,Im])))}function m$e(){m$e=Y,rsn=Dt((IE(),F(z(gye,1),Ee,385,0,[bye,dre,jI])))}function v$e(){v$e=Y,$sn=Dt((xO(),F(z(Hye,1),Ee,386,0,[JH,Fye,Jye])))}function y$e(){y$e=Y,rln=Dt((DB(),F(z(o6e,1),Ee,303,0,[$re,u6e,c6e])))}function k$e(){k$e=Y,cln=Dt((ez(),F(z(s6e,1),Ee,436,0,[$x,qH,Rre])))}function j$e(){j$e=Y,Dln=Dt((uB(),F(z(I6e,1),Ee,429,0,[Yre,N6e,O6e])))}function E$e(){E$e=Y,_ln=Dt((GB(),F(z(L6e,1),Ee,430,0,[D6e,_6e,Qre])))}function S$e(){S$e=Y,$ln=Dt((OO(),F(z(Wre,1),Ee,435,0,[VH,YH,QH])))}function x$e(){x$e=Y,fln=Dt((VB(),F(z(a6e,1),Ee,387,0,[f6e,qre,l6e])))}function A$e(){A$e=Y,ztn=Dt((kE(),F(z(wve,1),Ee,384,0,[Ste,Ete,xte])))}function M$e(){M$e=Y,jnn=Dt((zl(),F(z(Qo,1),Ee,130,0,[Kme,Yo,Vme])))}function C$e(){C$e=Y,Onn=Dt((wa(),F(z(dm,1),Ee,237,0,[Ou,No,Nu])))}function T$e(){T$e=Y,Inn=Dt((ws(),F(z(Nnn,1),Ee,461,0,[Oh,rb,qf])))}function O$e(){O$e=Y,_nn=Dt((Uo(),F(z(Dnn,1),Ee,462,0,[ja,cb,Uf])))}function N$e(){N$e=Y,Kfn=Dt((Ra(),F(z(t8e,1),Ee,279,0,[H7,Fm,G7])))}function I$e(){I$e=Y,dan=Dt((V4(),F(z(E8e,1),Ee,281,0,[j8e,Hm,gG])))}function D$e(){D$e=Y,Wfn=Dt((B1(),F(z(b8e,1),Ee,347,0,[lG,Wd,Wx])))}function _$e(){_$e=Y,fan=Dt((EE(),F(z(y8e,1),Ee,300,0,[qI,Tce,v8e])))}function ba(e,n){return!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),xQ(e.o,n)}function p9n(e){return!e.g&&(e.g=new G6),!e.g.d&&(e.g.d=new LSe(e)),e.g.d}function m9n(e){return!e.g&&(e.g=new G6),!e.g.b&&(e.g.b=new _Se(e)),e.g.b}function nO(e){return!e.g&&(e.g=new G6),!e.g.c&&(e.g.c=new $Se(e)),e.g.c}function v9n(e){return!e.g&&(e.g=new G6),!e.g.a&&(e.g.a=new PSe(e)),e.g.a}function y9n(e,n,t,i){return t&&(i=t.Oh(n,Ji(t.Ah(),e.c.sk()),null,i)),i}function k9n(e,n,t,i){return t&&(i=t.Qh(n,Ji(t.Ah(),e.c.sk()),null,i)),i}function bY(e,n,t,i){var r;return r=se($t,ni,30,n+1,15,1),$_n(r,e,n,t,i),r}function se(e,n,t,i,r,c){var o;return o=dHe(r,i),r!=10&&F(z(e,c),n,t,r,o),o}function j9n(e,n,t){var i,r;for(r=new W9(n,e),i=0;it||n=0?e.Ih(t,!0,!0):Xw(e,n,!0)}function tO(e,n){var t,i,r;return r=e.r,i=e.d,t=aS(e,n,!0),t.b!=r||t.a!=i}function R$e(e,n){return $Me(e.e,n)||ug(e.e,n,new $Je(n)),u($a(e.e,n),113)}function Cs(e,n,t,i){return _n(e),_n(n),_n(t),_n(i),new Bfe(e,n,new Fu)}function iO(e,n,t){var i,r;return r=(i=x8(e.b,n),i),r?Yz(lO(e,r),t):null}function R9n(e,n,t){var i,r,c;i=O1(e,t),r=null,i&&(r=I0e(i)),c=r,_Je(n,t,c)}function B9n(e,n,t){var i,r,c;i=O1(e,t),r=null,i&&(r=I0e(i)),c=r,_Je(n,t,c)}function os(e,n,t,i){this.$j(),this.a=n,this.b=e,this.c=new Lfe(this,n,t,i)}function mY(e,n,t,i,r,c){_ae.call(this,n,i,r,c),this.c=e,this.b=t}function rO(e,n,t,i,r,c){_ae.call(this,n,i,r,c),this.c=e,this.a=t}function ghe(e,n,t,i,r){FTe(this),this.b=e,this.d=n,this.f=t,this.g=i,this.c=r}function whe(e,n){D$.call(this,n.xd(),n.wd()&-16449),_n(e),this.a=e,this.c=n}function z9n(e,n){e.a.Le(n.d,e.b)>0&&(Te(e.c,new ofe(n.c,n.d,e.d)),e.b=n.d)}function vY(e){e.a=se($t,ni,30,e.b+1,15,1),e.c=se($t,ni,30,e.b,15,1),e.d=0}function F9n(e,n,t){var i;return i=Bze(e,n,t),e.b=new CB(i.c.length),Ibe(e,i)}function J9n(e){if(e.b<=0)throw R(new hu);return--e.b,e.a-=e.c.c,ke(e.a)}function H9n(e){var n;if(!e.a)throw R(new l_e);return n=e.a,e.a=Fi(e.a),n}function B$e(e){var n;if(e.ll())for(n=e.i-1;n>=0;--n)K(e,n);return $ae(e)}function J4(e){var n;return Nt(e),X(e,204)?(n=u(e,204),n):new t9(e)}function G9n(e){for(;!e.a;)if(!SNe(e.c,new Gke(e)))return!1;return!0}function phe(e,n){if(e.g==null||n>=e.i)throw R(new EK(n,e.i));return e.g[n]}function z$e(e,n,t){if(r8(e,t),t!=null&&!e.dk(t))throw R(new gX);return t}function yY(e,n){return aO(n)!=10&&F(Us(n),n.Qm,n.__elementTypeId$,aO(n),e),e}function F$e(e,n){var t,i;return i=n/e.c.Pd().gc()|0,t=n%e.c.Pd().gc(),F4(e,i,t)}function G9(e,n,t,i){var r;i=(Tw(),i||Fme),r=e.slice(n,t),J0e(r,e,n,t,-n,i)}function Pl(e,n,t,i,r){return n<0?Xw(e,t,i):u(t,69).uk().wk(e,e.ei(),n,i,r)}function q9n(e,n){return ji(ne(re(C(e,(me(),gp)))),ne(re(C(n,gp))))}function J$e(){J$e=Y,wnn=Dt((q9(),F(z(gJ,1),Ee,309,0,[fte,ate,hte,dte])))}function q9(){q9=Y,fte=new o$("All",0),ate=new MTe,hte=new BTe,dte=new CTe}function ws(){ws=Y,Oh=new UX(by,0),rb=new UX(H8,1),qf=new UX(gy,2)}function H$e(){H$e=Y,Uz(),b7e=Vi,yhn=Ir,g7e=new Zn(Vi),khn=new Zn(Ir)}function rB(){rB=Y,sfn=new yv,ffn=new tL,lfn=ckn((Xt(),Ece),sfn,bb,ffn)}function U9n(e){rB(),u(e.mf((Xt(),Rm)),182).Ec((ps(),GI)),e.of(Ece,null)}function X9n(e){return X(e,180)?""+u(e,180).a:e==null?null:fu(e)}function K9n(e){return X(e,180)?""+u(e,180).a:e==null?null:fu(e)}function mhe(e){var n,t;if(!e.b)return null;for(t=e.b;n=t.a[0];)t=n;return t}function G$e(e){var n,t;if(!e.b)return null;for(t=e.b;n=t.a[1];)t=n;return t}function cO(e){var n;for(n=e.p+1;n=0?sz(e,t,!0,!0):Xw(e,n,!0)}function e8n(e,n){A4(u(u(e.f,26).mf((Xt(),Vx)),102))&&XFe(iae(u(e.f,26)),n)}function mRe(e,n){Os(e,n==null||V$((_n(n),n))||isNaN((_n(n),n))?0:(_n(n),n))}function vRe(e,n){Ns(e,n==null||V$((_n(n),n))||isNaN((_n(n),n))?0:(_n(n),n))}function yRe(e,n){Pw(e,n==null||V$((_n(n),n))||isNaN((_n(n),n))?0:(_n(n),n))}function kRe(e,n){Lw(e,n==null||V$((_n(n),n))||isNaN((_n(n),n))?0:(_n(n),n))}function jRe(e){(this.q?this.q:(En(),En(),r1)).zc(e.q?e.q:(En(),En(),r1))}function xY(e,n,t){var i;return i=e.g[n],Qj(e,n,e.Xi(n,t)),e.Pi(n,t,i),e.Li(),i}function fB(e,n){var t;return t=e.bd(n),t>=0?(e.ed(t),!0):!1}function AY(e){var n;return e.d!=e.r&&(n=ff(e),e.e=!!n&&n.jk()==een,e.d=n),e.e}function MY(e,n){var t;for(Nt(e),Nt(n),t=!1;n.Ob();)t=t|e.Ec(n.Pb());return t}function $a(e,n){var t;return t=u(zn(e.e,n),393),t?(YTe(e,t),t.e):null}function ERe(e){var n,t;return n=e/60|0,t=e%60,t==0?""+n:""+n+":"+(""+t)}function lu(e,n){var t,i;return F0(e),i=new the(n,e.a),t=new jNe(i),new mn(e,t)}function L2(e,n){var t=e.a[n],i=(WY(),rte)[typeof t];return i?i(t):F1e(typeof t)}function n8n(e,n){var t,i,r;r=n.c.i,t=u(zn(e.f,r),60),i=t.d.c-t.e.c,Zhe(n.a,i,0)}function Vh(e,n,t){var i,r;for(i=10,r=0;r=0;)++n[0]}function CRe(e,n,t,i){ai(),bw.call(this,26),this.c=e,this.a=n,this.d=t,this.b=i}function L1(e,n,t,i,r,c,o){DY.call(this,n,i,r,c,o),this.c=e,this.b=t}function TRe(e){this.g=e,this.f=new Oe,this.a=k.Math.min(this.g.c.c,this.g.d.c)}function jE(){jE=Y,Wtn=new Ip,Ztn=new Dp,Ytn=new _p,Qtn=new Lp,ein=new xl}function aB(){aB=Y,yte=new fse("EADES",0),vJ=new fse("FRUCHTERMAN_REINGOLD",1)}function hO(){hO=Y,VJ=new bse("READING_DIRECTION",0),E3e=new bse("ROTATION",1)}function ORe(){ORe=Y,Min=Dt((X2(),F(z(Ain,1),Ee,371,0,[nI,UJ,XJ,qJ,GJ])))}function NRe(){NRe=Y,Gun=Dt((GE(),F(z(_4e,1),Ee,328,0,[D4e,Zie,ere,Ex,Sx])))}function IRe(){IRe=Y,Zin=Dt((Xs(),F(z(e5e,1),Ee,165,0,[fI,ax,V1,hx,Sg])))}function DRe(){DRe=Y,Lsn=Dt((kz(),F(z(_sn,1),Ee,364,0,[Ore,Mre,Nre,Cre,Tre])))}function _Re(){_Re=Y,Pln=Dt((tS(),F(z(Lln,1),Ee,369,0,[Q3,Jy,Hx,Jx,TI])))}function LRe(){LRe=Y,Jln=Dt((GO(),F(z(F6e,1),Ee,330,0,[R6e,tce,z6e,ice,B6e])))}function PRe(){PRe=Y,Gtn=Dt((zr(),F(z(pve,1),Ee,363,0,[Xf,c1,eo,no,Pc])))}function $Re(){$Re=Y,Ufn=Dt((vr(),F(z(Yx,1),Ee,86,0,[nh,ru,Zc,eh,Vl])))}function RRe(){RRe=Y,afn=Dt((vh(),F(z(Wa,1),Ee,160,0,[Cn,fr,xa,Yd,Q1])))}function BRe(){BRe=Y,tan=Dt((u3(),F(z(eA,1),Ee,257,0,[wb,HI,g8e,Zx,w8e])))}function zRe(){zRe=Y,can=Dt((De(),F(z(xc,1),qu,64,0,[ju,Kn,et,bt,Vn])))}function FRe(e){var n;return n=u(C(e,(me(),dp)),317),n?n.a==e:!1}function JRe(e){var n;return n=u(C(e,(me(),dp)),317),n?n.i==e:!1}function HRe(e,n){return _n(n),Ife(e),e.d.Ob()?(n.Ad(e.d.Pb()),!0):!1}function hB(e){return ao(e,oi)>0?oi:ao(e,Xr)<0?Xr:Rt(e)}function f8n(e,n){var t;return t=zw(e.e.c,n.e.c),t==0?ji(e.e.d,n.e.d):t}function TY(e,n){var t;return t=u(zn(e.a,n),150),t||(t=new Vg,ei(e.a,n,t)),t}function $f(e,n,t){var i;if(n==null)throw R(new c4);return i=O1(e,n),L6n(e,n,t),i}function a8n(e,n){var t,i;for(i=n.c,t=i+1;t<=n.f;t++)e.a[t]>e.a[i]&&(i=t);return i}function h8n(e,n,t){var i;return i=e.a.e[u(n.a,9).p]-e.a.e[u(t.a,9).p],lc($T(i))}function d8n(e,n,t){var i,r;for(r=new P(t);r.a0?n-1:n,pAe(lgn(hBe(dfe(new s4,t),e.n),e.j),e.k)}function y8n(e,n,t,i){var r;e.j=-1,nbe(e,D0e(e,n,t),(Tc(),r=u(n,69).tk(),r.vl(i)))}function KRe(e,n,t,i,r,c){var o;o=fY(i),fc(o,r),Gr(o,c),wn(e.a,i,new W$(o,n,t.f))}function dB(e,n){var t;return F0(e),t=new n_e(e,e.a.xd(),e.a.wd()|4,n),new mn(e,t)}function k8n(e,n){var t,i;return t=u(J2(e.d,n),18),t?(i=n,e.e.pc(i,t)):null}function Mn(e,n){var t;return t=(e.i==null&&kh(e),e.i),n>=0&&n=-.01&&e.a<=qa&&(e.a=0),e.b>=-.01&&e.b<=qa&&(e.b=0),e}function Yv(e){M8();var n,t;for(t=Fpe,n=0;nt&&(t=e[n]);return t}function j8n(e){var n;return n=ne(re(C(e,(Ie(),Ud)))),n<0&&(n=0,he(e,Ud,n)),n}function E8n(e,n){A4(u(C(u(e.e,9),(Ie(),Zi)),102))&&(En(),Tr(u(e.e,9).j,n))}function bB(e,n){var t,i;for(i=e.Jc();i.Ob();)t=u(i.Pb(),70),he(t,(me(),_y),n)}function S8n(e,n){var t,i,r;for(i=n.a.jd(),t=u(n.a.kd(),18).gc(),r=0;re||e>n)throw R(new Doe("fromIndex: 0, toIndex: "+e+Xge+n))}function WRe(e,n){Ei(e,(Qh(),Gre),n.f),Ei(e,lln,n.e),Ei(e,Hre,n.d),Ei(e,sln,n.c)}function Ao(e,n){var t,i,r,c;for(_n(n),i=e.c,r=0,c=i.length;r0&&(e.a/=n,e.b/=n),e}function ZRe(e,n,t){var i,r;i=n;do r=ne(e.p[i.p])+t,e.p[i.p]=r,i=e.a[i.p];while(i!=n)}function ol(e){var n;return e.w?e.w:(n=vyn(e),n&&!n.Sh()&&(e.w=n),n)}function Ahe(e,n){return Na(),Rf(Y0),k.Math.abs(e-n)<=Y0||e==n||isNaN(e)&&isNaN(n)}function I8n(e){var n;return e==null?null:(n=u(e,195),yMn(n,n.length))}function K(e,n){if(e.g==null||n>=e.i)throw R(new EK(n,e.i));return e.Ui(n,e.g[n])}function wa(){wa=Y,Ou=new qX("BEGIN",0),No=new qX(H8,1),Nu=new qX("END",2)}function Ra(){Ra=Y,H7=new pK(H8,0),Fm=new pK("HEAD",1),G7=new pK("TAIL",2)}function H4(){H4=Y,Osn=mh(mh(mh(Nj(new or,(ny(),Nx)),(uS(),hre)),oye),aye)}function P1(){P1=Y,Isn=mh(mh(mh(Nj(new or,(ny(),Dx)),(uS(),lye)),rye),sye)}function Qv(e,n){return bgn(ME(e,n,Rt(hc(e1,Xh(Rt(hc(n==null?0:Ni(n),n1)),15)))))}function Mhe(e,n){return Na(),Rf(Y0),k.Math.abs(e-n)<=Y0||e==n||isNaN(e)&&isNaN(n)}function X9(e,n){var t,i;i=e.a,t=djn(e,n,null),i!=n&&!e.e&&(t=_8(e,n,t)),t&&t.mj()}function D8n(e,n){var t;return t=Nr(pc(u(zn(e.g,n),8)),Use(u(zn(e.f,n),460).b)),t}function eBe(e,n,t){var i=function(){return e.apply(i,arguments)};return n.apply(i,t),i}function G4(e){var n;return tE(e==null||Array.isArray(e)&&(n=aO(e),!(n>=14&&n<=16))),e}function Che(e){e.b=(ws(),rb),e.f=(Uo(),cb),e.d=(sl(2,rm),new xo(2)),e.e=new Vr}function gB(e){this.b=(Nt(e),new bs(e)),this.a=new Oe,this.d=new Oe,this.e=new Vr}function nBe(e){return F0(e),C4(!0,"n may not be negative"),new mn(e,new yBe(e.a))}function _8n(e,n){En();var t,i;for(i=new Oe,t=0;t0?u(Pe(t.a,i-1),9):null}function Rf(e){if(!(e>=0))throw R(new qn("tolerance ("+e+") must be >= 0"));return e}function SE(){return oce||(oce=new DXe,K4(oce,F(z(xy,1),On,148,0,[new OC]))),oce}function mB(){mB=Y,Y4e=new uK("NO",0),lre=new uK(bwe,1),V4e=new uK("LOOK_BACK",2)}function Nc(){Nc=Y,Ax=new tK(yS,0),ys=new tK("INPUT",1),Io=new tK("OUTPUT",2)}function vB(){vB=Y,v3e=new VX("ARD",0),KJ=new VX("MSD",1),Vte=new VX("MANUAL",2)}function F8n(){return YO(),F(z(j3e,1),Ee,267,0,[Wte,k3e,eie,nie,Zte,tie,iI,Qte,Yte])}function J8n(){return WO(),F(z(O4e,1),Ee,268,0,[Vie,M4e,C4e,Xie,A4e,T4e,xH,Uie,Kie])}function H8n(){return _s(),F(z(k8e,1),Ee,266,0,[X7,VI,aG,rA,hG,bG,dG,Oce,KI])}function G8n(){kMe();for(var e=Kne,n=0;nt)throw R(new k2(n,t));return new Xle(e,n)}function yB(e){var n,t;for(t=e.c.Bc().Jc();t.Ob();)n=u(t.Pb(),18),n.$b();e.c.$b(),e.d=0}function q8n(e){var n,t,i,r;for(t=e.a,i=0,r=t.length;i=0),CEn(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function yBe(e){D$.call(this,e.yd(64)?Gse(0,lf(e.xd(),1)):bN,e.wd()),this.b=1,this.a=e}function kBe(){cle.call(this),this.n=-1,this.g=null,this.i=null,this.j=null,this.Bb|=Gf}function jBe(e,n,t,i){this.$j(),this.a=n,this.b=e,this.c=null,this.c=new mNe(this,n,t,i)}function DY(e,n,t,i,r){this.d=e,this.n=n,this.g=t,this.o=i,this.p=-1,r||(this.o=-2-i-1)}function EBe(e){Woe(),this.g=new wt,this.f=new wt,this.b=new wt,this.c=new Nw,this.i=e}function $he(){this.f=new Vr,this.d=new moe,this.c=new Vr,this.a=new Oe,this.b=new Oe}function X8n(e){var n,t;for(t=new P(vHe(e));t.a=0}function Rhe(){Rhe=Y,son=qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)}function SBe(){SBe=Y,lon=qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)}function Bhe(){Bhe=Y,fon=qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)}function xBe(){xBe=Y,aon=qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)}function ABe(){ABe=Y,hon=qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)}function MBe(){MBe=Y,don=qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)}function CBe(){CBe=Y,won=Eo(qt(qt(new or,(zr(),eo),(Ur(),_J)),no,TJ),Pc,DJ)}function TBe(){TBe=Y,nnn=F(z($t,1),ni,30,15,[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15])}function zhe(e,n){var t;t=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,0,t,e.b))}function Fhe(e,n){var t;t=e.c,e.c=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,1,t,e.c))}function _Y(e,n){var t;t=e.c,e.c=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,4,t,e.c))}function Jhe(e,n){var t;t=e.c,e.c=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,1,t,e.c))}function Hhe(e,n){var t;t=e.d,e.d=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,1,t,e.d))}function V9(e,n){var t;t=e.k,e.k=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,2,t,e.k))}function LY(e,n){var t;t=e.D,e.D=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,2,t,e.D))}function EB(e,n){var t;t=e.f,e.f=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,8,t,e.f))}function SB(e,n){var t;t=e.i,e.i=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,7,t,e.i))}function Ghe(e,n){var t;t=e.a,e.a=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,8,t,e.a))}function qhe(e,n){var t;t=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,0,t,e.b))}function Y8n(e,n,t){var i;e.b=n,e.a=t,i=(e.a&512)==512?new Lxe:new pC,e.c=MIn(i,e.b,e.a)}function OBe(e,n){return J1(e.e,n)?(Tc(),AY(n)?new uR(n,e):new vT(n,e)):new tTe(n,e)}function Q8n(e){var n,t;return 0>e?new Yoe:(n=e+1,t=new HPe(n,e),new Ale(null,t))}function W8n(e,n){En();var t;return t=new b4(1),$r(e)?Kc(t,e,n):Ko(t.f,e,n),new aX(t)}function Z8n(e,n){var t;t=new Kg,u(n.b,68),u(n.b,68),u(n.b,68),Ao(n.a,new ife(e,t,n))}function NBe(e,n){var t;return X(n,8)?(t=u(n,8),e.a==t.a&&e.b==t.b):!1}function e7n(e){var n;return n=C(e,(me(),mi)),X(n,174)?WFe(u(n,174)):null}function IBe(e){var n;return e=k.Math.max(e,2),n=b1e(e),e>n?(n<<=1,n>0?n:gS):n}function PY(e){switch(ile(e.e!=3),e.e){case 2:return!1;case 0:return!0}return r9n(e)}function Uhe(e){var n;return e.b==null?(Ed(),Ed(),iD):(n=e.sl()?e.rl():e.ql(),n)}function DBe(e,n){var t,i;for(i=n.vc().Jc();i.Ob();)t=u(i.Pb(),45),zO(e,t.jd(),t.kd())}function Xhe(e,n){var t;t=e.d,e.d=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,11,t,e.d))}function xB(e,n){var t;t=e.j,e.j=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,13,t,e.j))}function Khe(e,n){var t;t=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,21,t,e.b))}function Vhe(e,n){e.r>0&&e.c0&&e.g!=0&&Vhe(e.i,n/e.r*e.i.d))}function _Be(e,n,t){var i,r,c;for(c=e.a.length-1,r=e.b,i=0;i0?1:0:(!e.c&&(e.c=XT(Lu(e.f))),e.c).e}function GBe(e,n){n?e.B==null&&(e.B=e.D,e.D=null):e.B!=null&&(e.D=e.B,e.B=null)}function c7n(e,n){n.Tg(yQe,1),er(lu(new mn(null,new vn(e.b,16)),new Wg),new kD),n.Ug()}function FY(e,n,t,i,r,c){var o;this.c=e,o=new Oe,_de(e,o,n,e.b,t,i,r,c),this.a=new qr(o,0)}function rr(e,n,t,i,r,c,o,l,f,h,b,p,y){return uqe(e,n,t,i,r,c,o,l,f,h,b,p,y),mQ(e,!1),e}function u7n(e,n){typeof window===fN&&typeof window.$gwt===fN&&(window.$gwt[e]=n)}function o7n(e,n,t){var i,r,c;for(i=0,r=0;r>>31;i!=0&&(e[t]=i)}function s7n(e,n,t){t.Tg("DFS Treeifying phase",1),mEn(e,n),VNn(e,n),e.a=null,e.b=null,t.Ug()}function l7n(e,n){var t;n.Tg("General Compactor",1),t=eEn(u(je(e,(q0(),_re)),386)),t.Bg(e)}function f7n(e,n){var t,i;return t=u(je(e,(q0(),HH)),15),i=u(je(n,HH),15),oo(t.a,i.a)}function Zhe(e,n,t){var i,r;for(r=St(e,0);r.b!=r.d.c;)i=u(jt(r),8),i.a+=n,i.b+=t;return e}function a7n(e,n,t,i){var r;r=new l4,Xb(r,"x",vz(e,n,i.a)),Xb(r,"y",yz(e,n,i.b)),D4(t,r)}function h7n(e,n,t,i){var r;r=new l4,Xb(r,"x",vz(e,n,i.a)),Xb(r,"y",yz(e,n,i.b)),D4(t,r)}function d7n(){return X0(),F(z(B4e,1),Ee,243,0,[CH,pI,mI,P4e,$4e,L4e,R4e,TH,_7,xx])}function b7n(){return Ic(),F(z(fie,1),Ee,261,0,[ZJ,Kl,ux,eH,A7,P3,ox,S7,x7,nH])}function JY(){JY=Y,lA=new Oxe,Fce=F(z(ns,1),M3,179,0,[]),Wan=F(z(yf,1),ime,62,0,[])}function q4(){q4=Y,Pte=new Pi("edgelabelcenterednessanalysis.includelabel",($n(),ib))}function qBe(e,n){return ne(re(Js(CO(So(new mn(null,new vn(e.c.b,16)),new Qje(e)),n))))}function e1e(e,n){return ne(re(Js(CO(So(new mn(null,new vn(e.c.b,16)),new Yje(e)),n))))}function Ni(e){return $r(e)?Id(e):g2(e)?v4(e):b2(e)?qOe(e):Tfe(e)?e.Hb():Sfe(e)?jw(e):aae(e)}function UBe(e,n){return Na(),Rf(qa),k.Math.abs(0-n)<=qa||n==0||isNaN(0)&&isNaN(n)?0:e/n}function g7n(e,n){return n8(),e==fp&&n==bm||e==fp&&n==O3||e==gm&&n==O3||e==gm&&n==bm}function w7n(e,n){return n8(),e==fp&&n==gm||e==gm&&n==fp||e==O3&&n==bm||e==bm&&n==O3}function ss(){ss=Y,Ave=new k5,Sve=new a0,xve=new _h,Eve=new uk,Mve=new NA,Cve=new j5}function p7n(e){var n;return n=FR(e),Gj(n.a,0)?(WP(),WP(),bnn):(WP(),new SOe(n.b))}function HY(e){var n;return n=Iae(e),Gj(n.a,0)?(f2(),f2(),lte):(f2(),new $K(n.b))}function GY(e){var n;return n=Iae(e),Gj(n.a,0)?(f2(),f2(),lte):(f2(),new $K(n.c))}function m7n(e){return e.b.c.i.k==(Fn(),wr)?u(C(e.b.c.i,(me(),mi)),12):e.b.c}function XBe(e){return e.b.d.i.k==(Fn(),wr)?u(C(e.b.d.i,(me(),mi)),12):e.b.d}function KBe(e){switch(e.g){case 2:return De(),Vn;case 4:return De(),et;default:return e}}function VBe(e){switch(e.g){case 1:return De(),bt;case 3:return De(),Kn;default:return e}}function v7n(e,n){var t;return t=m0e(e),V0e(new Se(t.c,t.d),new Se(t.b,t.a),e.Kf(),n,e.$f())}function y7n(e,n){n.Tg(yQe,1),ode(xgn(new OP((Mj(),new DV(e,!1,!1,new ck))))),n.Ug()}function n1e(){n1e=Y,pon=mh(oTe(qt(qt(new or,(zr(),eo),(Ur(),_J)),no,TJ),Pc),DJ)}function YBe(){YBe=Y,kon=mh(oTe(qt(qt(new or,(zr(),eo),(Ur(),_J)),no,TJ),Pc),DJ)}function QBe(e,n,t){this.g=e,this.d=n,this.e=t,this.a=new Oe,fTn(this),En(),Tr(this.a,null)}function Bl(e,n,t,i,r,c,o){Ot.call(this,e,n),this.d=t,this.e=i,this.c=r,this.b=c,this.a=Pf(o)}function t1e(e){this.i=e.gc(),this.i>0&&(this.g=this.$i(this.i+(this.i/8|0)+1),e.Oc(this.g))}function AE(e,n){var t,i;for(_n(n),i=n.vc().Jc();i.Ob();)t=u(i.Pb(),45),e.yc(t.jd(),t.kd())}function k7n(e,n,t){var i;for(i=t.Jc();i.Ob();)if(!qR(e,n,i.Pb()))return!1;return!0}function ME(e,n,t){var i;for(i=e.b[t&e.f];i;i=i.b)if(t==i.a&&C1(n,i.g))return i;return null}function CE(e,n,t){var i;for(i=e.c[t&e.f];i;i=i.d)if(t==i.f&&C1(n,i.i))return i;return null}function j7n(e,n){var t;for(Nt(n);e.Ob();)if(t=e.Pb(),!u1e(u(t,9)))return!1;return!0}function E7n(e,n,t,i,r){var c;return t&&(c=Ji(n.Ah(),e.c),r=t.Oh(n,-1-(c==-1?i:c),null,r)),r}function S7n(e,n,t,i,r){var c;return t&&(c=Ji(n.Ah(),e.c),r=t.Qh(n,-1-(c==-1?i:c),null,r)),r}function WBe(e){var n;if(e.b==-2){if(e.e==0)n=-1;else for(n=0;e.a[n]==0;n++);e.b=n}return e.b}function x7n(e){var n,t,i;return e.j==(De(),Kn)&&(n=Zqe(e),t=cs(n,et),i=cs(n,Vn),i||i&&t)}function A7n(e){var n,t,i;for(i=0,t=new P(e.b);t.ar&&n.ac&&n.br?t=r:Qn(n,t+1),e.a=of(e.a,0,n)+(""+i)+qfe(e.a,t)}function ZBe(e,n,t,i){X(e.Cb,184)&&(u(e.Cb,184).tb=null),Mo(e,t),n&&ATn(e,n),i&&e.el(!0)}function T7n(e,n){var t,i;for(i=new P(n.b);i.a1||e.Ob())return++e.a,e.g=0,n=e.i,e.Ob(),n;throw R(new hu)}function $7n(e,n){var t,i;for(i=new P(n);i.a>22),r=e.h+n.h+(i>>22),_o(t&Ls,i&Ls,r&G1)}function Aze(e,n){var t,i,r;return t=e.l-n.l,i=e.m-n.m+(t>>22),r=e.h-n.h+(i>>22),_o(t&Ls,i&Ls,r&G1)}function QY(e){var n,t,i,r;for(r=new Oe,i=e.Jc();i.Ob();)t=u(i.Pb(),26),n=W2(t),Sr(r,n);return r}function tkn(e){var n;Bd(e,!0),n=zd,wi(e,(Ie(),N7))&&(n+=u(C(e,N7),15).a),he(e,N7,ke(n))}function Mze(e,n,t){var i;Hu(e.a),Ao(t.i,new YEe(e)),i=new P$(u(zn(e.a,n.b),68)),SJe(e,i,n),t.f=i}function l1e(e){var n,t;return t=(j0(),n=new yo,n),e&&Et((!e.a&&(e.a=new we($i,e,6,6)),e.a),t),t}function U4(e,n){var t,i;if(i=0,e<64&&e<=n)for(n=n<64?n:63,t=e;t<=n;t++)i=bh(i,qh(1,t));return i}function ikn(e,n){var t,i;for(NR(n,"predicate"),i=0;e.Ob();i++)if(t=e.Pb(),n.Lb(t))return i;return-1}function f1e(e,n){if(n===0){!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),e.o.c.$b();return}pW(e,n)}function Cze(e){switch(e.g){case 1:return gb;case 2:return l1;case 3:return FI;default:return JI}}function a1e(e){En();var n,t,i;for(i=0,t=e.Jc();t.Ob();)n=t.Pb(),i=i+(n!=null?Ni(n):0),i=i|0;return i}function rkn(e){var n;return n=new xn,n.a=e,n.b=fkn(e),n.c=se(He,Me,2,2,6,1),n.c[0]=HBe(e),n.c[1]=HBe(e),n}function $B(){$B=Y,$te=new h$(va,0),JJ=new h$(EQe,1),HJ=new h$(SQe,2),eI=new h$("BOTH",3)}function n8(){n8=Y,fp=new f$("Q1",0),gm=new f$("Q4",1),bm=new f$("Q2",2),O3=new f$("Q3",3)}function $0(){$0=Y,cI=new ZX("ONLY_WITHIN_GROUP",0),B3e=new ZX(eee,1),ym=new ZX("ENFORCED",2)}function tg(){tg=Y,iie=new QX(va,0),E7=new QX("INCOMING_ONLY",1),L3=new QX("OUTGOING_ONLY",2)}function X4(){X4=Y,ofn=new BM,ufn=new Z_}function WY(){WY=Y,rte={boolean:ygn,number:Ibn,string:Dbn,object:lqe,function:lqe,undefined:abn}}function Tze(){Tze=Y,qun=Dt((X0(),F(z(B4e,1),Ee,243,0,[CH,pI,mI,P4e,$4e,L4e,R4e,TH,_7,xx])))}function Oze(){Oze=Y,Uin=Dt((Ic(),F(z(fie,1),Ee,261,0,[ZJ,Kl,ux,eH,A7,P3,ox,S7,x7,nH])))}function ckn(e,n,t,i){return new rse(F(z(yg,1),tF,45,0,[(qQ(e,n),new pw(e,n)),(qQ(t,i),new pw(t,i))]))}function ukn(e,n){var t,i;return t=u(u(zn(e.g,n.a),49).a,68),i=u(u(zn(e.g,n.b),49).a,68),vKe(t,i)}function h1e(e,n,t){var i;if(i=e.gc(),n>i)throw R(new k2(n,i));return e.Qi()&&(t=F_e(e,t)),e.Ci(n,t)}function Nze(e){var n,t,i;return t=e.n,i=e.o,n=e.d,new _f(t.a-n.b,t.b-n.d,i.a+(n.b+n.c),i.b+(n.d+n.a))}function okn(e,n){return!e||!n||e==n?!1:zw(e.b.c,n.b.c+n.b.b)<0&&zw(n.b.c,e.b.c+e.b.b)<0}function ZY(e,n,t){return e>=128?!1:e<64?qj(Rr(qh(1,e),t),0):qj(Rr(qh(1,e-64),n),0)}function EO(e,n,t){switch(t.g){case 2:e.b=n;break;case 1:e.c=n;break;case 4:e.d=n;break;case 3:e.a=n}}function SO(e,n,t){return t==null?(!e.q&&(e.q=new wt),z4(e.q,n)):(!e.q&&(e.q=new wt),ei(e.q,n,t)),e}function he(e,n,t){return t==null?(!e.q&&(e.q=new wt),z4(e.q,n)):(!e.q&&(e.q=new wt),ei(e.q,n,t)),e}function Ize(e){var n,t;return t=new WR,Pu(t,e),he(t,(L0(),My),e),n=new wt,nLn(e,t,n),I$n(e,t,n),t}function skn(e){M8();var n,t,i;for(t=se(Lr,Me,8,2,0,1),i=0,n=0;n<2;n++)i+=.5,t[n]=FSn(i,e);return t}function Dze(e,n){var t,i,r,c;for(t=!1,i=e.a[n].length,c=0;ce.f,t=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d,n||t}function d1e(e){var n;return(!e.c||(e.Bb&1)==0&&(e.c.Db&64)!=0)&&(n=ff(e),X(n,88)&&(e.c=u(n,29))),e.c}function b1e(e){var n;if(e<0)return Xr;if(e==0)return 0;for(n=gS;(n&e)==0;n>>=1);return n}function fkn(e){var n;return e==0?"Etc/GMT":(e<0?(e=-e,n="Etc/GMT-"):n="Etc/GMT+",n+ERe(e))}function Lze(e){var n,t;return t=KO(e.h),t==32?(n=KO(e.m),n==32?KO(e.l)+32:n+20-10):t-12}function eQ(e){var n,t,i;n=~e.l+1&Ls,t=~e.m+(n==0?1:0)&Ls,i=~e.h+(n==0&&t==0?1:0)&G1,e.l=n,e.m=t,e.h=i}function OE(e){var n;return n=e.a[e.b],n==null?null:(ir(e.a,e.b,null),e.b=e.b+1&e.a.length-1,n)}function g1e(){this.o=null,this.k=null,this.j=null,this.d=null,this.b=null,this.n=null,this.a=null}function w1e(e,n){this.c=e,this.d=n,this.b=this.d/this.c.c.Pd().gc()|0,this.a=this.d%this.c.c.Pd().gc()}function Pze(e,n){this.b=e,Pv.call(this,(u(K(ge((C0(),Bn).o),10),19),n.i),n.g),this.a=(JY(),Fce)}function p1e(e,n,t){this.q=new k.Date,this.q.setFullYear(e+Q0,n,t),this.q.setHours(0,0,0,0),sS(this,0)}function $ze(e,n,t){var i,r;return i=new pY(n,t),r=new si,e.b=tXe(e,e.b,i,r),r.b||++e.c,e.b.b=!1,r.d}function m1e(e,n){En();var t,i,r,c,o;for(o=!1,i=n,r=0,c=i.length;ro||i+r>c)throw R(new soe)}function Rze(e,n,t){var i,r,c,o;for(o=PE(n,t),c=0,r=o.Jc();r.Ob();)i=u(r.Pb(),12),ei(e.c,i,ke(c++))}function R0(e){var n,t;for(t=new P(e.a.b);t.a=0,"Negative initial capacity"),LT(n>=0,"Non-positive load factor"),Hu(this)}function Hze(e,n){var t;for(t=0;t1||n>=0&&e.b<3)}function vkn(){ai();var e;return Xce||(e=wpn(K0("M",!0)),e=dR(K0("M",!1),e),Xce=e,Xce)}function Uze(e){if(e.g===0)return new R6;throw R(new qn(BF+(e.f!=null?e.f:""+e.g)))}function Xze(e){if(e.g===0)return new W_;throw R(new qn(BF+(e.f!=null?e.f:""+e.g)))}function E1e(e,n,t){if(n===0){!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),NB(e.o,t);return}yW(e,n,t)}function tQ(e,n,t){this.g=e,this.e=new Vr,this.f=new Vr,this.d=new xi,this.b=new xi,this.a=n,this.c=t}function iQ(e,n,t,i){this.b=new Oe,this.n=new Oe,this.i=i,this.j=t,this.s=e,this.t=n,this.r=0,this.d=0}function Kze(e,n,t,i){this.b=new wt,this.g=new wt,this.d=(_E(),AH),this.c=e,this.e=n,this.d=t,this.a=i}function r8(e,n){if(!e.Ji()&&n==null)throw R(new qn("The 'no null' constraint is violated"));return n}function S1e(e){switch(e.g){case 1:return qQe;default:case 2:return 0;case 3:return UQe;case 4:return zpe}}function ykn(e){return Te(e.c,(X4(),ofn)),Ahe(e.a,ne(re(Le((SQ(),SH)))))?new QM:new tSe(e)}function kkn(e){for(;!e.d||!e.d.Ob();)if(e.b&&!jj(e.b))e.d=u(N4(e.b),50);else return null;return e.d}function Id(e){var n,t;for(n=0,t=0;ti?1:0}function Vze(e,n){var t,i,r;for(r=e.b;r;){if(t=e.a.Le(n,r.d),t==0)return r;i=t<0?0:1,r=r.a[i]}return null}function rQ(e,n){var t;return n===e?!0:X(n,229)?(t=u(n,229),gi(e.Zb(),t.Zb())):!1}function x1e(e,n){return zUe(e,n)?(wn(e.b,u(C(n,(me(),K1)),22),n),Vt(e.a,n),!0):!1}function Skn(e,n){return wi(e,(me(),Oi))&&wi(n,Oi)?u(C(n,Oi),15).a-u(C(e,Oi),15).a:0}function xkn(e,n){return wi(e,(me(),Oi))&&wi(n,Oi)?u(C(e,Oi),15).a-u(C(n,Oi),15).a:0}function Yze(e){return Va?se(pnn,IYe,567,0,0,1):u(Ba(e.a,se(pnn,IYe,567,e.a.c.length,0,1)),840)}function Us(e){return $r(e)?He:g2(e)?gr:b2(e)?Qi:Tfe(e)||Sfe(e)?e.Pm:e.Pm||Array.isArray(e)&&z(Ven,1)||Ven}function i3(e,n,t){var i,r;return r=(i=new yX,i),Fc(r,n,t),Et((!e.q&&(e.q=new we(yf,e,11,10)),e.q),r),r}function cQ(e){var n,t,i,r;for(r=Pgn(Can,e),t=r.length,i=se(He,Me,2,t,6,1),n=0;n=e.b.c.length||(A1e(e,2*n+1),t=2*n+2,t0&&(n.Ad(t),t.i&&ZEn(t))}function M1e(e,n,t){var i;for(i=t-1;i>=0&&e[i]===n[i];i--);return i<0?0:HX(Rr(e[i],Dc),Rr(n[i],Dc))?-1:1}function Mkn(e,n){var t;return!e||e==n||!wi(n,(me(),bp))?!1:(t=u(C(n,(me(),bp)),9),t!=e)}function uQ(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.Yl()}}function Qze(e,n,t){return e.d[n.p][t.p]||(kSn(e,n,t),e.d[n.p][t.p]=!0,e.d[t.p][n.p]=!0),e.a[n.p][t.p]}function Wze(e,n,t){var i,r;this.g=e,this.c=n,this.a=this,this.d=this,r=IBe(t),i=se(Xen,gN,227,r,0,1),this.b=i}function Ckn(e,n){var t,i;for(i=e.Zb().Bc().Jc();i.Ob();)if(t=u(i.Pb(),18),t.Gc(n))return!0;return!1}function Zze(e,n,t){var i,r,c,o;for(_n(t),o=!1,c=e.dd(n),r=t.Jc();r.Ob();)i=r.Pb(),c.Rb(i),o=!0;return o}function oQ(e,n){var t,i;return i=u(Xn(e.a,4),129),t=se(Bce,_ne,415,n,0,1),i!=null&&Wu(i,0,t,0,i.length),t}function eFe(e,n){var t;return t=new DW((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,n),e.e!=null||(t.c=e),t}function Tkn(e,n){var t;return e===n?!0:X(n,92)?(t=u(n,92),T0e(Fb(e),t.vc())):!1}function nFe(e,n,t){var i,r;for(r=t.Jc();r.Ob();)if(i=u(r.Pb(),45),e.ze(n,i.kd()))return!0;return!1}function RB(){RB=Y,Dce=new M$("ELK",0),I8e=new M$("JSON",1),N8e=new M$("DOT",2),D8e=new M$("SVG",3)}function NE(){NE=Y,xre=new v$(eee,0),zH=new v$(VQe,1),Sre=new v$("FAN",2),Ere=new v$("CONSTRAINT",3)}function IE(){IE=Y,bye=new lK(va,0),dre=new lK("MIDDLE_TO_MIDDLE",1),jI=new lK("AVOID_OVERLAP",2)}function xO(){xO=Y,JH=new fK(va,0),Fye=new fK("RADIAL_COMPACTION",1),Jye=new fK("WEDGE_COMPACTION",2)}function DE(){DE=Y,ore=new rK("STACKED",0),ure=new rK("REVERSE_STACKED",1),vI=new rK("SEQUENCED",2)}function zl(){zl=Y,Kme=new GX("CONCURRENT",0),Yo=new GX("IDENTITY_FINISH",1),Vme=new GX("UNORDERED",2)}function B1(){B1=Y,lG=new mK(L2e,0),Wd=new mK("INCLUDE_CHILDREN",1),Wx=new mK("SEPARATE_CHILDREN",2)}function BB(){BB=Y,d8e=new yw(15),Qfn=new Yr((Xt(),s1),d8e),Qx=Uy,l8e=jfn,f8e=Ig,h8e=n5,a8e=$m}function sQ(){sQ=Y,Mte=__e(F(z(Yx,1),Ee,86,0,[(vr(),Zc),ru])),Cte=__e(F(z(Yx,1),Ee,86,0,[Vl,eh]))}function Okn(e){var n,t,i;for(n=0,i=se(Lr,Me,8,e.b,0,1),t=St(e,0);t.b!=t.d.c;)i[n++]=u(jt(t),8);return i}function lQ(e,n,t){var i,r,c;for(i=new xi,c=St(t,0);c.b!=c.d.c;)r=u(jt(c),8),Vt(i,new wc(r));Zze(e,n,i)}function Nkn(e,n){var t;t=Le((SQ(),SH))!=null&&n.Rg()!=null?ne(re(n.Rg()))/ne(re(Le(SH))):1,ei(e.b,n,t)}function Ikn(e,n){var t,i;return t=u(e.d.Ac(n),18),t?(i=e.e.hc(),i.Fc(t),e.e.d-=t.gc(),t.$b(),i):null}function C1e(e,n){var t,i;if(i=e.c[n],i!=0)for(e.c[n]=0,e.d-=i,t=n+1;t0)return N9(n-1,e.a.c.length),Cd(e.a,n-1);throw R(new exe)}function Dkn(e,n,t){if(n<0)throw R(new jo(bWe+n));nn)throw R(new qn(oF+e+DYe+n));if(e<0||n>t)throw R(new Doe(oF+e+Yge+n+Xge+t))}function iFe(e){if(!e.a||(e.a.i&8)==0)throw R(new Uc("Enumeration class expected for layout option "+e.f))}function rFe(e){B_e.call(this,"The given string does not match the expected format for individual spacings.",e)}function cFe(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e.Zl()}}function Dd(e){switch(e.c){case 0:return cV(),mme;case 1:return new r4(pqe(new d4(e)));default:return new Xxe(e)}}function uFe(e){switch(e.gc()){case 0:return cV(),mme;case 1:return new r4(e.Jc().Pb());default:return new cse(e)}}function O1e(e){var n;return n=(!e.a&&(e.a=new we(ed,e,9,5)),e.a),n.i!=0?_gn(u(K(n,0),684)):null}function _kn(e,n){var t;return t=mc(e,n),HX(QV(e,n),0)|N$(QV(e,t),0)?t:mc(bN,QV(Hb(t,63),1))}function N1e(e,n,t){var i,r;return N2(n,e.c.length),i=t.Nc(),r=i.length,r==0?!1:(sfe(e.c,n,i),!0)}function Lkn(e,n){var t,i;for(t=e.a.length-1;n!=e.b;)i=n-1&t,ir(e.a,n,e.a[i]),n=i;ir(e.a,e.b,null),e.b=e.b+1&t}function Pkn(e,n){var t,i;for(t=e.a.length-1,e.c=e.c-1&t;n!=e.c;)i=n+1&t,ir(e.a,n,e.a[i]),n=i;ir(e.a,e.c,null)}function c8(e,n){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),LY(e,n==null?null:(_n(n),n)),e.C&&e.fl(null)}function r3(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(r2(e.a.c,0),Sr(e.a,e.b),Sr(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function F2(e){var n;++e.j,e.i==0?e.g=null:e.ir&&(WHe(n.q,r),i=t!=n.q.d)),i}function gFe(e,n){var t,i,r,c,o,l,f,h;return f=n.i,h=n.j,i=e.f,r=i.i,c=i.j,o=f-r,l=h-c,t=k.Math.sqrt(o*o+l*l),t}function _1e(e,n){var t,i;return i=iz(e),i||(t=(eZ(),wUe(n)),i=new GSe(t),Et(i.Cl(),e)),i}function AO(e,n){var t,i;return t=u(e.c.Ac(n),18),t?(i=e.hc(),i.Fc(t),e.d-=t.gc(),t.$b(),e.mc(i)):e.jc()}function Jkn(e){var n;if(!(e.c.c<0?e.a>=e.c.b:e.a<=e.c.b))throw R(new hu);return n=e.a,e.a+=e.c.c,++e.b,ke(n)}function Hkn(e){var n,t;if(e==null)return!1;for(n=0,t=e.length;n=i||n=0?n:-n;i>0;)i%2==0?(t*=t,i=i/2|0):(r*=t,i-=1);return n<0?1/r:r}function Qkn(e,n){var t,i,r;for(r=1,t=e,i=n>=0?n:-n;i>0;)i%2==0?(t*=t,i=i/2|0):(r*=t,i-=1);return n<0?1/r:r}function z0(e,n){var t,i,r,c;return c=(r=e?iz(e):null,sqe((i=n,r&&r.El(),i))),c==n&&(t=iz(e),t&&t.El()),c}function P1e(e,n,t){var i,r;return r=e.a,e.a=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Dr(e,1,1,r,n),t?t.lj(i):t=i),t}function mFe(e,n,t){var i,r;return r=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Dr(e,1,3,r,n),t?t.lj(i):t=i),t}function vFe(e,n,t){var i,r;return r=e.f,e.f=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Dr(e,1,0,r,n),t?t.lj(i):t=i),t}function yFe(e){var n,t;if(e!=null)for(t=0;t-129&&e<128?(vIe(),n=e+128,t=Dme[n],!t&&(t=Dme[n]=new Ln(e)),t):new Ln(e)}function ke(e){var n,t;return e>-129&&e<128?(hIe(),n=e+128,t=Tme[n],!t&&(t=Tme[n]=new co(e)),t):new co(e)}function ijn(e,n,t,i,r){n==0||i==0||(n==1?r[i]=Cde(r,t,i,e[0]):i==1?r[n]=Cde(r,e,n,t[0]):UTn(e,t,r,n,i))}function xFe(e,n){var t;e.c.length!=0&&(t=u(Ba(e,se(u1,Fd,9,e.c.length,0,1)),199),Bse(t,new Ph),Nqe(t,n))}function AFe(e,n){var t;e.c.length!=0&&(t=u(Ba(e,se(u1,Fd,9,e.c.length,0,1)),199),Bse(t,new lv),Nqe(t,n))}function MFe(e,n){var t;e.a.c.length>0&&(t=u(Pe(e.a,e.a.c.length-1),565),x1e(t,n))||Te(e.a,new BPe(n))}function rjn(e){il();var n,t;n=e.d.c-e.e.c,t=u(e.g,156),Ao(t.b,new Pje(n)),Ao(t.c,new $je(n)),cc(t.i,new Rje(n))}function CFe(e){var n;return n=new y0,n.a+="VerticalSegment ",uo(n,e.e),n.a+=" ",Kt(n,nle(new IX,new P(e.k))),n.a}function cjn(e,n){var t;e.c=n,e.a=iEn(n),e.a<54&&(e.f=(t=n.d>1?$Le(n.a[0],n.a[1]):$Le(n.a[0],0),Qb(n.e>0?t:Od(t))))}function dQ(e,n){var t,i,r;for(t=0,r=vu(e,n).Jc();r.Ob();)i=u(r.Pb(),12),t+=C(i,(me(),vs))!=null?1:0;return t}function c3(e,n,t){var i,r,c;for(i=0,c=St(e,0);c.b!=c.d.c&&(r=ne(re(jt(c))),!(r>t));)r>=n&&++i;return i}function ujn(e){var n;return n=u($a(e.c.c,""),233),n||(n=new P4(b9(d9(new d0,""),"Other")),ug(e.c.c,"",n)),n}function LE(e){var n;return(e.Db&64)!=0?Ff(e):(n=new cf(Ff(e)),n.a+=" (name: ",Bc(n,e.zb),n.a+=")",n.a)}function B1e(e,n,t){var i,r;return r=e.sb,e.sb=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Dr(e,1,4,r,n),t?t.lj(i):t=i),t}function MO(e,n,t){var i;e.Zi(e.i+1),i=e.Xi(n,t),n!=e.i&&Wu(e.g,n,e.g,n+1,e.i-n),ir(e.g,n,i),++e.i,e.Ki(n,t),e.Li()}function z1e(e,n,t){var i,r;return r=e.r,e.r=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Dr(e,1,8,r,e.r),t?t.lj(i):t=i),t}function ojn(e,n,t){var i,r;return i=new L1(e.e,3,13,null,(r=n.c,r||(jn(),rh)),$d(e,n),!1),t?t.lj(i):t=i,t}function sjn(e,n,t){var i,r;return i=new L1(e.e,4,13,(r=n.c,r||(jn(),rh)),null,$d(e,n),!1),t?t.lj(i):t=i,t}function ljn(e,n){var t,i,r,c;if(n.cj(e.a),c=u(Xn(e.a,8),1997),c!=null)for(t=c,i=0,r=t.length;i>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function fjn(e){return e?(e.i&1)!=0?e==ts?Qi:e==$t?jr:e==Ym?b7:e==Jr?gr:e==Ap?sp:e==o5?lp:e==ds?jy:KS:e:null}function gi(e,n){return $r(e)?gn(e,n):g2(e)?yNe(e,n):b2(e)?(_n(e),ue(e)===ue(n)):Tfe(e)?e.Fb(n):Sfe(e)?gTe(e,n):Mae(e,n)}function OFe(e){var n;return ao(e,0)<0&&(e=P0(T3n(su(e)?sf(e):e))),n=Rt(Hb(e,32)),64-(n!=0?KO(n):KO(Rt(e))+32)}function CO(e,n){var t;return t=new Oa,e.a.zd(t)?(j9(),new xX(_n(dRe(e,t.a,n)))):(T0(e),j9(),j9(),Gme)}function PE(e,n){switch(n.g){case 2:case 1:return vu(e,n);case 3:case 4:return Ks(vu(e,n))}return En(),En(),Sc}function ajn(e,n){var t;return n.a&&(t=n.a.a.length,e.a?Kt(e.a,e.b):e.a=new tl(e.d),FLe(e.a,n.a,n.d.length,t)),e}function hjn(e){nF();var n,t,i,r;for(t=DQ(),i=0,r=t.length;it)throw R(new jo(oF+e+Yge+n+", size: "+t));if(e>n)throw R(new qn(oF+e+DYe+n))}function Fl(e,n,t){if(n<0)q0e(e,t);else{if(!t.pk())throw R(new qn(nb+t.ve()+LS));u(t,69).uk().Ck(e,e.ei(),n)}}function bQ(e,n,t){return k.Math.abs(n-e)DF?e-t>DF:t-e>DF}function J1e(e,n,t,i){switch(n){case 1:return!e.n&&(e.n=new we(Eu,e,1,7)),e.n;case 2:return e.k}return $de(e,n,t,i)}function IFe(e){var n;return(e.Db&64)!=0?Ff(e):(n=new cf(Ff(e)),n.a+=" (source: ",Bc(n,e.d),n.a+=")",n.a)}function Ld(e,n){var t;t=(e.Bb&256)!=0,n?e.Bb|=256:e.Bb&=-257,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,2,t,n))}function H1e(e,n){var t;t=(e.Bb&256)!=0,n?e.Bb|=256:e.Bb&=-257,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,8,t,n))}function G1e(e,n){var t;t=(e.Bb&512)!=0,n?e.Bb|=512:e.Bb&=-513,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,9,t,n))}function Pd(e,n){var t;t=(e.Bb&512)!=0,n?e.Bb|=512:e.Bb&=-513,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,3,t,n))}function HB(e,n){var t;t=(e.Bb&256)!=0,n?e.Bb|=256:e.Bb&=-257,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,8,t,n))}function djn(e,n,t){var i,r;return r=e.a,e.a=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Dr(e,1,5,r,e.a),t?s0e(t,i):t=i),t}function $E(e,n){var t;return e.b==-1&&e.a&&(t=e.a.nk(),e.b=t?e.c.Eh(e.a.Jj(),t):Ji(e.c.Ah(),e.a)),e.c.vh(e.b,n)}function DFe(e,n){var t,i;for(i=new st(e);i.e!=i.i.gc();)if(t=u(ft(i),29),ue(n)===ue(t))return!0;return!1}function _Fe(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function q1e(e){var n,t;return n=e.k,n==(Fn(),wr)?(t=u(C(e,(me(),Iu)),64),t==(De(),Kn)||t==bt):!1}function LFe(e){var n;return n=Iae(e),Gj(n.a,0)?(f2(),f2(),lte):(f2(),new $K(JX(n.a,0)?ehe(n)/Qb(n.a):0))}function bjn(e,n){var t;if(t=ZO(e,n),X(t,335))return u(t,38);throw R(new qn(nb+n+"' is not a valid attribute"))}function RE(e,n,t){var i;if(i=e.gc(),n>i)throw R(new k2(n,i));if(e.Qi()&&e.Gc(t))throw R(new qn(BN));e.Ei(n,t)}function PFe(e,n){var t,i;for(i=new st(e);i.e!=i.i.gc();)if(t=u(ft(i),143),ue(n)===ue(t))return!0;return!1}function gjn(e,n,t){var i,r,c;return c=(r=x8(e.b,n),r),c&&(i=u(Yz(lO(e,c),""),29),i)?gbe(e,i,n,t):null}function gQ(e,n,t){var i,r,c;return c=(r=x8(e.b,n),r),c&&(i=u(Yz(lO(e,c),""),29),i)?wbe(e,i,n,t):null}function wjn(e){var n,t,i;for(i=0,t=e.length,n=0;n=0?J0(e):lE(J0(Od(e))))}function $Fe(e,n,t,i,r,c){this.e=new Oe,this.f=(Nc(),Ax),Te(this.e,e),this.d=n,this.a=t,this.b=i,this.f=r,this.c=c}function ji(e,n){return en?1:e==n?e==0?ji(1/e,1/n):0:isNaN(e)?isNaN(n)?0:1:-1}function pjn(e){var n;return n=e.a[e.c-1&e.a.length-1],n==null?null:(e.c=e.c-1&e.a.length-1,ir(e.a,e.c,null),n)}function RFe(e){var n,t;for(t=e.p.a.ec().Jc();t.Ob();)if(n=u(t.Pb(),217),n.f&&e.b[n.c]<-1e-10)return n;return null}function mjn(e){var n,t,i;for(n=new Oe,i=new P(e.b);i.a=1?ru:eh):t}function Sjn(e){var n,t;for(t=pUe(ol(e)).Jc();t.Ob();)if(n=Pt(t.Pb()),oS(e,n))return P6n((DMe(),zan),n);return null}function xjn(e,n,t){var i,r;for(r=e.a.ec().Jc();r.Ob();)if(i=u(r.Pb(),9),jO(t,u(Pe(n,i.p),18)))return i;return null}function Ajn(e,n,t){var i,r;for(r=X(n,103)&&(u(n,19).Bb&Ec)!=0?new SK(n,e):new W9(n,e),i=0;i>10)+vN&yr,n[1]=(e&1023)+56320&yr,ph(n,0,n.length)}function Y1e(e,n){var t;t=(e.Bb&Ec)!=0,n?e.Bb|=Ec:e.Bb&=-65537,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,20,t,n))}function d8(e,n){var t;t=(e.Bb&jh)!=0,n?e.Bb|=jh:e.Bb&=-16385,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,16,t,n))}function mQ(e,n){var t;t=(e.Bb&Ru)!=0,n?e.Bb|=Ru:e.Bb&=-32769,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,18,t,n))}function Q1e(e,n){var t;t=(e.Bb&Ru)!=0,n?e.Bb|=Ru:e.Bb&=-32769,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Lf(e,1,18,t,n))}function vu(e,n){var t;return e.i||G0e(e),t=u(zc(e.g,n),49),t?new N0(e.j,u(t.a,15).a,u(t.b,15).a):(En(),En(),Sc)}function Tjn(e,n,t){var i,r;return i=u(n.mf(e.a),35),r=u(t.mf(e.a),35),i!=null&&r!=null?gO(i,r):i!=null?-1:r!=null?1:0}function W1e(e,n,t){var i,r;return i=(j0(),r=new Jk,r),wB(i,n),pB(i,t),e&&Et((!e.a&&(e.a=new mr(yl,e,5)),e.a),i),i}function Z1e(e,n,t){var i;return i=0,n&&(Rv(e.a)?i+=n.f.a/2:i+=n.f.b/2),t&&(Rv(e.a)?i+=t.f.a/2:i+=t.f.b/2),i}function Bw(e,n,t){var i;return i=e.a.get(n),e.a.set(n,t===void 0?null:t),i===void 0?(++e.c,++e.b.g):++e.d,i}function vQ(e){var n;return(e.Db&64)!=0?Ff(e):(n=new cf(Ff(e)),n.a+=" (identifier: ",Bc(n,e.k),n.a+=")",n.a)}function XB(e){var n;switch(e.gc()){case 0:return oR(),ete;case 1:return new GK(Nt(e.Xb(0)));default:return n=e,new WV(n)}}function Ojn(e){switch(u(C(e,(Ie(),Y1)),222).g){case 1:return new dd;case 3:return new D5;default:return new Bp}}function Njn(e){var n;return n=K2(e),n>34028234663852886e22?Vi:n<-34028234663852886e22?Ir:n}function mc(e,n){var t;return su(e)&&su(n)&&(t=e+n,mNn){ILe(t);break}}jR(t,n)}function en(e,n){var t,i,r,c,o;if(t=n.f,ug(e.c.d,t,n),n.g!=null)for(r=n.g,c=0,o=r.length;cn&&i.Le(e[c-1],e[c])>0;--c)o=e[c],ir(e,c,e[c-1]),ir(e,c-1,o)}function Jl(e,n,t,i){if(n<0)ybe(e,t,i);else{if(!t.pk())throw R(new qn(nb+t.ve()+LS));u(t,69).uk().Ak(e,e.ei(),n,i)}}function Fjn(e,n){var t;if(t=ZO(e.Ah(),n),X(t,103))return u(t,19);throw R(new qn(nb+n+"' is not a valid reference"))}function KB(e,n){if(n==e.d)return e.e;if(n==e.e)return e.d;throw R(new qn("Node "+n+" not part of edge "+e))}function nde(e,n,t,i){switch(n){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return J1e(e,n,t,i)}function Jjn(e){return e.k!=(Fn(),Wi)?!1:Vv(new mn(null,new A2(new Un(Yn(Ii(e).a.Jc(),new ee)))),new nM)}function Xs(){Xs=Y,fI=new fT(va,0),ax=new fT("FIRST",1),V1=new fT(EQe,2),hx=new fT("LAST",3),Sg=new fT(SQe,4)}function zE(){zE=Y,rx=new b$("LAYER_SWEEP",0),w3e=new b$("MEDIAN_LAYER_SWEEP",1),tI=new b$(cee,2),p3e=new b$(va,3)}function VB(){VB=Y,f6e=new dK("ASPECT_RATIO_DRIVEN",0),qre=new dK("MAX_SCALE_DRIVEN",1),l6e=new dK("AREA_DRIVEN",2)}function YB(){YB=Y,Ice=new A$(Rpe,0),M8e=new A$("GROUP_DEC",1),T8e=new A$("GROUP_MIXED",2),C8e=new A$("GROUP_INC",3)}function Hjn(e,n){return gn(n.b&&n.c?Yb(n.b)+"->"+Yb(n.c):"e_"+Ni(n),e.b&&e.c?Yb(e.b)+"->"+Yb(e.c):"e_"+Ni(e))}function Gjn(e,n){return gn(n.b&&n.c?Yb(n.b)+"->"+Yb(n.c):"e_"+Ni(n),e.b&&e.c?Yb(e.b)+"->"+Yb(e.c):"e_"+Ni(e))}function zw(e,n){return Na(),Rf(Y0),k.Math.abs(e-n)<=Y0||e==n||isNaN(e)&&isNaN(n)?0:en?1:Bb(isNaN(e),isNaN(n))}function tde(e){SQ(),this.c=Pf(F(z(VBn,1),On,829,0,[Bun])),this.b=new wt,this.a=e,ei(this.b,SH,1),Ao(zun,new nSe(this))}function FE(e){var n;this.a=(n=u(e.e&&e.e(),10),new _l(n,u(Df(n,n.length),10),0)),this.b=se(Mr,On,1,this.a.a.length,5,1)}function fu(e){var n;return Array.isArray(e)&&e.Rm===bn?Pb(Us(e))+"@"+(n=Ni(e)>>>0,n.toString(16)):e.toString()}function qjn(e){var n;return e==null?!0:(n=e.length,n>0&&(Qn(n-1,e.length),e.charCodeAt(n-1)==58)&&!jQ(e,oA,sA))}function jQ(e,n,t){var i,r;for(i=0,r=e.length;i=r)return n.c+t;return n.c+n.b.gc()}function XFe(e,n){A9();var t,i,r,c;for(i=B$e(e),r=n,G9(i,0,i.length,r),t=0;t0&&(i+=r,++t);return t>1&&(i+=e.d*(t-1)),i}function rde(e){var n,t,i;for(i=new vd,i.a+="[",n=0,t=e.gc();n=0;--i)for(n=t[i],r=0;r>5,n=e&31,i=se($t,ni,30,t+1,15,1),i[t]=1<0&&(n.lengthe.i&&ir(n,e.i,null),n}function QB(e){var n;return(e.Db&64)!=0?LE(e):(n=new cf(LE(e)),n.a+=" (instanceClassName: ",Bc(n,e.D),n.a+=")",n.a)}function WB(e){var n,t,i,r;for(r=0,t=0,i=e.length;t0?(e.Zj(),i=n==null?0:Ni(n),r=(i&oi)%e.d.length,t=EUe(e,r,i,n),t!=-1):!1}function Co(e,n,t){var i,r,c;return e.Nj()?(i=e.i,c=e.Oj(),MO(e,i,n),r=e.Gj(3,null,n,i,c),t?t.lj(r):t=r):MO(e,e.i,n),t}function pa(e,n){var t,i,r;return e.f>0&&(e.Zj(),i=n==null?0:Ni(n),r=(i&oi)%e.d.length,t=W0e(e,r,i,n),t)?t.kd():null}function dEn(e,n,t){var i,r;return i=new L1(e.e,3,10,null,(r=n.c,X(r,88)?u(r,29):(jn(),jf)),$d(e,n),!1),t?t.lj(i):t=i,t}function bEn(e,n,t){var i,r;return i=new L1(e.e,4,10,(r=n.c,X(r,88)?u(r,29):(jn(),jf)),null,$d(e,n),!1),t?t.lj(i):t=i,t}function rJe(e,n){var t,i,r;return X(n,45)?(t=u(n,45),i=t.jd(),r=J2(e.Pc(),i),C1(r,t.kd())&&(r!=null||e.Pc()._b(i))):!1}function dde(e,n){switch(n){case 3:Lw(e,0);return;case 4:Pw(e,0);return;case 5:Os(e,0);return;case 6:Ns(e,0);return}R1e(e,n)}function Fw(e,n){switch(n.g){case 1:return M4(e.j,(ss(),Sve));case 2:return M4(e.j,(ss(),Ave));default:return En(),En(),Sc}}function J0(e){yh();var n,t;return t=Rt(e),n=Rt(Hb(e,32)),n!=0?new dLe(t,n):t>10||t<0?new I1(1,t):unn[t]}function cJe(e){U2();var n;return(e.q?e.q:(En(),En(),r1))._b((Ie(),mp))?n=u(C(e,mp),203):n=u(C(_r(e),yx),203),n}function gEn(e,n,t,i){var r,c;if(c=t-n,c<3)for(;c<3;)e*=10,++c;else{for(r=1;c>3;)r*=10,--c;e=(e+(r>>1))/r|0}return i.i=e,!0}function uJe(e,n,t){aBe(),wxe.call(this),this.a=j2(Tnn,[Me,Zge],[592,216],0,[pJ,wte],2),this.c=new y4,this.g=e,this.f=n,this.d=t}function oJe(e){this.e=se($t,ni,30,e.length,15,1),this.c=se(ts,ma,30,e.length,16,1),this.b=se(ts,ma,30,e.length,16,1),this.f=0}function wEn(e){var n,t;for(e.j=se(Jr,Jc,30,e.p.c.length,15,1),t=new P(e.p);t.a>5,n&=31,r=e.d+t+(n==0?0:1),i=se($t,ni,30,r,15,1),bMn(i,e.a,t,n),c=new Gb(e.e,r,i),gE(c),c}function b8(e,n,t){var i,r,c;for(r=null,c=e.b;c;){if(i=e.a.Le(n,c.d),t&&i==0)return c;i>=0?c=c.a[1]:(r=c,c=c.a[0])}return r}function _O(e,n,t){var i,r,c;for(r=null,c=e.b;c;){if(i=e.a.Le(n,c.d),t&&i==0)return c;i<=0?c=c.a[0]:(r=c,c=c.a[1])}return r}function CQ(e,n){for(var t=0;!n[t]||n[t]=="";)t++;for(var i=n[t++];t0?(k.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):"stack"in new Error}function kEn(e){var n;n=e.a;do n=u(rt(new Un(Yn(Ii(n).a.Jc(),new ee))),17).d.i,n.k==(Fn(),dr)&&Te(e.e,n);while(n.k==(Fn(),dr))}function jEn(e,n){var t,i,r;for(i=new Un(Yn(Ii(e).a.Jc(),new ee));ht(i);)if(t=u(rt(i),17),r=t.d.i,r.c==n)return!1;return!0}function dJe(e,n,t){var i,r,c,o;for(r=u(zn(e.b,t),171),i=0,o=new P(n.j);o.an?1:Bb(isNaN(e),isNaN(n)))>0}function pde(e,n){return Na(),Na(),Rf(Y0),(k.Math.abs(e-n)<=Y0||e==n||isNaN(e)&&isNaN(n)?0:en?1:Bb(isNaN(e),isNaN(n)))<0}function mJe(e,n){return Na(),Na(),Rf(Y0),(k.Math.abs(e-n)<=Y0||e==n||isNaN(e)&&isNaN(n)?0:en?1:Bb(isNaN(e),isNaN(n)))<=0}function mde(e){switch(e.g){case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:return!0;default:return!1}}function vde(e,n,t,i,r,c){this.a=e,this.c=n,this.b=t,this.f=i,this.d=r,this.e=c,this.c>0&&this.b>0&&(this.g=lR(this.c,this.b,this.a))}function xEn(e,n){var t=e.a,i;n=String(n),t.hasOwnProperty(n)&&(i=t[n]);var r=(WY(),rte)[typeof i],c=r?r(i):F1e(typeof i);return c}function g8(e){var n,t,i;if(i=null,n=Ch in e.a,t=!n,t)throw R(new lh("Every element must have an id."));return i=ry(O1(e,Ch)),i}function Jw(e){var n,t;for(t=qGe(e),n=null;e.c==2;)fi(e),n||(n=(ai(),ai(),new Vj(2)),fg(n,t),t=n),t.Hm(qGe(e));return t}function nz(e,n){var t,i,r;return e.Zj(),i=n==null?0:Ni(n),r=(i&oi)%e.d.length,t=W0e(e,r,i,n),t?(pBe(e,t),t.kd()):null}function ph(e,n,t){var i,r,c,o;for(c=n+t,Qr(n,c,e.length),o="",r=n;rn.e?1:e.en.d?e.e:e.d=48&&e<48+k.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function AEn(e,n){if(n.c==e)return n.d;if(n.d==e)return n.c;throw R(new qn("Input edge is not connected to the input port."))}function mh(e,n){if(e.a<0)throw R(new Uc("Did not call before(...) or after(...) before calling add(...)."));return ble(e,e.a,n),e}function yde(e){return BR(),X(e,166)?u(zn(eD,ann),296).Qg(e):so(eD,Us(e))?u(zn(eD,Us(e)),296).Qg(e):null}function Lo(e){var n,t;return(e.Db&32)==0&&(t=(n=u(Xn(e,16),29),dt(n||e.fi())-dt(e.fi())),t!=0&&Q4(e,32,se(Mr,On,1,t,5,1))),e}function Q4(e,n,t){var i;(e.Db&n)!=0?t==null?qTn(e,n):(i=YQ(e,n),i==-1?e.Eb=t:ir(G4(e.Eb),i,t)):t!=null&&aIn(e,n,t)}function MEn(e,n,t,i){var r,c;n.c.length!=0&&(r=cNn(t,i),c=dTn(n),er(dB(new mn(null,new vn(c,1)),new p_),new HDe(e,t,r,i)))}function CEn(e,n){var t,i,r,c;return i=e.a.length-1,t=n-e.b&i,c=e.c-n&i,r=e.c-e.b&i,xOe(t=c?(Pkn(e,n),-1):(Lkn(e,n),1)}function TEn(e,n){var t,i;for(t=(Qn(n,e.length),e.charCodeAt(n)),i=n+1;in.e?1:e.fn.f?1:Ni(e)-Ni(n)}function EJe(e,n){var t;return ue(n)===ue(e)?!0:!X(n,22)||(t=u(n,22),t.gc()!=e.gc())?!1:e.Hc(t)}function tz(e,n){return _n(e),n==null?!1:gn(e,n)?!0:e.length==n.length&&gn(e.toLowerCase(),n.toLowerCase())}function q2(e){var n,t;return ao(e,-129)>0&&ao(e,128)<0?(mIe(),n=Rt(e)+128,t=Ome[n],!t&&(t=Ome[n]=new Sn(e)),t):new Sn(e)}function W4(){W4=Y,ex=new a$(va,0),vve=new a$("INSIDE_PORT_SIDE_GROUPS",1),Ote=new a$("GROUP_MODEL_ORDER",2),Nte=new a$(eee,3)}function iz(e){var n,t,i;if(i=e.Gh(),!i)for(n=0,t=e.Mh();t;t=t.Mh()){if(++n>RZ)return t.Nh();if(i=t.Gh(),i||t==e)break}return i}function IEn(e){var n;return e.b||fgn(e,(n=f2n(e.e,e.a),!n||!gn(hne,pa((!n.b&&(n.b=new Hs((jn(),Ac),Du,n)),n.b),"qualified")))),e.c}function DEn(e){var n,t;for(t=new P(e.a.b);t.a2e3&&(Yen=e,fJ=k.setTimeout(Agn,10))),lJ++==0?(o8n((Coe(),yme)),!0):!1}function qEn(e,n,t){var i;(mnn?(rEn(e),!0):vnn||knn?(y9(),!0):ynn&&(y9(),!1))&&(i=new NNe(n),i.b=t,UMn(e,i))}function NQ(e,n){var t;t=!e.A.Gc((Vs(),_g))||e.q==(Br(),to),e.u.Gc((ps(),Z1))?t?dRn(e,n):AVe(e,n):e.u.Gc(mb)&&(t?L$n(e,n):FVe(e,n))}function UEn(e,n,t){var i,r;hW(e.e,n,t,(De(),Vn)),hW(e.i,n,t,et),e.a&&(r=u(C(n,(me(),mi)),12),i=u(C(t,mi),12),ZV(e.g,r,i))}function CJe(e){var n;ue(je(e,(Xt(),W3)))===ue((B1(),lG))&&(Fi(e)?(n=u(je(Fi(e),W3),347),Ei(e,W3,n)):Ei(e,W3,Wx))}function TJe(e,n,t){return new _f(k.Math.min(e.a,n.a)-t/2,k.Math.min(e.b,n.b)-t/2,k.Math.abs(e.a-n.a)+t,k.Math.abs(e.b-n.b)+t)}function OJe(e){var n;this.d=new Oe,this.j=new Vr,this.g=new Vr,n=e.g.b,this.f=u(C(_r(n),(Ie(),wl)),86),this.e=ne(re(uz(n,Om)))}function NJe(e){this.d=new Oe,this.e=new D0,this.c=se($t,ni,30,(De(),F(z(xc,1),qu,64,0,[ju,Kn,et,bt,Vn])).length,15,1),this.b=e}function xde(e,n,t){var i;switch(i=t[e.g][n],e.g){case 1:case 3:return new Se(0,i);case 2:case 4:return new Se(i,0);default:return null}}function XEn(e,n){var t;if(t=Qv(e.o,n),t==null)throw R(new lh("Node did not exist in input."));return Sbe(e,n),$W(e,n),bbe(e,n,t),null}function IJe(e,n){var t,i;for(i=e.a.length,n.lengthi&&ir(n,i,null),n}function Ba(e,n){var t,i;for(i=e.c.length,n.lengthi&&ir(n,i,null),n}function IQ(e,n,t,i){var r;if(r=e.length,n>=r)return r;for(n=n>0?n:0;n0&&(Te(e.b,new VNe(n.a,t)),i=n.a.length,0i&&(n.a+=GTe(se(Wl,Eh,30,-i,15,1))))}function LJe(e,n,t){var i,r,c;if(!t[n.d])for(t[n.d]=!0,r=new P(r3(n));r.a=e.b>>1)for(i=e.c,t=e.b;t>n;--t)i=i.b;else for(i=e.a.a,t=0;t=0?e.Th(r):jW(e,i)):t<0?jW(e,i):u(i,69).uk().zk(e,e.ei(),t)}function BJe(e){var n,t,i;for(i=(!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),e.o),t=i.c.Jc();t.e!=t.i.gc();)n=u(t.Wj(),45),n.kd();return nO(i)}function Le(e){var n;if(X(e.a,4)){if(n=yde(e.a),n==null)throw R(new Uc(wWe+e.b+"'. "+gWe+(M1(nD),nD.k)+C2e));return n}else return e.a}function rSn(e){var n;if(e==null)return null;if(n=kRn(bo(e,!0)),n==null)throw R(new TX("Invalid base64Binary value: '"+e+"'"));return n}function ft(e){var n;try{return n=e.i.Xb(e.e),e.Vj(),e.g=e.e++,n}catch(t){throw t=sr(t),X(t,99)?(e.Vj(),R(new hu)):R(t)}}function PQ(e){var n;try{return n=e.c.Ti(e.e),e.Vj(),e.g=e.e++,n}catch(t){throw t=sr(t),X(t,99)?(e.Vj(),R(new hu)):R(t)}}function cz(e){var n,t,i,r;for(r=0,t=0,i=e.length;t=64&&n<128&&(r=bh(r,qh(1,n-64)));return r}function uz(e,n){var t,i;return i=null,wi(e,(Xt(),Xy))&&(t=u(C(e,Xy),105),t.nf(n)&&(i=t.mf(n))),i==null&&_r(e)&&(i=C(_r(e),n)),i}function cSn(e,n){var t;return t=u(C(e,(Ie(),Wc)),78),IK(n,tin)?t?qs(t):(t=new xs,he(e,Wc,t)):t&&he(e,Wc,null),t}function uSn(e,n){var t,i,r;for(r=new xo(n.gc()),i=n.Jc();i.Ob();)t=u(i.Pb(),294),t.c==t.f?E8(e,t,t.c):yCn(e,t)||Gn(r.c,t);return r}function zJe(e,n){var t,i,r;for(t=e.o,r=u(u(vi(e.r,n),22),83).Jc();r.Ob();)i=u(r.Pb(),115),i.e.a=sxn(i,t.a),i.e.b=t.b*ne(re(i.b.mf(mJ)))}function oSn(e,n){var t,i,r,c;return r=e.k,t=ne(re(C(e,(me(),gp)))),c=n.k,i=ne(re(C(n,gp))),c!=(Fn(),wr)?-1:r!=wr?1:t==i?0:tt.b)return!0}return!1}function HJe(e){var n;return n=new y0,n.a+="n",e.k!=(Fn(),Wi)&&Kt(Kt((n.a+="(",n),RK(e.k).toLowerCase()),")"),Kt((n.a+="_",n),$O(e)),n.a}function GE(){GE=Y,D4e=new aT(Rpe,0),Zie=new aT(cee,1),ere=new aT("LINEAR_SEGMENTS",2),Ex=new aT("BRANDES_KOEPF",3),Sx=new aT(zQe,4)}function Z4(e,n,t,i){var r;return t>=0?e.Ph(n,t,i):(e.Mh()&&(i=(r=e.Ch(),r>=0?e.xh(i):e.Mh().Qh(e,-1-r,null,i))),e.zh(n,t,i))}function Ade(e,n){switch(n){case 7:!e.e&&(e.e=new Nn(pr,e,7,4)),kt(e.e);return;case 8:!e.d&&(e.d=new Nn(pr,e,8,5)),kt(e.d);return}dde(e,n)}function Ei(e,n,t){return t==null?(!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),nz(e.o,n)):(!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),zO(e.o,n,t)),e}function Yu(e,n){var t;t=e.dd(n);try{return t.Pb()}catch(i){throw i=sr(i),X(i,112)?R(new jo("Can't get element "+n)):R(i)}}function GJe(e,n){var t;switch(t=u(zc(e.b,n),127).n,n.g){case 1:e.t>=0&&(t.d=e.t);break;case 3:e.t>=0&&(t.a=e.t)}e.C&&(t.b=e.C.b,t.c=e.C.c)}function bSn(e){var n;n=e.a;do n=u(rt(new Un(Yn(cr(n).a.Jc(),new ee))),17).c.i,n.k==(Fn(),dr)&&e.b.Ec(n);while(n.k==(Fn(),dr));e.b=Ks(e.b)}function qJe(e,n){var t,i,r;for(r=e,i=new Un(Yn(cr(n).a.Jc(),new ee));ht(i);)t=u(rt(i),17),t.c.i.c&&(r=k.Math.max(r,t.c.i.c.p));return r}function gSn(e,n){var t,i,r;for(r=0,i=u(u(vi(e.r,n),22),83).Jc();i.Ob();)t=u(i.Pb(),115),r+=t.d.d+t.b.Kf().b+t.d.a,i.Ob()&&(r+=e.w);return r}function wSn(e,n){var t,i,r;for(r=0,i=u(u(vi(e.r,n),22),83).Jc();i.Ob();)t=u(i.Pb(),115),r+=t.d.b+t.b.Kf().a+t.d.c,i.Ob()&&(r+=e.w);return r}function UJe(e){var n,t,i,r;if(i=0,r=W2(e),r.c.length==0)return 1;for(t=new P(r);t.a=0?e.Ih(o,t,!0):Xw(e,c,t)):u(c,69).uk().wk(e,e.ei(),r,t,i)}function vSn(e,n,t,i){var r,c;c=n.nf((Xt(),e5))?u(n.mf(e5),22):e.j,r=hjn(c),r!=(nF(),pte)&&(t&&!mde(r)||O0e(_On(e,r,i),n))}function $Q(e,n){return $r(e)?!!Hen[n]:e.Qm?!!e.Qm[n]:g2(e)?!!Jen[n]:b2(e)?!!Fen[n]:!1}function ySn(e){switch(e.g){case 1:return Rw(),VN;case 3:return Rw(),KN;case 2:return Rw(),vte;case 4:return Rw(),mte;default:return null}}function kSn(e,n,t){if(e.e)switch(e.b){case 1:P5n(e.c,n,t);break;case 0:$5n(e.c,n,t)}else sPe(e.c,n,t);e.a[n.p][t.p]=e.c.i,e.a[t.p][n.p]=e.c.e}function KJe(e){var n,t;if(e==null)return null;for(t=se(u1,Me,199,e.length,0,2),n=0;nc?1:0):0}function U2(){U2=Y,MH=new g$(va,0),Qie=new g$("PORT_POSITION",1),U3=new g$("NODE_SIZE_WHERE_SPACE_PERMITS",2),q3=new g$("NODE_SIZE",3)}function jSn(e,n){var t,i,r;for(n.Tg("Untreeify",1),t=u(C(e,(Ti(),yye)),16),r=t.Jc();r.Ob();)i=u(r.Pb(),65),Vt(i.b.d,i),Vt(i.c.b,i);n.Ug()}function Yh(){Yh=Y,lce=new Bj("AUTOMATIC",0),NI=new Bj(by,1),II=new Bj(gy,2),iG=new Bj("TOP",3),nG=new Bj(nwe,4),tG=new Bj(H8,5)}function o3(e,n,t){var i,r;if(r=e.gc(),n>=r)throw R(new k2(n,r));if(e.Qi()&&(i=e.bd(t),i>=0&&i!=n))throw R(new qn(BN));return e.Vi(n,t)}function $d(e,n){var t,i,r;if(r=OHe(e,n),r>=0)return r;if(e.ml()){for(i=0;i0||e==(EX(),Yne)||n==(SX(),Qne))throw R(new qn("Invalid range: "+oPe(e,n)))}function Cde(e,n,t,i){C8();var r,c;for(r=0,c=0;c0),(n&-n)==n)return lc(n*Ds(e,31)*4656612873077393e-25);do t=Ds(e,31),i=t%n;while(t-i+(n-1)<0);return lc(i)}function ESn(e,n){var t,i,r;for(t=kw(new Lb,e),r=new P(n);r.a1&&(c=ESn(e,n)),c}function CSn(e){var n,t,i;for(n=0,i=new P(e.c.a);i.a102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function qQ(e,n){if(e==null)throw R(new f4("null key in entry: null="+n));if(n==null)throw R(new f4("null value in entry: "+e+"=null"))}function tHe(e,n){var t;return t=F(z(Jr,1),Jc,30,15,[fQ(e.a[0],n),fQ(e.a[1],n),fQ(e.a[2],n)]),e.d&&(t[0]=k.Math.max(t[0],t[2]),t[2]=t[0]),t}function iHe(e,n){var t;return t=F(z(Jr,1),Jc,30,15,[FB(e.a[0],n),FB(e.a[1],n),FB(e.a[2],n)]),e.d&&(t[0]=k.Math.max(t[0],t[2]),t[2]=t[0]),t}function Ide(e,n,t){A4(u(C(n,(Ie(),Zi)),102))||(Xae(e,n,Rd(n,t)),Xae(e,n,Rd(n,(De(),bt))),Xae(e,n,Rd(n,Kn)),En(),Tr(n.j,new tEe(e)))}function rHe(e){var n,t;for(e.c||TPn(e),t=new xs,n=new P(e.a),_(n);n.a0&&(Qn(0,n.length),n.charCodeAt(0)==43)?(Qn(1,n.length+1),n.substr(1)):n))}function qSn(e){var n;return e==null?null:new A0((n=bo(e,!0),n.length>0&&(Qn(0,n.length),n.charCodeAt(0)==43)?(Qn(1,n.length+1),n.substr(1)):n))}function _de(e,n,t,i,r,c,o,l){var f,h;i&&(f=i.a[0],f&&_de(e,n,t,f,r,c,o,l),eW(e,t,i.d,r,c,o,l)&&n.Ec(i),h=i.a[1],h&&_de(e,n,t,h,r,c,o,l))}function qE(e,n){var t,i,r,c;for(c=e.gc(),n.lengthc&&ir(n,c,null),n}function USn(e,n){var t,i;if(i=e.gc(),n==null){for(t=0;t0&&(f+=r),h[b]=o,o+=l*(f+i)}function ZSn(e){var n;for(n=0;n0?e.c:0),++r;e.b=i,e.d=c}function wHe(e,n){var t;return t=F(z(Jr,1),Jc,30,15,[Tde(e,(wa(),Ou),n),Tde(e,No,n),Tde(e,Nu,n)]),e.f&&(t[0]=k.Math.max(t[0],t[2]),t[2]=t[0]),t}function pHe(e){var n;wi(e,(Ie(),pp))&&(n=u(C(e,pp),22),n.Gc((Q2(),Yf))?(n.Kc(Yf),n.Ec(Qf)):n.Gc(Qf)&&(n.Kc(Qf),n.Ec(Yf)))}function mHe(e){var n;wi(e,(Ie(),pp))&&(n=u(C(e,pp),22),n.Gc((Q2(),Zf))?(n.Kc(Zf),n.Ec(pf)):n.Gc(pf)&&(n.Kc(pf),n.Ec(Zf)))}function QQ(e,n,t,i){var r,c,o,l;return e.a==null&&YMn(e,n),o=n.b.j.c.length,c=t.d.p,l=i.d.p,r=l-1,r<0&&(r=o-1),c<=r?e.a[r]-e.a[c]:e.a[o-1]-e.a[c]+e.a[r]}function exn(e){var n;for(n=0;n0&&(r.b+=n),r}function gz(e,n){var t,i,r;for(r=new Vr,i=e.Jc();i.Ob();)t=u(i.Pb(),37),T8(t,0,r.b),r.b+=t.f.b+n,r.a=k.Math.max(r.a,t.f.a);return r.a>0&&(r.a+=n),r}function yHe(e,n){var t,i;if(n.length==0)return 0;for(t=CV(e.a,n[0],(De(),Vn)),t+=CV(e.a,n[n.length-1],et),i=0;i>16==6?e.Cb.Qh(e,5,Aa,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||e.fi()),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function uxn(e){B9();var n=e.e;if(n&&n.stack){var t=n.stack,i=n+` +`;return t.substring(0,i.length)==i&&(t=t.substring(i.length)),t.split(` +`)}return[]}function oxn(e){var n;return n=(TBe(),nnn),n[e>>>28]|n[e>>24&15]<<4|n[e>>20&15]<<8|n[e>>16&15]<<12|n[e>>12&15]<<16|n[e>>8&15]<<20|n[e>>4&15]<<24|n[e&15]<<28}function jHe(e){var n,t,i;e.b==e.c&&(i=e.a.length,t=b1e(k.Math.max(8,i))<<1,e.b!=0?(n=Df(e.a,t),_Be(e,n,i),e.a=n,e.b=0):r2(e.a,t),e.c=i)}function sxn(e,n){var t;return t=e.b,t.nf((Xt(),Ps))?t.$f()==(De(),Vn)?-t.Kf().a-ne(re(t.mf(Ps))):n+ne(re(t.mf(Ps))):t.$f()==(De(),Vn)?-t.Kf().a:n}function $O(e){var n;return e.b.c.length!=0&&u(Pe(e.b,0),70).a?u(Pe(e.b,0),70).a:(n=IV(e),n??""+(e.c?pu(e.c.a,e,0):-1))}function wz(e){var n;return e.f.c.length!=0&&u(Pe(e.f,0),70).a?u(Pe(e.f,0),70).a:(n=IV(e),n??""+(e.i?pu(e.i.j,e,0):-1))}function lxn(e,n){var t,i;if(n<0||n>=e.gc())return null;for(t=n;t0?e.c:0),r=k.Math.max(r,n.d),++i;e.e=c,e.b=r}function fxn(e){var n,t;if(!e.b)for(e.b=JR(u(e.f,125).jh().i),t=new st(u(e.f,125).jh());t.e!=t.i.gc();)n=u(ft(t),157),Te(e.b,new MX(n));return e.b}function axn(e,n){var t,i,r;if(n.dc())return A9(),A9(),tD;for(t=new VOe(e,n.gc()),r=new st(e);r.e!=r.i.gc();)i=ft(r),n.Gc(i)&&Et(t,i);return t}function $de(e,n,t,i){return n==0?i?(!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),e.o):(!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),nO(e.o)):sz(e,n,t,i)}function ZQ(e){var n,t;if(e.rb)for(n=0,t=e.rb.i;n>22),r+=i>>22,r<0)?!1:(e.l=t&Ls,e.m=i&Ls,e.h=r&G1,!0)}function eW(e,n,t,i,r,c,o){var l,f;return!(n.Re()&&(f=e.a.Le(t,i),f<0||!r&&f==0)||n.Se()&&(l=e.a.Le(t,c),l>0||!o&&l==0))}function gxn(e,n){i8();var t;if(t=e.j.g-n.j.g,t!=0)return 0;switch(e.j.g){case 2:return kQ(n,h3e)-kQ(e,h3e);case 4:return kQ(e,a3e)-kQ(n,a3e)}return 0}function wxn(e){switch(e.g){case 0:return rie;case 1:return cie;case 2:return uie;case 3:return oie;case 4:return YJ;case 5:return sie;default:return null}}function Qc(e,n,t){var i,r;return i=(r=new kX,cg(r,n),Mo(r,t),Et((!e.c&&(e.c=new we(jp,e,12,10)),e.c),r),r),Nd(i,0),$2(i,1),Pd(i,!0),Ld(i,!0),i}function ey(e,n){var t,i;if(n>=e.i)throw R(new EK(n,e.i));return++e.j,t=e.g[n],i=e.i-n-1,i>0&&Wu(e.g,n+1,e.g,n,i),ir(e.g,--e.i,null),e.Oi(n,t),e.Li(),t}function EHe(e,n){var t,i;return e.Db>>16==17?e.Cb.Qh(e,21,vf,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||e.fi()),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function pxn(e){var n,t,i,r;for(En(),Tr(e.c,e.a),r=new P(e.c);r.at.a.c.length))throw R(new qn("index must be >= 0 and <= layer node count"));e.c&&qo(e.c.a,e),e.c=t,t&&zb(t.a,n,e)}function NHe(e,n){this.c=new wt,this.a=e,this.b=n,this.d=u(C(e,(me(),z3)),316),ue(C(e,(Ie(),o4e)))===ue((uO(),QJ))?this.e=new yxe:this.e=new vxe}function Exn(e,n){var t,i,r,c;for(c=0,i=new P(e);i.a0?n:0),++t;return new Se(i,r)}function Sxn(e,n){var t,i;for(e.b=0,e.d=new BP,i=new P(n.a);i.a>16==6?e.Cb.Qh(e,6,pr,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(Gu(),wG)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function Hde(e,n){var t,i;return e.Db>>16==7?e.Cb.Qh(e,1,QI,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(Gu(),L8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function Gde(e,n){var t,i;return e.Db>>16==9?e.Cb.Qh(e,9,Ft,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(Gu(),$8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function _He(e,n){var t,i;return e.Db>>16==5?e.Cb.Qh(e,9,xG,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(jn(),n0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function LHe(e,n){var t,i;return e.Db>>16==7?e.Cb.Qh(e,6,Aa,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(jn(),i0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function qde(e,n){var t,i;return e.Db>>16==3?e.Cb.Qh(e,0,ZI,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(jn(),e0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function Ude(e,n){var t,i;return e.Db>>16==3?e.Cb.Qh(e,12,Ft,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(Gu(),_8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function Cxn(e,n,t){var i,r,c;for(t<0&&(t=0),c=e.i,r=t;rRZ)return m8(e,i);if(i==e)return!0}}return!1}function Oxn(e){switch(H$(),e.q.g){case 5:jqe(e,(De(),Kn)),jqe(e,bt);break;case 4:CUe(e,(De(),Kn)),CUe(e,bt);break;default:OVe(e,(De(),Kn)),OVe(e,bt)}}function Nxn(e){switch(H$(),e.q.g){case 5:Fqe(e,(De(),et)),Fqe(e,Vn);break;case 4:zJe(e,(De(),et)),zJe(e,Vn);break;default:NVe(e,(De(),et)),NVe(e,Vn)}}function Ixn(e){var n,t;n=u(C(e,(Hf(),Etn)),15),n?(t=n.a,t==0?he(e,(L0(),jJ),new yQ):he(e,(L0(),jJ),new VR(t))):he(e,(L0(),jJ),new VR(1))}function Dxn(e,n){var t;switch(t=e.i,n.g){case 1:return-(e.n.b+e.o.b);case 2:return e.n.a-t.o.a;case 3:return e.n.b-t.o.b;case 4:return-(e.n.a+e.o.a)}return 0}function _xn(e,n){switch(e.g){case 0:return n==(Xs(),V1)?JJ:HJ;case 1:return n==(Xs(),V1)?JJ:eI;case 2:return n==(Xs(),V1)?eI:HJ;default:return eI}}function BO(e,n){var t,i,r;for(qo(e.a,n),e.e-=n.r+(e.a.c.length==0?0:e.c),r=qee,i=new P(e.a);i.a>16==11?e.Cb.Qh(e,10,Ft,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(Gu(),P8e)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function PHe(e,n){var t,i;return e.Db>>16==10?e.Cb.Qh(e,11,vf,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(jn(),t0)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function $He(e,n){var t,i;return e.Db>>16==10?e.Cb.Qh(e,12,yf,n):(i=Oc(u(Mn((t=u(Xn(e,16),29),t||(jn(),Km)),e.Db>>16),19)),e.Cb.Qh(e,i.n,i.f,n))}function RHe(e,n){var t,i,r,c,o;if(n)for(r=n.a.length,t=new Jb(r),o=(t.b-t.a)*t.c<0?(S0(),Eb):new M0(t);o.Ob();)c=u(o.Pb(),15),i=F9(n,c.a),i&&jUe(e,i)}function Fxn(){nse();var e,n;for(sBn((C0(),Bn)),WRn(Bn),ZQ(Bn),Q8e=(jn(),rh),n=new P(u7e);n.a>19,h=n.h>>19,f!=h?h-f:(r=e.h,l=n.h,r!=l?r-l:(i=e.m,o=n.m,i!=o?i-o:(t=e.l,c=n.l,t-c)))}function BHe(e,n,t){var i,r,c,o,l;for(r=e[t.g],l=new P(n.d);l.a0?e.b:0),++t;n.b=i,n.e=r}function zHe(e){var n,t,i;if(i=e.b,wMe(e.i,i.length)){for(t=i.length*2,e.b=se(Wne,gN,308,t,0,1),e.c=se(Wne,gN,308,t,0,1),e.f=t-1,e.i=0,n=e.a;n;n=n.c)XO(e,n,n);++e.g}}function KE(e,n){return e.b.a=k.Math.min(e.b.a,n.c),e.b.b=k.Math.min(e.b.b,n.d),e.a.a=k.Math.max(e.a.a,n.c),e.a.b=k.Math.max(e.a.b,n.d),Gn(e.c,n),!0}function Hxn(e,n,t){var i;i=n.c.i,i.k==(Fn(),dr)?(he(e,(me(),Ea),u(C(i,Ea),12)),he(e,gf,u(C(i,gf),12))):(he(e,(me(),Ea),n.c),he(e,gf,t.d))}function v8(e,n,t){M8();var i,r,c,o,l,f;return o=n/2,c=t/2,i=k.Math.abs(e.a),r=k.Math.abs(e.b),l=1,f=1,i>o&&(l=o/i),r>c&&(f=c/r),A1(e,k.Math.min(l,f)),e}function Gxn(){Uz();var e,n;try{if(n=u(r0e((E0(),kf),o7),2075),n)return n}catch(t){if(t=sr(t),X(t,101))e=t,Ffe((Lt(),e));else throw R(t)}return new hU}function qxn(){Uz();var e,n;try{if(n=u(r0e((E0(),kf),hf),2002),n)return n}catch(t){if(t=sr(t),X(t,101))e=t,Ffe((Lt(),e));else throw R(t)}return new lw}function Uxn(){H$e();var e,n;try{if(n=u(r0e((E0(),kf),vg),2084),n)return n}catch(t){if(t=sr(t),X(t,101))e=t,Ffe((Lt(),e));else throw R(t)}return new lC}function Xxn(e,n,t){var i,r;return r=e.e,e.e=n,(e.Db&4)!=0&&(e.Db&1)==0&&(i=new Dr(e,1,4,r,n),t?t.lj(i):t=i),r!=n&&(n?t=_8(e,Iz(e,n),t):t=_8(e,e.a,t)),t}function FHe(){r$.call(this),this.e=-1,this.a=!1,this.p=Xr,this.k=-1,this.c=-1,this.b=-1,this.g=!1,this.f=-1,this.j=-1,this.n=-1,this.i=-1,this.d=-1,this.o=Xr}function Kxn(e,n){var t,i,r;if(i=e.b.d.d,e.a||(i+=e.b.d.a),r=n.b.d.d,n.a||(r+=n.b.d.a),t=ji(i,r),t==0){if(!e.a&&n.a)return-1;if(!n.a&&e.a)return 1}return t}function Vxn(e,n){var t,i,r;if(i=e.b.b.d,e.a||(i+=e.b.b.a),r=n.b.b.d,n.a||(r+=n.b.b.a),t=ji(i,r),t==0){if(!e.a&&n.a)return-1;if(!n.a&&e.a)return 1}return t}function Yxn(e,n){var t,i,r;if(i=e.b.g.d,e.a||(i+=e.b.g.a),r=n.b.g.d,n.a||(r+=n.b.g.a),t=ji(i,r),t==0){if(!e.a&&n.a)return-1;if(!n.a&&e.a)return 1}return t}function Vde(){Vde=Y,Ftn=Eo(qt(qt(qt(new or,(zr(),no),(Ur(),Qve)),no,Wve),Pc,Zve),Pc,zve),Htn=qt(qt(new or,no,Dve),no,Fve),Jtn=Eo(new or,Pc,Hve)}function Qxn(e){var n,t,i,r,c;for(n=u(C(e,(me(),sx)),92),c=e.n,i=n.Bc().Jc();i.Ob();)t=u(i.Pb(),318),r=t.i,r.c+=c.a,r.d+=c.b,t.c?dXe(t):bXe(t);he(e,sx,null)}function Wxn(e,n,t){var i,r;switch(r=e.b,i=r.d,n.g){case 1:return-i.d-t;case 2:return r.o.a+i.c+t;case 3:return r.o.b+i.a+t;case 4:return-i.b-t;default:return-1}}function JHe(e,n){var t,i;for(i=new P(n);i.a0&&(o=(c&oi)%e.d.length,r=W0e(e,o,c,n),r)?(l=r.ld(t),l):(i=e.ak(c,n,t),e.c.Ec(i),null)}function Wde(e,n){var t,i,r,c;switch(_d(e,n).Il()){case 3:case 2:{for(t=g3(n),r=0,c=t.i;r=0;i--)if(gn(e[i].d,n)||gn(e[i].d,t)){e.length>=i+1&&e.splice(0,i+1);break}return e}function FO(e,n){var t;return su(e)&&su(n)&&(t=e/n,mN0&&(e.b+=2,e.a+=i):(e.b+=1,e.a+=k.Math.min(i,r))}function VHe(e,n){var t,i;if(i=!1,$r(n)&&(i=!0,D4(e,new M2(Pt(n)))),i||X(n,242)&&(i=!0,D4(e,(t=UK(u(n,242)),new Av(t)))),!i)throw R(new CX(U2e))}function gAn(e,n,t,i){var r,c,o;return r=new L1(e.e,1,10,(o=n.c,X(o,88)?u(o,29):(jn(),jf)),(c=t.c,X(c,88)?u(c,29):(jn(),jf)),$d(e,n),!1),i?i.lj(r):i=r,i}function n0e(e){var n,t;switch(u(C(_r(e),(Ie(),Z5e)),420).g){case 0:return n=e.n,t=e.o,new Se(n.a+t.a/2,n.b+t.b/2);case 1:return new wc(e.n);default:return null}}function JO(){JO=Y,WJ=new Pj(va,0),T3e=new Pj("LEFTUP",1),N3e=new Pj("RIGHTUP",2),C3e=new Pj("LEFTDOWN",3),O3e=new Pj("RIGHTDOWN",4),lie=new Pj("BALANCED",5)}function wAn(e,n,t){var i,r,c;if(i=ji(e.a[n.p],e.a[t.p]),i==0){if(r=u(C(n,(me(),Dy)),16),c=u(C(t,Dy),16),r.Gc(t))return-1;if(c.Gc(n))return 1}return i}function pAn(e){switch(e.g){case 1:return new $_;case 2:return new _k;case 3:return new H5;case 0:return null;default:throw R(new qn(Wee+(e.f!=null?e.f:""+e.g)))}}function t0e(e,n,t){switch(n){case 1:!e.n&&(e.n=new we(Eu,e,1,7)),kt(e.n),!e.n&&(e.n=new we(Eu,e,1,7)),nr(e.n,u(t,18));return;case 2:V9(e,Pt(t));return}E1e(e,n,t)}function i0e(e,n,t){switch(n){case 3:Lw(e,ne(re(t)));return;case 4:Pw(e,ne(re(t)));return;case 5:Os(e,ne(re(t)));return;case 6:Ns(e,ne(re(t)));return}t0e(e,n,t)}function pz(e,n,t){var i,r,c;c=(i=new kX,i),r=Fa(c,n,null),r&&r.mj(),Mo(c,t),Et((!e.c&&(e.c=new we(jp,e,12,10)),e.c),c),Nd(c,0),$2(c,1),Pd(c,!0),Ld(c,!0)}function r0e(e,n){var t,i,r;return t=Dj(e.i,n),X(t,241)?(r=u(t,241),r.wi()==null,r.ti()):X(t,493)?(i=u(t,1999),r=i.b,r):null}function mAn(e,n,t,i){var r,c;return Nt(n),Nt(t),c=u(nE(e.d,n),15),SRe(!!c,"Row %s not in %s",n,e.e),r=u(nE(e.b,t),15),SRe(!!r,"Column %s not in %s",t,e.c),Eze(e,c.a,r.a,i)}function vAn(e){var n,t,i,r,c,o;for(t=null,r=e,c=0,o=r.length;c1||l==-1?(c=u(f,16),r.Wb(tEn(e,c))):r.Wb(FW(e,u(f,57)))))}function AAn(e,n,t,i){kMe();var r=Kne;function c(){for(var o=0;o0)return!1;return!0}function TAn(e){switch(u(C(e.b,(Ie(),U5e)),381).g){case 1:er(So(lu(new mn(null,new vn(e.d,16)),new tw),new r_),new iM);break;case 2:uDn(e);break;case 0:ZCn(e)}}function OAn(e,n,t){var i,r,c;for(i=t,!i&&(i=new s4),i.Tg("Layout",e.a.c.length),c=new P(e.a);c.aKee)return t;r>-1e-6&&++t}return t}function vz(e,n,t){if(X(n,271))return iNn(e,u(n,85),t);if(X(n,276))return Lxn(e,u(n,276),t);throw R(new qn(s7+Ja(new Su(F(z(Mr,1),On,1,5,[n,t])))))}function yz(e,n,t){if(X(n,271))return rNn(e,u(n,85),t);if(X(n,276))return Pxn(e,u(n,276),t);throw R(new qn(s7+Ja(new Su(F(z(Mr,1),On,1,5,[n,t])))))}function u0e(e,n){var t;n!=e.b?(t=null,e.b&&(t=LR(e.b,e,-4,t)),n&&(t=Z4(n,e,-4,t)),t=mFe(e,n,t),t&&t.mj()):(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,3,n,n))}function ZHe(e,n){var t;n!=e.f?(t=null,e.f&&(t=LR(e.f,e,-1,t)),n&&(t=Z4(n,e,-1,t)),t=vFe(e,n,t),t&&t.mj()):(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,0,n,n))}function LAn(e,n,t,i){var r,c,o,l;return Fs(e.e)&&(r=n.Jk(),l=n.kd(),c=t.kd(),o=O0(e,1,r,l,c,r.Hk()?N8(e,r,c,X(r,103)&&(u(r,19).Bb&Ec)!=0):-1,!0),i?i.lj(o):i=o),i}function eGe(e){var n,t,i;if(e==null)return null;if(t=u(e,16),t.dc())return"";for(i=new vd,n=t.Jc();n.Ob();)Bc(i,(Si(),Pt(n.Pb()))),i.a+=" ";return jK(i,i.a.length-1)}function nGe(e){var n,t,i;if(e==null)return null;if(t=u(e,16),t.dc())return"";for(i=new vd,n=t.Jc();n.Ob();)Bc(i,(Si(),Pt(n.Pb()))),i.a+=" ";return jK(i,i.a.length-1)}function PAn(e,n){var t,i,r,c,o;for(c=new P(n.a);c.a0&&rc(e,e.length-1)==33)try{return n=wUe(of(e,0,e.length-1)),n.e==null}catch(t){if(t=sr(t),!X(t,32))throw R(t)}return!1}function zAn(e,n,t){var i,r,c;switch(i=_r(n),r=UB(i),c=new Qu,wu(c,n),t.g){case 1:Ar(c,NO(Y4(r)));break;case 2:Ar(c,Y4(r))}return he(c,(Ie(),Am),re(C(e,Am))),c}function o0e(e){var n,t;return n=u(rt(new Un(Yn(cr(e.a).a.Jc(),new ee))),17),t=u(rt(new Un(Yn(Ii(e.a).a.Jc(),new ee))),17),Fe(ze(C(n,(me(),qd))))||Fe(ze(C(t,qd)))}function X2(){X2=Y,nI=new lT("ONE_SIDE",0),UJ=new lT("TWO_SIDES_CORNER",1),XJ=new lT("TWO_SIDES_OPPOSING",2),qJ=new lT("THREE_SIDES",3),GJ=new lT("FOUR_SIDES",4)}function rGe(e,n){var t,i,r,c;for(c=new Oe,r=0,i=n.Jc();i.Ob();){for(t=ke(u(i.Pb(),15).a+r);t.a=e.f)break;Gn(c.c,t)}return c}function FAn(e){var n,t;for(t=new P(e.e.b);t.a0&&xHe(this,this.c-1,(De(),et)),this.c0&&e[0].length>0&&(this.c=Fe(ze(C(_r(e[0][0]),(me(),X3e))))),this.a=se(bon,Me,2079,e.length,0,2),this.b=se(gon,Me,2080,e.length,0,2),this.d=new hFe}function qAn(e){return e.c.length==0?!1:(kn(0,e.c.length),u(e.c[0],17)).c.i.k==(Fn(),dr)?!0:Vv(So(new mn(null,new vn(e,16)),new jk),new l_)}function oGe(e,n){var t,i,r,c,o,l,f;for(l=W2(n),c=n.f,f=n.g,o=k.Math.sqrt(c*c+f*f),r=0,i=new P(l);i.a=0?(t=FO(e,rF),i=AQ(e,rF)):(n=Hb(e,1),t=FO(n,5e8),i=AQ(n,5e8),i=mc(qh(i,1),Rr(e,1))),bh(qh(i,32),Rr(t,Dc))}function iMn(e,n,t,i){var r,c,o,l,f;for(r=null,c=0,l=new P(n);l.a1;n>>=1)(n&1)!=0&&(i=Kv(i,t)),t.d==1?t=Kv(t,t):t=new AJe(eKe(t.a,t.d,se($t,ni,30,t.d<<1,15,1)));return i=Kv(i,t),i}function w0e(){w0e=Y;var e,n,t,i;for(qme=se(Jr,Jc,30,25,15,1),Ume=se(Jr,Jc,30,33,15,1),i=152587890625e-16,n=32;n>=0;n--)Ume[n]=i,i*=.5;for(t=1,e=24;e>=0;e--)qme[e]=t,t*=.5}function sMn(e){var n,t;if(Fe(ze(je(e,(Ie(),Sm))))){for(t=new Un(Yn(U0(e).a.Jc(),new ee));ht(t);)if(n=u(rt(t),85),Uw(n)&&Fe(ze(je(n,xg))))return!0}return!1}function fGe(e){var n,t,i,r;for(n=new xi,t=new xi,r=St(e,0);r.b!=r.d.c;)i=u(jt(r),12),i.e.c.length==0?Ki(t,i,t.c.b,t.c):Ki(n,i,n.c.b,n.c);return Ks(n).Fc(t),n}function aGe(e,n){var t,i,r;hr(e.f,n)&&(n.b=e,i=n.c,pu(e.j,i,0)!=-1||Te(e.j,i),r=n.d,pu(e.j,r,0)!=-1||Te(e.j,r),t=n.a.b,t.c.length!=0&&(!e.i&&(e.i=new OJe(e)),$7n(e.i,t)))}function lMn(e){var n,t,i,r,c;return t=e.c.d,i=t.j,r=e.d.d,c=r.j,i==c?t.p=0&&gn(e.substr(n,3),"GMT")||n>=0&&gn(e.substr(n,3),"UTC"))&&(t[0]=n+3),Zbe(e,t,i)}function aMn(e,n){var t,i,r,c,o;for(c=e.g.a,o=e.g.b,i=new P(e.d);i.at;c--)e[c]|=n[c-t-1]>>>o,e[c-1]=n[c-t-1]<0&&Wu(e.g,n,e.g,n+i,l),o=t.Jc(),e.i+=i,r=0;r>4&15,c=e[i]&15,o[r++]=R8e[t],o[r++]=R8e[c];return ph(o,0,o.length)}function Xo(e){var n,t;return e>=Ec?(n=vN+(e-Ec>>10&1023)&yr,t=56320+(e-Ec&1023)&yr,String.fromCharCode(n)+(""+String.fromCharCode(t))):String.fromCharCode(e&yr)}function kMn(e,n){v2();var t,i,r,c;return r=u(u(vi(e.r,n),22),83),r.gc()>=2?(i=u(r.Jc().Pb(),115),t=e.u.Gc((ps(),tA)),c=e.u.Gc(Yy),!i.a&&!t&&(r.gc()==2||c)):!1}function gGe(e,n,t,i,r){var c,o,l;for(c=cXe(e,n,t,i,r),l=!1;!c;)Oz(e,r,!0),l=!0,c=cXe(e,n,t,i,r);l&&Oz(e,r,!1),o=QY(r),o.c.length!=0&&(e.d&&e.d.Fg(o),gGe(e,r,t,i,o))}function Ez(){Ez=Y,Jre=new k$("NODE_SIZE_REORDERER",0),Bre=new k$("INTERACTIVE_NODE_REORDERER",1),Fre=new k$("MIN_SIZE_PRE_PROCESSOR",2),zre=new k$("MIN_SIZE_POST_PROCESSOR",3)}function Sz(){Sz=Y,Cce=new Fj(va,0),c8e=new Fj("DIRECTED",1),o8e=new Fj("UNDIRECTED",2),i8e=new Fj("ASSOCIATION",3),u8e=new Fj("GENERALIZATION",4),r8e=new Fj("DEPENDENCY",5)}function jMn(e,n){var t;if(!_a(e))throw R(new Uc(zWe));switch(t=_a(e),n.g){case 1:return-(e.j+e.f);case 2:return e.i-t.g;case 3:return e.j-t.f;case 4:return-(e.i+e.g)}return 0}function EMn(e,n,t){var i,r,c;return i=n.Jk(),c=n.kd(),r=i.Hk()?O0(e,4,i,c,null,N8(e,i,c,X(i,103)&&(u(i,19).Bb&Ec)!=0),!0):O0(e,i.rk()?2:1,i,c,i.gk(),-1,!0),t?t.lj(r):t=r,t}function k8(e,n){var t,i;for(_n(n),i=e.b.c.length,Te(e.b,n);i>0;){if(t=i,i=(i-1)/2|0,e.a.Le(Pe(e.b,i),n)<=0)return ul(e.b,t,n),!0;ul(e.b,t,Pe(e.b,i))}return ul(e.b,i,n),!0}function v0e(e,n,t,i){var r,c;if(r=0,t)r=FB(e.a[t.g][n.g],i);else for(c=0;c=l)}function wGe(e){switch(e.g){case 0:return new K_;case 1:return new PM;default:throw R(new qn("No implementation is available for the width approximator "+(e.f!=null?e.f:""+e.g)))}}function y0e(e,n,t,i){var r;if(r=!1,$r(i)&&(r=!0,O9(n,t,Pt(i))),r||b2(i)&&(r=!0,y0e(e,n,t,i)),r||X(i,242)&&(r=!0,Xb(n,t,u(i,242))),!r)throw R(new CX(U2e))}function xMn(e,n){var t,i,r;if(t=n.ni(e.a),t&&(r=pa((!t.b&&(t.b=new Hs((jn(),Ac),Du,t)),t.b),af),r!=null)){for(i=1;i<(ls(),s7e).length;++i)if(gn(s7e[i],r))return i}return 0}function AMn(e,n){var t,i,r;if(t=n.ni(e.a),t&&(r=pa((!t.b&&(t.b=new Hs((jn(),Ac),Du,t)),t.b),af),r!=null)){for(i=1;i<(ls(),l7e).length;++i)if(gn(l7e[i],r))return i}return 0}function pGe(e,n){var t,i,r,c;if(_n(n),c=e.a.gc(),c0?1:0;c.a[r]!=t;)c=c.a[r],r=e.a.Le(t.d,c.d)>0?1:0;c.a[r]=i,i.b=t.b,i.a[0]=t.a[0],i.a[1]=t.a[1],t.a[0]=null,t.a[1]=null}function TMn(e){var n,t,i,r;for(n=new Oe,t=se(ts,ma,30,e.a.c.length,16,1),$fe(t,t.length),r=new P(e.a);r.a0&&VXe((kn(0,t.c.length),u(t.c[0],25)),e),t.c.length>1&&VXe(u(Pe(t,t.c.length-1),25),e),n.Ug()}function NMn(e){ps();var n,t;return n=Ci(Z1,F(z(fG,1),Ee,280,0,[mb])),!(pO(PR(n,e))>1||(t=Ci(tA,F(z(fG,1),Ee,280,0,[nA,Yy])),pO(PR(t,e))>1))}function j0e(e,n){var t;t=lo((E0(),kf),e),X(t,493)?Kc(kf,e,new YCe(this,n)):Kc(kf,e,this),bW(this,n),n==(g9(),Y8e)?(this.wb=u(this,2e3),u(n,2002)):this.wb=(C0(),Bn)}function IMn(e){var n,t,i;if(e==null)return null;for(n=null,t=0;tc}function kGe(e,n){var t,i,r;if(S0e(e,n))return!0;for(i=new P(n);i.a=r||n<0)throw R(new jo(Cne+n+pg+r));if(t>=r||t<0)throw R(new jo(Tne+t+pg+r));return n!=t?i=(c=e.Aj(t),e.oj(n,c),c):i=e.vj(t),i}function EGe(e){var n,t,i;if(i=e,e)for(n=0,t=e.Bh();t;t=t.Bh()){if(++n>RZ)return EGe(t);if(i=t,t==e)throw R(new Uc("There is a cycle in the containment hierarchy of "+e))}return i}function Ja(e){var n,t,i;for(i=new ng(To,"[","]"),t=e.Jc();t.Ob();)n=t.Pb(),D1(i,ue(n)===ue(e)?"(this Collection)":n==null?Vo:fu(n));return i.a?i.e.length==0?i.a.a:i.a.a+(""+i.e):i.c}function S0e(e,n){var t,i;if(i=!1,n.gc()<2)return!1;for(t=0;t1&&(e.j.b+=e.e)):(e.j.a+=t.a,e.j.b=k.Math.max(e.j.b,t.b),e.d.c.length>1&&(e.j.a+=e.e))}function G0(){G0=Y,Tin=F(z(xc,1),qu,64,0,[(De(),Kn),et,bt]),Cin=F(z(xc,1),qu,64,0,[et,bt,Vn]),Oin=F(z(xc,1),qu,64,0,[bt,Vn,Kn]),Nin=F(z(xc,1),qu,64,0,[Vn,Kn,et])}function xGe(e){var n,t,i,r,c,o,l,f,h;for(this.a=KJe(e),this.b=new Oe,t=e,i=0,r=t.length;iFK(e.d).c?(e.i+=e.g.c,TQ(e.d)):FK(e.d).c>FK(e.g).c?(e.e+=e.d.c,TQ(e.g)):(e.i+=SIe(e.g),e.e+=SIe(e.d),TQ(e.g),TQ(e.d))}function FMn(e,n,t){var i,r,c,o;for(c=n.q,o=n.r,new Kb((da(),ab),n,c,1),new Kb(ab,c,o,1),r=new P(t);r.al&&(f=l/i),r>c&&(h=c/r),o=k.Math.min(f,h),e.a+=o*(n.a-e.a),e.b+=o*(n.b-e.b)}function qMn(e,n,t,i,r){var c,o;for(o=!1,c=u(Pe(t.b,0),26);K_n(e,n,c,i,r)&&(o=!0,NAn(t,c),t.b.c.length!=0);)c=u(Pe(t.b,0),26);return t.b.c.length==0&&BO(t.j,t),o&&bz(n.q),o}function A0e(e,n,t,i){var r,c;return t==0?(!e.o&&(e.o=new os((Gu(),h1),Zd,e,0)),K$(e.o,n,i)):(c=u(Mn((r=u(Xn(e,16),29),r||e.fi()),t),69),c.uk().yk(e,Lo(e),t-dt(e.fi()),n,i))}function bW(e,n){var t;n!=e.sb?(t=null,e.sb&&(t=u(e.sb,52).Qh(e,1,cA,t)),n&&(t=u(n,52).Oh(e,1,cA,t)),t=B1e(e,n,t),t&&t.mj()):(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,4,n,n))}function TGe(e,n){var t,i,r,c;if(n)r=$1(n,"x"),t=new hSe(e),Wv(t.a,(_n(r),r)),c=$1(n,"y"),i=new dSe(e),Zv(i.a,(_n(c),c));else throw R(new lh("All edge sections need an end point."))}function OGe(e,n){var t,i,r,c;if(n)r=$1(n,"x"),t=new lSe(e),e3(t.a,(_n(r),r)),c=$1(n,"y"),i=new fSe(e),n3(i.a,(_n(c),c));else throw R(new lh("All edge sections need a start point."))}function UMn(e,n){var t,i,r,c,o,l,f;for(i=Yze(e),c=0,l=i.length;c>22-n,r=e.h<>22-n):n<44?(t=0,i=e.l<>44-n):(t=0,i=0,r=e.l<=zd?"error":i>=900?"warn":i>=800?"info":"log"),pDe(t,e.a),e.b&&Mbe(n,t,e.b,"Exception: ",!0))}function _Ge(e,n){var t,i,r,c,o;for(r=n==1?Cte:Mte,i=r.a.ec().Jc();i.Ob();)for(t=u(i.Pb(),86),o=u(vi(e.f.c,t),22).Jc();o.Ob();)c=u(o.Pb(),49),Te(e.b.b,u(c.b,82)),Te(e.b.a,u(c.b,82).d)}function LGe(e,n,t,i){var r,c,o,l,f;switch(f=e.b,c=n.d,o=c.j,l=xde(o,f.d[o.g],t),r=pi(pc(c.n),c.a),c.j.g){case 3:case 1:l.a+=r.a;break;case 2:l.b+=r.b;break;case 4:l.b+=r.b}Ki(i,l,i.c.b,i.c)}function YMn(e,n){var t,i,r,c;for(c=n.b.j,e.a=se($t,ni,30,c.c.length,15,1),r=0,i=0;ie)throw R(new qn("k must be smaller than n"));return n==0||n==e?1:e==0?0:Zde(e)/(Zde(n)*Zde(e-n))}function M0e(e,n){var t,i,r,c;for(t=new MK(e);t.g==null&&!t.c?mae(t):t.g==null||t.i!=0&&u(t.g[t.i-1],50).Ob();)if(c=u(Nz(t),57),X(c,174))for(i=u(c,174),r=0;r>4],n[t*2+1]=OG[c&15];return ph(n,0,n.length)}function lCn(e){var n,t,i;switch(i=e.c.length,i){case 0:return OV(),Ken;case 1:return n=u(pqe(new P(e)),45),Jpn(n.jd(),n.kd());default:return t=u(Ba(e,se(yg,tF,45,e.c.length,0,1)),175),new ise(t)}}function Rd(e,n){switch(n.g){case 1:return M4(e.j,(ss(),xve));case 2:return M4(e.j,(ss(),Eve));case 3:return M4(e.j,(ss(),Mve));case 4:return M4(e.j,(ss(),Cve));default:return En(),En(),Sc}}function fCn(e,n){var t,i,r;t=$vn(n,e.e),i=u(zn(e.g.f,t),15).a,r=e.a.c.length-1,e.a.c.length!=0&&u(Pe(e.a,r),295).c==i?(++u(Pe(e.a,r),295).a,++u(Pe(e.a,r),295).b):Te(e.a,new COe(i))}function q0(){q0=Y,nln=(Xt(),Uy),tln=Qd,Qsn=Ig,Wsn=n5,Zsn=bb,Ysn=e5,Vye=$I,eln=Rm,Dre=(Gbe(),Bsn),_re=zsn,Qye=Gsn,Lre=Xsn,Wye=qsn,Zye=Usn,Yye=Fsn,HH=Jsn,GH=Hsn,AI=Ksn,e6e=Vsn,Kye=Rsn}function $Ge(e,n){var t,i,r,c,o;if(e.e<=n||wyn(e,e.g,n))return e.g;for(c=e.r,i=e.g,o=e.r,r=(c-i)/2+i;i+11&&(e.e.b+=e.a)):(e.e.a+=t.a,e.e.b=k.Math.max(e.e.b,t.b),e.d.c.length>1&&(e.e.a+=e.a))}function dCn(e){var n,t,i,r;switch(r=e.i,n=r.b,i=r.j,t=r.g,r.a.g){case 0:t.a=(e.g.b.o.a-i.a)/2;break;case 1:t.a=n.d.n.a+n.d.a.a;break;case 2:t.a=n.d.n.a+n.d.a.a-i.a;break;case 3:t.b=n.d.n.b+n.d.a.b}}function bCn(e,n,t){var i,r,c;for(r=new Un(Yn(wh(t).a.Jc(),new ee));ht(r);)i=u(rt(r),17),!uc(i)&&!(!uc(i)&&i.c.i.c==i.d.i.c)&&(c=NUe(e,i,t,new mxe),c.c.length>1&&Gn(n.c,c))}function zGe(e,n,t,i,r){if(ii&&(e.a=i),e.br&&(e.b=r),e}function gCn(e){if(X(e,144))return PNn(u(e,144));if(X(e,233))return Xjn(u(e,233));if(X(e,21))return KMn(u(e,21));throw R(new qn(s7+Ja(new Su(F(z(Mr,1),On,1,5,[e])))))}function wCn(e,n,t,i,r){var c,o,l;for(c=!0,o=0;o>>r|t[o+i+1]<>>r,++o}return c}function N0e(e,n,t,i){var r,c,o;if(n.k==(Fn(),dr)){for(c=new Un(Yn(cr(n).a.Jc(),new ee));ht(c);)if(r=u(rt(c),17),o=r.c.i.k,o==dr&&e.c.a[r.c.i.c.p]==i&&e.c.a[n.c.p]==t)return!0}return!1}function pCn(e,n){var t,i,r,c;return n&=63,t=e.h&G1,n<22?(c=t>>>n,r=e.m>>n|t<<22-n,i=e.l>>n|e.m<<22-n):n<44?(c=0,r=t>>>n-22,i=e.m>>n-22|e.h<<44-n):(c=0,r=0,i=t>>>n-44),_o(i&Ls,r&Ls,c&G1)}function FGe(e,n,t,i){var r;this.b=i,this.e=e==(rg(),Cx),r=n[t],this.d=j2(ts,[Me,ma],[171,30],16,[r.length,r.length],2),this.a=j2($t,[Me,ni],[54,30],15,[r.length,r.length],2),this.c=new h0e(n,t)}function mCn(e){var n,t,i;for(e.k=new Sae((De(),F(z(xc,1),qu,64,0,[ju,Kn,et,bt,Vn])).length,e.j.c.length),i=new P(e.j);i.a=t)return E8(e,n,i.p),!0;return!1}function a3(e,n,t,i){var r,c,o,l,f,h;for(o=t.length,c=0,r=-1,h=URe((Qn(n,e.length+1),e.substr(n)),(VK(),Hme)),l=0;lc&&C3n(h,URe(t[l],Hme))&&(r=l,c=f);return r>=0&&(i[0]=n+c),r}function kCn(e,n,t){var i,r,c,o,l,f,h,b;c=e.d.p,l=c.e,f=c.r,e.g=new NT(f),o=e.d.o.c.p,i=o>0?l[o-1]:se(u1,Fd,9,0,0,1),r=l[o],h=ot?F0e(e,t,"start index"):n<0||n>t?F0e(n,t,"end index"):cS("end index (%s) must not be less than start index (%s)",F(z(Mr,1),On,1,5,[ke(n),ke(e)]))}function UGe(e,n){var t,i,r,c;for(i=0,r=e.length;i0&&XGe(e,c,t));n.p=0}function xCn(e){var n,t,i,r;for(n=qb(Kt(new tl("Predicates."),"and"),40),t=!0,r=new qc(e);r.b=0?e.hi(r):q0e(e,i);else throw R(new qn(nb+i.ve()+LS));else throw R(new qn(QWe+n+WWe));else Fl(e,t,i)}function I0e(e){var n,t;if(t=null,n=!1,X(e,210)&&(n=!0,t=u(e,210).a),n||X(e,265)&&(n=!0,t=""+u(e,265).a),n||X(e,479)&&(n=!0,t=""+u(e,479).a),!n)throw R(new CX(U2e));return t}function D0e(e,n,t){var i,r,c,o,l,f;for(f=Po(e.e.Ah(),n),i=0,l=e.i,r=u(e.g,122),o=0;o=e.d.b.c.length&&(n=new Xu(e.d),n.p=i.p-1,Te(e.d.b,n),t=new Xu(e.d),t.p=i.p,Te(e.d.b,t)),Or(i,u(Pe(e.d.b,i.p),25))}function CCn(e){var n,t,i,r;for(t=new xi,ac(t,e.o),i=new BP;t.b!=0;)n=u(t.b==0?null:(at(t.b!=0),$l(t,t.a.a)),500),r=$Ve(e,n,!0),r&&Te(i.a,n);for(;i.a.c.length!=0;)n=u(T1e(i),500),$Ve(e,n,!1)}function qe(e){var n;this.c=new xi,this.f=e.e,this.e=e.d,this.i=e.g,this.d=e.c,this.b=e.b,this.k=e.j,this.a=e.a,e.i?this.j=e.i:this.j=(n=u(la(Wa),10),new _l(n,u(Df(n,n.length),10),0)),this.g=e.f}function lg(){lg=Y,o9e=new p4(yS,0),xr=new p4("BOOLEAN",1),dc=new p4("INT",2),Gy=new p4("STRING",3),ec=new p4("DOUBLE",4),Bi=new p4("ENUM",5),Hy=new p4("ENUMSET",6),Za=new p4("OBJECT",7)}function YE(e,n){var t,i,r,c,o;i=k.Math.min(e.c,n.c),c=k.Math.min(e.d,n.d),r=k.Math.max(e.c+e.b,n.c+n.b),o=k.Math.max(e.d+e.a,n.d+n.a),r=(r/2|0))for(this.e=i?i.c:null,this.d=r;t++0;)She(this);this.b=n,this.a=null}function NCn(e,n){var t,i;n.a?eIn(e,n):(t=u(BX(e.b,n.b),60),t&&t==e.a[n.b.f]&&t.a&&t.a!=n.b.a&&t.c.Ec(n.b),i=u(RX(e.b,n.b),60),i&&e.a[i.f]==n.b&&i.a&&i.a!=n.b.a&&n.b.c.Ec(i),DK(e.b,n.b))}function eqe(e,n){var t,i;if(t=u(zc(e.b,n),127),u(u(vi(e.r,n),22),83).dc()){t.n.b=0,t.n.c=0;return}t.n.b=e.C.b,t.n.c=e.C.c,e.A.Gc((Vs(),_g))&&OXe(e,n),i=wSn(e,n),NW(e,n)==(u3(),wb)&&(i+=2*e.w),t.a.a=i}function nqe(e,n){var t,i;if(t=u(zc(e.b,n),127),u(u(vi(e.r,n),22),83).dc()){t.n.d=0,t.n.a=0;return}t.n.d=e.C.d,t.n.a=e.C.a,e.A.Gc((Vs(),_g))&&NXe(e,n),i=gSn(e,n),NW(e,n)==(u3(),wb)&&(i+=2*e.w),t.a.b=i}function ICn(e,n){var t,i,r,c;for(c=new Oe,i=new P(n);i.ai&&(Qn(n-1,e.length),e.charCodeAt(n-1)<=32);)--n;return i>0||nt.a&&(i.Gc((sg(),qx))?r=(n.a-t.a)/2:i.Gc(Ux)&&(r=n.a-t.a)),n.b>t.b&&(i.Gc((sg(),Kx))?c=(n.b-t.b)/2:i.Gc(Xx)&&(c=n.b-t.b)),k0e(e,r,c)}function uqe(e,n,t,i,r,c,o,l,f,h,b,p,y){X(e.Cb,88)&&Y2(Ms(u(e.Cb,88)),4),Mo(e,t),e.f=o,a8(e,l),h8(e,f),l8(e,h),f8(e,b),Pd(e,p),d8(e,y),Ld(e,!0),Nd(e,r),e.Xk(c),cg(e,n),i!=null&&(e.i=null,xB(e,i))}function F0e(e,n,t){if(e<0)return cS(oYe,F(z(Mr,1),On,1,5,[t,ke(e)]));if(n<0)throw R(new qn(sYe+n));return cS("%s (%s) must not be greater than size (%s)",F(z(Mr,1),On,1,5,[t,ke(e),ke(n)]))}function J0e(e,n,t,i,r,c){var o,l,f,h;if(o=i-t,o<7){zjn(n,t,i,c);return}if(f=t+r,l=i+r,h=f+(l-f>>1),J0e(n,e,f,h,-r,c),J0e(n,e,h,l,-r,c),c.Le(e[h-1],e[h])<=0){for(;t=0?e.$h(c,t):ybe(e,r,t);else throw R(new qn(nb+r.ve()+LS));else throw R(new qn(QWe+n+WWe));else Jl(e,i,r,t)}function oqe(e){var n,t;if(e.f){for(;e.n>0;){if(n=u(e.k.Xb(e.n-1),75),t=n.Jk(),X(t,103)&&(u(t,19).Bb&Ru)!=0&&(!e.e||t.nk()!=K7||t.Jj()!=0)&&n.kd()!=null)return!0;--e.n}return!1}else return e.n>0}function sqe(e){var n,t,i,r;if(t=u(e,52).Yh(),t)try{if(i=null,n=x8((E0(),kf),ZXe(Kjn(t))),n&&(r=n.Zh(),r&&(i=r.Dl(Pbn(t.e)))),i&&i!=e)return sqe(i)}catch(c){if(c=sr(c),!X(c,63))throw R(c)}return e}function KCn(e,n,t){var i,r,c;t.Tg("Remove overlaps",1),t.bh(n,Ype),i=u(je(n,(Gv(),V3)),26),e.f=i,e.a=RQ(u(je(n,(q0(),AI)),303)),r=re(je(n,(Xt(),Qd))),t4(e,(_n(r),r)),c=W2(i),yVe(e,n,c,t),t.bh(n,PF)}function VCn(e){var n,t,i;if(Fe(ze(je(e,(Xt(),LI))))){for(i=new Oe,t=new Un(Yn(U0(e).a.Jc(),new ee));ht(t);)n=u(rt(t),85),Uw(n)&&Fe(ze(je(n,wce)))&&Gn(i.c,n);return i}else return En(),En(),Sc}function lqe(e){if(!e)return nAe(),Zen;var n=e.valueOf?e.valueOf():e;if(n!==e){var t=rte[typeof n];return t?t(n):F1e(typeof n)}else return e instanceof Array||e instanceof k.Array?new i9(e):new c9(e)}function fqe(e,n,t){var i,r,c;switch(c=e.o,i=u(zc(e.p,t),253),r=i.i,r.b=WE(i),r.a=QE(i),r.b=k.Math.max(r.b,c.a),r.b>c.a&&!n&&(r.b=c.a),r.c=-(r.b-c.a)/2,t.g){case 1:r.d=-r.a;break;case 3:r.d=c.b}GW(i),qW(i)}function aqe(e,n,t){var i,r,c;switch(c=e.o,i=u(zc(e.p,t),253),r=i.i,r.b=WE(i),r.a=QE(i),r.a=k.Math.max(r.a,c.b),r.a>c.b&&!n&&(r.a=c.b),r.d=-(r.a-c.b)/2,t.g){case 4:r.c=-r.b;break;case 2:r.c=c.a}GW(i),qW(i)}function YCn(e,n){var t,i,r;return X(n.g,9)&&u(n.g,9).k==(Fn(),wr)?Vi:(r=R4(n),r?k.Math.max(0,e.b/2-.5):(t=Xv(n),t?(i=ne(re(G2(t,(Ie(),Tg)))),k.Math.max(0,i/2-.5)):Vi))}function QCn(e,n){var t,i,r;return X(n.g,9)&&u(n.g,9).k==(Fn(),wr)?Vi:(r=R4(n),r?k.Math.max(0,e.b/2-.5):(t=Xv(n),t?(i=ne(re(G2(t,(Ie(),Tg)))),k.Math.max(0,i/2-.5)):Vi))}function WCn(e,n){var t,i,r,c,o;if(!n.dc()){if(r=u(n.Xb(0),132),n.gc()==1){VUe(e,r,r,1,0,n);return}for(t=1;t0)try{r=al(n,Xr,oi)}catch(c){throw c=sr(c),X(c,131)?(i=c,R(new sB(i))):R(c)}return t=(!e.a&&(e.a=new dX(e)),e.a),r=0?u(K(t,r),57):null}function nTn(e,n){if(e<0)return cS(oYe,F(z(Mr,1),On,1,5,["index",ke(e)]));if(n<0)throw R(new qn(sYe+n));return cS("%s (%s) must be less than size (%s)",F(z(Mr,1),On,1,5,["index",ke(e),ke(n)]))}function tTn(e){var n,t,i,r,c;if(e==null)return Vo;for(c=new ng(To,"[","]"),t=e,i=0,r=t.length;i=0?e.Ih(t,!0,!0):Xw(e,r,!0),163)),u(i,219).Xl(n);else throw R(new qn(nb+n.ve()+LS))}function U0e(e){var n,t;return e>-0x800000000000&&e<0x800000000000?e==0?0:(n=e<0,n&&(e=-e),t=lc(k.Math.floor(k.Math.log(e)/.6931471805599453)),(!n||e!=k.Math.pow(2,t))&&++t,t):OFe(Lu(e))}function dTn(e){var n,t,i,r,c,o,l;for(c=new Fh,t=new P(e);t.a2&&l.e.b+l.j.b<=2&&(r=l,i=o),c.a.yc(r,c),r.q=i);return c}function bTn(e,n,t){t.Tg("Eades radial",1),t.bh(n,PF),e.d=u(je(n,(Gv(),V3)),26),e.c=ne(re(je(n,(q0(),GH)))),e.e=RQ(u(je(n,AI),303)),e.a=Zjn(u(je(n,e6e),426)),e.b=pAn(u(je(n,Yye),354)),nAn(e),t.bh(n,PF)}function gTn(e,n){if(n.Tg("Target Width Setter",1),ba(e,(Ha(),Kre)))Ei(e,(Qh(),_m),re(je(e,Kre)));else throw R(new md("A target width has to be set if the TargetWidthWidthApproximator should be used."));n.Ug()}function mqe(e,n){var t,i,r;return i=new za(e),Pu(i,n),he(i,(me(),cH),n),he(i,(Ie(),Zi),(Br(),to)),he(i,Nh,(Yh(),tG)),Mf(i,(Fn(),wr)),t=new Qu,wu(t,i),Ar(t,(De(),Vn)),r=new Qu,wu(r,i),Ar(r,et),i}function vqe(e,n){var t,i,r,c,o;for(e.c[n.p]=!0,Te(e.a,n),o=new P(n.j);o.a=c)o.$b();else for(r=o.Jc(),i=0;i0?Noe():o<0&&Sqe(e,n,-o),!0):!1}function QE(e){var n,t,i,r,c,o,l;if(l=0,e.b==0){for(o=tHe(e,!0),n=0,i=o,r=0,c=i.length;r0&&(l+=t,++n);n>1&&(l+=e.c*(n-1))}else l=sAe(HY(C2(li(vV(e.a),new ud),new Cp)));return l>0?l+e.n.d+e.n.a:0}function WE(e){var n,t,i,r,c,o,l;if(l=0,e.b==0)l=sAe(HY(C2(li(vV(e.a),new b5),new l0)));else{for(o=iHe(e,!0),n=0,i=o,r=0,c=i.length;r0&&(l+=t,++n);n>1&&(l+=e.c*(n-1))}return l>0?l+e.n.b+e.n.c:0}function kTn(e){var n,t;if(e.c.length!=2)throw R(new Uc("Order only allowed for two paths."));n=(kn(0,e.c.length),u(e.c[0],17)),t=(kn(1,e.c.length),u(e.c[1],17)),n.d.i!=t.c.i&&(e.c.length=0,Gn(e.c,t),Gn(e.c,n))}function xqe(e,n,t){var i;for(vw(t,n.g,n.f),Il(t,n.i,n.j),i=0;i<(!n.a&&(n.a=new we(Ft,n,10,11)),n.a).i;i++)xqe(e,u(K((!n.a&&(n.a=new we(Ft,n,10,11)),n.a),i),26),u(K((!t.a&&(t.a=new we(Ft,t,10,11)),t.a),i),26))}function jTn(e,n){var t,i,r,c;for(c=u(zc(e.b,n),127),t=c.a,r=u(u(vi(e.r,n),22),83).Jc();r.Ob();)i=u(r.Pb(),115),i.c&&(t.a=k.Math.max(t.a,wfe(i.c)));if(t.a>0)switch(n.g){case 2:c.n.c=e.s;break;case 4:c.n.b=e.s}}function ETn(e,n){var t,i,r;return t=u(C(n,(Hf(),Ay)),15).a-u(C(e,Ay),15).a,t==0?(i=Nr(pc(u(C(e,(L0(),YN)),8)),u(C(e,ZS),8)),r=Nr(pc(u(C(n,YN),8)),u(C(n,ZS),8)),ji(i.a*i.b,r.a*r.b)):t}function STn(e,n){var t,i,r;return t=u(C(n,(Mu(),BH)),15).a-u(C(e,BH),15).a,t==0?(i=Nr(pc(u(C(e,(Ti(),EI)),8)),u(C(e,P7),8)),r=Nr(pc(u(C(n,EI),8)),u(C(n,P7),8)),ji(i.a*i.b,r.a*r.b)):t}function Aqe(e){var n,t;return t=new y0,t.a+="e_",n=F7n(e),n!=null&&(t.a+=""+n),e.c&&e.d&&(Kt((t.a+=" ",t),wz(e.c)),Kt(uo((t.a+="[",t),e.c.i),"]"),Kt((t.a+=nee,t),wz(e.d)),Kt(uo((t.a+="[",t),e.d.i),"]")),t.a}function Mqe(e){switch(e.g){case 0:return new DU;case 1:return new lP;case 2:return new _U;case 3:return new AC;default:throw R(new qn("No implementation is available for the layout phase "+(e.f!=null?e.f:""+e.g)))}}function V0e(e,n,t,i,r){var c;switch(c=0,r.g){case 1:c=k.Math.max(0,n.b+e.b-(t.b+i));break;case 3:c=k.Math.max(0,-e.b-i);break;case 2:c=k.Math.max(0,-e.a-i);break;case 4:c=k.Math.max(0,n.a+e.a-(t.a+i))}return c}function Cqe(e,n,t){var i,r,c,o,l;if(t)for(r=t.a.length,i=new Jb(r),l=(i.b-i.a)*i.c<0?(S0(),Eb):new M0(i);l.Ob();)o=u(l.Pb(),15),c=F9(t,o.a),F2e in c.a||Ane in c.a?CDn(e,c,n):VRn(e,c,n),npn(u(zn(e.c,g8(c)),85))}function Y0e(e){var n,t;switch(e.b){case-1:return!0;case 0:return t=e.t,t>1||t==-1?(e.b=-1,!0):(n=ff(e),n&&(Tc(),n.jk()==een)?(e.b=-1,!0):(e.b=1,!1));default:case 1:return!1}}function Q0e(e,n){var t,i,r,c;if(fi(e),e.c!=0||e.a!=123)throw R(new Bt(Ht((Lt(),jZe))));if(c=n==112,i=e.d,t=E9(e.i,125,i),t<0)throw R(new Bt(Ht((Lt(),EZe))));return r=of(e.i,i,t),e.d=t+1,$$e(r,c,(e.e&512)==512)}function xTn(e){var n,t,i,r,c,o,l;for(l=Jh(e.c.length),r=new P(e);r.a=0&&i=0?e.Ih(t,!0,!0):Xw(e,r,!0),163)),u(i,219).Ul(n);throw R(new qn(nb+n.ve()+pne))}function MTn(){nse();var e;return ehn?u(x8((E0(),kf),hf),2e3):(ti(yg,new DL),p$n(),e=u(X(lo((E0(),kf),hf),548)?lo(kf,hf):new NDe,548),ehn=!0,wBn(e),jBn(e),ei((ese(),V8e),e,new Ev),Kc(kf,hf,e),e)}function CTn(e,n){var t,i,r,c;e.j=-1,Fs(e.e)?(t=e.i,c=e.i!=0,WT(e,n),i=new L1(e.e,3,e.c,null,n,t,c),r=n.xl(e.e,e.c,null),r=cGe(e,n,r),r?(r.lj(i),r.mj()):hi(e.e,i)):(WT(e,n),r=n.xl(e.e,e.c,null),r&&r.mj())}function Cz(e,n){var t,i,r;if(r=0,i=n[0],i>=e.length)return-1;for(t=(Qn(i,e.length),e.charCodeAt(i));t>=48&&t<=57&&(r=r*10+(t-48),++i,!(i>=e.length));)t=(Qn(i,e.length),e.charCodeAt(i));return i>n[0]?n[0]=i:r=-1,r}function TTn(e,n,t){var i,r,c,o,l;o=e.c,l=e.d,c=mu(F(z(Lr,1),Me,8,0,[o.i.n,o.n,o.a])).b,r=(c+mu(F(z(Lr,1),Me,8,0,[l.i.n,l.n,l.a])).b)/2,i=null,o.j==(De(),et)?i=new Se(n+o.i.c.c.a+t,r):i=new Se(n-t,r),S9(e.a,0,i)}function Uw(e){var n,t,i,r;for(n=null,i=Uh(Rl(F(z(Xl,1),On,20,0,[(!e.b&&(e.b=new Nn(mt,e,4,7)),e.b),(!e.c&&(e.c=new Nn(mt,e,5,8)),e.c)])));ht(i);)if(t=u(rt(i),84),r=iu(t),!n)n=r;else if(n!=r)return!1;return!0}function EW(e,n,t){var i;if(++e.j,n>=e.i)throw R(new jo(Cne+n+pg+e.i));if(t>=e.i)throw R(new jo(Tne+t+pg+e.i));return i=e.g[t],n!=t&&(n>16),n=i>>16&16,t=16-n,e=e>>n,i=e-256,n=i>>16&8,t+=n,e<<=n,i=e-cm,n=i>>16&4,t+=n,e<<=n,i=e-jh,n=i>>16&2,t+=n,e<<=n,i=e>>14,n=i&~(i>>1),t+2-n)}function OTn(e,n){var t,i,r;for(r=new Oe,i=St(n.a,0);i.b!=i.d.c;)t=u(jt(i),65),t.c.g==e.g&&ue(C(t.b,(Mu(),Dh)))!==ue(C(t.c,Dh))&&!Vv(new mn(null,new vn(r,16)),new NEe(t))&&Gn(r.c,t);return Tr(r,new Ck),r}function Oqe(e,n,t){var i,r,c,o;return X(n,155)&&X(t,155)?(c=u(n,155),o=u(t,155),e.a[c.a][o.a]+e.a[o.a][c.a]):X(n,251)&&X(t,251)&&(i=u(n,251),r=u(t,251),i.a==r.a)?u(C(r.a,(Hf(),Ay)),15).a:0}function Nqe(e,n){var t,i,r,c,o,l,f,h;for(h=ne(re(C(n,(Ie(),kx)))),f=e[0].n.a+e[0].o.a+e[0].d.c+h,l=1;l=0?t:(l=aE(Nr(new Se(o.c+o.b/2,o.d+o.a/2),new Se(c.c+c.b/2,c.d+c.a/2))),-(sKe(c,o)-1)*l)}function ITn(e,n,t){var i;er(new mn(null,(!t.a&&(t.a=new we($i,t,6,6)),new vn(t.a,16))),new ICe(e,n)),er(new mn(null,(!t.n&&(t.n=new we(Eu,t,1,7)),new vn(t.n,16))),new DCe(e,n)),i=u(je(t,(Xt(),Z3)),78),i&&Zhe(i,e,n)}function Xw(e,n,t){var i,r,c;if(c=w3((ls(),nc),e.Ah(),n),c)return Tc(),u(c,69).vk()||(c=$4(Vc(nc,c))),r=(i=e.Fh(c),u(i>=0?e.Ih(i,!0,!0):Xw(e,c,!0),163)),u(r,219).Ql(n,t);throw R(new qn(nb+n.ve()+pne))}function W0e(e,n,t,i){var r,c,o,l,f;if(r=e.d[n],r){if(c=r.g,f=r.i,i!=null){for(l=0;l=t&&(i=n,h=(f.c+f.a)/2,o=h-t,f.c<=h-t&&(r=new WK(f.c,o),zb(e,i++,r)),l=h+t,l<=f.a&&(c=new WK(l,f.a),N2(i,e.c.length),_j(e.c,i,c)))}function Lqe(e,n,t){var i,r,c,o,l,f;if(!n.dc()){for(r=new xi,f=n.Jc();f.Ob();)for(l=u(f.Pb(),40),ei(e.a,ke(l.g),ke(t)),o=(i=St(new S1(l).a.d,0),new Cv(i));WC(o.a);)c=u(jt(o.a),65).c,Ki(r,c,r.c.b,r.c);Lqe(e,r,t+1)}}function Z0e(e){var n;if(!e.c&&e.g==null)e.d=e._i(e.f),Et(e,e.d),n=e.d;else{if(e.g==null)return!0;if(e.i==0)return!1;n=u(e.g[e.i-1],50)}return n==e.b&&null.Tm>=null.Sm()?(Nz(e),Z0e(e)):n.Ob()}function Pqe(e){if(this.a=e,e.c.i.k==(Fn(),wr))this.c=e.c,this.d=u(C(e.c.i,(me(),Iu)),64);else if(e.d.i.k==wr)this.c=e.d,this.d=u(C(e.d.i,(me(),Iu)),64);else throw R(new qn("Edge "+e+" is not an external edge."))}function $qe(e,n){var t,i,r;r=e.b,e.b=n,(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,3,r,e.b)),n?n!=e&&(Mo(e,n.zb),IY(e,n.d),t=(i=n.c,i??n.zb),_Y(e,t==null||gn(t,n.zb)?null:t)):(Mo(e,null),IY(e,0),_Y(e,null))}function Rqe(e){!tte&&(tte=SRn());var n=e.replace(/[\x00-\x1f\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200b-\u200f\u2028-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb"\\]/g,function(t){return m4n(t)});return'"'+n+'"'}function ebe(e,n,t,i,r,c){var o,l,f,h,b;if(r!=0)for(ue(e)===ue(t)&&(e=e.slice(n,n+r),n=0),f=t,l=n,h=n+r;l=o)throw R(new k2(n,o));return r=t[n],o==1?i=null:(i=se(Bce,_ne,415,o-1,0,1),Wu(t,0,i,0,n),c=o-n-1,c>0&&Wu(t,n+1,i,n,c)),p8(e,i),cqe(e,n,r),r}function Bqe(e){var n,t;if(e.f){for(;e.n0)for(o=e.c.d,l=e.d.d,r=A1(Nr(new Se(l.a,l.b),o),1/(i+1)),c=new Se(o.a,o.b),t=new P(e.a);t.a0?c=Y4(t):c=NO(Y4(t))),Ei(n,O7,c)}function Gqe(e,n){var t,i;if(e.c.length!=0){if(e.c.length==2)sy((kn(0,e.c.length),u(e.c[0],9)),(fl(),l1)),sy((kn(1,e.c.length),u(e.c[1],9)),gb);else for(i=new P(e);i.a0&&nN(e,t,n),c):i.a!=null?(nN(e,n,t),-1):r.a!=null?(nN(e,t,n),1):0}function qqe(e){UV();var n,t,i,r,c,o,l;for(t=new D0,r=new P(e.e.b);r.a=0;)i=t[c],o.$l(i.Jk())&&Et(r,i);!JVe(e,r)&&Fs(e.e)&&f9(e,n.Hk()?O0(e,6,n,(En(),Sc),null,-1,!1):O0(e,n.rk()?2:1,n,null,null,-1,!1))}function JTn(e,n){var t,i,r,c,o;return e.a==(j8(),cx)?!0:(c=n.a.c,t=n.a.c+n.a.b,!(n.j&&(i=n.A,o=i.c.c.a-i.o.a/2,r=c-(i.n.a+i.o.a),r>o)||n.q&&(i=n.C,o=i.c.c.a-i.o.a/2,r=i.n.a-t,r>o)))}function Xqe(e,n,t){var i,r,c,o,l,f;for(i=0,f=t,n||(i=t*(e.c.length-1),f*=-1),c=new P(e);c.a=0?e.xh(null):e.Mh().Qh(e,-1-n,null,null)),e.yh(u(r,52),t),i&&i.mj(),e.sh()&&e.th()&&t>-1&&hi(e,new Dr(e,9,t,c,r)),r):c}function rbe(e,n){var t,i,r,c,o;for(c=e.b.Ae(n),i=(t=e.a.get(c),t??se(Mr,On,1,0,5,1)),o=0;o>5,r>=e.d)return e.e<0;if(t=e.a[r],n=1<<(n&31),e.e<0){if(i=WBe(e),r>16)),16).bd(c),l0&&(!(x1(e.a.c)&&n.n.d)&&!(Rv(e.a.c)&&n.n.b)&&(n.g.d+=k.Math.max(0,i/2-.5)),!(x1(e.a.c)&&n.n.a)&&!(Rv(e.a.c)&&n.n.c)&&(n.g.a-=i-1))}function uUe(e,n,t){var i,r,c,o,l,f;c=u(Pe(n.e,0),17).c,i=c.i,r=i.k,f=u(Pe(t.g,0),17).d,o=f.i,l=o.k,r==(Fn(),dr)?he(e,(me(),Ea),u(C(i,Ea),12)):he(e,(me(),Ea),c),l==dr?he(e,(me(),gf),u(C(o,gf),12)):he(e,(me(),gf),f)}function oUe(e,n){var t,i,r,c,o,l;for(c=new P(e.b);c.a>n,c=e.m>>n|t<<22-n,r=e.l>>n|e.m<<22-n):n<44?(o=i?G1:0,c=t>>n-22,r=e.m>>n-22|t<<44-n):(o=i?G1:0,c=i?Ls:0,r=t>>n-44),_o(r&Ls,c&Ls,o&G1)}function sUe(e,n){var t,i,r,c,o,l,f,h,b;if(e.a.f>0&&X(n,45)&&(e.a.Zj(),h=u(n,45),f=h.jd(),c=f==null?0:Ni(f),o=Nle(e.a,c),t=e.a.d[o],t)){for(i=u(t.g,374),b=t.i,l=0;l=2)for(t=r.Jc(),n=re(t.Pb());t.Ob();)c=n,n=re(t.Pb()),i=k.Math.min(i,(_n(n),n-(_n(c),c)));return i}function aOn(e,n){var t,i,r;for(r=new Oe,i=St(n.a,0);i.b!=i.d.c;)t=u(jt(i),65),t.b.g==e.g&&!gn(t.b.c,_F)&&ue(C(t.b,(Mu(),Dh)))!==ue(C(t.c,Dh))&&!Vv(new mn(null,new vn(r,16)),new IEe(t))&&Gn(r.c,t);return Tr(r,new cw),r}function hOn(e,n){var t,i,r;if(ue(n)===ue(Nt(e)))return!0;if(!X(n,16)||(i=u(n,16),r=e.gc(),r!=i.gc()))return!1;if(X(i,59)){for(t=0;t0&&(r=t),o=new P(e.f.e);o.a0?r+=n:r+=1;return r}function yOn(e,n){var t,i,r,c,o,l,f,h,b,p;h=e,f=wE(h,"individualSpacings"),f&&(i=ba(n,(Xt(),Xy)),o=!i,o&&(r=new z6,Ei(n,Xy,r)),l=u(je(n,Xy),379),p=f,c=null,p&&(c=(b=zY(p,se(He,Me,2,0,6,1)),new $X(p,b))),c&&(t=new HCe(p,l),cc(c,t)))}function kOn(e,n){var t,i,r,c,o,l,f,h,b,p,y;return f=null,p=e,b=null,(oZe in p.a||sZe in p.a||HF in p.a)&&(h=null,y=l1e(n),o=wE(p,oZe),t=new wSe(y),YFe(t.a,o),l=wE(p,sZe),i=new xSe(y),QFe(i.a,l),c=Dw(p,HF),r=new CSe(y),h=(iGe(r.a,c),c),b=h),f=b,f}function jOn(e,n){var t,i,r;if(n===e)return!0;if(X(n,540)){if(r=u(n,833),e.a.d!=r.a.d||qv(e).gc()!=qv(r).gc())return!1;for(i=qv(r).Jc();i.Ob();)if(t=u(i.Pb(),416),uLe(e,t.a.jd())!=u(t.a.kd(),18).gc())return!1;return!0}return!1}function EOn(e,n){var t,i,r,c;for(c=new P(n.a);c.an.c?1:e.bn.b?1:e.a!=n.a?Ni(e.a)-Ni(n.a):e.d==(vE(),Ox)&&n.d==Tx?-1:e.d==Tx&&n.d==Ox?1:0}function AW(e){var n,t,i,r,c,o,l,f;for(r=Vi,i=Ir,t=new P(e.e.b);t.a0&&r0):r<0&&-r0):!1}function xOn(e,n,t,i){var r,c,o,l,f,h,b,p;for(r=(n-e.d)/e.c.c.length,c=0,e.a+=t,e.d=n,p=new P(e.c);p.a>24;return o}function MOn(e){if(e.xe()){var n=e.c;n.ye()?e.o="["+n.n:n.xe()?e.o="["+n.ve():e.o="[L"+n.ve()+";",e.b=n.ue()+"[]",e.k=n.we()+"[]";return}var t=e.j,i=e.d;i=i.split("/"),e.o=CQ(".",[t,CQ("$",i)]),e.b=CQ(".",[t,CQ(".",i)]),e.k=i[i.length-1]}function COn(e,n){var t,i,r,c,o;for(o=null,c=new P(e.e.a);c.a0&&lN(n,(kn(i-1,e.c.length),u(e.c[i-1],9)),r)>0;)ul(e,i,(kn(i-1,e.c.length),u(e.c[i-1],9))),--i;kn(i,e.c.length),e.c[i]=r}n.b=new wt,n.g=new wt}function yUe(e,n,t){var i,r,c;for(i=1;i0&&n.Le((kn(r-1,e.c.length),u(e.c[r-1],9)),c)>0;)ul(e,r,(kn(r-1,e.c.length),u(e.c[r-1],9))),--r;kn(r,e.c.length),e.c[r]=c}t.a=new wt,t.b=new wt}function Oz(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(c=n.Jc();c.Ob();)r=u(c.Pb(),26),b=r.i+r.g/2,y=r.j+r.f/2,f=e.f,o=f.i+f.g/2,l=f.j+f.f/2,h=b-o,p=y-l,i=k.Math.sqrt(h*h+p*p),h*=e.e/i,p*=e.e/i,t?(b-=h,y-=p):(b+=h,y+=p),Os(r,b-r.g/2),Ns(r,y-r.f/2)}function h3(e){var n,t,i;if(!e.c&&e.b!=null){for(n=e.b.length-4;n>=0;n-=2)for(t=0;t<=n;t+=2)(e.b[t]>e.b[t+2]||e.b[t]===e.b[t+2]&&e.b[t+1]>e.b[t+3])&&(i=e.b[t+2],e.b[t+2]=e.b[t],e.b[t]=i,i=e.b[t+3],e.b[t+3]=e.b[t+1],e.b[t+1]=i);e.c=!0}}function Ff(e){var n,t;return t=new tl(Pb(e.Pm)),t.a+="@",Kt(t,(n=Ni(e)>>>0,n.toString(16))),e.Sh()?(t.a+=" (eProxyURI: ",uo(t,e.Yh()),e.Hh()&&(t.a+=" eClass: ",uo(t,e.Hh())),t.a+=")"):e.Hh()&&(t.a+=" (eClass: ",uo(t,e.Hh()),t.a+=")"),t.a}function nS(e){var n,t,i,r;if(e.e)throw R(new Uc((M1(gte),UZ+gte.k+XZ)));for(e.d==(vr(),nh)&&Qz(e,Zc),t=new P(e.a.a);t.a>24}return t}function _On(e,n,t){var i,r,c;if(r=u(zc(e.i,n),318),!r)if(r=new GRe(e.d,n,t),I4(e.i,n,r),mde(n))epn(e.a,n.c,n.b,r);else switch(c=TCn(n),i=u(zc(e.p,c),253),c.g){case 1:case 3:r.j=!0,AX(i,n.b,r);break;case 4:case 2:r.k=!0,AX(i,n.c,r)}return r}function LOn(e,n,t,i){var r,c,o,l,f,h;if(l=new J6,f=Po(e.e.Ah(),n),r=u(e.g,122),Tc(),u(n,69).vk())for(o=0;o=0)return r;for(c=1,l=new P(n.j);l.a=0)return r;for(c=1,l=new P(n.j);l.a=0?(n||(n=new Ej,i>0&&Bc(n,(Qr(0,i,e.length),e.substr(0,i)))),n.a+="\\",_9(n,t&yr)):n&&_9(n,t&yr);return n?n.a:e}function $On(e){var n,t,i;for(t=new P(e.a.a.b);t.a0&&(!(x1(e.a.c)&&n.n.d)&&!(Rv(e.a.c)&&n.n.b)&&(n.g.d-=k.Math.max(0,i/2-.5)),!(x1(e.a.c)&&n.n.a)&&!(Rv(e.a.c)&&n.n.c)&&(n.g.a+=k.Math.max(0,i-1)))}function AUe(e,n,t){var i,r;if((e.c-e.b&e.a.length-1)==2)n==(De(),Kn)||n==et?(bB(u(OE(e),16),(fl(),l1)),bB(u(OE(e),16),gb)):(bB(u(OE(e),16),(fl(),gb)),bB(u(OE(e),16),l1));else for(r=new dE(e);r.a!=r.b;)i=u(JB(r),16),bB(i,t)}function ROn(e,n,t){var i,r,c,o,l,f,h,b,p;for(b=-1,p=0,l=n,f=0,h=l.length;f0&&++p;++b}return p}function BOn(e,n){var t,i,r,c,o,l,f;for(r=T9(new roe(e)),l=new qr(r,r.c.length),c=T9(new roe(n)),f=new qr(c,c.c.length),o=null;l.b>0&&f.b>0&&(t=(at(l.b>0),u(l.a.Xb(l.c=--l.b),26)),i=(at(f.b>0),u(f.a.Xb(f.c=--f.b),26)),t==i);)o=t;return o}function zOn(e,n){var t,i,r,c;for(n.Tg("Self-Loop pre-processing",1),i=new P(e.a);i.agLe(e,t)?(i=vu(t,(De(),et)),e.d=i.dc()?0:iV(u(i.Xb(0),12)),o=vu(n,Vn),e.b=o.dc()?0:iV(u(o.Xb(0),12))):(r=vu(t,(De(),Vn)),e.d=r.dc()?0:iV(u(r.Xb(0),12)),c=vu(n,et),e.b=c.dc()?0:iV(u(c.Xb(0),12)))}function FOn(e){var n,t,i,r,c,o,l,f;n=!0,r=null,c=null;e:for(f=new P(e.a);f.ae.c));o++)r.a>=e.s&&(c<0&&(c=o),l=o);return f=(e.s+e.c)/2,c>=0&&(i=ADn(e,n,c,l),f=Ngn((kn(i,n.c.length),u(n.c[i],340))),PTn(n,i,t)),f}function Ct(e,n,t){var i,r,c,o,l,f,h;for(o=(c=new Nb,c),Hhe(o,(_n(n),n)),h=(!o.b&&(o.b=new Hs((jn(),Ac),Du,o)),o.b),f=1;f=2}function qOn(e,n,t,i,r){var c,o,l,f,h,b;for(c=e.c.d.j,o=u(Yu(t,0),8),b=1;b1||(n=Ci(Yf,F(z($c,1),Ee,96,0,[W1,Qf])),pO(PR(n,e))>1)||(i=Ci(Zf,F(z($c,1),Ee,96,0,[f1,pf])),pO(PR(i,e))>1))}function TUe(e){var n,t,i,r,c,o,l;for(n=0,i=new P(e.a);i.a0&&(i.b.n-=i.c,i.b.n<=0&&i.b.u>0&&Vt(n,i.b));for(r=new P(e.i);r.a0&&(i.a.u-=i.c,i.a.u<=0&&i.a.n>0&&Vt(t,i.a))}function Nz(e){var n,t,i,r,c;if(e.g==null&&(e.d=e._i(e.f),Et(e,e.d),e.c))return c=e.f,c;if(n=u(e.g[e.i-1],50),r=n.Pb(),e.e=n,t=e._i(r),t.Ob())e.d=t,Et(e,t);else for(e.d=null;!n.Ob()&&(ir(e.g,--e.i,null),e.i!=0);)i=u(e.g[e.i-1],50),n=i;return r}function XOn(e,n){var t,i,r,c,o,l;if(i=n,r=i.Jk(),J1(e.e,r)){if(r.Qi()&&qR(e,r,i.kd()))return!1}else for(l=Po(e.e.Ah(),r),t=u(e.g,122),c=0;c1||t>1)return 2;return n+t==1?2:0}function Ds(e,n){var t,i,r,c,o,l;return c=e.a*JZ+e.b*1502,l=e.b*JZ+11,t=k.Math.floor(l*kN),c+=t,l-=t*Uge,c%=Uge,e.a=c,e.b=l,n<=24?k.Math.floor(e.a*qme[n]):(r=e.a*(1<=2147483648&&(i-=4294967296),i)}function IUe(e,n,t){var i,r,c,o,l,f,h;for(c=new Oe,h=new xi,o=new xi,hLn(e,h,o,n),XPn(e,h,o,n,t),f=new P(e);f.ai.b.g&&Gn(c.c,i);return c}function ZOn(e,n,t){var i,r,c,o,l,f;for(l=e.c,o=(t.q?t.q:(En(),En(),r1)).vc().Jc();o.Ob();)c=u(o.Pb(),45),i=!w9(li(new mn(null,new vn(l,16)),new s9(new yCe(n,c)))).zd(($b(),Sy)),i&&(f=c.kd(),X(f,4)&&(r=yde(f),r!=null&&(f=r)),n.of(u(c.jd(),147),f))}function eNn(e,n){var t,i,r,c;for(n.Tg("Resize child graph to fit parent.",1),i=new P(e.b);i.a1)for(r=new P(e.a);r.a=0?e.Ih(i,!0,!0):Xw(e,c,!0),163)),u(r,219).Vl(n,t)}else throw R(new qn(nb+n.ve()+LS))}function iNn(e,n,t){var i,r,c,o,l,f;if(f=Ele(e,u(zn(e.e,n),26)),l=null,f)switch(f.g){case 3:i=Xse(e,T2(n)),l=(_n(t),t+(_n(i),i));break;case 2:r=Xse(e,T2(n)),o=(_n(t),t+(_n(r),r)),c=Xse(e,u(zn(e.e,n),26)),l=o-(_n(c),c);break;default:l=t}else l=t;return l}function rNn(e,n,t){var i,r,c,o,l,f;if(f=Ele(e,u(zn(e.e,n),26)),l=null,f)switch(f.g){case 3:i=Kse(e,T2(n)),l=(_n(t),t+(_n(i),i));break;case 2:r=Kse(e,T2(n)),o=(_n(t),t+(_n(r),r)),c=Kse(e,u(zn(e.e,n),26)),l=o-(_n(c),c);break;default:l=t}else l=t;return l}function Iz(e,n){var t,i,r,c,o;if(n){for(c=X(e.Cb,88)||X(e.Cb,103),o=!c&&X(e.Cb,335),i=new st((!n.a&&(n.a=new iE(n,Rc,n)),n.a));i.e!=i.i.gc();)if(t=u(ft(i),87),r=Gz(t),c?X(r,88):o?X(r,159):r)return r;return c?(jn(),jf):(jn(),rh)}else return null}function cNn(e,n){var t,i,r,c,o;for(t=new Oe,r=lu(new mn(null,new vn(e,16)),new z5),c=lu(new mn(null,new vn(e,16)),new Mk),o=V9n(w9n(C2(wNn(F(z(DBn,1),On,832,0,[r,c])),new m_))),i=1;i=2*n&&Te(t,new WK(o[i-1]+n,o[i]-n));return t}function DUe(e,n,t){var i,r,c,o,l,f,h,b;if(t)for(c=t.a.length,i=new Jb(c),l=(i.b-i.a)*i.c<0?(S0(),Eb):new M0(i);l.Ob();)o=u(l.Pb(),15),r=F9(t,o.a),r&&(f=j6n(e,(h=(j0(),b=new voe,b),n&&kbe(h,n),h),r),V9(f,N1(r,Ch)),jz(r,f),H0e(r,f),nQ(e,r,f))}function Dz(e){var n,t,i,r,c,o;if(!e.j){if(o=new EL,n=lA,c=n.a.yc(e,n),c==null){for(i=new st(tu(e));i.e!=i.i.gc();)t=u(ft(i),29),r=Dz(t),nr(o,r),Et(o,t);n.a.Ac(e)!=null}F2(o),e.j=new Pv((u(K(ge((C0(),Bn).o),11),19),o.i),o.g),Ms(e).b&=-33}return e.j}function uNn(e){var n,t,i,r;if(e==null)return null;if(i=bo(e,!0),r=qN.length,gn(i.substr(i.length-r,r),qN)){if(t=i.length,t==4){if(n=(Qn(0,i.length),i.charCodeAt(0)),n==43)return g7e;if(n==45)return khn}else if(t==3)return g7e}return new aoe(i)}function oNn(e){var n,t,i;return t=e.l,(t&t-1)!=0||(i=e.m,(i&i-1)!=0)||(n=e.h,(n&n-1)!=0)||n==0&&i==0&&t==0?-1:n==0&&i==0&&t!=0?Phe(t):n==0&&i!=0&&t==0?Phe(i)+22:n!=0&&i==0&&t==0?Phe(n)+44:-1}function d3(e,n){var t,i,r,c,o;for(r=n.a&e.f,c=null,i=e.b[r];;i=i.b){if(i==n){c?c.b=n.b:e.b[r]=n.b;break}c=i}for(o=n.f&e.f,c=null,t=e.c[o];;t=t.d){if(t==n){c?c.d=n.d:e.c[o]=n.d;break}c=t}n.e?n.e.c=n.c:e.a=n.c,n.c?n.c.e=n.e:e.e=n.e,--e.i,++e.g}function sNn(e,n){var t;n.d?n.d.b=n.b:e.a=n.b,n.b?n.b.d=n.d:e.e=n.d,!n.e&&!n.c?(t=u(uf(u(z4(e.b,n.a),262)),262),t.a=0,++e.c):(t=u(uf(u(zn(e.b,n.a),262)),262),--t.a,n.e?n.e.c=n.c:t.b=u(uf(n.c),497),n.c?n.c.e=n.e:t.c=u(uf(n.e),497)),--e.d}function CW(e,n){var t,i,r,c;for(c=new qr(e,0),t=(at(c.b0),c.a.Xb(c.c=--c.b),y2(c,r),at(c.b3&&Vh(e,0,n-3))}function fNn(e){var n,t,i,r;return ue(C(e,(Ie(),Em)))===ue((B1(),Wd))?!e.e&&ue(C(e,hI))!==ue((e8(),rI)):(i=u(C(e,Nie),302),r=Fe(ze(C(e,Iie)))||ue(C(e,px))===ue((zE(),tI)),n=u(C(e,z5e),15).a,t=e.a.c.length,!r&&i!=(e8(),rI)&&(n==0||n>t))}function aNn(e,n){var t,i,r,c,o,l,f;for(r=e.Jc();r.Ob();)for(i=u(r.Pb(),9),l=new Qu,wu(l,i),Ar(l,(De(),et)),he(l,(me(),uH),($n(),!0)),o=n.Jc();o.Ob();)c=u(o.Pb(),9),f=new Qu,wu(f,c),Ar(f,Vn),he(f,uH,!0),t=new Ow,he(t,uH,!0),fc(t,l),Gr(t,f)}function hNn(e){var n,t;for(t=0;t0);t++);if(t>0&&t0);n++);return n>0&&t>16!=6&&n){if(m8(e,n))throw R(new qn(PS+Kqe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Jde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=Z4(n,e,6,i)),i=Tle(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,6,n,n))}function _z(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=3&&n){if(m8(e,n))throw R(new qn(PS+RKe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Ude(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=Z4(n,e,12,i)),i=Cle(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,3,n,n))}function kbe(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=9&&n){if(m8(e,n))throw R(new qn(PS+LXe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Gde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=Z4(n,e,9,i)),i=Ole(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,9,n,n))}function A8(e){var n,t,i,r,c;if(i=ff(e),c=e.j,c==null&&i)return e.Hk()?null:i.gk();if(X(i,159)){if(t=i.hk(),t&&(r=t.ti(),r!=e.i)){if(n=u(i,159),n.lk())try{e.g=r.qi(n,c)}catch(o){if(o=sr(o),X(o,80))e.g=null;else throw R(o)}e.i=r}return e.g}return null}function RUe(e){var n;return n=new Oe,Te(n,new g4(new Se(e.c,e.d),new Se(e.c+e.b,e.d))),Te(n,new g4(new Se(e.c,e.d),new Se(e.c,e.d+e.a))),Te(n,new g4(new Se(e.c+e.b,e.d+e.a),new Se(e.c+e.b,e.d))),Te(n,new g4(new Se(e.c+e.b,e.d+e.a),new Se(e.c,e.d+e.a))),n}function bNn(e){var n,t,i,r;for(i=e.a.d.j,r=e.c.d.j,t=new P(e.i.d);t.a>>0),t.toString(16)),qEn(G7n(),(y9(),"Exception during lenientFormat for "+i),n),"<"+i+" threw "+Pb(n.Pm)+">";throw R(r)}}function wNn(e){var n,t,i,r,c,o,l,f,h;for(i=!1,n=336,t=0,c=new eNe(e.length),l=e,f=0,h=l.length;f1)for(n=kw((t=new Lb,++e.b,t),e.d),l=St(c,0);l.b!=l.d.c;)o=u(jt(l),124),Jf(Of(Tf(Nf(Cf(new tf,1),0),n),o))}function Lz(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=11&&n){if(m8(e,n))throw R(new qn(PS+Jbe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Xde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=Z4(n,e,10,i)),i=Gle(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,11,n,n))}function kNn(e,n,t){var i,r,c,o,l,f;if(c=0,o=0,e.c)for(f=new P(e.d.i.j);f.ac.a?-1:r.af){for(b=e.d,e.d=se(z8e,nme,67,2*f+4,0,1),c=0;c=9223372036854776e3?(U9(),jme):(r=!1,e<0&&(r=!0,e=-e),i=0,e>=hg&&(i=lc(e/hg),e-=i*hg),t=0,e>=dy&&(t=lc(e/dy),e-=t*dy),n=lc(e),c=_o(n,t,i),r&&eQ(c),c)}function DNn(e){var n,t,i,r,c;if(c=new Oe,Ao(e.b,new Kke(c)),e.b.c.length=0,c.c.length!=0){for(n=(kn(0,c.c.length),u(c.c[0],80)),t=1,i=c.c.length;t>16!=7&&n){if(m8(e,n))throw R(new qn(PS+HGe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?Hde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=u(n,52).Oh(e,1,QI,i)),i=Mfe(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,7,n,n))}function FUe(e,n){var t,i;if(n!=e.Cb||e.Db>>16!=3&&n){if(m8(e,n))throw R(new qn(PS+IFe(e)));i=null,e.Cb&&(i=(t=e.Db>>16,t>=0?qde(e,i):e.Cb.Qh(e,-1-t,null,i))),n&&(i=u(n,52).Oh(e,0,ZI,i)),i=Cfe(e,n,i),i&&i.mj()}else(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,3,n,n))}function TW(e,n){C8();var t,i,r,c,o,l,f,h,b;return n.d>e.d&&(l=e,e=n,n=l),n.d<63?EIn(e,n):(o=(e.d&-2)<<4,h=Vae(e,o),b=Vae(n,o),i=VW(e,B4(h,o)),r=VW(n,B4(b,o)),f=TW(h,b),t=TW(i,r),c=TW(VW(h,i),VW(r,b)),c=tZ(tZ(c,f),t),c=B4(c,o),f=B4(f,o<<1),tZ(tZ(f,c),t))}function WO(){WO=Y,Vie=new Iv(zQe,0),M4e=new Iv("LONGEST_PATH",1),C4e=new Iv("LONGEST_PATH_SOURCE",2),Xie=new Iv("COFFMAN_GRAHAM",3),A4e=new Iv(cee,4),T4e=new Iv("STRETCH_WIDTH",5),xH=new Iv("MIN_WIDTH",6),Uie=new Iv("BF_MODEL_ORDER",7),Kie=new Iv("DF_MODEL_ORDER",8)}function RNn(e,n){var t,i,r,c,o,l;if(!e.tb){for(c=(!e.rb&&(e.rb=new x2(e,Ma,e)),e.rb),l=new b4(c.i),r=new st(c);r.e!=r.i.gc();)i=u(ft(r),143),o=i.ve(),t=u(o==null?Ko(l.f,null,i):Bw(l.i,o,i),143),t&&(o==null?Ko(l.f,null,t):Bw(l.i,o,t));e.tb=l}return u(lo(e.tb,n),143)}function ZO(e,n){var t,i,r,c,o;if((e.i==null&&kh(e),e.i).length,!e.p){for(o=new b4((3*e.g.i/2|0)+1),r=new E4(e.g);r.e!=r.i.gc();)i=u(PQ(r),179),c=i.ve(),t=u(c==null?Ko(o.f,null,i):Bw(o.i,c,i),179),t&&(c==null?Ko(o.f,null,t):Bw(o.i,c,t));e.p=o}return u(lo(e.p,n),179)}function Mbe(e,n,t,i,r){var c,o,l,f,h;for(LEn(i+_R(t,t.ge()),r),pDe(n,Wjn(t)),c=t.f,c&&Mbe(e,n,c,"Caused by: ",!1),l=(t.k==null&&(t.k=se(nte,Me,80,0,0,1)),t.k),f=0,h=l.length;f=0;c+=t?1:-1)o=o|n.c.jg(f,c,t,i&&!Fe(ze(C(n.j,(me(),ob))))&&!Fe(ze(C(n.j,(me(),B3))))),o=o|n.q.tg(f,c,t),o=o|CXe(e,f[c],t,i);return hr(e.c,n),o}function $z(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(b=ULe(e.j),p=0,y=b.length;p1&&(e.a=!0),h3n(u(t.b,68),pi(pc(u(n.b,68).c),A1(Nr(pc(u(t.b,68).a),u(n.b,68).a),r))),tLe(e,n),HUe(e,t)}function GUe(e){var n,t,i,r,c,o,l;for(c=new P(e.a.a);c.a0&&c>0?o.p=n++:i>0?o.p=t++:c>0?o.p=r++:o.p=t++}En(),Tr(e.j,new _q)}function HNn(e){var n,t;t=null,n=u(Pe(e.g,0),17);do{if(t=n.d.i,wi(t,(me(),gf)))return u(C(t,gf),12).i;if(t.k!=(Fn(),Wi)&&ht(new Un(Yn(Ii(t).a.Jc(),new ee))))n=u(rt(new Un(Yn(Ii(t).a.Jc(),new ee))),17);else if(t.k!=Wi)return null}while(t&&t.k!=(Fn(),Wi));return t}function GNn(e,n){var t,i,r,c,o,l,f,h,b;for(l=n.j,o=n.g,f=u(Pe(l,l.c.length-1),113),b=(kn(0,l.c.length),u(l.c[0],113)),h=QQ(e,o,f,b),c=1;ch&&(f=t,b=r,h=i);n.a=b,n.c=f}function Kw(e,n,t,i){var r,c;if(r=ue(C(t,(Ie(),gx)))===ue(($0(),ym)),c=u(C(t,B5e),16),wi(e,(me(),Oi)))if(r){if(c.Gc(C(e,wx))&&c.Gc(C(n,wx)))return i*u(C(e,wx),15).a+u(C(e,Oi),15).a}else return u(C(e,Oi),15).a;else return-1;return u(C(e,Oi),15).a}function qNn(e,n,t){var i,r,c,o,l,f,h;for(h=new kd(new bEe(e)),o=F(z(uin,1),fQe,12,0,[n,t]),l=0,f=o.length;lf-e.b&&lf-e.a&&lt.p?1:0:c.Ob()?1:-1}function ZNn(e,n){var t,i,r,c,o,l;n.Tg(fWe,1),r=u(je(e,(Ha(),zx)),104),c=(!e.a&&(e.a=new we(Ft,e,10,11)),e.a),o=yxn(c),l=k.Math.max(o.a,ne(re(je(e,(Qh(),Bx))))-(r.b+r.c)),i=k.Math.max(o.b,ne(re(je(e,UH)))-(r.d+r.a)),t=i-o.b,Ei(e,Rx,t),Ei(e,Fy,l),Ei(e,R7,i+t),n.Ug()}function Rz(e){var n,t;if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i==0)return l1e(e);for(n=u(K((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170),kt((!n.a&&(n.a=new mr(yl,n,5)),n.a)),e3(n,0),n3(n,0),Wv(n,0),Zv(n,0),t=(!e.a&&(e.a=new we($i,e,6,6)),e.a);t.i>1;)Z2(t,t.i-1);return n}function Po(e,n){Tc();var t,i,r,c;return n?n==(Si(),vhn)||(n==ohn||n==Pg||n==uhn)&&e!=d7e?new Age(e,n):(i=u(n,682),t=i.Yk(),t||($9(Vc((ls(),nc),n)),t=i.Yk()),c=(!t.i&&(t.i=new wt),t.i),r=u(bu(Xc(c.f,e)),2003),!r&&ei(c,e,r=new Age(e,n)),r):ihn}function eIn(e,n){var t,i;if(i=RT(e.b,n.b),!i)throw R(new Uc("Invalid hitboxes for scanline constraint calculation."));(Sze(n.b,u(jgn(e.b,n.b),60))||Sze(n.b,u(kgn(e.b,n.b),60)))&&jd(),e.a[n.b.f]=u(BX(e.b,n.b),60),t=u(RX(e.b,n.b),60),t&&(e.a[t.f]=n.b)}function nIn(e,n){var t,i,r,c,o,l,f,h,b;for(f=u(C(e,(me(),mi)),12),h=mu(F(z(Lr,1),Me,8,0,[f.i.n,f.n,f.a])).a,b=e.i.n.b,t=gh(e.e),r=t,c=0,o=r.length;c0?c.a?(l=c.b.Kf().a,t>l&&(r=(t-l)/2,c.d.b=r,c.d.c=r)):c.d.c=e.s+t:uE(e.u)&&(i=m0e(c.b),i.c<0&&(c.d.b=-i.c),i.c+i.b>c.b.Kf().a&&(c.d.c=i.c+i.b-c.b.Kf().a))}function oIn(e,n){var t,i,r,c,o;o=new Oe,t=n;do c=u(zn(e.b,t),132),c.B=t.c,c.D=t.d,Gn(o.c,c),t=u(zn(e.k,t),17);while(t);return i=(kn(0,o.c.length),u(o.c[0],132)),i.j=!0,i.A=u(i.d.a.ec().Jc().Pb(),17).c.i,r=u(Pe(o,o.c.length-1),132),r.q=!0,r.C=u(r.d.a.ec().Jc().Pb(),17).d.i,o}function sIn(e){var n,t;t=u(C(e,(Ie(),ku)),165),n=u(C(e,(me(),jg)),315),t==(Xs(),V1)?(he(e,ku,fI),he(e,jg,(_1(),$3))):t==Sg?(he(e,ku,fI),he(e,jg,(_1(),Ty))):n==(_1(),$3)?(he(e,ku,V1),he(e,jg,uI)):n==Ty&&(he(e,ku,Sg),he(e,jg,uI))}function Bz(){Bz=Y,kI=new Xp,Jon=qt(new or,(zr(),eo),(Ur(),CJ)),qon=Eo(qt(new or,eo,PJ),Pc,LJ),Uon=mh(mh(Nj(Eo(qt(new or,Xf,zJ),Pc,BJ),no),RJ),FJ),Hon=Eo(qt(qt(qt(new or,c1,OJ),no,IJ),no,p7),Pc,NJ),Gon=Eo(qt(qt(new or,no,p7),no,MJ),Pc,AJ)}function rS(){rS=Y,Von=qt(Eo(new or,(zr(),Pc),(Ur(),Jve)),eo,CJ),Zon=mh(mh(Nj(Eo(qt(new or,Xf,zJ),Pc,BJ),no),RJ),FJ),Yon=Eo(qt(qt(qt(new or,c1,OJ),no,IJ),no,p7),Pc,NJ),Won=qt(qt(new or,eo,PJ),Pc,LJ),Qon=Eo(qt(qt(new or,no,p7),no,MJ),Pc,AJ)}function lIn(e,n,t,i,r){var c,o;(!uc(n)&&n.c.i.c==n.d.i.c||!NBe(mu(F(z(Lr,1),Me,8,0,[r.i.n,r.n,r.a])),t))&&!uc(n)&&(n.c==r?S9(n.a,0,new wc(t)):Vt(n.a,new wc(t)),i&&!rf(e.a,t)&&(o=u(C(n,(Ie(),Wc)),78),o||(o=new xs,he(n,Wc,o)),c=new wc(t),Ki(o,c,o.c.b,o.c),hr(e.a,c)))}function XUe(e,n){var t,i,r,c;for(c=Rt(hc(e1,Xh(Rt(hc(n==null?0:Ni(n),n1)),15))),t=c&e.b.length-1,r=null,i=e.b[t];i;r=i,i=i.a)if(i.d==c&&C1(i.i,n))return r?r.a=i.a:e.b[t]=i.a,aAe(u(uf(i.c),593),u(uf(i.f),593)),VC(u(uf(i.b),227),u(uf(i.e),227)),--e.f,++e.e,!0;return!1}function fIn(e){var n,t;for(t=new Un(Yn(cr(e).a.Jc(),new ee));ht(t);)if(n=u(rt(t),17),n.c.i.k!=(Fn(),Uu))throw R(new md(ree+$O(e)+"' has its layer constraint set to FIRST, but has at least one incoming edge that does not come from a FIRST_SEPARATE node. That must not happen."))}function KUe(e,n){var t,i,r,c,o,l,f,h,b,p,y;r=n?new rw:new oM,c=!1;do for(c=!1,h=n?Ks(e.b):e.b,f=h.Jc();f.Ob();)for(l=u(f.Pb(),25),y=Vb(l.a),n||Ks(y),p=new P(y);p.a=0;o+=r?1:-1){for(l=n[o],f=i==(De(),et)?r?vu(l,i):Ks(vu(l,i)):r?Ks(vu(l,i)):vu(l,i),c&&(e.c[l.p]=f.gc()),p=f.Jc();p.Ob();)b=u(p.Pb(),12),e.d[b.p]=h++;Sr(t,f)}}function YUe(e,n,t){var i,r,c,o,l,f,h,b;for(c=ne(re(e.b.Jc().Pb())),h=ne(re(q7n(n.b))),i=A1(pc(e.a),h-t),r=A1(pc(n.a),t-c),b=pi(i,r),A1(b,1/(h-c)),this.a=b,this.b=new Oe,l=!0,o=e.b.Jc(),o.Pb();o.Ob();)f=ne(re(o.Pb())),l&&f-t>Kee&&(this.b.Ec(t),l=!1),this.b.Ec(f);l&&this.b.Ec(t)}function hIn(e){var n,t,i,r;if(TDn(e,e.n),e.d.c.length>0){for(kj(e.c);obe(e,u(_(new P(e.e.a)),124))>5,n&=31,i>=e.d)return e.e<0?(yh(),cnn):(yh(),VS);if(c=e.d-i,r=se($t,ni,30,c+1,15,1),wCn(r,c,e.a,i,n),e.e<0){for(t=0;t0&&e.a[t]<<32-n!=0){for(t=0;t=0?!1:(t=w3((ls(),nc),r,n),t?(i=t.Gk(),(i>1||i==-1)&&Cw(Vc(nc,t))!=3):!0)):!1}function mIn(e,n,t,i){var r,c,o,l,f,h,b,p,y,S;if(f=e.c.d,h=e.d.d,f.j!=h.j)for(S=e.b,b=null,l=null,o=DEn(e),o&&S.i&&(b=e.b.i.i,l=S.i.j),r=f.j,p=null;r!=h.j;)p=n==0?qB(r):X1e(r),c=xde(r,S.d[r.g],t),y=xde(p,S.d[p.g],t),o&&b&&l&&(r==b?HFe(c,b,l):p==b&&HFe(y,b,l)),Vt(i,pi(c,y)),r=p}function Obe(e,n,t){var i,r,c,o,l,f;if(i=sgn(t,e.length),o=e[i],c=wAe(t,o.length),o[c].k==(Fn(),wr))for(f=n.j,r=0;r0&&(t[0]+=e.d,o-=t[0]),t[2]>0&&(t[2]+=e.d,o-=t[2]),c=k.Math.max(0,o),t[1]=k.Math.max(t[1],o),Qae(e,No,r.c+i.b+t[0]-(t[1]-o)/2,t),n==No&&(e.c.b=c,e.c.c=r.c+i.b+(c-o)/2)}function rXe(){this.c=se(Jr,Jc,30,(De(),F(z(xc,1),qu,64,0,[ju,Kn,et,bt,Vn])).length,15,1),this.b=se(Jr,Jc,30,F(z(xc,1),qu,64,0,[ju,Kn,et,bt,Vn]).length,15,1),this.a=se(Jr,Jc,30,F(z(xc,1),qu,64,0,[ju,Kn,et,bt,Vn]).length,15,1),use(this.c,Vi),use(this.b,Ir),use(this.a,Ir)}function SIn(e,n,t,i){var r,c,o,l,f;for(f=n.i,l=t[f.g][e.d[f.g]],r=!1,o=new P(n.d);o.a=r&&(e.c=!1,e.a=!1),e.b[i++]=r,e.b[i]=c,e.c||h3(e)}}function xIn(e,n,t){var i,r,c,o,l,f,h;for(h=n.d,e.a=new xo(h.c.length),e.c=new wt,l=new P(h);l.a=0?e.Ih(h,!1,!0):Xw(e,t,!1),61));e:for(c=p.Jc();c.Ob();){for(r=u(c.Pb(),57),b=0;be.d[o.p]&&(t+=Hae(e.b,c),I0(e.a,ke(c)));for(;!jj(e.a);)Ehe(e.b,u(N4(e.a),15).a)}return t}function oXe(e,n,t){var i,r,c,o;for(c=(!n.a&&(n.a=new we(Ft,n,10,11)),n.a).i,r=new st((!n.a&&(n.a=new we(Ft,n,10,11)),n.a));r.e!=r.i.gc();)i=u(ft(r),26),(!i.a&&(i.a=new we(Ft,i,10,11)),i.a).i==0||(c+=oXe(e,i,!1));if(t)for(o=Fi(n);o;)c+=(!o.a&&(o.a=new we(Ft,o,10,11)),o.a).i,o=Fi(o);return c}function Z2(e,n){var t,i,r,c;return e.Nj()?(i=null,r=e.Oj(),e.Rj()&&(i=e.Tj(e.Yi(n),null)),t=e.Gj(4,c=ey(e,n),null,n,r),e.Kj()&&c!=null&&(i=e.Mj(c,i)),i?(i.lj(t),i.mj()):e.Hj(t),c):(c=ey(e,n),e.Kj()&&c!=null&&(i=e.Mj(c,null),i&&i.mj()),c)}function IIn(e){var n,t,i,r,c,o,l,f,h,b;for(h=e.a,n=new ar,f=0,i=new P(e.d);i.al.d&&(b=l.d+l.a+h));t.c.d=b,n.a.yc(t,n),f=k.Math.max(f,t.c.d+t.c.a)}return f}function DIn(e,n,t){var i,r,c,o,l,f;for(o=u(C(e,(me(),pie)),16).Jc();o.Ob();){switch(c=u(o.Pb(),9),u(C(c,(Ie(),ku)),165).g){case 2:Or(c,n);break;case 4:Or(c,t)}for(r=new Un(Yn(wh(c).a.Jc(),new ee));ht(r);)i=u(rt(r),17),!(i.c&&i.d)&&(l=!i.d,f=u(C(i,Q3e),12),l?Gr(i,f):fc(i,f))}}function Ic(){Ic=Y,ZJ=new h2("COMMENTS",0),Kl=new h2("EXTERNAL_PORTS",1),ux=new h2("HYPEREDGES",2),eH=new h2("HYPERNODES",3),A7=new h2("NON_FREE_PORTS",4),P3=new h2("NORTH_SOUTH_PORTS",5),ox=new h2(CQe,6),S7=new h2("CENTER_LABELS",7),x7=new h2("END_LABELS",8),nH=new h2("PARTITIONS",9)}function _In(e,n,t,i,r){return i<0?(i=a3(e,r,F(z(He,1),Me,2,6,[vZ,yZ,kZ,jZ,ay,EZ,SZ,xZ,AZ,MZ,CZ,TZ]),n),i<0&&(i=a3(e,r,F(z(He,1),Me,2,6,["Jan","Feb","Mar","Apr",ay,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),n)),i<0?!1:(t.k=i,!0)):i>0?(t.k=i-1,!0):!1}function LIn(e,n,t,i,r){return i<0?(i=a3(e,r,F(z(He,1),Me,2,6,[vZ,yZ,kZ,jZ,ay,EZ,SZ,xZ,AZ,MZ,CZ,TZ]),n),i<0&&(i=a3(e,r,F(z(He,1),Me,2,6,["Jan","Feb","Mar","Apr",ay,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),n)),i<0?!1:(t.k=i,!0)):i>0?(t.k=i-1,!0):!1}function PIn(e,n,t,i,r,c){var o,l,f,h;if(l=32,i<0){if(n[0]>=e.length||(l=rc(e,n[0]),l!=43&&l!=45)||(++n[0],i=Cz(e,n),i<0))return!1;l==45&&(i=-i)}return l==32&&n[0]-t==2&&r.b==2&&(f=new r$,h=f.q.getFullYear()-Q0+Q0-80,o=h%100,c.a=i==o,i+=(h/100|0)*100+(i=0?J0(e):lE(J0(Od(e)))),YS[n]=N$(qh(e,n),0)?J0(qh(e,n)):lE(J0(Od(qh(e,n)))),e=hc(e,5);for(;n=h&&(f=i);f&&(b=k.Math.max(b,f.a.o.a)),b>y&&(p=h,y=b)}return p}function FIn(e){var n,t,i,r,c,o,l;for(c=new kd(u(Nt(new Op),51)),l=Ir,t=new P(e.d);t.arWe?Tr(f,e.b):i<=rWe&&i>cWe?Tr(f,e.d):i<=cWe&&i>uWe?Tr(f,e.c):i<=uWe&&Tr(f,e.a),c=aXe(e,f,c);return r}function hXe(e,n,t,i){var r,c,o,l,f,h;for(r=(i.c+i.a)/2,qs(n.j),Vt(n.j,r),qs(t.e),Vt(t.e,r),h=new bAe,l=new P(e.f);l.a1,l&&(i=new Se(r,t.b),Vt(n.a,i)),xE(n.a,F(z(Lr,1),Me,8,0,[y,p]))}function Dbe(e,n,t){var i,r;for(n=48;t--)dA[t]=t-48<<24>>24;for(i=70;i>=65;i--)dA[i]=i-65+10<<24>>24;for(r=102;r>=97;r--)dA[r]=r-97+10<<24>>24;for(c=0;c<10;c++)OG[c]=48+c&yr;for(e=10;e<=15;e++)OG[e]=65+e-10&yr}function wXe(e,n){n.Tg("Process graph bounds",1),he(e,(Ti(),pre),oT(GY(C2(new mn(null,new vn(e.b,16)),new eU)))),he(e,mre,oT(GY(C2(new mn(null,new vn(e.b,16)),new Bs)))),he(e,mye,oT(HY(C2(new mn(null,new vn(e.b,16)),new jM)))),he(e,vye,oT(HY(C2(new mn(null,new vn(e.b,16)),new EM)))),n.Ug()}function UIn(e){var n,t,i,r,c;r=u(C(e,(Ie(),Ag)),22),c=u(C(e,kH),22),t=new Se(e.f.a+e.d.b+e.d.c,e.f.b+e.d.d+e.d.a),n=new wc(t),r.Gc((Vs(),Jm))&&(i=u(C(e,T7),8),c.Gc((_s(),X7))&&(i.a<=0&&(i.a=20),i.b<=0&&(i.b=20)),n.a=k.Math.max(t.a,i.a),n.b=k.Math.max(t.b,i.b)),Fe(ze(C(e,Bie)))||mLn(e,t,n)}function XIn(e){var n,t,i,r,c,o,l;for(n=!1,t=0,r=new P(e.d.b);r.a>19!=0)return"-"+pXe(t8(e));for(t=e,i="";!(t.l==0&&t.m==0&&t.h==0);){if(r=lY(rF),t=mge(t,r,!0),n=""+IAe(tb),!(t.l==0&&t.m==0&&t.h==0))for(c=9-n.length;c>0;c--)n="0"+n;i=n+i}return i}function KIn(){if(!Object.create||!Object.getOwnPropertyNames)return!1;var e="__proto__",n=Object.create(null);if(n[e]!==void 0)return!1;var t=Object.getOwnPropertyNames(n);return!(t.length!=0||(n[e]=42,n[e]!==42)||Object.getOwnPropertyNames(n).length==0)}function VIn(e,n,t){var i,r,c,o,l,f,h,b,p;for(i=t.c,r=t.d,l=La(n.c),f=La(n.d),i==n.c?(l=vbe(e,l,r),f=mGe(n.d)):(l=mGe(n.c),f=vbe(e,f,r)),h=new XP(n.a),Ki(h,l,h.a,h.a.a),Ki(h,f,h.c.b,h.c),o=n.c==i,p=new uxe,c=0;c=e.a||!b0e(n,t))return-1;if(I2(u(i.Kb(n),20)))return 1;for(r=0,o=u(i.Kb(n),20).Jc();o.Ob();)if(c=u(o.Pb(),17),f=c.c.i==n?c.d.i:c.c.i,l=Pbe(e,f,t,i),l==-1||(r=k.Math.max(r,l),r>e.c-1))return-1;return r+1}function Ha(){Ha=Y,KH=new Yr((Xt(),B7),1.3),Cln=new Yr($m,($n(),!1)),k6e=new yw(15),zx=new Yr(s1,k6e),Fx=new Yr(Qd,15),Sln=DI,Mln=Ig,Tln=n5,Oln=bb,Aln=e5,Ure=$I,Nln=Rm,x6e=(nge(),kln),S6e=yln,Kre=Eln,A6e=jln,y6e=pln,Xre=wln,v6e=gln,E6e=vln,p6e=PI,xln=pce,MI=hln,w6e=aln,CI=dln,j6e=mln,m6e=bln}function mXe(e,n){var t,i,r,c,o,l;if(ue(n)===ue(e))return!0;if(!X(n,16)||(i=u(n,16),l=e.gc(),i.gc()!=l))return!1;if(o=i.Jc(),e.Wi()){for(t=0;t0){if(e.Zj(),n!=null){for(c=0;c>24;case 97:case 98:case 99:case 100:case 101:case 102:return e-97+10<<24>>24;case 65:case 66:case 67:case 68:case 69:case 70:return e-65+10<<24>>24;default:throw R(new fh("Invalid hexadecimal"))}}function yXe(e,n,t,i){var r,c,o,l,f,h;for(f=iW(e,t),h=iW(n,t),r=!1;f&&h&&(i||nxn(f,h,t));)o=iW(f,t),l=iW(h,t),cO(n),cO(e),c=f.c,iZ(f,!1),iZ(h,!1),t?(H0(n,h.p,c),n.p=h.p,H0(e,f.p+1,c),e.p=f.p):(H0(e,f.p,c),e.p=f.p,H0(n,h.p+1,c),n.p=h.p),Or(f,null),Or(h,null),f=o,h=l,r=!0;return r}function kXe(e){switch(e.g){case 0:return new uP;case 1:return new oP;case 3:return new OMe;case 4:return new C6;case 5:return new cNe;case 6:return new ko;case 2:return new sP;case 7:return new EC;case 8:return new jC;default:throw R(new qn("No implementation is available for the layerer "+(e.f!=null?e.f:""+e.g)))}}function ZIn(e,n,t,i){var r,c,o,l,f;for(r=!1,c=!1,l=new P(i.j);l.a=n.length)throw R(new jo("Greedy SwitchDecider: Free layer not in graph."));this.c=n[e],this.e=new NT(i),RY(this.e,this.c,(De(),Vn)),this.i=new NT(i),RY(this.i,this.c,et),this.f=new OIe(this.c),this.a=!c&&r.i&&!r.s&&this.c[0].k==(Fn(),wr),this.a&&kCn(this,e,n.length)}function EXe(e,n){var t,i,r,c,o,l;c=!e.B.Gc((_s(),KI)),o=e.B.Gc(Oce),e.a=new uJe(o,c,e.c),e.n&&sae(e.a.n,e.n),AX(e.g,(wa(),No),e.a),n||(i=new HE(1,c,e.c),i.n.a=e.k,I4(e.p,(De(),Kn),i),r=new HE(1,c,e.c),r.n.d=e.k,I4(e.p,bt,r),l=new HE(0,c,e.c),l.n.c=e.k,I4(e.p,Vn,l),t=new HE(0,c,e.c),t.n.b=e.k,I4(e.p,et,t))}function nDn(e){var n,t,i;switch(n=u(C(e.d,(Ie(),Y1)),222),n.g){case 2:t=HRn(e);break;case 3:t=(i=new Oe,er(li(So(lu(lu(new mn(null,new vn(e.d.b,16)),new nw),new n_),new yk),new h0),new Gje(i)),i);break;default:throw R(new Uc("Compaction not supported for "+n+" edges."))}dPn(e,t),cc(new it(e.g),new zje(e))}function tDn(e,n){var t,i,r,c,o,l,f;if(n.Tg("Process directions",1),t=u(C(e,(Mu(),kp)),86),t!=(vr(),eh))for(r=St(e.b,0);r.b!=r.d.c;){switch(i=u(jt(r),40),l=u(C(i,(Ti(),SI)),15).a,f=u(C(i,xI),15).a,t.g){case 4:f*=-1;break;case 1:c=l,l=f,f=c;break;case 2:o=l,l=-f,f=o}he(i,SI,ke(l)),he(i,xI,ke(f))}n.Ug()}function iDn(e){var n,t,i,r,c,o,l,f;for(f=new zPe,l=new P(e.a);l.a0&&n=0)return!1;if(n.p=t.b,Te(t.e,n),r==(Fn(),dr)||r==wo){for(o=new P(n.j);o.ae.d[l.p]&&(t+=Hae(e.b,c),I0(e.a,ke(c)))):++o;for(t+=e.b.d*o;!jj(e.a);)Ehe(e.b,u(N4(e.a),15).a)}return t}function _Xe(e){var n,t,i,r,c,o;return c=0,n=ff(e),n.ik()&&(c|=4),(e.Bb&as)!=0&&(c|=2),X(e,103)?(t=u(e,19),r=Oc(t),(t.Bb&Ru)!=0&&(c|=32),r&&(dt(O2(r)),c|=8,o=r.t,(o>1||o==-1)&&(c|=16),(r.Bb&Ru)!=0&&(c|=64)),(t.Bb&Ec)!=0&&(c|=V0),c|=Gf):X(n,459)?c|=512:(i=n.ik(),i&&(i.i&1)!=0&&(c|=256)),(e.Bb&512)!=0&&(c|=128),c}function gDn(e,n){var t;return e.f==Gce?(t=Cw(Vc((ls(),nc),n)),e.e?t==4&&n!=(cy(),Zy)&&n!=(cy(),Wy)&&n!=(cy(),qce)&&n!=(cy(),Uce):t==2):e.d&&(e.d.Gc(n)||e.d.Gc($4(Vc((ls(),nc),n)))||e.d.Gc(w3((ls(),nc),e.b,n)))?!0:e.f&&jbe((ls(),e.f),FT(Vc(nc,n)))?(t=Cw(Vc(nc,n)),e.e?t==4:t==2):!1}function wDn(e,n){var t,i,r,c,o,l,f,h;for(c=new Oe,n.b.c.length=0,t=u(gs(Eae(new mn(null,new vn(new it(e.a.b),1))),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),16),r=t.Jc();r.Ob();)if(i=u(r.Pb(),15),o=Pae(e.a,i),o.b!=0)for(l=new Xu(n),Gn(c.c,l),l.p=i.a,h=St(o,0);h.b!=h.d.c;)f=u(jt(h),9),Or(f,l);Sr(n.b,c)}function LW(e){var n,t,i,r,c,o,l;for(l=new wt,i=new P(e.a.b);i.agg&&(r-=gg),l=u(je(i,Uy),8),h=l.a,p=l.b+e,c=k.Math.atan2(p,h),c<0&&(c+=gg),c+=n,c>gg&&(c-=gg),Na(),Rf(1e-10),k.Math.abs(r-c)<=1e-10||r==c||isNaN(r)&&isNaN(c)?0:rc?1:Bb(isNaN(r),isNaN(c))}function Fbe(e,n,t,i){var r,c,o;n&&(c=ne(re(C(n,(Ti(),Vd))))+i,o=t+ne(re(C(n,RH)))/2,he(n,SI,ke(Rt(Lu(k.Math.round(c))))),he(n,xI,ke(Rt(Lu(k.Math.round(o))))),n.d.b==0||Fbe(e,u(R$((r=St(new S1(n).a.d,0),new Cv(r))),40),t+ne(re(C(n,RH)))+e.b,i+ne(re(C(n,$7)))),C(n,yre)!=null&&Fbe(e,u(C(n,yre),40),t,i))}function yDn(e,n){var t,i,r,c;if(c=u(je(e,(Xt(),t5)),64).g-u(je(n,t5),64).g,c!=0)return c;if(t=u(je(e,jce),15),i=u(je(n,jce),15),t&&i&&(r=t.a-i.a,r!=0))return r;switch(u(je(e,t5),64).g){case 1:return ji(e.i,n.i);case 2:return ji(e.j,n.j);case 3:return ji(n.i,e.i);case 4:return ji(n.j,e.j);default:throw R(new Uc(dwe))}}function Jbe(e){var n,t,i;return(e.Db&64)!=0?gW(e):(n=new tl(R2e),t=e.k,t?Kt(Kt((n.a+=' "',n),t),'"'):(!e.n&&(e.n=new we(Eu,e,1,7)),e.n.i>0&&(i=(!e.n&&(e.n=new we(Eu,e,1,7)),u(K(e.n,0),157)).a,!i||Kt(Kt((n.a+=' "',n),i),'"'))),Kt(ww(Kt(ww(Kt(ww(Kt(ww((n.a+=" (",n),e.i),","),e.j)," | "),e.g),","),e.f),")"),n.a)}function LXe(e){var n,t,i;return(e.Db&64)!=0?gW(e):(n=new tl(B2e),t=e.k,t?Kt(Kt((n.a+=' "',n),t),'"'):(!e.n&&(e.n=new we(Eu,e,1,7)),e.n.i>0&&(i=(!e.n&&(e.n=new we(Eu,e,1,7)),u(K(e.n,0),157)).a,!i||Kt(Kt((n.a+=' "',n),i),'"'))),Kt(ww(Kt(ww(Kt(ww(Kt(ww((n.a+=" (",n),e.i),","),e.j)," | "),e.g),","),e.f),")"),n.a)}function kDn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;for(S=-1,A=0,b=n,p=0,y=b.length;p0&&++A;++S}return A}function jDn(e,n){var t,i,r,c,o;for(n==(DE(),ure)&&qO(u(vi(e.a,(X2(),nI)),16)),r=u(vi(e.a,(X2(),nI)),16).Jc();r.Ob();)switch(i=u(r.Pb(),107),t=u(Pe(i.j,0),113).d.j,c=new bs(i.j),Tr(c,new I5),n.g){case 2:sW(e,c,t,($w(),ub),1);break;case 1:case 0:o=hNn(c),sW(e,new N0(c,0,o),t,($w(),ub),0),sW(e,new N0(c,o,c.c.length),t,ub,1)}}function EDn(e){var n,t,i,r,c,o,l;for(r=u(C(e,(me(),bp)),9),i=e.j,t=(kn(0,i.c.length),u(i.c[0],12)),o=new P(r.j);o.ar.p?(Ar(c,bt),c.d&&(l=c.o.b,n=c.a.b,c.a.b=l-n)):c.j==bt&&r.p>e.p&&(Ar(c,Kn),c.d&&(l=c.o.b,n=c.a.b,c.a.b=-(l-n)));break}return r}function Hbe(e,n){var t,i,r,c,o,l,f;if(n==null||n.length==0)return null;if(r=u(lo(e.a,n),144),!r){for(i=(l=new ot(e.b).a.vc().Jc(),new Hi(l));i.a.Ob();)if(t=(c=u(i.a.Pb(),45),u(c.kd(),144)),o=t.c,f=n.length,gn(o.substr(o.length-f,f),n)&&(n.length==o.length||rc(o,o.length-n.length-1)==46)){if(r)return null;r=t}r&&Kc(e.a,n,r)}return r}function T8(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(c=new Se(n,t),b=new P(e.a);b.a1,l&&(i=new Se(r,t.b),Vt(n.a,i)),xE(n.a,F(z(Lr,1),Me,8,0,[y,p]))}function X0(){X0=Y,CH=new d2(va,0),pI=new d2("NIKOLOV",1),mI=new d2("NIKOLOV_PIXEL",2),P4e=new d2("NIKOLOV_IMPROVED",3),$4e=new d2("NIKOLOV_IMPROVED_PIXEL",4),L4e=new d2("DUMMYNODE_PERCENTAGE",5),R4e=new d2("NODECOUNT_PERCENTAGE",6),TH=new d2("NO_BOUNDARY",7),_7=new d2("MODEL_ORDER_LEFT_TO_RIGHT",8),xx=new d2("MODEL_ORDER_RIGHT_TO_LEFT",9)}function $W(e,n){var t,i,r,c,o,l,f,h,b,p,y,S;return b=null,y=hbe(e,n),i=null,l=u(je(n,(Xt(),Tfn)),300),l?i=l:i=(EE(),qI),S=i,S==(EE(),qI)&&(r=null,h=u(zn(e.r,y),300),h?r=h:r=Tce,S=r),ei(e.r,n,S),c=null,f=u(je(n,Cfn),278),f?c=f:c=(s8(),BI),p=c,p==(s8(),BI)&&(o=null,t=u(zn(e.b,y),278),t?o=t:o=sG,p=o),b=u(ei(e.b,n,p),278),b}function _Dn(e){var n,t,i,r,c;for(i=e.length,n=new Ej,c=0;c=40,o&&D_n(e),qLn(e),hIn(e),t=RFe(e),i=0;t&&i0&&Vt(e.g,c)):(e.d[o]-=h+1,e.d[o]<=0&&e.a[o]>0&&Vt(e.f,c))))}function KXe(e,n,t,i){var r,c,o,l,f,h,b;for(f=new Se(t,i),Nr(f,u(C(n,(Ti(),P7)),8)),b=St(n.b,0);b.b!=b.d.c;)h=u(jt(b),40),pi(h.e,f),Vt(e.b,h);for(l=u(gs(yae(new mn(null,new vn(n.a,16))),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),16).Jc();l.Ob();){for(o=u(l.Pb(),65),c=St(o.a,0);c.b!=c.d.c;)r=u(jt(c),8),r.a+=f.a,r.b+=f.b;Vt(e.a,o)}}function Qbe(e,n){var t,i,r,c;if(0<(X(e,18)?u(e,18).gc():ha(e.Jc()))){if(r=n,1=0&&f1)&&n==1&&u(e.a[e.b],9).k==(Fn(),Uu)?sy(u(e.a[e.b],9),(fl(),l1)):i&&(!t||(e.c-e.b&e.a.length-1)>1)&&n==1&&u(e.a[e.c-1&e.a.length-1],9).k==(Fn(),Uu)?sy(u(e.a[e.c-1&e.a.length-1],9),(fl(),gb)):(e.c-e.b&e.a.length-1)==2?(sy(u(OE(e),9),(fl(),l1)),sy(u(OE(e),9),gb)):NOn(e,r),zae(e)}function QDn(e){var n,t,i,r,c,o,l,f;for(f=new wt,n=new wX,o=e.Jc();o.Ob();)r=u(o.Pb(),9),l=kw(iT(new Lb,r),n),Ko(f.f,r,l);for(c=e.Jc();c.Ob();)for(r=u(c.Pb(),9),i=new Un(Yn(Ii(r).a.Jc(),new ee));ht(i);)t=u(rt(i),17),!uc(t)&&Jf(Of(Tf(Cf(Nf(new tf,k.Math.max(1,u(C(t,(Ie(),g4e)),15).a)),1),u(zn(f,t.c.i),124)),u(zn(f,t.d.i),124)));return n}function QXe(e,n,t,i){var r,c,o,l,f,h,b,p,y,S;if(C8n(e,n,t),c=n[t],S=i?(De(),Vn):(De(),et),Wwn(n.length,t,i)){for(r=n[i?t-1:t+1],rhe(e,r,i?(Nc(),Io):(Nc(),ys)),f=c,b=0,y=f.length;bc*2?(b=new gB(p),h=us(o)/Gs(o),f=oZ(b,n,new o4,t,i,r,h),pi(fa(b.e),f),p.c.length=0,c=0,Gn(p.c,b),Gn(p.c,o),c=us(b)*Gs(b)+us(o)*Gs(o)):(Gn(p.c,o),c+=us(o)*Gs(o));return p}function ZDn(e,n){var t,i,r,c,o,l,f;for(n.Tg("Port order processing",1),f=u(C(e,(Ie(),b4e)),421),i=new P(e.b);i.at?n:t;h<=p;++h)h==t?l=i++:(c=r[h],b=A.$l(c.Jk()),h==n&&(f=h==p&&!b?i-1:i),b&&++i);return y=u(BE(e,n,t),75),l!=f&&f9(e,new rO(e.e,7,o,ke(l),S.kd(),f)),y}}else return u(EW(e,n,t),75);return u(BE(e,n,t),75)}function Wbe(e,n){var t,i,r,c,o,l,f,h,b,p;for(p=0,c=new Fv,I0(c,n);c.b!=c.c;)for(f=u(N4(c),218),h=0,b=u(C(n.j,(Ie(),o1)),269),u(C(n.j,gx),329),o=ne(re(C(n.j,aI))),l=ne(re(C(n.j,Mie))),b!=(F1(),fb)&&(h+=o*ROn(n.j,f.e,b),h+=l*kDn(n.j,f.e)),p+=yHe(f.d,f.e)+h,r=new P(f.b);r.a=0&&(l=bxn(e,o),!(l&&(h<22?f.l|=1<>>1,o.m=b>>>1|(p&1)<<21,o.l=y>>>1|(b&1)<<21,--h;return t&&eQ(f),c&&(i?(tb=t8(e),r&&(tb=Aze(tb,(U9(),Eme)))):tb=_o(e.l,e.m,e.h)),f}function t_n(e,n){var t,i,r,c,o,l,f,h,b,p;for(h=e.e[n.c.p][n.p]+1,f=n.c.a.c.length+1,l=new P(e.a);l.a0&&(Qn(0,e.length),e.charCodeAt(0)==45||(Qn(0,e.length),e.charCodeAt(0)==43))?1:0,i=o;it)throw R(new fh(Zw+e+'"'));return l}function i_n(e){var n,t,i,r,c,o,l;for(o=new xi,c=new P(e.a);c.a=e.length)return t.o=0,!0;switch(rc(e,n[0])){case 43:r=1;break;case 45:r=-1;break;default:return t.o=0,!0}if(++n[0],c=n[0],o=Cz(e,n),o==0&&n[0]==c)return!1;if(n[0]l&&(l=r,b.c.length=0),r==l&&Te(b,new jc(t.c.i,t)));En(),Tr(b,e.c),zb(e.b,f.p,b)}}function l_n(e,n){var t,i,r,c,o,l,f,h,b;for(o=new P(n.b);o.al&&(l=r,b.c.length=0),r==l&&Te(b,new jc(t.d.i,t)));En(),Tr(b,e.c),zb(e.f,f.p,b)}}function f_n(e){var n,t,i,r,c,o,l;for(c=_a(e),r=new st((!e.e&&(e.e=new Nn(pr,e,7,4)),e.e));r.e!=r.i.gc();)if(i=u(ft(r),85),l=iu(u(K((!i.c&&(i.c=new Nn(mt,i,5,8)),i.c),0),84)),!P2(l,c))return!0;for(t=new st((!e.d&&(e.d=new Nn(pr,e,8,5)),e.d));t.e!=t.i.gc();)if(n=u(ft(t),85),o=iu(u(K((!n.b&&(n.b=new Nn(mt,n,4,7)),n.b),0),84)),!P2(o,c))return!0;return!1}function a_n(e){var n,t,i,r,c;i=u(C(e,(me(),mi)),26),c=u(je(i,(Ie(),Ag)),182).Gc((Vs(),_g)),e.e||(r=u(C(e,po),22),n=new Se(e.f.a+e.d.b+e.d.c,e.f.b+e.d.d+e.d.a),r.Gc((Ic(),Kl))?(Ei(i,Zi,(Br(),to)),Yw(i,n.a,n.b,!1,!0)):Fe(ze(je(i,Bie)))||Yw(i,n.a,n.b,!0,!0)),c?Ei(i,Ag,rn(_g)):Ei(i,Ag,(t=u(la(iA),10),new _l(t,u(Df(t,t.length),10),0)))}function h_n(e,n){var t,i,r,c,o,l,f,h;if(h=ze(C(n,(Mu(),jsn))),h==null||(_n(h),h)){for(FTn(e,n),r=new Oe,f=St(n.b,0);f.b!=f.d.c;)o=u(jt(f),40),t=P0e(e,o,null),t&&(Pu(t,n),Gn(r.c,t));if(e.a=null,e.b=null,r.c.length>1)for(i=new P(r);i.a=0&&l!=t&&(c=new Dr(e,1,l,o,null),i?i.lj(c):i=c),t>=0&&(c=new Dr(e,1,t,l==t?o:null,n),i?i.lj(c):i=c)),i}function ZXe(e){var n,t,i;if(e.b==null){if(i=new vd,e.i!=null&&(Bc(i,e.i),i.a+=":"),(e.f&256)!=0){for((e.f&256)!=0&&e.a!=null&&(x5n(e.i)||(i.a+="//"),Bc(i,e.a)),e.d!=null&&(i.a+="/",Bc(i,e.d)),(e.f&16)!=0&&(i.a+="/"),n=0,t=e.j.length;ny?!1:(p=(f=aS(i,y,!1),f.a),b+l+p<=n.b&&(tO(t,c-t.s),t.c=!0,tO(i,c-t.s),LO(i,t.s,t.t+t.d+l),i.k=!0,i1e(t.q,i),S=!0,r&&(kB(n,i),i.j=n,e.c.length>o&&(BO((kn(o,e.c.length),u(e.c[o],186)),i),(kn(o,e.c.length),u(e.c[o],186)).a.c.length==0&&Cd(e,o)))),S)}function v_n(e,n){var t,i,r,c,o,l;if(n.Tg("Partition midprocessing",1),r=new Nw,er(li(new mn(null,new vn(e.a,16)),new m6),new Sje(r)),r.d!=0){for(l=u(gs(Eae((c=r.i,new mn(null,(c||(r.i=new Hv(r,r.c))).Lc()))),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),16),i=l.Jc(),t=u(i.Pb(),15);i.Ob();)o=u(i.Pb(),15),aNn(u(vi(r,t),22),u(vi(r,o),22)),t=o;n.Ug()}}function oS(e,n){var t,i,r,c,o;if(e.Ab){if(e.Ab){if(o=e.Ab.i,o>0){if(r=u(e.Ab.g,1995),n==null){for(c=0;ct.s&&lf+A&&(O=p.g+y.g,y.a=(y.g*y.a+p.g*p.a)/O,y.g=O,p.f=y,t=!0)),c=l,p=y;return t}function j_n(e,n,t){var i,r,c,o,l,f,h,b;for(t.Tg(XQe,1),Hu(e.b),Hu(e.a),l=null,c=St(n.b,0);!l&&c.b!=c.d.c;)h=u(jt(c),40),Fe(ze(C(h,(Ti(),db))))&&(l=h);for(f=new xi,Ki(f,l,f.c.b,f.c),IVe(e,f),b=St(n.b,0);b.b!=b.d.c;)h=u(jt(b),40),o=Pt(C(h,(Ti(),_x))),r=lo(e.b,o)!=null?u(lo(e.b,o),15).a:0,he(h,wre,ke(r)),i=1+(lo(e.a,o)!=null?u(lo(e.a,o),15).a:0),he(h,pye,ke(i));t.Ug()}function cKe(e){a2(e,new qw(l2(u2(s2(o2(new gd,cp),"ELK Box"),"Algorithm for packing of unconnected boxes, i.e. graphs without edges."),new UM))),xe(e,cp,sm,g9e),xe(e,cp,om,15),xe(e,cp,xN,ke(0)),xe(e,cp,T2e,Le(h9e)),xe(e,cp,k3,Le(wfn)),xe(e,cp,py,Le(pfn)),xe(e,cp,U8,pWe),xe(e,cp,ES,Le(d9e)),xe(e,cp,my,Le(b9e)),xe(e,cp,O2e,Le(fce)),xe(e,cp,OF,Le(gfn))}function uKe(e,n){var t,i,r,c,o,l,f,h,b;if(r=e.i,o=r.o.a,c=r.o.b,o<=0&&c<=0)return De(),ju;switch(h=e.n.a,b=e.n.b,l=e.o.a,t=e.o.b,n.g){case 2:case 1:if(h<0)return De(),Vn;if(h+l>o)return De(),et;break;case 4:case 3:if(b<0)return De(),Kn;if(b+t>c)return De(),bt}return f=(h+l/2)/o,i=(b+t/2)/c,f+i<=1&&f-i<=0?(De(),Vn):f+i>=1&&f-i>=0?(De(),et):i<.5?(De(),Kn):(De(),bt)}function oKe(e,n,t,i,r,c,o){var l,f,h,b,p,y;for(y=new y4,h=n.Jc();h.Ob();)for(l=u(h.Pb(),837),p=new P(l.Pf());p.a0?l.a?(h=l.b.Kf().b,r>h&&(e.v||l.c.d.c.length==1?(o=(r-h)/2,l.d.d=o,l.d.a=o):(t=u(Pe(l.c.d,0),187).Kf().b,i=(t-h)/2,l.d.d=k.Math.max(0,i),l.d.a=r-i-h))):l.d.a=e.t+r:uE(e.u)&&(c=m0e(l.b),c.d<0&&(l.d.d=-c.d),c.d+c.a>l.b.Kf().b&&(l.d.a=c.d+c.a-l.b.Kf().b))}function Hf(){Hf=Y,Ay=new Yr((Xt(),RI),ke(1)),kJ=new Yr(Qd,80),xtn=new Yr(q9e,5),gtn=new Yr(B7,q8),Etn=new Yr(Sce,ke(1)),Stn=new Yr(xce,($n(),!0)),cve=new yw(50),ktn=new Yr(s1,cve),tve=PI,uve=Vx,wtn=new Yr(bce,!1),rve=$I,vtn=$m,ytn=bb,mtn=Ig,ptn=e5,jtn=Rm,ive=(C0e(),stn),jte=htn,yJ=otn,kte=ltn,ove=atn,Ctn=J7,Ttn=uG,Mtn=zm,Atn=F7,sve=(V4(),Hm),new Yr(Ky,sve)}function x_n(e,n){var t;switch(aO(e)){case 6:return $r(n);case 7:return g2(n);case 8:return b2(n);case 3:return Array.isArray(n)&&(t=aO(n),!(t>=14&&t<=16));case 11:return n!=null&&typeof n===hZ;case 12:return n!=null&&(typeof n===fN||typeof n==hZ);case 0:return $Q(n,e.__elementTypeId$);case 2:return mV(n)&&n.Rm!==bn;case 1:return mV(n)&&n.Rm!==bn||$Q(n,e.__elementTypeId$);default:return!0}}function A_n(e){var n,t,i,r;i=e.o,v2(),e.A.dc()||gi(e.A,Qme)?r=i.a:(e.D?r=k.Math.max(i.a,WE(e.f)):r=WE(e.f),e.A.Gc((Vs(),UI))&&!e.B.Gc((_s(),rA))&&(r=k.Math.max(r,WE(u(zc(e.p,(De(),Kn)),253))),r=k.Math.max(r,WE(u(zc(e.p,bt),253)))),n=tze(e),n&&(r=k.Math.max(r,n.a))),Fe(ze(e.e.Rf().mf((Xt(),$m))))?i.a=k.Math.max(i.a,r):i.a=r,t=e.f.i,t.c=0,t.b=r,GW(e.f)}function sKe(e,n){var t,i,r,c;return i=k.Math.min(k.Math.abs(e.c-(n.c+n.b)),k.Math.abs(e.c+e.b-n.c)),c=k.Math.min(k.Math.abs(e.d-(n.d+n.a)),k.Math.abs(e.d+e.a-n.d)),t=k.Math.abs(e.c+e.b/2-(n.c+n.b/2)),t>e.b/2+n.b/2||(r=k.Math.abs(e.d+e.a/2-(n.d+n.a/2)),r>e.a/2+n.a/2)?1:t==0&&r==0?0:t==0?c/r+1:r==0?i/t+1:k.Math.min(i/t,c/r)+1}function M_n(e,n){var t,i,r,c,o,l,f;for(c=0,l=0,f=0,r=new P(e.f.e);r.a0&&e.d!=(kE(),xte)&&(l+=o*(i.d.a+e.a[n.a][i.a]*(n.d.a-i.d.a)/t)),t>0&&e.d!=(kE(),Ete)&&(f+=o*(i.d.b+e.a[n.a][i.a]*(n.d.b-i.d.b)/t)));switch(e.d.g){case 1:return new Se(l/c,n.d.b);case 2:return new Se(n.d.a,f/c);default:return new Se(l/c,f/c)}}function lKe(e){var n,t,i,r,c,o;for(t=(!e.a&&(e.a=new mr(yl,e,5)),e.a).i+2,o=new xo(t),Te(o,new Se(e.j,e.k)),er(new mn(null,(!e.a&&(e.a=new mr(yl,e,5)),new vn(e.a,16))),new iSe(o)),Te(o,new Se(e.b,e.c)),n=1;n0&&(EO(f,!1,(vr(),Zc)),EO(f,!0,ru)),Ao(n.g,new nCe(e,t)),ei(e.g,n,t)}function nge(){nge=Y,mln=new fn(s2e,($n(),!1)),ke(-1),aln=new fn(l2e,ke(-1)),ke(-1),hln=new fn(f2e,ke(-1)),dln=new fn(a2e,!1),bln=new fn(h2e,!1),g6e=(QR(),Vre),jln=new fn(d2e,g6e),Eln=new fn(b2e,-1),b6e=(VB(),qre),kln=new fn(g2e,b6e),yln=new fn(w2e,!0),h6e=(uB(),Yre),pln=new fn(p2e,h6e),wln=new fn(m2e,!1),ke(1),gln=new fn(v2e,ke(1)),d6e=(GB(),Qre),vln=new fn(y2e,d6e)}function hKe(){hKe=Y;var e;for(Nme=F(z($t,1),ni,30,15,[-1,-1,30,19,15,13,11,11,10,9,9,8,8,8,8,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5]),cte=se($t,ni,30,37,15,1),tnn=F(z($t,1),ni,30,15,[-1,-1,63,40,32,28,25,23,21,20,19,19,18,18,17,17,16,16,16,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13,13,13,13]),Ime=se(Ap,xYe,30,37,14,1),e=2;e<=36;e++)cte[e]=lc(k.Math.pow(e,Nme[e])),Ime[e]=FO(bN,cte[e])}function C_n(e){var n;if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i!=1)throw R(new qn(FWe+(!e.a&&(e.a=new we($i,e,6,6)),e.a).i));return n=new xs,VY(u(K((!e.b&&(e.b=new Nn(mt,e,4,7)),e.b),0),84))&&ac(n,YVe(e,VY(u(K((!e.b&&(e.b=new Nn(mt,e,4,7)),e.b),0),84)),!1)),VY(u(K((!e.c&&(e.c=new Nn(mt,e,5,8)),e.c),0),84))&&ac(n,YVe(e,VY(u(K((!e.c&&(e.c=new Nn(mt,e,5,8)),e.c),0),84)),!0)),n}function dKe(e,n){var t,i,r,c,o;for(n.d?r=e.a.c==(dh(),yp)?cr(n.b):Ii(n.b):r=e.a.c==(dh(),Kd)?cr(n.b):Ii(n.b),c=!1,i=new Un(Yn(r.a.Jc(),new ee));ht(i);)if(t=u(rt(i),17),o=Fe(e.a.f[e.a.g[n.b.p].p]),!(!o&&!uc(t)&&t.c.i.c==t.d.i.c)&&!(Fe(e.a.n[e.a.g[n.b.p].p])||Fe(e.a.n[e.a.g[n.b.p].p]))&&(c=!0,rf(e.b,e.a.g[QSn(t,n.b).p])))return n.c=!0,n.a=t,n;return n.c=c,n.a=null,n}function tge(e,n,t){var i,r,c,o,l,f,h;if(i=t.gc(),i==0)return!1;if(e.Nj())if(f=e.Oj(),lde(e,n,t),o=i==1?e.Gj(3,null,t.Jc().Pb(),n,f):e.Gj(5,null,t,n,f),e.Kj()){for(l=i<100?null:new k0(i),c=n+i,r=n;r0){for(o=0;o>16==-15&&e.Cb.Vh()&&EY(new mY(e.Cb,9,13,t,e.c,$d(Ts(u(e.Cb,62)),e))):X(e.Cb,88)&&e.Db>>16==-23&&e.Cb.Vh()&&(n=e.c,X(n,88)||(n=(jn(),jf)),X(t,88)||(t=(jn(),jf)),EY(new mY(e.Cb,9,10,t,n,$d(Vu(u(e.Cb,29)),e)))))),e.c}function wKe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A;if(n==t)return!0;if(n=ube(e,n),t=ube(e,t),i=GQ(n),i){if(b=GQ(t),b!=i)return b?(f=i.kk(),A=b.kk(),f==A&&f!=null):!1;if(o=(!n.d&&(n.d=new mr(Rc,n,1)),n.d),c=o.i,y=(!t.d&&(t.d=new mr(Rc,t,1)),t.d),c==y.i){for(h=0;h0,l=KB(n,c),fle(t?l.b:l.g,n),r3(l).c.length==1&&Ki(i,l,i.c.b,i.c),r=new jc(c,n),I0(e.o,r),qo(e.e.a,c))}function vKe(e,n){var t,i,r,c,o,l,f;return i=k.Math.abs(vR(e.b).a-vR(n.b).a),l=k.Math.abs(vR(e.b).b-vR(n.b).b),r=0,f=0,t=1,o=1,i>e.b.b/2+n.b.b/2&&(r=k.Math.min(k.Math.abs(e.b.c-(n.b.c+n.b.b)),k.Math.abs(e.b.c+e.b.b-n.b.c)),t=1-r/i),l>e.b.a/2+n.b.a/2&&(f=k.Math.min(k.Math.abs(e.b.d-(n.b.d+n.b.a)),k.Math.abs(e.b.d+e.b.a-n.b.d)),o=1-f/l),c=k.Math.min(t,o),(1-c)*k.Math.sqrt(i*i+l*l)}function __n(e){var n,t,i,r;for(uZ(e,e.e,e.f,(Iw(),hb),!0,e.c,e.i),uZ(e,e.e,e.f,hb,!1,e.c,e.i),uZ(e,e.e,e.f,X3,!0,e.c,e.i),uZ(e,e.e,e.f,X3,!1,e.c,e.i),N_n(e,e.c,e.e,e.f,e.i),i=new qr(e.i,0);i.b=65;t--)ch[t]=t-65<<24>>24;for(i=122;i>=97;i--)ch[i]=i-97+26<<24>>24;for(r=57;r>=48;r--)ch[r]=r-48+52<<24>>24;for(ch[43]=62,ch[47]=63,c=0;c<=25;c++)r0[c]=65+c&yr;for(o=26,f=0;o<=51;++o,f++)r0[o]=97+f&yr;for(e=52,l=0;e<=61;++e,l++)r0[e]=48+l&yr;r0[62]=43,r0[63]=47}function yKe(e,n){var t,i,r,c,o,l;return r=Whe(e),l=Whe(n),r==l?e.e==n.e&&e.a<54&&n.a<54?e.fn.f?1:0:(i=e.e-n.e,t=(e.d>0?e.d:k.Math.floor((e.a-1)*AYe)+1)-(n.d>0?n.d:k.Math.floor((n.a-1)*AYe)+1),t>i+1?r:t0&&(o=Kv(o,IKe(i))),kJe(c,o))):rh&&(y=0,S+=f+n,f=0),T8(o,y,S),t=k.Math.max(t,y+b.a),f=k.Math.max(f,b.b),y+=b.a+n;return new Se(t+n,S+f+n)}function uge(e,n){var t,i,r,c,o,l,f;if(!_a(e))throw R(new Uc(zWe));if(i=_a(e),c=i.g,r=i.f,c<=0&&r<=0)return De(),ju;switch(l=e.i,f=e.j,n.g){case 2:case 1:if(l<0)return De(),Vn;if(l+e.g>c)return De(),et;break;case 4:case 3:if(f<0)return De(),Kn;if(f+e.f>r)return De(),bt}return o=(l+e.g/2)/c,t=(f+e.f/2)/r,o+t<=1&&o-t<=0?(De(),Vn):o+t>=1&&o-t>=0?(De(),et):t<.5?(De(),Kn):(De(),bt)}function $_n(e,n,t,i,r){var c,o;if(c=mc(Rr(n[0],Dc),Rr(i[0],Dc)),e[0]=Rt(c),c=Sw(c,32),t>=r){for(o=1;o0&&(r.b[o++]=0,r.b[o++]=c.b[0]-1),n=1;n0&&(Db(f,f.d-r.d),r.c==(da(),ab)&&iX(f,f.a-r.d),f.d<=0&&f.i>0&&Ki(n,f,n.c.b,n.c)));for(c=new P(e.f);c.a0&&(m0(l,l.i-r.d),r.c==(da(),ab)&&CP(l,l.b-r.d),l.i<=0&&l.d>0&&Ki(t,l,t.c.b,t.c)))}function z_n(e,n,t,i,r){var c,o,l,f,h,b,p,y,S;for(En(),Tr(e,new VM),o=_T(e),S=new Oe,y=new Oe,l=null,f=0;o.b!=0;)c=u(o.b==0?null:(at(o.b!=0),$l(o,o.a.a)),167),!l||us(l)*Gs(l)/21&&(f>us(l)*Gs(l)/2||o.b==0)&&(p=new gB(y),b=us(l)/Gs(l),h=oZ(p,n,new o4,t,i,r,b),pi(fa(p.e),h),l=p,Gn(S.c,p),f=0,y.c.length=0));return Sr(S,y),S}function Wu(e,n,t,i,r){jd();var c,o,l,f,h,b,p;if(Rfe(e,"src"),Rfe(t,"dest"),p=Us(e),f=Us(t),ffe((p.i&4)!=0,"srcType is not an array"),ffe((f.i&4)!=0,"destType is not an array"),b=p.c,o=f.c,ffe((b.i&1)!=0?b==o:(o.i&1)==0,"Array types don't match"),akn(e,n,t,i,r),(b.i&1)==0&&p!=f)if(h=G4(e),c=G4(t),ue(e)===ue(t)&&ni;)ir(c,l,h[--n]);else for(l=i+r;i0),i.a.Xb(i.c=--i.b),p>y+f&&As(i);for(o=new P(S);o.a0),i.a.Xb(i.c=--i.b)}}function J_n(){ai();var e,n,t,i,r,c;if(Kce)return Kce;for(e=new cl(4),tm(e,K0(Une,!0)),bS(e,K0("M",!0)),bS(e,K0("C",!0)),c=new cl(4),i=0;i<11;i++)ho(c,i,i);return n=new cl(4),tm(n,K0("M",!0)),ho(n,4448,4607),ho(n,65438,65439),r=new Vj(2),fg(r,e),fg(r,gA),t=new Vj(2),t.Hm(dR(c,K0("L",!0))),t.Hm(n),t=new D2(3,t),t=new zfe(r,t),Kce=t,Kce}function nm(e,n){var t,i,r,c,o,l,f,h;for(t=new RegExp(n,"g"),f=se(He,Me,2,0,6,1),i=0,h=e,c=null;;)if(l=t.exec(h),l==null||h==""){f[i]=h;break}else o=l.index,f[i]=(Qr(0,o,h.length),h.substr(0,o)),h=of(h,o+l[0].length,h.length),t.lastIndex=0,c==h&&(f[i]=(Qr(0,1,h.length),h.substr(0,1)),h=(Qn(1,h.length+1),h.substr(1))),c=h,++i;if(e.length>0){for(r=f.length;r>0&&f[r-1]=="";)--r;rb&&(b=f);for(h=k.Math.pow(4,n),b>h&&(h=b),y=(k.Math.log(h)-k.Math.log(1))/n,c=k.Math.exp(y),r=c,o=0;o0&&(p-=i[0]+e.c,i[0]+=e.c),i[2]>0&&(p-=i[2]+e.c),i[1]=k.Math.max(i[1],p),gR(e.a[1],t.c+n.b+i[0]-(i[1]-p)/2,i[1]);for(c=e.a,l=0,h=c.length;l0?(e.n.c.length-1)*e.i:0,i=new P(e.n);i.a1)for(i=St(r,0);i.b!=i.d.c;)for(t=u(jt(i),235),c=0,f=new P(t.e);f.a0&&(n[0]+=e.c,p-=n[0]),n[2]>0&&(p-=n[2]+e.c),n[1]=k.Math.max(n[1],p),wR(e.a[1],i.d+t.d+n[0]-(n[1]-p)/2,n[1]);else for(A=i.d+t.d,S=i.a-t.d-t.a,o=e.a,f=0,b=o.length;f=n.o&&t.f<=n.f||n.a*.5<=t.f&&n.a*1.5>=t.f){if(o=u(Pe(n.n,n.n.c.length-1),208),o.e+o.d+t.g+r<=i&&(c=u(Pe(n.n,n.n.c.length-1),208),c.f-e.f+t.f<=e.b||e.a.c.length==1))return ede(n,t),!0;if(n.s+t.g<=i&&n.t+n.d+t.f+r<=e.f+e.b)return Te(n.b,t),l=u(Pe(n.n,n.n.c.length-1),208),Te(n.n,new RR(n.s,l.f+l.a+n.i,n.i)),Dde(u(Pe(n.n,n.n.c.length-1),208),t),EKe(n,t),!0}return!1}function qz(e,n,t,i){var r,c,o,l,f;if(f=Po(e.e.Ah(),n),r=u(e.g,122),Tc(),u(n,69).vk()){for(o=0;o0||zw(r.b.d,e.b.d+e.b.a)==0&&i.b<0||zw(r.b.d+r.b.a,e.b.d)==0&&i.b>0){l=0;break}}else l=k.Math.min(l,dqe(e,r,i));l=k.Math.min(l,xKe(e,c,l,i))}return l}function sge(e,n){var t,i,r,c,o,l,f;if(e.b<2)throw R(new qn("The vector chain must contain at least a source and a target point."));for(r=(at(e.b!=0),u(e.a.a.c,8)),kT(n,r.a,r.b),f=new j4((!n.a&&(n.a=new mr(yl,n,5)),n.a)),o=St(e,1);o.a=0&&c!=t))throw R(new qn(BN));for(r=0,f=0;fne(Ia(o.g,o.d[0]).a)?(at(f.b>0),f.a.Xb(f.c=--f.b),y2(f,o),r=!0):l.e&&l.e.gc()>0&&(c=(!l.e&&(l.e=new Oe),l.e).Kc(n),h=(!l.e&&(l.e=new Oe),l.e).Kc(t),(c||h)&&((!l.e&&(l.e=new Oe),l.e).Ec(o),++o.c));r||Gn(i.c,o)}function Q_n(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B;return p=e.a.i+e.a.g/2,y=e.a.i+e.a.g/2,A=n.i+n.g/2,D=n.j+n.f/2,l=new Se(A,D),h=u(je(n,(Xt(),Uy)),8),h.a=h.a+p,h.b=h.b+y,c=(l.b-h.b)/(l.a-h.a),i=l.b-c*l.a,O=t.i+t.g/2,B=t.j+t.f/2,f=new Se(O,B),b=u(je(t,Uy),8),b.a=b.a+p,b.b=b.b+y,o=(f.b-b.b)/(f.a-b.a),r=f.b-o*f.a,S=(i-r)/(o-c),h.a>>0,"0"+n.toString(16)),i="\\x"+of(t,t.length-2,t.length)):e>=Ec?(t=(n=e>>>0,"0"+n.toString(16)),i="\\v"+of(t,t.length-6,t.length)):i=""+String.fromCharCode(e&yr)}return i}function OKe(e,n){var t,i,r,c,o,l,f,h,b;for(c=new P(e.b);c.at){n.Ug();return}switch(u(C(e,(Ie(),Gie)),350).g){case 2:c=new x6;break;case 0:c=new Jp;break;default:c=new lM}if(i=c.mg(e,r),!c.ng())switch(u(C(e,EH),351).g){case 2:i=bqe(r,i);break;case 1:i=rGe(r,i)}WLn(e,r,i),n.Ug()}function sS(e,n){var t,i,r,c,o,l,f,h;n%=24,e.q.getHours()!=n&&(i=new k.Date(e.q.getTime()),i.setDate(i.getDate()+1),l=e.q.getTimezoneOffset()-i.getTimezoneOffset(),l>0&&(f=l/60|0,h=l%60,r=e.q.getDate(),t=e.q.getHours(),t+f>=24&&++r,c=new k.Date(e.q.getFullYear(),e.q.getMonth(),r,n+f,e.q.getMinutes()+h,e.q.getSeconds(),e.q.getMilliseconds()),e.q.setTime(c.getTime()))),o=e.q.getTime(),e.q.setTime(o+36e5),e.q.getHours()!=n&&e.q.setTime(o)}function rLn(e,n){var t,i,r,c;if(R4n(e.d,e.e),e.c.a.$b(),ne(re(C(n.j,(Ie(),aI))))!=0||ne(re(C(n.j,aI)))!=0)for(t=E3,ue(C(n.j,o1))!==ue((F1(),fb))&&he(n.j,(me(),ob),($n(),!0)),c=u(C(n.j,jx),15).a,r=0;rr&&++h,Te(o,(kn(l+h,n.c.length),u(n.c[l+h],15))),f+=(kn(l+h,n.c.length),u(n.c[l+h],15)).a-i,++t;t=D&&e.e[f.p]>A*e.b||V>=t*D)&&(Gn(y.c,l),l=new Oe,ac(o,c),c.a.$b(),h-=b,S=k.Math.max(S,h*e.b+O),h+=V,q=V,V=0,b=0,O=0);return new jc(S,y)}function UW(e){var n,t,i,r,c,o,l;if(!e.d){if(l=new dU,n=lA,c=n.a.yc(e,n),c==null){for(i=new st(tu(e));i.e!=i.i.gc();)t=u(ft(i),29),nr(l,UW(t));n.a.Ac(e)!=null,n.a.gc()==0}for(o=l.i,r=(!e.q&&(e.q=new we(yf,e,11,10)),new st(e.q));r.e!=r.i.gc();++o)u(ft(r),403);nr(l,(!e.q&&(e.q=new we(yf,e,11,10)),e.q)),F2(l),e.d=new Pv((u(K(ge((C0(),Bn).o),9),19),l.i),l.g),e.e=u(l.g,678),e.e==null&&(e.e=Wan),Ms(e).b&=-17}return e.d}function N8(e,n,t,i){var r,c,o,l,f,h;if(h=Po(e.e.Ah(),n),f=0,r=u(e.g,122),Tc(),u(n,69).vk()){for(o=0;o1||A==-1)if(p=u(O,72),y=u(b,72),p.dc())y.$b();else for(o=!!Oc(n),c=0,l=e.a?p.Jc():p.Gi();l.Ob();)h=u(l.Pb(),57),r=u($a(e,h),57),r?(o?(f=y.bd(r),f==-1?y.Ei(c,r):c!=f&&y.Si(c,r)):y.Ei(c,r),++c):e.b&&!o&&(y.Ei(c,h),++c);else O==null?b.Wb(null):(r=$a(e,O),r==null?e.b&&!Oc(n)&&b.Wb(O):b.Wb(r))}function lLn(e,n){var t,i,r,c,o,l,f,h;for(t=new w6,r=new Un(Yn(cr(n).a.Jc(),new ee));ht(r);)if(i=u(rt(r),17),!uc(i)&&(l=i.c.i,b0e(l,xJ))){if(h=Pbe(e,l,xJ,SJ),h==-1)continue;t.b=k.Math.max(t.b,h),!t.a&&(t.a=new Oe),Te(t.a,l)}for(o=new Un(Yn(Ii(n).a.Jc(),new ee));ht(o);)if(c=u(rt(o),17),!uc(c)&&(f=c.d.i,b0e(f,SJ))){if(h=Pbe(e,f,SJ,xJ),h==-1)continue;t.d=k.Math.max(t.d,h),!t.c&&(t.c=new Oe),Te(t.c,f)}return t}function fLn(e,n,t,i){var r,c,o,l,f,h,b;if(t.d.i!=n.i){for(r=new za(e),Mf(r,(Fn(),dr)),he(r,(me(),mi),t),he(r,(Ie(),Zi),(Br(),to)),Gn(i.c,r),o=new Qu,wu(o,r),Ar(o,(De(),Vn)),l=new Qu,wu(l,r),Ar(l,et),b=t.d,Gr(t,o),c=new Ow,Pu(c,t),he(c,Wc,null),fc(c,l),Gr(c,b),h=new qr(t.b,0);h.b1e6)throw R(new HP("power of ten too big"));if(e<=oi)return B4(VO(Ey[1],n),n);for(i=VO(Ey[1],oi),r=i,t=Lu(e-oi),n=lc(e%oi);ao(t,oi)>0;)r=Kv(r,i),t=lf(t,oi);for(r=Kv(r,VO(Ey[1],n)),r=B4(r,oi),t=Lu(e-oi);ao(t,oi)>0;)r=B4(r,oi),t=lf(t,oi);return r=B4(r,n),r}function DKe(e){var n,t,i,r,c,o,l,f,h,b;for(f=new P(e.a);f.ah&&i>h)b=l,h=ne(n.p[l.p])+ne(n.d[l.p])+l.o.b+l.d.a;else{r=!1,t.$g()&&t.ah("bk node placement breaks on "+l+" which should have been after "+b);break}if(!r)break}return t.$g()&&t.ah(n+" is feasible: "+r),r}function age(e,n,t,i){var r,c,o,l,f,h,b,p,y;if(c=new za(e),Mf(c,(Fn(),wo)),he(c,(Ie(),Zi),(Br(),to)),r=0,n){for(o=new Qu,he(o,(me(),mi),n),he(c,mi,n.i),Ar(o,(De(),Vn)),wu(o,c),y=gh(n.e),h=y,b=0,p=h.length;b0){if(r<0&&b.a&&(r=f,c=h[0],i=0),r>=0){if(l=b.b,f==r&&(l-=i++,l==0))return 0;if(!LVe(n,h,b,l,o)){f=r-1,h[0]=c;continue}}else if(r=-1,!LVe(n,h,b,0,o))return 0}else{if(r=-1,rc(b.c,0)==32){if(p=h[0],MRe(n,h),h[0]>p)continue}else if(V5n(n,b.c,h[0])){h[0]+=b.c.length;continue}return 0}return iRn(o,t)?h[0]:0}function gLn(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(b=new mR(new nje(t)),l=se(ts,ma,30,e.f.e.c.length,16,1),$fe(l,l.length),t[n.a]=0,h=new P(e.f.e);h.a=l.a?c.b>=l.b?(i.a=l.a+(c.a-l.a)/2+r,i.b=l.b+(c.b-l.b)/2-r-e.e.b):(i.a=l.a+(c.a-l.a)/2+r,i.b=c.b+(l.b-c.b)/2+r):c.b>=l.b?(i.a=c.a+(l.a-c.a)/2+r,i.b=l.b+(c.b-l.b)/2+r):(i.a=c.a+(l.a-c.a)/2+r,i.b=c.b+(l.b-c.b)/2-r-e.e.b))}function fS(e){var n,t,i,r,c,o,l,f;if(!e.f){if(f=new iC,l=new iC,n=lA,o=n.a.yc(e,n),o==null){for(c=new st(tu(e));c.e!=c.i.gc();)r=u(ft(c),29),nr(f,fS(r));n.a.Ac(e)!=null,n.a.gc()==0}for(i=(!e.s&&(e.s=new we(ns,e,21,17)),new st(e.s));i.e!=i.i.gc();)t=u(ft(i),179),X(t,103)&&Et(l,u(t,19));F2(l),e.r=new oIe(e,(u(K(ge((C0(),Bn).o),6),19),l.i),l.g),nr(f,e.r),F2(f),e.f=new Pv((u(K(ge(Bn.o),5),19),f.i),f.g),Ms(e).b&=-3}return e.f}function Uz(){Uz=Y,R8e=F(z(Wl,1),Eh,30,15,[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70]),Can=new RegExp(`[ +\r\f]+`);try{uA=F(z(ezn,1),On,2076,0,[new KC(($se(),ZB("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ",TT((zP(),zP(),XS))))),new KC(ZB("yyyy-MM-dd'T'HH:mm:ss'.'SSS",TT(XS))),new KC(ZB("yyyy-MM-dd'T'HH:mm:ss",TT(XS))),new KC(ZB("yyyy-MM-dd'T'HH:mm",TT(XS))),new KC(ZB("yyyy-MM-dd",TT(XS)))])}catch(e){if(e=sr(e),!X(e,80))throw R(e)}}function wLn(e){var n,t,i,r,c,o,l;for(t=null,l=null,i=u(C(e.b,(Ie(),Die)),348),i==(DE(),vI)&&(t=new Oe,l=new Oe),o=new P(e.d);o.at);return c}function LKe(e,n){var t,i,r,c;if(r=Ds(e.d,1)!=0,i=Mz(e,n),i==0&&Fe(ze(C(n.j,(me(),ob)))))return 0;!Fe(ze(C(n.j,(me(),ob))))&&!Fe(ze(C(n.j,B3)))||ue(C(n.j,(Ie(),o1)))===ue((F1(),fb))?n.c.kg(n.e,r):r=Fe(ze(C(n.j,ob))),eN(e,n,r,!0),Fe(ze(C(n.j,B3)))&&he(n.j,B3,($n(),!1)),Fe(ze(C(n.j,ob)))&&(he(n.j,ob,($n(),!1)),he(n.j,B3,!0)),t=Mz(e,n);do{if(Qhe(e),t==0)return 0;r=!r,c=t,eN(e,n,r,!1),t=Mz(e,n)}while(c>t);return c}function mLn(e,n,t){var i,r,c,o,l;if(i=u(C(e,(Ie(),Oie)),22),t.a>n.a&&(i.Gc((sg(),qx))?e.c.a+=(t.a-n.a)/2:i.Gc(Ux)&&(e.c.a+=t.a-n.a)),t.b>n.b&&(i.Gc((sg(),Kx))?e.c.b+=(t.b-n.b)/2:i.Gc(Xx)&&(e.c.b+=t.b-n.b)),u(C(e,(me(),po)),22).Gc((Ic(),Kl))&&(t.a>n.a||t.b>n.b))for(l=new P(e.a);l.an.a&&(i.Gc((sg(),qx))?e.c.a+=(t.a-n.a)/2:i.Gc(Ux)&&(e.c.a+=t.a-n.a)),t.b>n.b&&(i.Gc((sg(),Kx))?e.c.b+=(t.b-n.b)/2:i.Gc(Xx)&&(e.c.b+=t.b-n.b)),u(C(e,(me(),po)),22).Gc((Ic(),Kl))&&(t.a>n.a||t.b>n.b))for(o=new P(e.a);o.a=0&&p<=1&&y>=0&&y<=1?pi(new Se(e.a,e.b),A1(new Se(n.a,n.b),p)):null}function aS(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(c=0,o=e.t,r=0,i=0,f=0,y=0,p=0,t&&(e.n.c.length=0,Te(e.n,new RR(e.s,e.t,e.i))),l=0,b=new P(e.b);b.a0?e.i:0)>n&&f>0&&(c=0,o+=f+e.i,r=k.Math.max(r,y),i+=f+e.i,f=0,y=0,t&&(++p,Te(e.n,new RR(e.s,o,e.i))),l=0),y+=h.g+(l>0?e.i:0),f=k.Math.max(f,h.f),t&&Dde(u(Pe(e.n,p),208),h),c+=h.g+(l>0?e.i:0),++l;return r=k.Math.max(r,y),i+=f,t&&(e.r=r,e.d=i,Pde(e.j)),new _f(e.s,e.t,r,i)}function Xz(e){var n,t,i;return t=ue(je(e,(Ie(),By)))===ue((YO(),nie))||ue(je(e,By))===ue(Yte)||ue(je(e,By))===ue(Qte)||ue(je(e,By))===ue(Zte)||ue(je(e,By))===ue(tie)||ue(je(e,By))===ue(iI),i=ue(je(e,wH))===ue((WO(),Uie))||ue(je(e,wH))===ue(Kie)||ue(je(e,dI))===ue((X0(),_7))||ue(je(e,dI))===ue((X0(),xx)),n=ue(je(e,o1))!==ue((F1(),fb))||Fe(ze(je(e,C7)))||ue(je(e,bx))!==ue((W4(),ex))||ne(re(je(e,aI)))!=0||ne(re(je(e,Mie)))!=0,t||i||n}function g3(e){var n,t,i,r,c,o,l,f;if(!e.a){if(e.o=null,f=new BSe(e),n=new Af,t=lA,l=t.a.yc(e,t),l==null){for(o=new st(tu(e));o.e!=o.i.gc();)c=u(ft(o),29),nr(f,g3(c));t.a.Ac(e)!=null,t.a.gc()==0}for(r=(!e.s&&(e.s=new we(ns,e,21,17)),new st(e.s));r.e!=r.i.gc();)i=u(ft(r),179),X(i,335)&&Et(n,u(i,38));F2(n),e.k=new uIe(e,(u(K(ge((C0(),Bn).o),7),19),n.i),n.g),nr(f,e.k),F2(f),e.a=new Pv((u(K(ge(Bn.o),4),19),f.i),f.g),Ms(e).b&=-2}return e.a}function kLn(e){var n,t,i,r,c,o,l,f,h,b,p,y;if(l=e.d,p=u(C(e,(me(),$y)),16),n=u(C(e,Oy),16),!(!p&&!n)){if(c=ne(re(G2(e,(Ie(),zie)))),o=ne(re(G2(e,w4e))),y=0,p){for(h=0,r=p.Jc();r.Ob();)i=u(r.Pb(),9),h=k.Math.max(h,i.o.b),y+=i.o.a;y+=c*(p.gc()-1),l.d+=h+o}if(t=0,n){for(h=0,r=n.Jc();r.Ob();)i=u(r.Pb(),9),h=k.Math.max(h,i.o.b),t+=i.o.a;t+=c*(n.gc()-1),l.a+=h+o}f=k.Math.max(y,t),f>e.o.a&&(b=(f-e.o.a)/2,l.b=k.Math.max(l.b,b),l.c=k.Math.max(l.c,b))}}function bge(e,n,t,i){var r,c,o,l,f,h,b;if(b=Po(e.e.Ah(),n),r=0,c=u(e.g,122),f=null,Tc(),u(n,69).vk()){for(l=0;ll?1:-1:M1e(e.a,n.a,c),r==-1)p=-f,b=o==f?hY(n.a,l,e.a,c):bY(n.a,l,e.a,c);else if(p=o,o==f){if(r==0)return yh(),VS;b=hY(e.a,c,n.a,l)}else b=bY(e.a,c,n.a,l);return h=new Gb(p,b.length,b),gE(h),h}function SLn(e,n){var t,i,r,c;if(c=kKe(n),!n.c&&(n.c=new we($s,n,9,9)),er(new mn(null,(!n.c&&(n.c=new we($s,n,9,9)),new vn(n.c,16))),new cje(c)),r=u(C(c,(me(),po)),22),y$n(n,r),r.Gc((Ic(),Kl)))for(i=new st((!n.c&&(n.c=new we($s,n,9,9)),n.c));i.e!=i.i.gc();)t=u(ft(i),125),q$n(e,n,c,t);return u(je(n,(Ie(),Ag)),182).gc()!=0&&sXe(n,c),Fe(ze(C(c,a4e)))&&r.Ec(nH),wi(c,bI)&&Wxe(new tde(ne(re(C(c,bI)))),c),ue(je(n,Em))===ue((B1(),Wd))?dBn(e,n,c):Q$n(e,n,c),c}function bo(e,n){var t,i,r,c,o,l,f;if(e==null)return null;if(c=e.length,c==0)return"";for(f=se(Wl,Eh,30,c,15,1),Qr(0,c,e.length),Qr(0,c,f.length),cDe(e,0,c,f,0),t=null,l=n,r=0,o=0;r0?of(t.a,0,c-1):""):(Qr(0,c-1,e.length),e.substr(0,c-1)):t?t.a:e}function xLn(e,n,t){var i,r,c;if(wi(n,(Ie(),ku))&&(ue(C(n,ku))===ue((Xs(),V1))||ue(C(n,ku))===ue(Sg))||wi(t,ku)&&(ue(C(t,ku))===ue((Xs(),V1))||ue(C(t,ku))===ue(Sg)))return 0;if(i=_r(n),r=dDn(e,n,t),r!=0)return r;if(wi(n,(me(),Oi))&&wi(t,Oi)){if(c=oo(Kw(n,t,i,u(C(i,sb),15).a),Kw(t,n,i,u(C(i,sb),15).a)),ue(C(i,gx))===ue(($0(),cI))&&ue(C(n,wx))!==ue(C(t,wx))&&(c=0),c<0)return nN(e,n,t),c;if(c>0)return nN(e,t,n),c}return zTn(e,n,t)}function PKe(e,n){var t,i,r,c,o,l,f,h,b,p,y;for(i=new Un(Yn(U0(n).a.Jc(),new ee));ht(i);)t=u(rt(i),85),X(K((!t.b&&(t.b=new Nn(mt,t,4,7)),t.b),0),193)||(f=iu(u(K((!t.c&&(t.c=new Nn(mt,t,5,8)),t.c),0),84)),eS(t)||(o=n.i+n.g/2,l=n.j+n.f/2,b=f.i+f.g/2,p=f.j+f.f/2,y=new Vr,y.a=b-o,y.b=p-l,c=new Se(y.a,y.b),v8(c,n.g,n.f),y.a-=c.a,y.b-=c.b,o=b-y.a,l=p-y.b,h=new Se(y.a,y.b),v8(h,f.g,f.f),y.a-=h.a,y.b-=h.b,b=o+y.a,p=l+y.b,r=Rz(t),e3(r,o),n3(r,l),Wv(r,b),Zv(r,p),PKe(e,f)))}function tm(e,n){var t,i,r,c,o;if(o=u(n,137),h3(e),h3(o),o.b!=null){if(e.c=!0,e.b==null){e.b=se($t,ni,30,o.b.length,15,1),Wu(o.b,0,e.b,0,o.b.length);return}for(c=se($t,ni,30,e.b.length+o.b.length,15,1),t=0,i=0,r=0;t=e.b.length?(c[r++]=o.b[i++],c[r++]=o.b[i++]):i>=o.b.length?(c[r++]=e.b[t++],c[r++]=e.b[t++]):o.b[i]0?e.i:0)),++n;for(K1e(e.n,f),e.d=t,e.r=i,e.g=0,e.f=0,e.e=0,e.o=Vi,e.p=Vi,c=new P(e.b);c.a0&&(r=(!e.n&&(e.n=new we(Eu,e,1,7)),u(K(e.n,0),157)).a,!r||Kt(Kt((n.a+=' "',n),r),'"'))),t=(!e.b&&(e.b=new Nn(mt,e,4,7)),!(e.b.i<=1&&(!e.c&&(e.c=new Nn(mt,e,5,8)),e.c.i<=1))),t?n.a+=" [":n.a+=" ",Kt(n,nle(new IX,new st(e.b))),t&&(n.a+="]"),n.a+=nee,t&&(n.a+="["),Kt(n,nle(new IX,new st(e.c))),t&&(n.a+="]"),n.a)}function MLn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn;for(be=e.c,fe=n.c,t=pu(be.a,e,0),i=pu(fe.a,n,0),V=u(Fw(e,(Nc(),ys)).Jc().Pb(),12),cn=u(Fw(e,Io).Jc().Pb(),12),te=u(Fw(n,ys).Jc().Pb(),12),Tn=u(Fw(n,Io).Jc().Pb(),12),B=gh(V.e),_e=gh(cn.g),q=gh(te.e),on=gh(Tn.g),H0(e,i,fe),o=q,b=0,A=o.length;b0&&f[i]&&(A=zv(e.b,f[i],r)),O=k.Math.max(O,r.c.c.b+A);for(c=new P(b.e);c.ab?new Kb((da(),Dm),t,n,h-b):h>0&&b>0&&(new Kb((da(),Dm),n,t,0),new Kb(Dm,t,n,0))),o)}function NLn(e,n,t){var i,r,c;for(e.a=new Oe,c=St(n.b,0);c.b!=c.d.c;){for(r=u(jt(c),40);u(C(r,(Mu(),Dh)),15).a>e.a.c.length-1;)Te(e.a,new jc(E3,Fpe));i=u(C(r,Dh),15).a,t==(vr(),Zc)||t==ru?(r.e.ane(re(u(Pe(e.a,i),49).b))&&HC(u(Pe(e.a,i),49),r.e.a+r.f.a)):(r.e.bne(re(u(Pe(e.a,i),49).b))&&HC(u(Pe(e.a,i),49),r.e.b+r.f.b))}}function BKe(e,n,t,i){var r,c,o,l,f,h,b;if(c=UB(i),l=Fe(ze(C(i,(Ie(),c4e)))),(l||Fe(ze(C(e,gH))))&&!$v(u(C(e,Zi),102)))r=Y4(c),f=ege(e,t,t==(Nc(),Io)?r:NO(r));else switch(f=new Qu,wu(f,e),n?(b=f.n,b.a=n.a-e.n.a,b.b=n.b-e.n.b,zGe(b,0,0,e.o.a,e.o.b),Ar(f,uKe(f,c))):(r=Y4(c),Ar(f,t==(Nc(),Io)?r:NO(r))),o=u(C(i,(me(),po)),22),h=f.j,c.g){case 2:case 1:(h==(De(),Kn)||h==bt)&&o.Ec((Ic(),P3));break;case 4:case 3:(h==(De(),et)||h==Vn)&&o.Ec((Ic(),P3))}return f}function zKe(e,n){var t,i,r,c,o,l;for(o=new B2(new sn(e.f.b).a);o.b;){if(c=t3(o),r=u(c.jd(),591),n==1){if(r.yf()!=(vr(),Vl)&&r.yf()!=eh)continue}else if(r.yf()!=(vr(),Zc)&&r.yf()!=ru)continue;switch(i=u(u(c.kd(),49).b,82),l=u(u(c.kd(),49).a,194),t=l.c,r.yf().g){case 2:i.g.c=e.e.a,i.g.b=k.Math.max(1,i.g.b+t);break;case 1:i.g.c=i.g.c+t,i.g.b=k.Math.max(1,i.g.b-t);break;case 4:i.g.d=e.e.b,i.g.a=k.Math.max(1,i.g.a+t);break;case 3:i.g.d=i.g.d+t,i.g.a=k.Math.max(1,i.g.a-t)}}}function ILn(e,n){var t,i,r,c,o,l,f,h,b,p;for(n.Tg("Simple node placement",1),p=u(C(e,(me(),z3)),316),l=0,c=new P(e.b);c.a1)throw R(new qn(GN));f||(c=Kh(n,i.Jc().Pb()),o.Ec(c))}return h1e(e,D0e(e,n,t),o)}function Vz(e,n,t){var i,r,c,o,l,f,h,b;if(J1(e.e,n))f=(Tc(),u(n,69).vk()?new uR(n,e):new vT(n,e)),Tz(f.c,f.b),Yj(f,u(t,18));else{for(b=Po(e.e.Ah(),n),i=u(e.g,122),o=0;o"}f!=null&&(n.a+=""+f)}else e.e?(l=e.e.zb,l!=null&&(n.a+=""+l)):(n.a+="?",e.b?(n.a+=" super ",QW(e.b,n)):e.f&&(n.a+=" extends ",QW(e.f,n)))}function BLn(e){e.b=null,e.a=null,e.o=null,e.q=null,e.v=null,e.w=null,e.B=null,e.p=null,e.Q=null,e.R=null,e.S=null,e.T=null,e.U=null,e.V=null,e.W=null,e.bb=null,e.eb=null,e.ab=null,e.H=null,e.db=null,e.c=null,e.d=null,e.f=null,e.n=null,e.r=null,e.s=null,e.u=null,e.G=null,e.J=null,e.e=null,e.j=null,e.i=null,e.g=null,e.k=null,e.t=null,e.F=null,e.I=null,e.L=null,e.M=null,e.O=null,e.P=null,e.$=null,e.N=null,e.Z=null,e.cb=null,e.K=null,e.D=null,e.A=null,e.C=null,e._=null,e.fb=null,e.X=null,e.Y=null,e.gb=!1,e.hb=!1}function zLn(e){var n,t,i,r;if(i=fZ((!e.c&&(e.c=XT(Lu(e.f))),e.c),0),e.e==0||e.a==0&&e.f!=-1&&e.e<0)return i;if(n=Whe(e)<0?1:0,t=e.e,r=(i.length+1+k.Math.abs(lc(e.e)),new h4),n==1&&(r.a+="-"),e.e>0)if(t-=i.length-n,t>=0){for(r.a+="0.";t>kg.length;t-=kg.length)MIe(r,kg);ZOe(r,kg,lc(t)),Kt(r,(Qn(n,i.length+1),i.substr(n)))}else t=n-t,Kt(r,of(i,n,lc(t))),r.a+=".",Kt(r,qfe(i,lc(t)));else{for(Kt(r,(Qn(n,i.length+1),i.substr(n)));t<-kg.length;t+=kg.length)MIe(r,kg);ZOe(r,kg,lc(-t))}return r.a}function WW(e){var n,t,i,r,c,o,l,f,h;return!(e.k!=(Fn(),Wi)||e.j.c.length<=1||(c=u(C(e,(Ie(),Zi)),102),c==(Br(),to))||(r=(U2(),(e.q?e.q:(En(),En(),r1))._b(mp)?i=u(C(e,mp),203):i=u(C(_r(e),yx),203),i),r==MH)||!(r==U3||r==q3)&&(o=ne(re(G2(e,kx))),n=u(C(e,wI),140),!n&&(n=new $le(o,o,o,o)),h=vu(e,(De(),Vn)),f=n.d+n.a+(h.gc()-1)*o,f>e.o.b||(t=vu(e,et),l=n.d+n.a+(t.gc()-1)*o,l>e.o.b)))}function FLn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D;n.Tg("Orthogonal edge routing",1),h=ne(re(C(e,(Ie(),Nm)))),t=ne(re(C(e,Tm))),i=ne(re(C(e,lb))),y=new EV(0,t),D=0,o=new qr(e.b,0),l=null,b=null,f=null,p=null;do b=o.b0?(S=(A-1)*t,l&&(S+=i),b&&(S+=i),S0;for(l=u(C(e.c.i,xm),15).a,c=u(gs(li(n.Mc(),new Aje(l)),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),16),o=new xi,b=new ar,Vt(o,e.c.i),hr(b,e.c.i);o.b!=0;){if(t=u(o.b==0?null:(at(o.b!=0),$l(o,o.a.a)),9),c.Gc(t))return!0;for(r=new Un(Yn(Ii(t).a.Jc(),new ee));ht(r);)i=u(rt(r),17),f=i.d.i,b.a._b(f)||(b.a.yc(f,b),Ki(o,f,o.c.b,o.c))}return!1}function qKe(e,n,t){var i,r,c,o,l,f,h,b,p;for(p=new Oe,b=new Cae(0,t),c=0,kB(b,new iQ(0,0,b,t)),r=0,h=new st(e);h.e!=h.i.gc();)f=u(ft(h),26),i=u(Pe(b.a,b.a.c.length-1),173),l=r+f.g+(u(Pe(b.a,0),173).b.c.length==0?0:t),(l>n||Fe(ze(je(f,(Ha(),CI)))))&&(r=0,c+=b.b+t,Gn(p.c,b),b=new Cae(c,t),i=new iQ(0,b.f,b,t),kB(b,i),r=0),i.b.c.length==0||!Fe(ze(je(Fi(f),(Ha(),Xre))))&&(f.f>=i.o&&f.f<=i.f||i.a*.5<=f.f&&i.a*1.5>=f.f)?ede(i,f):(o=new iQ(i.s+i.r+t,b.f,b,t),kB(b,o),ede(o,f)),r=f.i+f.g;return Gn(p.c,b),p}function hS(e){var n,t,i,r;if(!(e.b==null||e.b.length<=2)&&!e.a){for(n=0,r=0;r=e.b[r+1])r+=2;else if(t0)for(i=new bs(u(vi(e.a,c),22)),En(),Tr(i,new noe(n)),r=new qr(c.b,0);r.b0&&i>=-6?i>=0?jT(c,t-lc(e.e),"."):(UY(c,n-1,n-1,"0."),jT(c,n+1,ph(kg,0,-lc(i)-1))):(t-n>=1&&(jT(c,n,"."),++t),jT(c,t,"E"),i>0&&jT(c,++t,"+"),jT(c,++t,""+cE(Lu(i)))),e.g=c.a,e.g))}function QLn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e;i=ne(re(C(n,(Ie(),s4e)))),be=u(C(n,jx),15).a,y=4,r=3,fe=20/be,S=!1,f=0,o=oi;do{for(c=f!=1,p=f!=0,_e=0,D=e.a,q=0,te=D.length;qbe)?(f=2,o=oi):f==0?(f=1,o=_e):(f=0,o=_e)):(S=_e>=o||o-_e=Ec?Bc(t,V1e(i)):_9(t,i&yr),o=new JV(10,null,0),I3n(e.a,o,l-1)):(t=(o.Km().length+c,new Ej),Bc(t,o.Km())),n.e==0?(i=n.Im(),i>=Ec?Bc(t,V1e(i)):_9(t,i&yr)):Bc(t,n.Km()),u(o,517).b=t.a}}function WLn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D;if(!t.dc()){for(l=0,y=0,i=t.Jc(),A=u(i.Pb(),15).a;l0?1:Bb(isNaN(i),isNaN(0)))>=0^(Rf(Mh),(k.Math.abs(l)<=Mh||l==0||isNaN(l)&&isNaN(0)?0:l<0?-1:l>0?1:Bb(isNaN(l),isNaN(0)))>=0)?k.Math.max(l,i):(Rf(Mh),(k.Math.abs(i)<=Mh||i==0||isNaN(i)&&isNaN(0)?0:i<0?-1:i>0?1:Bb(isNaN(i),isNaN(0)))>0?k.Math.sqrt(l*l+i*i):-k.Math.sqrt(l*l+i*i))}function tPn(e){var n,t,i,r;r=e.o,v2(),e.A.dc()||gi(e.A,Qme)?n=r.b:(e.D?n=k.Math.max(r.b,QE(e.f)):n=QE(e.f),e.A.Gc((Vs(),UI))&&!e.B.Gc((_s(),rA))&&(n=k.Math.max(n,QE(u(zc(e.p,(De(),et)),253))),n=k.Math.max(n,QE(u(zc(e.p,Vn),253)))),t=tze(e),t&&(n=k.Math.max(n,t.b)),e.A.Gc(XI)&&(e.q==(Br(),a1)||e.q==to)&&(n=k.Math.max(n,rR(u(zc(e.b,(De(),et)),127))),n=k.Math.max(n,rR(u(zc(e.b,Vn),127))))),Fe(ze(e.e.Rf().mf((Xt(),$m))))?r.b=k.Math.max(r.b,n):r.b=n,i=e.f.i,i.d=0,i.a=n,qW(e.f)}function iPn(e,n,t,i,r,c,o,l){var f,h,b,p;switch(f=Pf(F(z(KBn,1),On,238,0,[n,t,i,r])),p=null,e.b.g){case 1:p=Pf(F(z(M6e,1),On,523,0,[new Pk,new LM,new P6]));break;case 0:p=Pf(F(z(M6e,1),On,523,0,[new P6,new LM,new Pk]));break;case 2:p=Pf(F(z(M6e,1),On,523,0,[new LM,new Pk,new P6]))}for(b=new P(p);b.a1&&(f=h.Gg(f,e.a,l));return f.c.length==1?u(Pe(f,f.c.length-1),238):f.c.length==2?HLn((kn(0,f.c.length),u(f.c[0],238)),(kn(1,f.c.length),u(f.c[1],238)),o,c):null}function rPn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A;r=new c9(e),c=new Qqe,i=(QT(c.n),QT(c.p),Hu(c.c),QT(c.f),QT(c.o),Hu(c.q),Hu(c.d),Hu(c.g),Hu(c.k),Hu(c.e),Hu(c.i),Hu(c.j),Hu(c.r),Hu(c.b),y=kqe(c,r,null),jUe(c,r),y),n&&(f=new c9(n),o=jLn(f),M0e(i,F(z(u9e,1),On,524,0,[o]))),p=!1,b=!1,t&&(f=new c9(t),UF in f.a&&(p=O1(f,UF).oe().a),hZe in f.a&&(b=O1(f,hZe).oe().a)),h=pAe(hBe(new s4,p),b),aCn(new zM,i,h),UF in r.a&&$f(r,UF,null),(p||b)&&(l=new l4,gKe(h,l,p,b),$f(r,UF,l)),S=new kSe(c),Fze(new MK(i),S),A=new jSe(c),Fze(new MK(i),A)}function cPn(e,n,t){var i,r,c,o,l,f,h;for(t.Tg("Find roots",1),e.a.c.length=0,r=St(n.b,0);r.b!=r.d.c;)i=u(jt(r),40),i.b.b==0&&(he(i,(Ti(),db),($n(),!0)),Te(e.a,i));switch(e.a.c.length){case 0:c=new tQ(0,n,"DUMMY_ROOT"),he(c,(Ti(),db),($n(),!0)),he(c,gre,!0),Vt(n.b,c);break;case 1:break;default:for(o=new tQ(0,n,_F),f=new P(e.a);f.a=k.Math.abs(i.b)?(i.b=0,c.d+c.a>o.d&&c.do.c&&c.c0){if(n=new Nse(e.i,e.g),t=e.i,c=t<100?null:new k0(t),e.Rj())for(i=0;i0){for(l=e.g,h=e.i,yE(e),c=h<100?null:new k0(h),i=0;i>13|(e.m&15)<<9,r=e.m>>4&8191,c=e.m>>17|(e.h&255)<<5,o=(e.h&1048320)>>8,l=n.l&8191,f=n.l>>13|(n.m&15)<<9,h=n.m>>4&8191,b=n.m>>17|(n.h&255)<<5,p=(n.h&1048320)>>8,on=t*l,cn=i*l,Tn=r*l,In=c*l,lt=o*l,f!=0&&(cn+=t*f,Tn+=i*f,In+=r*f,lt+=c*f),h!=0&&(Tn+=t*h,In+=i*h,lt+=r*h),b!=0&&(In+=t*b,lt+=i*b),p!=0&&(lt+=t*p),S=on&Ls,A=(cn&511)<<13,y=S+A,D=on>>22,B=cn>>9,q=(Tn&262143)<<4,V=(In&31)<<17,O=D+B+q+V,be=Tn>>18,fe=In>>5,_e=(lt&4095)<<8,te=be+fe+_e,O+=y>>22,y&=Ls,te+=O>>22,O&=Ls,te&=G1,_o(y,O,te)}function VKe(e){var n,t,i,r,c,o,l;if(l=u(Pe(e.j,0),12),l.g.c.length!=0&&l.e.c.length!=0)throw R(new Uc("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges."));if(l.g.c.length!=0){for(c=Vi,t=new P(l.g);t.a0&&XGe(e,l,p);for(r=new P(p);r.a4)if(e.dk(n)){if(e.$k()){if(r=u(n,52),i=r.Bh(),f=i==e.e&&(e.kl()?r.vh(r.Ch(),e.gl())==e.hl():-1-r.Ch()==e.Jj()),e.ll()&&!f&&!i&&r.Gh()){for(c=0;ce.d[o.p]&&(t+=Hae(e.b,c)*u(f.b,15).a,I0(e.a,ke(c)));for(;!jj(e.a);)Ehe(e.b,u(N4(e.a),15).a)}return t}function fPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D;for(n.Tg(JQe,1),S=new Oe,b=k.Math.max(e.a.c.length,u(C(e,(me(),sb)),15).a),t=b*u(C(e,oI),15).a,l=ue(C(e,(Ie(),Ry)))===ue(($0(),ym)),O=new P(e.a);O.a0&&(h=e.n.a/c);break;case 2:case 4:r=e.i.o.b,r>0&&(h=e.n.b/r)}he(e,(me(),gp),h)}if(f=e.o,o=e.a,i)o.a=i.a,o.b=i.b,e.d=!0;else if(n!=th&&n!=pb&&l!=ju)switch(l.g){case 1:o.a=f.a/2;break;case 2:o.a=f.a,o.b=f.b/2;break;case 3:o.a=f.a/2,o.b=f.b;break;case 4:o.b=f.b/2}else o.a=f.a/2,o.b=f.b/2}function dS(e){var n,t,i,r,c,o,l,f,h,b;if(e.Nj())if(b=e.Cj(),f=e.Oj(),b>0)if(n=new t1e(e.nj()),t=b,c=t<100?null:new k0(t),MT(e,t,n.g),r=t==1?e.Gj(4,K(n,0),null,0,f):e.Gj(6,n,null,-1,f),e.Kj()){for(i=new st(n);i.e!=i.i.gc();)c=e.Mj(ft(i),c);c?(c.lj(r),c.mj()):e.Hj(r)}else c?(c.lj(r),c.mj()):e.Hj(r);else MT(e,e.Cj(),e.Dj()),e.Hj(e.Gj(6,(En(),Sc),null,-1,f));else if(e.Kj())if(b=e.Cj(),b>0){for(l=e.Dj(),h=b,MT(e,b,l),c=h<100?null:new k0(h),i=0;i1&&us(o)*Gs(o)/2>l[0]){for(c=0;cl[c];)++c;A=new N0(O,0,c+1),p=new gB(A),b=us(o)/Gs(o),f=oZ(p,n,new o4,t,i,r,b),pi(fa(p.e),f),C4(k8(y,p),F8),S=new N0(O,c+1,O.c.length),zde(y,S),O.c.length=0,h=0,NIe(l,l.length,0)}else D=y.b.c.length==0?null:Pe(y.b,0),D!=null&&$Y(y,0),h>0&&(l[h]=l[h-1]),l[h]+=us(o)*Gs(o),++h,Gn(O.c,o);return O}function vPn(e,n){var t,i,r,c;t=n.b,c=new bs(t.j),r=0,i=t.j,i.c.length=0,xw(u(eg(e.b,(De(),Kn),($w(),hp)),16),t),r=PO(c,r,new E6,i),xw(u(eg(e.b,Kn,ub),16),t),r=PO(c,r,new ad,i),xw(u(eg(e.b,Kn,ap),16),t),xw(u(eg(e.b,et,hp),16),t),xw(u(eg(e.b,et,ub),16),t),r=PO(c,r,new hd,i),xw(u(eg(e.b,et,ap),16),t),xw(u(eg(e.b,bt,hp),16),t),r=PO(c,r,new Rp,i),xw(u(eg(e.b,bt,ub),16),t),r=PO(c,r,new Cb,i),xw(u(eg(e.b,bt,ap),16),t),xw(u(eg(e.b,Vn,hp),16),t),r=PO(c,r,new fd,i),xw(u(eg(e.b,Vn,ub),16),t),xw(u(eg(e.b,Vn,ap),16),t)}function yPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O;for(n.Tg("Layer size calculation",1),b=Vi,h=Ir,r=!1,l=new P(e.b);l.a.5?B-=o*2*(A-.5):A<.5&&(B+=c*2*(.5-A)),r=l.d.b,BD.a-O-b&&(B=D.a-O-b),l.n.a=n+B}}function jPn(e){var n,t,i,r,c;if(i=u(C(e,(Ie(),ku)),165),i==(Xs(),V1)){for(t=new Un(Yn(cr(e).a.Jc(),new ee));ht(t);)if(n=u(rt(t),17),!UPe(n))throw R(new md(ree+$O(e)+"' has its layer constraint set to FIRST_SEPARATE, but has at least one incoming edge. FIRST_SEPARATE nodes must not have incoming edges."))}else if(i==Sg){for(c=new Un(Yn(Ii(e).a.Jc(),new ee));ht(c);)if(r=u(rt(c),17),!UPe(r))throw R(new md(ree+$O(e)+"' has its layer constraint set to LAST_SEPARATE, but has at least one outgoing edge. LAST_SEPARATE nodes must not have outgoing edges."))}}function uN(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;if(e.e&&e.c.c>19!=0&&(n=t8(n),f=!f),o=oNn(n),c=!1,r=!1,i=!1,e.h==pN&&e.m==0&&e.l==0)if(r=!0,c=!0,o==-1)e=wTe((U9(),jme)),i=!0,f=!f;else return l=lbe(e,o),f&&eQ(l),t&&(tb=_o(0,0,0)),l;else e.h>>19!=0&&(c=!0,e=t8(e),i=!0,f=!f);return o!=-1?pkn(e,o,f,c,t):Kde(e,n)<0?(t&&(c?tb=t8(e):tb=_o(e.l,e.m,e.h)),_o(0,0,0)):n_n(i?e:_o(e.l,e.m,e.h),n,f,c,r,t)}function tZ(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;if(o=e.e,f=n.e,o==0)return n;if(f==0)return e;if(c=e.d,l=n.d,c+l==2)return t=Rr(e.a[0],Dc),i=Rr(n.a[0],Dc),o==f?(b=mc(t,i),A=Rt(b),S=Rt(Hb(b,32)),S==0?new I1(o,A):new Gb(o,2,F(z($t,1),ni,30,15,[A,S]))):(yh(),N$(o<0?lf(i,t):lf(t,i),0)?J0(o<0?lf(i,t):lf(t,i)):lE(J0(Od(o<0?lf(i,t):lf(t,i)))));if(o==f)y=o,p=c>=l?bY(e.a,c,n.a,l):bY(n.a,l,e.a,c);else{if(r=c!=l?c>l?1:-1:M1e(e.a,n.a,c),r==0)return yh(),VS;r==1?(y=o,p=hY(e.a,c,n.a,l)):(y=f,p=hY(n.a,l,e.a,c))}return h=new Gb(y,p.length,p),gE(h),h}function SPn(e,n){var t,i,r,c,o,l,f;if(!(e.g>n.f||n.g>e.f)){for(t=0,i=0,o=e.w.a.ec().Jc();o.Ob();)r=u(o.Pb(),12),bQ(mu(F(z(Lr,1),Me,8,0,[r.i.n,r.n,r.a])).b,n.g,n.f)&&++t;for(l=e.r.a.ec().Jc();l.Ob();)r=u(l.Pb(),12),bQ(mu(F(z(Lr,1),Me,8,0,[r.i.n,r.n,r.a])).b,n.g,n.f)&&--t;for(f=n.w.a.ec().Jc();f.Ob();)r=u(f.Pb(),12),bQ(mu(F(z(Lr,1),Me,8,0,[r.i.n,r.n,r.a])).b,e.g,e.f)&&++i;for(c=n.r.a.ec().Jc();c.Ob();)r=u(c.Pb(),12),bQ(mu(F(z(Lr,1),Me,8,0,[r.i.n,r.n,r.a])).b,e.g,e.f)&&--i;t=0)return t;switch(Cw(Vc(e,t))){case 2:{if(gn("",_d(e,t.ok()).ve())){if(f=FT(Vc(e,t)),l=$9(Vc(e,t)),b=gbe(e,n,f,l),b)return b;for(r=qbe(e,n),o=0,p=r.gc();o1)throw R(new qn(GN));for(b=Po(e.e.Ah(),n),i=u(e.g,122),o=0;o1,h=new Pa(y.b);gu(h.a)||gu(h.b);)f=u(gu(h.a)?_(h.a):_(h.b),17),p=f.c==y?f.d:f.c,k.Math.abs(mu(F(z(Lr,1),Me,8,0,[p.i.n,p.n,p.a])).b-o.b)>1&&lIn(e,f,o,c,y)}}function TPn(e){var n,t,i,r,c,o;if(r=new qr(e.e,0),i=new qr(e.a,0),e.d)for(t=0;tKee;){for(c=n,o=0;k.Math.abs(n-c)0),r.a.Xb(r.c=--r.b),F_n(e,e.b-o,c,i,r),at(r.b0),i.a.Xb(i.c=--i.b)}if(!e.d)for(t=0;t0?(e.f[b.p]=S/(b.e.c.length+b.g.c.length),e.c=k.Math.min(e.c,e.f[b.p]),e.b=k.Math.max(e.b,e.f[b.p])):l&&(e.f[b.p]=S)}}function NPn(e){e.b=null,e.bb=null,e.fb=null,e.qb=null,e.a=null,e.c=null,e.d=null,e.e=null,e.f=null,e.n=null,e.M=null,e.L=null,e.Q=null,e.R=null,e.K=null,e.db=null,e.eb=null,e.g=null,e.i=null,e.j=null,e.k=null,e.gb=null,e.o=null,e.p=null,e.q=null,e.r=null,e.$=null,e.ib=null,e.S=null,e.T=null,e.t=null,e.s=null,e.u=null,e.v=null,e.w=null,e.B=null,e.A=null,e.C=null,e.D=null,e.F=null,e.G=null,e.H=null,e.I=null,e.J=null,e.P=null,e.Z=null,e.U=null,e.V=null,e.W=null,e.X=null,e.Y=null,e._=null,e.ab=null,e.cb=null,e.hb=null,e.nb=null,e.lb=null,e.mb=null,e.ob=null,e.pb=null,e.jb=null,e.kb=null,e.N=!1,e.O=!1}function IPn(e,n,t){var i,r,c,o;for(t.Tg("Graph transformation ("+e.a+")",1),o=Vb(n.a),c=new P(n.b);c.a=l.b.c)&&(l.b=n),(!l.c||n.c<=l.c.c)&&(l.d=l.c,l.c=n),(!l.e||n.d>=l.e.d)&&(l.e=n),(!l.f||n.d<=l.f.d)&&(l.f=n);return i=new oz((n8(),fp)),VT(e,Ztn,new Su(F(z(QN,1),On,377,0,[i]))),o=new oz(gm),VT(e,Wtn,new Su(F(z(QN,1),On,377,0,[o]))),r=new oz(bm),VT(e,Qtn,new Su(F(z(QN,1),On,377,0,[r]))),c=new oz(O3),VT(e,Ytn,new Su(F(z(QN,1),On,377,0,[c]))),CW(i.c,fp),CW(r.c,bm),CW(c.c,O3),CW(o.c,gm),l.a.c.length=0,Sr(l.a,i.c),Sr(l.a,Ks(r.c)),Sr(l.a,c.c),Sr(l.a,Ks(o.c)),l}function LPn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;for(n.Tg(fWe,1),S=ne(re(je(e,(Qh(),_m)))),o=ne(re(je(e,(Ha(),Fx)))),l=u(je(e,zx),104),Yhe((!e.a&&(e.a=new we(Ft,e,10,11)),e.a)),b=qKe((!e.a&&(e.a=new we(Ft,e,10,11)),e.a),S,o),!e.a&&(e.a=new we(Ft,e,10,11)),h=new P(b);h.a0&&(e.a=f+(S-1)*c,n.c.b+=e.a,n.f.b+=e.a)),A.a.gc()!=0&&(y=new EV(1,c),S=jge(y,n,A,O,n.f.b+f-n.c.b),S>0&&(n.f.b+=f+(S-1)*c))}function WKe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te;for(b=ne(re(C(e,(Ie(),Cg)))),i=ne(re(C(e,m4e))),y=new z6,he(y,Cg,b+i),h=n,B=h.d,O=h.c.i,q=h.d.i,D=zse(O.c),V=zse(q.c),r=new Oe,p=D;p<=V;p++)l=new za(e),Mf(l,(Fn(),dr)),he(l,(me(),mi),h),he(l,Zi,(Br(),to)),he(l,jH,y),S=u(Pe(e.b,p),25),p==D?H0(l,S.a.c.length-t,S):Or(l,S),te=ne(re(C(h,Ud))),te<0&&(te=0,he(h,Ud,te)),l.o.b=te,A=k.Math.floor(te/2),o=new Qu,Ar(o,(De(),Vn)),wu(o,l),o.n.b=A,f=new Qu,Ar(f,et),wu(f,l),f.n.b=A,Gr(h,o),c=new Ow,Pu(c,h),he(c,Wc,null),fc(c,f),Gr(c,B),Hxn(l,h,c),Gn(r.c,c),h=c;return r}function $Pn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V;if(O=n.b.c.length,!(O<3)){for(S=se($t,ni,30,O,15,1),p=0,b=new P(n.b);b.ao)&&hr(e.b,u(D.b,17));++l}c=o}}}function iZ(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V;for(f=u(Rd(e,(De(),Vn)).Jc().Pb(),12).e,S=u(Rd(e,et).Jc().Pb(),12).g,l=f.c.length,V=La(u(Pe(e.j,0),12));l-- >0;){for(O=(kn(0,f.c.length),u(f.c[0],17)),r=(kn(0,S.c.length),u(S.c[0],17)),q=r.d.e,c=pu(q,r,0),Kyn(O,r.d,c),fc(r,null),Gr(r,null),A=O.a,n&&Vt(A,new wc(V)),i=St(r.a,0);i.b!=i.d.c;)t=u(jt(i),8),Vt(A,new wc(t));for(B=O.b,y=new P(r.b);y.a-2;default:return!1}switch(n=e.Pj(),e.p){case 0:return n!=null&&Fe(ze(n))!=qj(e.k,0);case 1:return n!=null&&u(n,221).a!=Rt(e.k)<<24>>24;case 2:return n!=null&&u(n,180).a!=(Rt(e.k)&yr);case 6:return n!=null&&qj(u(n,190).a,e.k);case 5:return n!=null&&u(n,15).a!=Rt(e.k);case 7:return n!=null&&u(n,191).a!=Rt(e.k)<<16>>16;case 3:return n!=null&&ne(re(n))!=e.j;case 4:return n!=null&&u(n,164).a!=e.j;default:return n==null?e.n!=null:!gi(n,e.n)}}function oN(e,n,t){var i,r,c,o;return e.ml()&&e.ll()&&(o=wV(e,u(t,57)),ue(o)!==ue(t))?(e.vj(n),e.Bj(n,z$e(e,n,o)),e.$k()&&(c=(r=u(t,52),e.kl()?e.il()?r.Qh(e.b,Oc(u(Mn(Go(e.b),e.Jj()),19)).n,u(Mn(Go(e.b),e.Jj()).Fk(),29).ik(),null):r.Qh(e.b,Ji(r.Ah(),Oc(u(Mn(Go(e.b),e.Jj()),19))),null,null):r.Qh(e.b,-1-e.Jj(),null,null)),!u(o,52).Mh()&&(c=(i=u(o,52),e.kl()?e.il()?i.Oh(e.b,Oc(u(Mn(Go(e.b),e.Jj()),19)).n,u(Mn(Go(e.b),e.Jj()).Fk(),29).ik(),c):i.Oh(e.b,Ji(i.Ah(),Oc(u(Mn(Go(e.b),e.Jj()),19))),null,c):i.Oh(e.b,-1-e.Jj(),null,c))),c&&c.mj()),Fs(e.b)&&e.Hj(e.Gj(9,t,o,n,!1)),o):t}function ZKe(e){var n,t,i,r,c,o,l,f,h,b;for(i=new Oe,o=new P(e.e.a);o.a0&&(o=k.Math.max(o,UBe(e.C.b+i.d.b,r))),b=i,p=r,y=c;e.C&&e.C.c>0&&(S=y+e.C.c,h&&(S+=b.d.c),o=k.Math.max(o,(Na(),Rf(qa),k.Math.abs(p-1)<=qa||p==1||isNaN(p)&&isNaN(1)?0:S/(1-p)))),t.n.b=0,t.a.a=o}function nVe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S;if(t=u(zc(e.b,n),127),f=u(u(vi(e.r,n),22),83),f.dc()){t.n.d=0,t.n.a=0;return}for(h=e.u.Gc((ps(),Z1)),o=0,e.A.Gc((Vs(),_g))&&NXe(e,n),l=f.Jc(),b=null,y=0,p=0;l.Ob();)i=u(l.Pb(),115),c=ne(re(i.b.mf((H$(),mJ)))),r=i.b.Kf().b,b?(S=p+b.d.a+e.w+i.d.d,o=k.Math.max(o,(Na(),Rf(qa),k.Math.abs(y-c)<=qa||y==c||isNaN(y)&&isNaN(c)?0:S/(c-y)))):e.C&&e.C.d>0&&(o=k.Math.max(o,UBe(e.C.d+i.d.d,c))),b=i,y=c,p=r;e.C&&e.C.a>0&&(S=p+e.C.a,h&&(S+=b.d.a),o=k.Math.max(o,(Na(),Rf(qa),k.Math.abs(y-1)<=qa||y==1||isNaN(y)&&isNaN(1)?0:S/(1-y)))),t.n.d=0,t.a.b=o}function tVe(e,n,t){var i,r,c,o,l,f;for(this.g=e,l=n.d.length,f=t.d.length,this.d=se(u1,Fd,9,l+f,0,1),o=0;o0?NY(this,this.f/this.a):Ia(n.g,n.d[0]).a!=null&&Ia(t.g,t.d[0]).a!=null?NY(this,(ne(Ia(n.g,n.d[0]).a)+ne(Ia(t.g,t.d[0]).a))/2):Ia(n.g,n.d[0]).a!=null?NY(this,Ia(n.g,n.d[0]).a):Ia(t.g,t.d[0]).a!=null&&NY(this,Ia(t.g,t.d[0]).a)}function BPn(e,n,t,i,r,c,o,l){var f,h,b,p,y,S,A,O,D,B;if(A=!1,h=Ebe(t.q,n.f+n.b-t.q.f),S=i.f>n.b&&l,B=r-(t.q.e+h-o),p=(f=aS(i,B,!1),f.a),S&&p>i.f)return!1;if(S){for(y=0,D=new P(n.d);D.a=(kn(c,e.c.length),u(e.c[c],186)).e,!S&&p>n.b&&!b)?!1:((b||S||p<=n.b)&&(b&&p>n.b?(t.d=p,tO(t,$Ge(t,p))):(WHe(t.q,h),t.c=!0),tO(i,r-(t.s+t.r)),LO(i,t.q.e+t.q.d,n.f),kB(n,i),e.c.length>c&&(BO((kn(c,e.c.length),u(e.c[c],186)),i),(kn(c,e.c.length),u(e.c[c],186)).a.c.length==0&&Cd(e,c)),A=!0),A)}function zPn(e,n){var t,i,r,c,o,l,f,h,b,p;for(e.a=new yDe(hkn(Yx)),i=new P(n.a);i.a0&&(Qn(0,t.length),t.charCodeAt(0)!=47)))throw R(new qn("invalid opaquePart: "+t));if(e&&!(n!=null&&xj(SG,n.toLowerCase()))&&!(t==null||!jQ(t,oA,sA)))throw R(new qn(JZe+t));if(e&&n!=null&&xj(SG,n.toLowerCase())&&!BAn(t))throw R(new qn(JZe+t));if(!qjn(i))throw R(new qn("invalid device: "+i));if(!Hkn(r))throw o=r==null?"invalid segments: null":"invalid segment: "+$kn(r),R(new qn(o));if(!(c==null||ah(c,Xo(35))==-1))throw R(new qn("invalid query: "+c))}function rVe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B;if(y=new wc(e.o),B=n.a/y.a,l=n.b/y.b,O=n.a-y.a,c=n.b-y.b,t)for(r=ue(C(e,(Ie(),Zi)))===ue((Br(),to)),A=new P(e.j);A.a=1&&(D-o>0&&p>=0?(f.n.a+=O,f.n.b+=c*o):D-o<0&&b>=0&&(f.n.a+=O*D,f.n.b+=c));e.o.a=n.a,e.o.b=n.b,he(e,(Ie(),Ag),(Vs(),i=u(la(iA),10),new _l(i,u(Df(i,i.length),10),0)))}function GPn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B;if(t.Tg("Network simplex layering",1),e.b=n,B=u(C(n,(Ie(),jx)),15).a*4,D=e.b.a,D.c.length<1){t.Ug();return}for(c=$Dn(e,D),O=null,r=St(c,0);r.b!=r.d.c;){for(i=u(jt(r),16),l=B*lc(k.Math.sqrt(i.gc())),o=QDn(i),zW(_oe(Qbn(Loe(YK(o),l),O),!0),t.dh(1)),y=e.b.b,A=new P(o.a);A.a1)for(O=se($t,ni,30,e.b.b.c.length,15,1),p=0,h=new P(e.b.b);h.a0){rz(e,t,0),t.a+=String.fromCharCode(i),r=TEn(n,c),rz(e,t,r),c+=r-1;continue}i==39?c+10&&A.a<=0){f.c.length=0,Gn(f.c,A);break}S=A.i-A.d,S>=l&&(S>l&&(f.c.length=0,l=S),Gn(f.c,A))}f.c.length!=0&&(o=u(Pe(f,fz(r,f.c.length)),116),V.a.Ac(o)!=null,o.g=b++,oge(o,n,t,i),f.c.length=0)}for(D=e.c.length+1,y=new P(e);y.aIr||n.o==Og&&b=l&&r<=f)l<=r&&c<=f?(t[b++]=r,t[b++]=c,i+=2):l<=r?(t[b++]=r,t[b++]=f,e.b[i]=f+1,o+=2):c<=f?(t[b++]=l,t[b++]=c,i+=2):(t[b++]=l,t[b++]=f,e.b[i]=f+1);else if(fY0)&&l<10);Poe(e.c,new kc),cVe(e),B3n(e.c),DPn(e.f)}function t$n(e,n){var t,i,r,c,o,l,f,h,b,p,y;switch(e.k.g){case 1:if(i=u(C(e,(me(),mi)),17),t=u(C(i,K3e),78),t?Fe(ze(C(i,qd)))&&(t=k1e(t)):t=new xs,h=u(C(e,Ea),12),h){if(b=mu(F(z(Lr,1),Me,8,0,[h.i.n,h.n,h.a])),n<=b.a)return b.b;Ki(t,b,t.a,t.a.a)}if(p=u(C(e,gf),12),p){if(y=mu(F(z(Lr,1),Me,8,0,[p.i.n,p.n,p.a])),y.a<=n)return y.b;Ki(t,y,t.c.b,t.c)}if(t.b>=2){for(f=St(t,0),o=u(jt(f),8),l=u(jt(f),8);l.a0&&EO(h,!0,(vr(),ru)),l.k==(Fn(),wr)&&LDe(h),ei(e.f,l,n)}}function oVe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q;for(h=Vi,b=Vi,l=Ir,f=Ir,y=new P(n.i);y.a=e.j?(++e.j,Te(e.b,ke(1)),Te(e.c,b)):(i=e.d[n.p][1],ul(e.b,h,ke(u(Pe(e.b,h),15).a+1-i)),ul(e.c,h,ne(re(Pe(e.c,h)))+b-i*e.f)),(e.r==(X0(),pI)&&(u(Pe(e.b,h),15).a>e.k||u(Pe(e.b,h-1),15).a>e.k)||e.r==mI&&(ne(re(Pe(e.c,h)))>e.n||ne(re(Pe(e.c,h-1)))>e.n))&&(f=!1),o=new Un(Yn(cr(n).a.Jc(),new ee));ht(o);)c=u(rt(o),17),l=c.c.i,e.g[l.p]==h&&(p=sVe(e,l),r=r+u(p.a,15).a,f=f&&Fe(ze(p.b)));return e.g[n.p]=h,r=r+e.d[n.p][0],new jc(ke(r),($n(),!!f))}function r$n(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe;return y=e.c[n],S=e.c[t],A=u(C(y,(me(),Dy)),16),!!A&&A.gc()!=0&&A.Gc(S)||(O=y.k!=(Fn(),dr)&&S.k!=dr,D=u(C(y,bp),9),B=u(C(S,bp),9),q=D!=B,V=!!D&&D!=y||!!B&&B!=S,te=UQ(y,(De(),Kn)),be=UQ(S,bt),V=V|(UQ(y,bt)||UQ(S,Kn)),fe=V&&q||te||be,O&&fe)||y.k==(Fn(),wo)&&S.k==Wi||S.k==(Fn(),wo)&&y.k==Wi?!1:(b=e.c[n],c=e.c[t],r=GHe(e.e,b,c,(De(),Vn)),f=GHe(e.i,b,c,et),NNn(e.f,b,c),h=Qze(e.b,b,c)+u(r.a,15).a+u(f.a,15).a+e.f.d,l=Qze(e.b,c,b)+u(r.b,15).a+u(f.b,15).a+e.f.b,e.a&&(p=u(C(b,mi),12),o=u(C(c,mi),12),i=CHe(e.g,p,o),h+=u(i.a,15).a,l+=u(i.b,15).a),h>l)}function lVe(e,n){var t,i,r,c,o;t=ne(re(C(n,(Ie(),Kf)))),t<2&&he(n,Kf,2),i=u(C(n,wl),86),i==(vr(),nh)&&he(n,wl,UB(n)),r=u(C(n,Dun),15),r.a==0?he(n,(me(),Ly),new yQ):he(n,(me(),Ly),new VR(r.a)),c=ze(C(n,vx)),c==null&&he(n,vx,($n(),ue(C(n,Y1))===ue((z1(),q7)))),er(new mn(null,new vn(n.a,16)),new Zue(e)),er(lu(new mn(null,new vn(n.b,16)),new b1),new eoe(e)),o=new iVe(n),he(n,(me(),z3),o),zT(e.a),aa(e.a,(zr(),Xf),u(C(n,By),188)),aa(e.a,c1,u(C(n,wH),188)),aa(e.a,eo,u(C(n,px),188)),aa(e.a,no,u(C(n,yH),188)),aa(e.a,Pc,L7n(u(C(n,Y1),222))),Fse(e.a,ZRn(n)),he(n,kie,uN(e.a,n))}function jge(e,n,t,i,r){var c,o,l,f,h,b,p,y,S,A,O,D,B;for(p=new wt,o=new Oe,iqe(e,t,e.d.zg(),o,p),iqe(e,i,e.d.Ag(),o,p),e.b=.2*(O=fUe(lu(new mn(null,new vn(o,16)),new vM)),D=fUe(lu(new mn(null,new vn(o,16)),new yM)),k.Math.min(O,D)),c=0,l=0;l=2&&(B=IUe(o,!0,y),!e.e&&(e.e=new CEe(e)),MEn(e.e,B,o,e.b)),lGe(o,y),f$n(o),S=-1,b=new P(o);b.a0&&(t+=f.n.a+f.o.a/2,++p),A=new P(f.j);A.a0&&(t/=p),B=se(Jr,Jc,30,i.a.c.length,15,1),l=0,h=new P(i.a);h.a-1){for(r=St(l,0);r.b!=r.d.c;)i=u(jt(r),132),i.v=o;for(;l.b!=0;)for(i=u(nW(l,0),132),t=new P(i.i);t.a-1){for(c=new P(l);c.a0)&&(dw(f,k.Math.min(f.o,r.o-1)),m0(f,f.i-1),f.i==0&&Gn(l.c,f))}}function hVe(e,n,t,i,r){var c,o,l,f;return f=Vi,o=!1,l=dge(e,Nr(new Se(n.a,n.b),e),pi(new Se(t.a,t.b),r),Nr(new Se(i.a,i.b),t)),c=!!l&&!(k.Math.abs(l.a-e.a)<=rp&&k.Math.abs(l.b-e.b)<=rp||k.Math.abs(l.a-n.a)<=rp&&k.Math.abs(l.b-n.b)<=rp),l=dge(e,Nr(new Se(n.a,n.b),e),t,r),l&&((k.Math.abs(l.a-e.a)<=rp&&k.Math.abs(l.b-e.b)<=rp)==(k.Math.abs(l.a-n.a)<=rp&&k.Math.abs(l.b-n.b)<=rp)||c?f=k.Math.min(f,aE(Nr(l,t))):o=!0),l=dge(e,Nr(new Se(n.a,n.b),e),i,r),l&&(o||(k.Math.abs(l.a-e.a)<=rp&&k.Math.abs(l.b-e.b)<=rp)==(k.Math.abs(l.a-n.a)<=rp&&k.Math.abs(l.b-n.b)<=rp)||c)&&(f=k.Math.min(f,aE(Nr(l,i)))),f}function dVe(e){a2(e,new qw(UP(l2(u2(s2(o2(new gd,W0),uQe),"Minimizes the stress within a layout using stress majorization. Stress exists if the euclidean distance between a pair of nodes doesn't match their graph theoretic distance, that is, the shortest path between the two nodes. The method allows to specify individual edge lengths."),new m5),$o))),xe(e,W0,ES,Le(dve)),xe(e,W0,aF,($n(),!0)),xe(e,W0,k3,Le(Ptn)),xe(e,W0,my,Le($tn)),xe(e,W0,py,Le(Rtn)),xe(e,W0,K8,Le(Ltn)),xe(e,W0,SS,Le(gve)),xe(e,W0,V8,Le(Btn)),xe(e,W0,swe,Le(hve)),xe(e,W0,fwe,Le(fve)),xe(e,W0,awe,Le(ave)),xe(e,W0,hwe,Le(bve)),xe(e,W0,lwe,Le(EJ))}function a$n(e){var n,t,i,r,c,o,l,f;for(n=null,i=new P(e);i.a0&&t.c==0&&(!n&&(n=new Oe),Gn(n.c,t));if(n)for(;n.c.length!=0;){if(t=u(Cd(n,0),239),t.b&&t.b.c.length>0){for(c=(!t.b&&(t.b=new Oe),new P(t.b));c.apu(e,t,0))return new jc(r,t)}else if(ne(Ia(r.g,r.d[0]).a)>ne(Ia(t.g,t.d[0]).a))return new jc(r,t)}for(l=(!t.e&&(t.e=new Oe),t.e).Jc();l.Ob();)o=u(l.Pb(),239),f=(!o.b&&(o.b=new Oe),o.b),N2(0,f.c.length),_j(f.c,0,t),o.c==f.c.length&&Gn(n.c,o)}return null}function bS(e,n){var t,i,r,c,o,l,f,h,b;if(n.e==5){uVe(e,n);return}if(h=n,!(h.b==null||e.b==null)){for(h3(e),hS(e),h3(h),hS(h),t=se($t,ni,30,e.b.length+h.b.length,15,1),b=0,i=0,o=0;i=l&&r<=f)l<=r&&c<=f?i+=2:l<=r?(e.b[i]=f+1,o+=2):c<=f?(t[b++]=r,t[b++]=l-1,i+=2):(t[b++]=r,t[b++]=l-1,e.b[i]=f+1,o+=2);else if(f0),u(b.a.Xb(b.c=--b.b),17));c!=i&&b.b>0;)e.a[c.p]=!0,e.a[i.p]=!0,c=(at(b.b>0),u(b.a.Xb(b.c=--b.b),17));b.b>0&&As(b)}}function bVe(e,n,t){var i,r,c,o,l,f,h,b,p,y;if(t)for(i=-1,b=new qr(n,0);b.b0?r-=864e5:r+=864e5,f=new jle(mc(Lu(n.q.getTime()),r))),b=new h4,h=e.a.length,c=0;c=97&&i<=122||i>=65&&i<=90){for(o=c+1;o=h)throw R(new qn("Missing trailing '"));o+1=14&&b<=16))?n.a._b(i)?(t.a?Kt(t.a,t.b):t.a=new tl(t.d),Xj(t.a,"[...]")):(l=G4(i),h=new E2(n),D1(t,wVe(l,h))):X(i,171)?D1(t,cTn(u(i,171))):X(i,195)?D1(t,XAn(u(i,195))):X(i,201)?D1(t,ZMn(u(i,201))):X(i,2073)?D1(t,KAn(u(i,2073))):X(i,54)?D1(t,rTn(u(i,54))):X(i,584)?D1(t,mTn(u(i,584))):X(i,830)?D1(t,iTn(u(i,830))):X(i,108)&&D1(t,tTn(u(i,108))):D1(t,i==null?Vo:fu(i));return t.a?t.e.length==0?t.a.a:t.a.a+(""+t.e):t.c}function D8(e,n){var t,i,r,c;c=e.F,n==null?(e.F=null,c8(e,null)):(e.F=(_n(n),n),i=ah(n,Xo(60)),i!=-1?(r=(Qr(0,i,n.length),n.substr(0,i)),ah(n,Xo(46))==-1&&!gn(r,ly)&&!gn(r,BS)&&!gn(r,VF)&&!gn(r,zS)&&!gn(r,FS)&&!gn(r,JS)&&!gn(r,HS)&&!gn(r,GS)&&(r=nen),t=z$(n,Xo(62)),t!=-1&&(r+=""+(Qn(t+1,n.length+1),n.substr(t+1))),c8(e,r)):(r=n,ah(n,Xo(46))==-1&&(i=ah(n,Xo(91)),i!=-1&&(r=(Qr(0,i,n.length),n.substr(0,i))),!gn(r,ly)&&!gn(r,BS)&&!gn(r,VF)&&!gn(r,zS)&&!gn(r,FS)&&!gn(r,JS)&&!gn(r,HS)&&!gn(r,GS)?(r=nen,i!=-1&&(r+=""+(Qn(i,n.length+1),n.substr(i)))):r=n),c8(e,r),r==n&&(e.F=e.D))),(e.Db&4)!=0&&(e.Db&1)==0&&hi(e,new Dr(e,1,5,c,n))}function m$n(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A;if(e.c=e.e,A=ze(C(n,(Ie(),_un))),S=A==null||(_n(A),A),c=u(C(n,(me(),po)),22).Gc((Ic(),Kl)),r=u(C(n,Zi),102),t=!(r==(Br(),Dg)||r==a1||r==to),S&&(t||!c)){for(p=new P(n.a);p.a=0)return r=Fjn(e,(Qr(1,o,n.length),n.substr(1,o-1))),b=(Qr(o+1,f,n.length),n.substr(o+1,f-(o+1))),GRn(e,b,r)}else{if(t=-1,Mme==null&&(Mme=new RegExp("\\d")),Mme.test(String.fromCharCode(l))&&(t=Hle(n,Xo(46),f-1),t>=0)){i=u(aY(e,YRe(e,(Qr(1,t,n.length),n.substr(1,t-1))),!1),61),h=0;try{h=al((Qn(t+1,n.length+1),n.substr(t+1)),Xr,oi)}catch(y){throw y=sr(y),X(y,131)?(c=y,R(new sB(c))):R(y)}if(h>16==-10?t=u(e.Cb,293).Wk(n,t):e.Db>>16==-15&&(!n&&(n=(jn(),rh)),!h&&(h=(jn(),rh)),e.Cb.Vh()&&(f=new L1(e.Cb,1,13,h,n,$d(Ts(u(e.Cb,62)),e),!1),t?t.lj(f):t=f));else if(X(e.Cb,88))e.Db>>16==-23&&(X(n,88)||(n=(jn(),jf)),X(h,88)||(h=(jn(),jf)),e.Cb.Vh()&&(f=new L1(e.Cb,1,10,h,n,$d(Vu(u(e.Cb,29)),e),!1),t?t.lj(f):t=f));else if(X(e.Cb,446))for(l=u(e.Cb,834),o=(!l.b&&(l.b=new IP(new jX)),l.b),c=(i=new B2(new sn(o.a).a),new DP(i));c.a.b;)r=u(t3(c.a).jd(),87),t=_8(r,Iz(r,l),t)}return t}function y$n(e,n){var t,i,r,c,o,l,f,h,b,p,y;for(o=Fe(ze(je(e,(Ie(),Sm)))),y=u(je(e,Mm),22),f=!1,h=!1,p=new st((!e.c&&(e.c=new we($s,e,9,9)),e.c));p.e!=p.i.gc()&&(!f||!h);){for(c=u(ft(p),125),l=0,r=Uh(Rl(F(z(Xl,1),On,20,0,[(!c.d&&(c.d=new Nn(pr,c,8,5)),c.d),(!c.e&&(c.e=new Nn(pr,c,7,4)),c.e)])));ht(r)&&(i=u(rt(r),85),b=o&&Uw(i)&&Fe(ze(je(i,xg))),t=YKe((!i.b&&(i.b=new Nn(mt,i,4,7)),i.b),c)?e==Fi(iu(u(K((!i.c&&(i.c=new Nn(mt,i,5,8)),i.c),0),84))):e==Fi(iu(u(K((!i.b&&(i.b=new Nn(mt,i,4,7)),i.b),0),84))),!((b||t)&&(++l,l>1))););(l>0||y.Gc((ps(),Z1))&&(!c.n&&(c.n=new we(Eu,c,1,7)),c.n).i>0)&&(f=!0),l>1&&(h=!0)}f&&n.Ec((Ic(),Kl)),h&&n.Ec((Ic(),ux))}function mVe(e){var n,t,i,r,c,o,l,f,h,b,p,y;if(y=u(je(e,(Xt(),Ig)),22),y.dc())return null;if(l=0,o=0,y.Gc((Vs(),XI))){for(b=u(je(e,Vx),102),i=2,t=2,r=2,c=2,n=Fi(e)?u(je(Fi(e),Ng),86):u(je(e,Ng),86),h=new st((!e.c&&(e.c=new we($s,e,9,9)),e.c));h.e!=h.i.gc();)if(f=u(ft(h),125),p=u(je(f,t5),64),p==(De(),ju)&&(p=uge(f,n),Ei(f,t5,p)),b==(Br(),to))switch(p.g){case 1:i=k.Math.max(i,f.i+f.g);break;case 2:t=k.Math.max(t,f.j+f.f);break;case 3:r=k.Math.max(r,f.i+f.g);break;case 4:c=k.Math.max(c,f.j+f.f)}else switch(p.g){case 1:i+=f.g+2;break;case 2:t+=f.f+2;break;case 3:r+=f.g+2;break;case 4:c+=f.f+2}l=k.Math.max(i,r),o=k.Math.max(t,c)}return Yw(e,l,o,!0,!0)}function k$n(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O;for(r=null,i=new P(n.a);i.a1)for(r=e.e.b,Vt(e.e,f),l=f.a.ec().Jc();l.Ob();)o=u(l.Pb(),9),ei(e.c,o,ke(r))}}function j$n(e,n,t,i){var r,c,o,l,f,h,b,p,y,S;for(c=new Pqe(n),p=VIn(e,n,c),S=k.Math.max(ne(re(C(n,(Ie(),Ud)))),1),b=new P(p.a);b.a=0){for(f=null,l=new qr(b.a,h+1);l.b0,h?h&&(y=B.p,o?++y:--y,p=u(Pe(B.c.a,y),9),i=Nze(p),S=!(BUe(i,fe,t[0])||VIe(i,fe,t[0]))):S=!0),A=!1,be=n.D.i,be&&be.c&&l.e&&(b=o&&be.p>0||!o&&be.p=0&&Oo?1:Bb(isNaN(0),isNaN(o)))<0&&(Rf(Mh),(k.Math.abs(o-1)<=Mh||o==1||isNaN(o)&&isNaN(1)?0:o<1?-1:o>1?1:Bb(isNaN(o),isNaN(1)))<0)&&(Rf(Mh),(k.Math.abs(0-l)<=Mh||l==0||isNaN(0)&&isNaN(l)?0:0l?1:Bb(isNaN(0),isNaN(l)))<0)&&(Rf(Mh),(k.Math.abs(l-1)<=Mh||l==1||isNaN(l)&&isNaN(1)?0:l<1?-1:l>1?1:Bb(isNaN(l),isNaN(1)))<0)),c)}function O$n(e){var n,t,i,r,c,o,l,f,h,b,p;for(e.j=se($t,ni,30,e.g,15,1),e.o=new Oe,er(lu(new mn(null,new vn(e.e.b,16)),new pv),new EEe(e)),e.a=se(ts,ma,30,e.b,16,1),CO(new mn(null,new vn(e.e.b,16)),new xEe(e)),i=(p=new Oe,er(li(lu(new mn(null,new vn(e.e.b,16)),new B5),new SEe(e)),new lCe(e,p)),p),f=new P(i);f.a=h.c.c.length?b=Bae((Fn(),Wi),dr):b=Bae((Fn(),dr),dr),b*=2,c=t.a.g,t.a.g=k.Math.max(c,c+(b-c)),o=t.b.g,t.b.g=k.Math.max(o,o+(b-o)),r=n}}function Qz(e,n){var t;if(e.e)throw R(new Uc((M1(gte),UZ+gte.k+XZ)));if(!Hgn(e.a,n))throw R(new du(RYe+n+BYe));if(n==e.d)return e;switch(t=e.d,e.d=n,t.g){case 0:switch(n.g){case 2:Hw(e);break;case 1:B0(e),Hw(e);break;case 4:l3(e),Hw(e);break;case 3:l3(e),B0(e),Hw(e)}break;case 2:switch(n.g){case 1:B0(e),LW(e);break;case 4:l3(e),Hw(e);break;case 3:l3(e),B0(e),Hw(e)}break;case 1:switch(n.g){case 2:B0(e),LW(e);break;case 4:B0(e),l3(e),Hw(e);break;case 3:B0(e),l3(e),B0(e),Hw(e)}break;case 4:switch(n.g){case 2:l3(e),Hw(e);break;case 1:l3(e),B0(e),Hw(e);break;case 3:B0(e),LW(e)}break;case 3:switch(n.g){case 2:B0(e),l3(e),Hw(e);break;case 1:B0(e),l3(e),B0(e),Hw(e);break;case 4:B0(e),LW(e)}}return e}function p3(e,n){var t;if(e.d)throw R(new Uc((M1(Tte),UZ+Tte.k+XZ)));if(!Jgn(e.a,n))throw R(new du(RYe+n+BYe));if(n==e.c)return e;switch(t=e.c,e.c=n,t.g){case 0:switch(n.g){case 2:ig(e);break;case 1:R0(e),ig(e);break;case 4:f3(e),ig(e);break;case 3:f3(e),R0(e),ig(e)}break;case 2:switch(n.g){case 1:R0(e),PW(e);break;case 4:f3(e),ig(e);break;case 3:f3(e),R0(e),ig(e)}break;case 1:switch(n.g){case 2:R0(e),PW(e);break;case 4:R0(e),f3(e),ig(e);break;case 3:R0(e),f3(e),R0(e),ig(e)}break;case 4:switch(n.g){case 2:f3(e),ig(e);break;case 1:f3(e),R0(e),ig(e);break;case 3:R0(e),PW(e)}break;case 3:switch(n.g){case 2:R0(e),f3(e),ig(e);break;case 1:R0(e),f3(e),R0(e),ig(e);break;case 4:R0(e),PW(e)}}return e}function N$n(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V;for(p=e.b,b=new qr(p,0),y2(b,new Xu(e)),q=!1,o=1;b.b0&&(n.a+=To),Wz(u(ft(l),174),n);for(n.a+=nee,f=new j4((!i.c&&(i.c=new Nn(mt,i,5,8)),i.c));f.e!=f.i.gc();)f.e>0&&(n.a+=To),Wz(u(ft(f),174),n);n.a+=")"}}function I$n(e,n,t){var i,r,c,o,l,f,h,b;for(f=new st((!e.a&&(e.a=new we(Ft,e,10,11)),e.a));f.e!=f.i.gc();)for(l=u(ft(f),26),r=new Un(Yn(U0(l).a.Jc(),new ee));ht(r);){if(i=u(rt(r),85),!i.b&&(i.b=new Nn(mt,i,4,7)),!(i.b.i<=1&&(!i.c&&(i.c=new Nn(mt,i,5,8)),i.c.i<=1)))throw R(new a4("Graph must not contain hyperedges."));if(!eS(i)&&l!=iu(u(K((!i.c&&(i.c=new Nn(mt,i,5,8)),i.c),0),84)))for(h=new tNe,Pu(h,i),he(h,(L0(),My),i),xP(h,u(bu(Xc(t.f,l)),155)),nX(h,u(zn(t,iu(u(K((!i.c&&(i.c=new Nn(mt,i,5,8)),i.c),0),84))),155)),Te(n.c,h),o=new st((!i.n&&(i.n=new we(Eu,i,1,7)),i.n));o.e!=o.i.gc();)c=u(ft(o),157),b=new fPe(h,c.a),Pu(b,c),he(b,My,c),b.e.a=k.Math.max(c.g,1),b.e.b=k.Math.max(c.f,1),hge(b),Te(n.d,b)}}function D$n(e,n,t){var i,r,c,o,l,f,h,b,p,y;switch(t.Tg("Node promotion heuristic",1),e.i=n,e.r=u(C(n,(Ie(),dI)),243),e.r!=(X0(),_7)&&e.r!=xx?cRn(e):NIn(e),b=u(C(e.i,i4e),15).a,c=new Nq,e.r.g){case 2:case 1:I8(e,c);break;case 3:for(e.r=TH,I8(e,c),f=0,l=new P(e.b);l.ae.k&&(e.r=pI,I8(e,c));break;case 4:for(e.r=TH,I8(e,c),h=0,r=new P(e.c);r.ae.n&&(e.r=mI,I8(e,c));break;case 6:y=lc(k.Math.ceil(e.g.length*b/100)),I8(e,new jje(y));break;case 5:p=lc(k.Math.ceil(e.e*b/100)),I8(e,new Eje(p));break;case 8:eYe(e,!0);break;case 9:eYe(e,!1);break;default:I8(e,c)}e.r!=_7&&e.r!=xx?QNn(e,n):wDn(e,n),t.Ug()}function _$n(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V;for(p=new Mge(e),j4n(p,!(n==(vr(),Vl)||n==eh)),b=p.a,y=new o4,r=(wa(),F(z(dm,1),Ee,237,0,[Ou,No,Nu])),o=0,f=r.length;o0&&(y.d+=b.n.d,y.d+=b.d),y.a>0&&(y.a+=b.n.a,y.a+=b.d),y.b>0&&(y.b+=b.n.b,y.b+=b.d),y.c>0&&(y.c+=b.n.c,y.c+=b.d),y}function kVe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A;for(y=t.d,p=t.c,c=new Se(t.f.a+t.d.b+t.d.c,t.f.b+t.d.d+t.d.a),o=c.b,h=new P(e.a);h.a0&&(e.c[n.c.p][n.p].d+=Ds(e.i,24)*kN*.07000000029802322-.03500000014901161,e.c[n.c.p][n.p].a=e.c[n.c.p][n.p].d/e.c[n.c.p][n.p].b)}}function P$n(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D;for(A=new P(e);A.ai.d,i.d=k.Math.max(i.d,n),l&&t&&(i.d=k.Math.max(i.d,i.a),i.a=i.d+r);break;case 3:t=n>i.a,i.a=k.Math.max(i.a,n),l&&t&&(i.a=k.Math.max(i.a,i.d),i.d=i.a+r);break;case 2:t=n>i.c,i.c=k.Math.max(i.c,n),l&&t&&(i.c=k.Math.max(i.b,i.c),i.b=i.c+r);break;case 4:t=n>i.b,i.b=k.Math.max(i.b,n),l&&t&&(i.b=k.Math.max(i.b,i.c),i.c=i.b+r)}}}function EVe(e,n){var t,i,r,c,o,l,f,h,b;return h="",n.length==0?e.le(Jge,pZ,-1,-1):(b=V2(n),gn(b.substr(0,3),"at ")&&(b=(Qn(3,b.length+1),b.substr(3))),b=b.replace(/\[.*?\]/g,""),o=b.indexOf("("),o==-1?(o=b.indexOf("@"),o==-1?(h=b,b=""):(h=V2((Qn(o+1,b.length+1),b.substr(o+1))),b=V2((Qr(0,o,b.length),b.substr(0,o))))):(t=b.indexOf(")",o),h=(Qr(o+1,t,b.length),b.substr(o+1,t-(o+1))),b=V2((Qr(0,o,b.length),b.substr(0,o)))),o=ah(b,Xo(46)),o!=-1&&(b=(Qn(o+1,b.length+1),b.substr(o+1))),(b.length==0||gn(b,"Anonymous function"))&&(b=pZ),l=z$(h,Xo(58)),r=Hle(h,Xo(58),l-1),f=-1,i=-1,c=Jge,l!=-1&&r!=-1&&(c=(Qr(0,r,h.length),h.substr(0,r)),f=kOe((Qr(r+1,l,h.length),h.substr(r+1,l-(r+1)))),i=kOe((Qn(l+1,h.length+1),h.substr(l+1)))),e.le(c,b,f,i))}function R$n(e){var n,t,i,r,c,o,l,f,h,b,p;for(h=new P(e);h.a0||b.j==Vn&&b.e.c.length-b.g.c.length<0)){n=!1;break}for(r=new P(b.g);r.a=h&&be>=D&&(y+=A.n.b+O.n.b+O.a.b-te,++l));if(t)for(o=new P(q.e);o.a=h&&be>=D&&(y+=A.n.b+O.n.b+O.a.b-te,++l))}l>0&&(fe+=y/l,++S)}S>0?(n.a=r*fe/S,n.g=S):(n.a=0,n.g=0)}function xge(e,n,t,i){var r,c,o,l,f;return l=new Mge(n),_Nn(l,i),r=!0,e&&e.nf((Xt(),Ng))&&(c=u(e.mf((Xt(),Ng)),86),r=c==(vr(),nh)||c==Zc||c==ru),EXe(l,!1),Ao(l.e.Pf(),new Kle(l,!1,r)),HV(l,l.f,(wa(),Ou),(De(),Kn)),HV(l,l.f,Nu,bt),HV(l,l.g,Ou,Vn),HV(l,l.g,Nu,et),GJe(l,Kn),GJe(l,bt),BDe(l,et),BDe(l,Vn),v2(),o=l.A.Gc((Vs(),Jm))&&l.B.Gc((_s(),VI))?iJe(l):null,o&&Zbn(l.a,o),$$n(l),rxn(l),cxn(l),d$n(l),A_n(l),Oxn(l),NQ(l,Kn),NQ(l,bt),bDn(l),tPn(l),t&&(Yjn(l),Nxn(l),NQ(l,et),NQ(l,Vn),f=l.B.Gc((_s(),rA)),fqe(l,f,Kn),fqe(l,f,bt),aqe(l,f,et),aqe(l,f,Vn),er(new mn(null,new vn(new ot(l.i),0)),new Gg),er(li(new mn(null,Jfe(l.r).a.oc()),new qg),new Ug),HAn(l),l.e.Nf(l.o),er(new mn(null,Jfe(l.r).a.oc()),new sd)),l.o}function z$n(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O;for(h=Vi,i=new P(e.a.b);i.a1)for(S=new wge(A,V,i),cc(V,new aCe(e,S)),Gn(o.c,S),p=V.a.ec().Jc();p.Ob();)b=u(p.Pb(),49),qo(c,b.b);if(l.a.gc()>1)for(S=new wge(A,l,i),cc(l,new hCe(e,S)),Gn(o.c,S),p=l.a.ec().Jc();p.Ob();)b=u(p.Pb(),49),qo(c,b.b)}}function G$n(e,n){var t,i,r,c,o,l;if(u(C(n,(me(),po)),22).Gc((Ic(),Kl))){for(l=new P(n.a);l.a=0&&o0&&(u(zc(e.b,n),127).a.b=t)}function Q$n(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B;for(S=0,i=new ar,c=new st((!n.a&&(n.a=new we(Ft,n,10,11)),n.a));c.e!=c.i.gc();)r=u(ft(c),26),Fe(ze(je(r,(Ie(),Mg))))||(p=Fi(r),Xz(p)&&!Fe(ze(je(r,aH)))&&(Ei(r,(me(),Oi),ke(S)),++S,ba(r,jm)&&hr(i,u(je(r,jm),15))),xVe(e,r,t));for(he(t,(me(),sb),ke(S)),he(t,oI,ke(i.a.gc())),S=0,b=new st((!n.b&&(n.b=new we(pr,n,12,3)),n.b));b.e!=b.i.gc();)f=u(ft(b),85),Xz(n)&&(Ei(f,Oi,ke(S)),++S),D=dW(f),B=jGe(f),y=Fe(ze(je(D,(Ie(),Sm)))),O=!Fe(ze(je(f,Mg))),A=y&&Uw(f)&&Fe(ze(je(f,xg))),o=Fi(D)==n&&Fi(D)==Fi(B),l=(Fi(D)==n&&B==n)^(Fi(B)==n&&D==n),O&&!A&&(l||o)&&Ige(e,f,n,t);if(Fi(n))for(h=new st(UDe(Fi(n)));h.e!=h.i.gc();)f=u(ft(h),85),D=dW(f),D==n&&Uw(f)&&(A=Fe(ze(je(D,(Ie(),Sm))))&&Fe(ze(je(f,xg))),A&&Ige(e,f,n,t))}function W$n(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn,In;for(fe=new Oe,A=new P(e.b);A.a=n.length)return{done:!0};var r=n[i++];return{value:[r,t.get(r)],done:!1}}}},KIn()||(e.prototype.createObject=function(){return{}},e.prototype.get=function(n){return this.obj[":"+n]},e.prototype.set=function(n,t){this.obj[":"+n]=t},e.prototype[FZ]=function(n){delete this.obj[":"+n]},e.prototype.keys=function(){var n=[];for(var t in this.obj)t.charCodeAt(0)==58&&n.push(t.substring(1));return n}),e}function Ti(){Ti=Y,Lx=new ki(owe),new Pi("DEPTH",ke(0)),wre=new Pi("FAN",ke(0)),pye=new Pi(VQe,ke(0)),db=new Pi("ROOT",($n(),!1)),vre=new Pi("LEFTNEIGHBOR",null),csn=new Pi("RIGHTNEIGHBOR",null),$H=new Pi("LEFTSIBLING",null),yre=new Pi("RIGHTSIBLING",null),gre=new Pi("DUMMY",!1),new Pi("LEVEL",ke(0)),yye=new Pi("REMOVABLE_EDGES",new xi),SI=new Pi("XCOOR",ke(0)),xI=new Pi("YCOOR",ke(0)),RH=new Pi("LEVELHEIGHT",0),Sa=new Pi("LEVELMIN",0),Vf=new Pi("LEVELMAX",0),pre=new Pi("GRAPH_XMIN",0),mre=new Pi("GRAPH_YMIN",0),mye=new Pi("GRAPH_XMAX",0),vye=new Pi("GRAPH_YMAX",0),wye=new Pi("COMPACT_LEVEL_ASCENSION",!1),bre=new Pi("COMPACT_CONSTRAINTS",new Oe),_x=new Pi("ID",""),Px=new Pi("POSITION",ke(0)),Vd=new Pi("PRELIM",0),$7=new Pi("MODIFIER",0),P7=new ki(rQe),EI=new ki(cQe)}function tRn(e){cge();var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D;if(e==null)return null;if(p=e.length*8,p==0)return"";for(l=p%24,S=p/24|0,y=l!=0?S+1:S,c=null,c=se(Wl,Eh,30,y*4,15,1),h=0,b=0,n=0,t=0,i=0,o=0,r=0,f=0;f>24,h=(n&3)<<24>>24,A=(n&-128)==0?n>>2<<24>>24:(n>>2^192)<<24>>24,O=(t&-128)==0?t>>4<<24>>24:(t>>4^240)<<24>>24,D=(i&-128)==0?i>>6<<24>>24:(i>>6^252)<<24>>24,c[o++]=r0[A],c[o++]=r0[O|h<<4],c[o++]=r0[b<<2|D],c[o++]=r0[i&63];return l==8?(n=e[r],h=(n&3)<<24>>24,A=(n&-128)==0?n>>2<<24>>24:(n>>2^192)<<24>>24,c[o++]=r0[A],c[o++]=r0[h<<4],c[o++]=61,c[o++]=61):l==16&&(n=e[r],t=e[r+1],b=(t&15)<<24>>24,h=(n&3)<<24>>24,A=(n&-128)==0?n>>2<<24>>24:(n>>2^192)<<24>>24,O=(t&-128)==0?t>>4<<24>>24:(t>>4^240)<<24>>24,c[o++]=r0[A],c[o++]=r0[O|h<<4],c[o++]=r0[b<<2],c[o++]=61),ph(c,0,c.length)}function iRn(e,n){var t,i,r,c,o,l,f;if(e.e==0&&e.p>0&&(e.p=-(e.p-1)),e.p>Xr&&Fae(n,e.p-Q0),o=n.q.getDate(),UT(n,1),e.k>=0&&D4n(n,e.k),e.c>=0?UT(n,e.c):e.k>=0?(f=new p1e(n.q.getFullYear()-Q0,n.q.getMonth(),35),i=35-f.q.getDate(),UT(n,k.Math.min(i,o))):UT(n,o),e.f<0&&(e.f=n.q.getHours()),e.b>0&&e.f<12&&(e.f+=12),Hwn(n,e.f==24&&e.g?0:e.f),e.j>=0&&a9n(n,e.j),e.n>=0&&S9n(n,e.n),e.i>=0&&rTe(n,mc(hc(FO(Lu(n.q.getTime()),zd),zd),e.i)),e.a&&(r=new r$,Fae(r,r.q.getFullYear()-Q0-80),HX(Lu(n.q.getTime()),Lu(r.q.getTime()))&&Fae(n,r.q.getFullYear()-Q0+100)),e.d>=0){if(e.c==-1)t=(7+e.d-n.q.getDay())%7,t>3&&(t-=7),l=n.q.getMonth(),UT(n,n.q.getDate()+t),n.q.getMonth()!=l&&UT(n,n.q.getDate()+(t>0?-7:7));else if(n.q.getDay()!=e.d)return!1}return e.o>Xr&&(c=n.q.getTimezoneOffset(),rTe(n,mc(Lu(n.q.getTime()),(e.o-c)*60*zd))),!0}function TVe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te;if(r=C(n,(me(),mi)),!!X(r,206)){for(A=u(r,26),O=n.e,y=new wc(n.c),c=n.d,y.a+=c.b,y.b+=c.d,te=u(je(A,(Ie(),kH)),182),cs(te,(_s(),aG))&&(S=u(je(A,l4e),104),WU(S,c.a),tX(S,c.d),ZU(S,c.b),eX(S,c.c)),t=new Oe,b=new P(n.a);b.ai.c.length-1;)Te(i,new jc(E3,Fpe));t=u(C(r,Dh),15).a,x1(u(C(e,kp),86))?(r.e.ane(re((kn(t,i.c.length),u(i.c[t],49)).b))&&HC((kn(t,i.c.length),u(i.c[t],49)),r.e.a+r.f.a)):(r.e.bne(re((kn(t,i.c.length),u(i.c[t],49)).b))&&HC((kn(t,i.c.length),u(i.c[t],49)),r.e.b+r.f.b))}for(c=St(e.b,0);c.b!=c.d.c;)r=u(jt(c),40),t=u(C(r,(Mu(),Dh)),15).a,he(r,(Ti(),Sa),re((kn(t,i.c.length),u(i.c[t],49)).a)),he(r,Vf,re((kn(t,i.c.length),u(i.c[t],49)).b));n.Ug()}function cRn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O;for(e.o=ne(re(C(e.i,(Ie(),Tg)))),e.f=ne(re(C(e.i,lb))),e.j=e.i.b.c.length,l=e.j-1,y=0,e.k=0,e.n=0,e.b=Pf(se(jr,Me,15,e.j,0,1)),e.c=Pf(se(gr,Me,346,e.j,7,1)),o=new P(e.i.b);o.a0&&Te(e.q,b),Te(e.p,b);n-=i,S=f+n,h+=n*e.f,ul(e.b,l,ke(S)),ul(e.c,l,h),e.k=k.Math.max(e.k,S),e.n=k.Math.max(e.n,h),e.e+=n,n+=O}}function IVe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V;if(n.b!=0){for(S=new xi,l=null,A=null,i=lc(k.Math.floor(k.Math.log(n.b)*k.Math.LOG10E)+1),f=0,V=St(n,0);V.b!=V.d.c;)for(B=u(jt(V),40),ue(A)!==ue(C(B,(Ti(),_x)))&&(A=Pt(C(B,_x)),f=0),A!=null?l=A+bLe(f++,i):l=bLe(f++,i),he(B,_x,l),D=(r=St(new S1(B).a.d,0),new Cv(r));WC(D.a);)O=u(jt(D.a),65).c,Ki(S,O,S.c.b,S.c),he(O,_x,l);for(y=new wt,o=0;o0&&(V-=S),pge(o,V),b=0,y=new P(o.a);y.a0),l.a.Xb(l.c=--l.b)),f=.4*i*b,!c&&l.b0&&(f=(Qn(0,n.length),n.charCodeAt(0)),f!=64)){if(f==37&&(p=n.lastIndexOf("%"),h=!1,p!=0&&(p==y-1||(h=(Qn(p+1,n.length),n.charCodeAt(p+1)==46))))){if(o=(Qr(1,p,n.length),n.substr(1,p-1)),V=gn("%",o)?null:Tge(o),i=0,h)try{i=al((Qn(p+2,n.length+1),n.substr(p+2)),Xr,oi)}catch(te){throw te=sr(te),X(te,131)?(l=te,R(new sB(l))):R(te)}for(D=Uhe(e.Dh());D.Ob();)if(A=IB(D),X(A,504)&&(r=u(A,587),q=r.d,(V==null?q==null:gn(V,q))&&i--==0))return r;return null}if(b=n.lastIndexOf("."),S=b==-1?n:(Qr(0,b,n.length),n.substr(0,b)),t=0,b!=-1)try{t=al((Qn(b+1,n.length+1),n.substr(b+1)),Xr,oi)}catch(te){if(te=sr(te),X(te,131))S=n;else throw R(te)}for(S=gn("%",S)?null:Tge(S),O=Uhe(e.Dh());O.Ob();)if(A=IB(O),X(A,197)&&(c=u(A,197),B=c.ve(),(S==null?B==null:gn(S,B))&&t--==0))return c;return null}return pVe(e,n)}function hRn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q;for(b=new wt,f=new Nw,i=new P(e.a.a.b);i.an.d.c){if(S=e.c[n.a.d],D=e.c[p.a.d],S==D)continue;Jf(Of(Tf(Nf(Cf(new tf,1),100),S),D))}}}}}function dRn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe;if(y=u(u(vi(e.r,n),22),83),n==(De(),et)||n==Vn){AVe(e,n);return}for(c=n==Kn?(Rw(),KN):(Rw(),VN),te=n==Kn?(Uo(),ja):(Uo(),Uf),t=u(zc(e.b,n),127),i=t.i,r=i.c+Yv(F(z(Jr,1),Jc,30,15,[t.n.b,e.C.b,e.k])),B=i.c+i.b-Yv(F(z(Jr,1),Jc,30,15,[t.n.c,e.C.c,e.k])),o=$oe(Vle(c),e.t),q=n==Kn?Ir:Vi,p=y.Jc();p.Ob();)h=u(p.Pb(),115),!(!h.c||h.c.d.c.length<=0)&&(D=h.b.Kf(),O=h.e,S=h.c,A=S.i,A.b=(f=S.n,S.e.a+f.b+f.c),A.a=(l=S.n,S.e.b+l.d+l.a),HT(te,ewe),S.f=te,ga(S,(ws(),qf)),A.c=O.a-(A.b-D.a)/2,be=k.Math.min(r,O.a),fe=k.Math.max(B,O.a+D.a),A.cfe&&(A.c=fe-A.b),Te(o.d,new aV(A,U1e(o,A))),q=n==Kn?k.Math.max(q,O.b+h.b.Kf().b):k.Math.min(q,O.b));for(q+=n==Kn?e.t:-e.t,V=ade((o.e=q,o)),V>0&&(u(zc(e.b,n),127).a.b=V),b=y.Jc();b.Ob();)h=u(b.Pb(),115),!(!h.c||h.c.d.c.length<=0)&&(A=h.c.i,A.c-=h.e.a,A.d-=h.e.b)}function bRn(e,n){KW();var t,i,r,c,o,l,f,h,b,p,y,S,A,O;if(f=ao(e,0)<0,f&&(e=Od(e)),ao(e,0)==0)switch(n){case 0:return"0";case 1:return z8;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return S=new y0,n<0?S.a+="0E+":S.a+="0E",S.a+=n==Xr?"2147483648":""+-n,S.a}b=18,p=se(Wl,Eh,30,b+1,15,1),t=b,O=e;do h=O,O=FO(O,10),p[--t]=Rt(mc(48,lf(h,hc(O,10))))&yr;while(ao(O,0)!=0);if(r=lf(lf(lf(b,t),n),1),n==0)return f&&(p[--t]=45),ph(p,t,b-t);if(n>0&&ao(r,-6)>=0){if(ao(r,0)>=0){for(c=t+Rt(r),l=b-1;l>=c;l--)p[l+1]=p[l];return p[++c]=46,f&&(p[--t]=45),ph(p,t,b-t+1)}for(o=2;HX(o,mc(Od(r),1));o++)p[--t]=48;return p[--t]=46,p[--t]=48,f&&(p[--t]=45),ph(p,t,b-t)}return A=t+1,i=b,y=new h4,f&&(y.a+="-"),i-A>=1?(qb(y,p[t]),y.a+=".",y.a+=ph(p,t+1,b-t-1)):y.a+=ph(p,t,b-t),y.a+="E",ao(r,0)>0&&(y.a+="+"),y.a+=""+cE(r),y.a}function DVe(e){a2(e,new qw(UP(l2(u2(s2(o2(new gd,Gl),"ELK Radial"),'A radial layout provider which is based on the algorithm of Peter Eades published in "Drawing free trees.", published by International Institute for Advanced Study of Social Information Science, Fujitsu Limited in 1991. The radial layouter takes a tree and places the nodes in radial order around the root. The nodes of the same tree level are placed on the same radius.'),new IM),Gl))),xe(e,Gl,NF,Le(nln)),xe(e,Gl,om,Le(tln)),xe(e,Gl,k3,Le(Qsn)),xe(e,Gl,my,Le(Wsn)),xe(e,Gl,py,Le(Zsn)),xe(e,Gl,K8,Le(Ysn)),xe(e,Gl,SS,Le(Vye)),xe(e,Gl,V8,Le(eln)),xe(e,Gl,ene,Le(Dre)),xe(e,Gl,Zee,Le(_re)),xe(e,Gl,$F,Le(Qye)),xe(e,Gl,nne,Le(Lre)),xe(e,Gl,tne,Le(Wye)),xe(e,Gl,c2e,Le(Zye)),xe(e,Gl,r2e,Le(Yye)),xe(e,Gl,e2e,Le(HH)),xe(e,Gl,n2e,Le(GH)),xe(e,Gl,t2e,Le(AI)),xe(e,Gl,i2e,Le(e6e)),xe(e,Gl,Zpe,Le(Kye))}function Yw(e,n,t,i,r){var c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe;if(D=new Se(e.g,e.f),O=R0e(e),O.a=k.Math.max(O.a,n),O.b=k.Math.max(O.b,t),fe=O.a/D.a,b=O.b/D.b,te=O.a-D.a,f=O.b-D.b,i)for(o=Fi(e)?u(je(Fi(e),(Xt(),Ng)),86):u(je(e,(Xt(),Ng)),86),l=ue(je(e,(Xt(),Vx)))===ue((Br(),to)),q=new st((!e.c&&(e.c=new we($s,e,9,9)),e.c));q.e!=q.i.gc();)switch(B=u(ft(q),125),V=u(je(B,t5),64),V==(De(),ju)&&(V=uge(B,o),Ei(B,t5,V)),V.g){case 1:l||Os(B,B.i*fe);break;case 2:Os(B,B.i+te),l||Ns(B,B.j*b);break;case 3:l||Os(B,B.i*fe),Ns(B,B.j+f);break;case 4:l||Ns(B,B.j*b)}if(vw(e,O.a,O.b),r)for(y=new st((!e.n&&(e.n=new we(Eu,e,1,7)),e.n));y.e!=y.i.gc();)p=u(ft(y),157),S=p.i+p.g/2,A=p.j+p.f/2,be=S/D.a,h=A/D.b,be+h>=1&&(be-h>0&&A>=0?(Os(p,p.i+te),Ns(p,p.j+f*h)):be-h<0&&S>=0&&(Os(p,p.i+te*be),Ns(p,p.j+f)));return Ei(e,(Xt(),Ig),(Vs(),c=u(la(iA),10),new _l(c,u(Df(c,c.length),10),0))),new Se(fe,b)}function Zz(e){var n,t,i,r,c,o,l,f,h,b,p;if(e==null)throw R(new fh(Vo));if(h=e,c=e.length,f=!1,c>0&&(n=(Qn(0,e.length),e.charCodeAt(0)),(n==45||n==43)&&(e=(Qn(1,e.length+1),e.substr(1)),--c,f=n==45)),c==0)throw R(new fh(Zw+h+'"'));for(;e.length>0&&(Qn(0,e.length),e.charCodeAt(0)==48);)e=(Qn(1,e.length+1),e.substr(1)),--c;if(c>(hKe(),tnn)[10])throw R(new fh(Zw+h+'"'));for(r=0;r0&&(p=-parseInt((Qr(0,i,e.length),e.substr(0,i)),10),e=(Qn(i,e.length+1),e.substr(i)),c-=i,t=!1);c>=o;){if(i=parseInt((Qr(0,o,e.length),e.substr(0,o)),10),e=(Qn(o,e.length+1),e.substr(o)),c-=o,t)t=!1;else{if(ao(p,l)<0)throw R(new fh(Zw+h+'"'));p=hc(p,b)}p=lf(p,i)}if(ao(p,0)>0)throw R(new fh(Zw+h+'"'));if(!f&&(p=Od(p),ao(p,0)<0))throw R(new fh(Zw+h+'"'));return p}function Tge(e){eZ();var n,t,i,r,c,o,l,f;if(e==null)return null;if(r=ah(e,Xo(37)),r<0)return e;for(f=new tl((Qr(0,r,e.length),e.substr(0,r))),n=se(ds,A3,30,4,15,1),l=0,i=0,o=e.length;rr+2&&ZY((Qn(r+1,e.length),e.charCodeAt(r+1)),G8e,q8e)&&ZY((Qn(r+2,e.length),e.charCodeAt(r+2)),G8e,q8e))if(t=Bvn((Qn(r+1,e.length),e.charCodeAt(r+1)),(Qn(r+2,e.length),e.charCodeAt(r+2))),r+=2,i>0?(t&192)==128?n[l++]=t<<24>>24:i=0:t>=128&&((t&224)==192?(n[l++]=t<<24>>24,i=2):(t&240)==224?(n[l++]=t<<24>>24,i=3):(t&248)==240&&(n[l++]=t<<24>>24,i=4)),i>0){if(l==i){switch(l){case 2:{qb(f,((n[0]&31)<<6|n[1]&63)&yr);break}case 3:{qb(f,((n[0]&15)<<12|(n[1]&63)<<6|n[2]&63)&yr);break}}l=0,i=0}}else{for(c=0;c=2){if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i==0)t=(j0(),r=new yo,r),Et((!e.a&&(e.a=new we($i,e,6,6)),e.a),t);else if((!e.a&&(e.a=new we($i,e,6,6)),e.a).i>1)for(y=new j4((!e.a&&(e.a=new we($i,e,6,6)),e.a));y.e!=y.i.gc();)VE(y);sge(n,u(K((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170))}if(p)for(i=new st((!e.a&&(e.a=new we($i,e,6,6)),e.a));i.e!=i.i.gc();)for(t=u(ft(i),170),h=new st((!t.a&&(t.a=new mr(yl,t,5)),t.a));h.e!=h.i.gc();)f=u(ft(h),372),l.a=k.Math.max(l.a,f.a),l.b=k.Math.max(l.b,f.b);for(o=new st((!e.n&&(e.n=new we(Eu,e,1,7)),e.n));o.e!=o.i.gc();)c=u(ft(o),157),b=u(je(c,Qx),8),b&&Il(c,b.a,b.b),p&&(l.a=k.Math.max(l.a,c.i+c.g),l.b=k.Math.max(l.b,c.j+c.f));return l}function LVe(e,n,t,i,r){var c,o,l;if(MRe(e,n),o=n[0],c=rc(t.c,0),l=-1,j1e(t))if(i>0){if(o+i>e.length)return!1;l=Cz((Qr(0,o+i,e.length),e.substr(0,o+i)),n)}else l=Cz(e,n);switch(c){case 71:return l=a3(e,o,F(z(He,1),Me,2,6,[vYe,yYe]),n),r.e=l,!0;case 77:return _In(e,n,r,l,o);case 76:return LIn(e,n,r,l,o);case 69:return $Cn(e,n,o,r);case 99:return RCn(e,n,o,r);case 97:return l=a3(e,o,F(z(He,1),Me,2,6,["AM","PM"]),n),r.b=l,!0;case 121:return PIn(e,n,o,l,t,r);case 100:return l<=0?!1:(r.c=l,!0);case 83:return l<0?!1:gEn(l,o,n[0],r);case 104:l==12&&(l=0);case 75:case 72:return l<0?!1:(r.f=l,r.g=!1,!0);case 107:return l<0?!1:(r.f=l,r.g=!0,!0);case 109:return l<0?!1:(r.j=l,!0);case 115:return l<0?!1:(r.n=l,!0);case 90:if(oon[f]&&(D=f),p=new P(e.a.b);p.a=l){at(q.b>0),q.a.Xb(q.c=--q.b);break}else D.a>f&&(i?(Sr(i.b,D.b),i.a=k.Math.max(i.a,D.a),As(q)):(Te(D.b,b),D.c=k.Math.min(D.c,f),D.a=k.Math.max(D.a,l),i=D));i||(i=new hxe,i.c=f,i.a=l,y2(q,i),Te(i.b,b))}for(o=e.b,h=0,B=new P(t);B.a1;){if(r=MNn(n),p=c.g,A=u(je(n,zx),104),O=ne(re(je(n,KH))),(!n.a&&(n.a=new we(Ft,n,10,11)),n.a).i>1&&ne(re(je(n,(Qh(),Gre))))!=Vi&&(c.c+(A.b+A.c))/(c.b+(A.d+A.a))1&&ne(re(je(n,(Qh(),Hre))))!=Vi&&(c.c+(A.b+A.c))/(c.b+(A.d+A.a))>O&&Ei(r,(Qh(),_m),k.Math.max(ne(re(je(n,Bx))),ne(re(je(r,_m)))-ne(re(je(n,Hre))))),S=new Ose(i,b),f=WVe(S,r,y),h=f.g,h>=p&&h==h){for(o=0;o<(!r.a&&(r.a=new we(Ft,r,10,11)),r.a).i;o++)xqe(e,u(K((!r.a&&(r.a=new we(Ft,r,10,11)),r.a),o),26),u(K((!n.a&&(n.a=new we(Ft,n,10,11)),n.a),o),26));WRe(n,S),y4n(c,f.c),v4n(c,f.b)}--l}Ei(n,(Qh(),R7),c.b),Ei(n,Fy,c.c),t.Ug()}function vRn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn;for(n.Tg("Compound graph postprocessor",1),t=Fe(ze(C(e,(Ie(),Hie)))),l=u(C(e,(me(),q3e)),229),b=new ar,B=l.ec().Jc();B.Ob();){for(D=u(B.Pb(),17),o=new bs(l.cc(D)),En(),Tr(o,new noe(e)),be=m7n((kn(0,o.c.length),u(o.c[0],250))),_e=XBe(u(Pe(o,o.c.length-1),250)),V=be.i,Q9(_e.i,V)?q=V.e:q=_r(V),p=cSn(D,o),qs(D.a),y=null,c=new P(o);c.axh,cn=k.Math.abs(y.b-A.b)>xh,(!t&&on&&cn||t&&(on||cn))&&Vt(D.a,te)),ac(D.a,i),i.b==0?y=te:y=(at(i.b!=0),u(i.c.b.c,8)),V7n(S,p,O),XBe(r)==_e&&(_r(_e.i)!=r.a&&(O=new Vr,L0e(O,_r(_e.i),q)),he(D,Eie,O)),nCn(S,D,q),b.a.yc(S,b);fc(D,be),Gr(D,_e)}for(h=b.a.ec().Jc();h.Ob();)f=u(h.Pb(),17),fc(f,null),Gr(f,null);n.Ug()}function yRn(e,n){var t,i,r,c,o,l,f,h,b,p,y;for(r=u(C(e,(Mu(),kp)),86),b=r==(vr(),Zc)||r==ru?eh:ru,t=u(gs(li(new mn(null,new vn(e.b,16)),new vv),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),16),f=u(gs(So(t.Mc(),new PEe(n)),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[Yo]))),16),f.Fc(u(gs(So(t.Mc(),new $Ee(n)),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[Yo]))),18)),f.gd(new REe(b)),y=new kd(new BEe(r)),i=new wt,l=f.Jc();l.Ob();)o=u(l.Pb(),240),h=u(o.a,40),Fe(ze(o.c))?(y.a.yc(h,($n(),ib))==null,new o9(y.a.Xc(h,!1)).a.gc()>0&&ei(i,h,u(new o9(y.a.Xc(h,!1)).a.Tc(),40)),new o9(y.a.$c(h,!0)).a.gc()>1&&ei(i,tJe(y,h),h)):(new o9(y.a.Xc(h,!1)).a.gc()>0&&(c=u(new o9(y.a.Xc(h,!1)).a.Tc(),40),ue(c)===ue(bu(Xc(i.f,h)))&&u(C(h,(Ti(),bre)),16).Ec(c)),new o9(y.a.$c(h,!0)).a.gc()>1&&(p=tJe(y,h),ue(bu(Xc(i.f,p)))===ue(h)&&u(C(p,(Ti(),bre)),16).Ec(h)),y.a.Ac(h)!=null)}function PVe(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te;if(e.gc()==1)return u(e.Xb(0),235);if(e.gc()<=0)return new WR;for(r=e.Jc();r.Ob();){for(t=u(r.Pb(),235),A=0,b=oi,p=oi,f=Xr,h=Xr,S=new P(t.e);S.al&&(V=0,te+=o+B,o=0),KDn(O,t,V,te),n=k.Math.max(n,V+D.a),o=k.Math.max(o,D.b),V+=D.a+B;return O}function kRn(e){cge();var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D;if(e==null||(c=lB(e),A=wjn(c),A%4!=0))return null;if(O=A/4|0,O==0)return se(ds,A3,30,0,15,1);for(p=null,n=0,t=0,i=0,r=0,o=0,l=0,f=0,h=0,S=0,y=0,b=0,p=se(ds,A3,30,O*3,15,1);S>4)<<24>>24,p[y++]=((t&15)<<4|i>>2&15)<<24>>24,p[y++]=(i<<6|r)<<24>>24}return!nT(o=c[b++])||!nT(l=c[b++])?null:(n=ch[o],t=ch[l],f=c[b++],h=c[b++],ch[f]==-1||ch[h]==-1?f==61&&h==61?(t&15)!=0?null:(D=se(ds,A3,30,S*3+1,15,1),Wu(p,0,D,0,S*3),D[y]=(n<<2|t>>4)<<24>>24,D):f!=61&&h==61?(i=ch[f],(i&3)!=0?null:(D=se(ds,A3,30,S*3+2,15,1),Wu(p,0,D,0,S*3),D[y++]=(n<<2|t>>4)<<24>>24,D[y]=((t&15)<<4|i>>2&15)<<24>>24,D)):null:(i=ch[f],r=ch[h],p[y++]=(n<<2|t>>4)<<24>>24,p[y++]=((t&15)<<4|i>>2&15)<<24>>24,p[y++]=(i<<6|r)<<24>>24,p))}function jRn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be;for(n.Tg(xQe,1),A=u(C(e,(Ie(),Y1)),222),r=new P(e.b);r.a=2){for(O=!0,y=new P(c.j),t=u(_(y),12),S=null;y.a0)if(i=p.gc(),h=lc(k.Math.floor((i+1)/2))-1,r=lc(k.Math.ceil((i+1)/2))-1,n.o==Qa)for(b=r;b>=h;b--)n.a[te.p]==te&&(O=u(p.Xb(b),49),A=u(O.a,9),!rf(t,O.b)&&S>e.b.e[A.p]&&(n.a[A.p]=te,n.g[te.p]=n.g[A.p],n.a[te.p]=n.g[te.p],n.f[n.g[te.p].p]=($n(),!!(Fe(n.f[n.g[te.p].p])&te.k==(Fn(),dr))),S=e.b.e[A.p]));else for(b=h;b<=r;b++)n.a[te.p]==te&&(B=u(p.Xb(b),49),D=u(B.a,9),!rf(t,B.b)&&S0&&(r=u(Pe(D.c.a,fe-1),9),o=e.i[r.p],on=k.Math.ceil(zv(e.n,r,D)),c=be.a.e-D.d.d-(o.a.e+r.o.b+r.d.a)-on),h=Vi,fe0&&_e.a.e.e-_e.a.a-(_e.b.e.e-_e.b.a)<0,A=V.a.e.e-V.a.a-(V.b.e.e-V.b.a)<0&&_e.a.e.e-_e.a.a-(_e.b.e.e-_e.b.a)>0,S=V.a.e.e+V.b.a<_e.b.e.e+_e.a.a,y=V.a.e.e+V.b.a>_e.b.e.e+_e.a.a,te=0,!O&&!A&&(y?c+p>0?te=p:h-i>0&&(te=i):S&&(c+l>0?te=l:h-q>0&&(te=q))),be.a.e+=te,be.b&&(be.d.e+=te),!1))}function RVe(e,n,t){var i,r,c,o,l,f,h,b,p,y;if(i=new _f(n.Jf().a,n.Jf().b,n.Kf().a,n.Kf().b),r=new y4,e.c)for(o=new P(n.Pf());o.a0&&Or(S,(kn(t,n.c.length),u(n.c[t],25))),c=0,y=!0,B=Ks(Vb(cr(S))),f=B.Jc();f.Ob();){for(l=u(f.Pb(),17),y=!1,p=l,h=0;h(kn(h,n.c.length),u(n.c[h],25)).a.c.length?Or(r,(kn(h,n.c.length),u(n.c[h],25))):H0(r,i+c,(kn(h,n.c.length),u(n.c[h],25))),p=OW(p,r);t>0&&(c+=1)}if(y){for(h=0;h(kn(h,n.c.length),u(n.c[h],25)).a.c.length?Or(r,(kn(h,n.c.length),u(n.c[h],25))):H0(r,i+c,(kn(h,n.c.length),u(n.c[h],25)));t>0&&(c+=1)}for(o=!1,O=new Un(Yn(Ii(S).a.Jc(),new ee));ht(O);){for(A=u(rt(O),17),p=A,b=t+1;b(kn(h,n.c.length),u(n.c[h],25)).a.c.length?Or(D,(kn(h,n.c.length),u(n.c[h],25))):H0(D,i+1,(kn(h,n.c.length),u(n.c[h],25))));o&&(c+=1),o=!0}return c>0?c-1:0}function K0(e,n){ai();var t,i,r,c,o,l,f,h,b,p,y,S,A;if(Aj(Y7)==0){for(p=se(nzn,Me,121,Ehn.length,0,1),o=0;oh&&(i.a+=GTe(se(Wl,Eh,30,-h,15,1))),i.a+="Is",ah(f,Xo(32))>=0)for(r=0;r=i.o.b/2}else q=!p;q?(B=u(C(i,(me(),$y)),16),B?y?c=B:(r=u(C(i,Oy),16),r?B.gc()<=r.gc()?c=B:c=r:(c=new Oe,he(i,Oy,c))):(c=new Oe,he(i,$y,c))):(r=u(C(i,(me(),Oy)),16),r?p?c=r:(B=u(C(i,$y),16),B?r.gc()<=B.gc()?c=r:c=B:(c=new Oe,he(i,$y,c))):(c=new Oe,he(i,Oy,c))),c.Ec(e),he(e,(me(),tH),t),n.d==t?(Gr(n,null),t.e.c.length+t.g.c.length==0&&wu(t,null),jkn(t)):(fc(n,null),t.e.c.length+t.g.c.length==0&&wu(t,null)),qs(n.a)}function MRn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn,In,lt,Qt,Ui;for(t.Tg("MinWidth layering",1),S=n.b,_e=n.a,Ui=u(C(n,(Ie(),n4e)),15).a,l=u(C(n,t4e),15).a,e.b=ne(re(C(n,Kf))),e.d=Vi,te=new P(_e);te.aS&&(c&&(gc(fe,y),gc(on,ke(h.b-1))),Qt=t.b,Ui+=y+n,y=0,b=k.Math.max(b,t.b+t.c+lt)),Os(l,Qt),Ns(l,Ui),b=k.Math.max(b,Qt+lt+t.c),y=k.Math.max(y,p),Qt+=lt+n;if(b=k.Math.max(b,i),In=Ui+y+t.a,In0?(h=0,D&&(h+=l),h+=(cn-1)*o,V&&(h+=l),on&&V&&(h=k.Math.max(h,XNn(V,o,q,_e))),h=e.a&&(i=lLn(e,q),b=k.Math.max(b,i.b),te=k.Math.max(te,i.d),Te(l,new jc(q,i)));for(on=new Oe,h=0;h0),D.a.Xb(D.c=--D.b),cn=new Xu(e.b),y2(D,cn),at(D.b0){for(y=b<100?null:new k0(b),h=new t1e(n),A=h.g,B=se($t,ni,30,b,15,1),i=0,te=new _w(b),r=0;r=0;)if(S!=null?gi(S,A[f]):ue(S)===ue(A[f])){B.length<=i&&(D=B,B=se($t,ni,30,2*B.length,15,1),Wu(D,0,B,0,i)),B[i++]=r,Et(te,A[f]);break e}if(S=S,ue(S)===ue(l))break}}if(h=te,A=te.g,b=i,i>B.length&&(D=B,B=se($t,ni,30,i,15,1),Wu(D,0,B,0,i)),i>0){for(V=!0,c=0;c=0;)ey(e,B[o]);if(i!=b){for(r=b;--r>=i;)ey(h,r);D=B,B=se($t,ni,30,i,15,1),Wu(D,0,B,0,i)}n=h}}}else for(n=axn(e,n),r=e.i;--r>=0;)n.Gc(e.g[r])&&(ey(e,r),V=!0);if(V){if(B!=null){for(t=n.gc(),p=t==1?bE(e,4,n.Jc().Pb(),null,B[0],O):bE(e,6,n,B,B[0],O),y=t<100?null:new k0(t),r=n.Jc();r.Ob();)S=r.Pb(),y=qle(e,u(S,75),y);y?(y.lj(p),y.mj()):hi(e.e,p)}else{for(y=y2n(n.gc()),r=n.Jc();r.Ob();)S=r.Pb(),y=qle(e,u(S,75),y);y&&y.mj()}return!0}else return!1}function IRn(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V;for(t=new XJe(n),t.a||c_n(n),h=iDn(n),f=new Nw,D=new rXe,O=new P(n.a);O.a0||t.o==Qa&&r=t}function _Rn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn;for(V=e.a,te=0,be=V.length;te0?(p=u(Pe(y.c.a,o-1),9),on=zv(e.b,y,p),D=y.n.b-y.d.d-(p.n.b+p.o.b+p.d.a+on)):D=y.n.b-y.d.d,h=k.Math.min(D,h),o1&&(o=k.Math.min(o,k.Math.abs(u(Yu(l.a,1),8).b-b.b)))));else for(O=new P(n.j);O.ar&&(c=y.a-r,o=oi,i.c.length=0,r=y.a),y.a>=r&&(Gn(i.c,l),l.a.b>1&&(o=k.Math.min(o,k.Math.abs(u(Yu(l.a,l.a.b-2),8).b-y.b)))));if(i.c.length!=0&&c>n.o.a/2&&o>n.o.b/2){for(S=new Qu,wu(S,n),Ar(S,(De(),Kn)),S.n.a=n.o.a/2,B=new Qu,wu(B,n),Ar(B,bt),B.n.a=n.o.a/2,B.n.b=n.o.b,f=new P(i);f.a=h.b?fc(l,B):fc(l,S)):(h=u(Cvn(l.a),8),D=l.a.b==0?La(l.c):u(If(l.a),8),D.b>=h.b?Gr(l,B):Gr(l,S)),p=u(C(l,(Ie(),Wc)),78),p&&H2(p,h,!0);n.n.a=r-n.o.a/2}}function $Rn(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(l=St(e.b,0);l.b!=l.d.c;)if(o=u(jt(l),40),!gn(o.c,_F))for(h=aOn(o,e),n==(vr(),Zc)||n==ru?Tr(h,new S_):Tr(h,new iU),f=h.c.length,i=0;i=0?S=Y4(l):S=NO(Y4(l)),e.of(O7,S)),h=new Vr,y=!1,e.nf(vp)?(wle(h,u(e.mf(vp),8)),y=!0):Zwn(h,o.a/2,o.b/2),S.g){case 4:he(b,ku,(Xs(),V1)),he(b,rH,(tg(),L3)),b.o.b=o.b,O<0&&(b.o.a=-O),Ar(p,(De(),et)),y||(h.a=o.a),h.a-=o.a;break;case 2:he(b,ku,(Xs(),Sg)),he(b,rH,(tg(),E7)),b.o.b=o.b,O<0&&(b.o.a=-O),Ar(p,(De(),Vn)),y||(h.a=0);break;case 1:he(b,jg,(_1(),$3)),b.o.a=o.a,O<0&&(b.o.b=-O),Ar(p,(De(),bt)),y||(h.b=o.b),h.b-=o.b;break;case 3:he(b,jg,(_1(),Ty)),b.o.a=o.a,O<0&&(b.o.b=-O),Ar(p,(De(),Kn)),y||(h.b=0)}if(wle(p.n,h),he(b,vp,h),n==Dg||n==a1||n==to){if(A=0,n==Dg&&e.nf(Xd))switch(S.g){case 1:case 2:A=u(e.mf(Xd),15).a;break;case 3:case 4:A=-u(e.mf(Xd),15).a}else switch(S.g){case 4:case 2:A=c.b,n==a1&&(A/=r.b);break;case 1:case 3:A=c.a,n==a1&&(A/=r.a)}he(b,gp,A)}return he(b,Iu,S),b}function RRn(){zoe();function e(i){var r=this;this.dispatch=function(c){var o=c.data;switch(o.cmd){case"algorithms":var l=fde((En(),new Hr(new ot(Lg.b))));i.postMessage({id:o.id,data:l});break;case"categories":var f=fde((En(),new Hr(new ot(Lg.c))));i.postMessage({id:o.id,data:f});break;case"options":var h=fde((En(),new Hr(new ot(Lg.d))));i.postMessage({id:o.id,data:h});break;case"register":aPn(o.algorithms),i.postMessage({id:o.id});break;case"layout":rPn(o.graph,o.layoutOptions||{},o.options||{}),i.postMessage({id:o.id,data:o.graph});break}},this.saveDispatch=function(c){try{r.dispatch(c)}catch(o){i.postMessage({id:c.data.id,error:o})}}}function n(i){var r=this;this.dispatcher=new e({postMessage:function(c){r.onmessage({data:c})}}),this.postMessage=function(c){setTimeout(function(){r.dispatcher.saveDispatch({data:c})},0)}}if(typeof document===qZ&&typeof self!==qZ){var t=new e(self);self.onmessage=t.saveDispatch}else typeof M!==qZ&&M.exports&&(Object.defineProperty(N,"__esModule",{value:!0}),M.exports={default:n,Worker:n})}function oZ(e,n,t,i,r,c,o){var l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn,In,lt,Qt,Ui;for(O=0,Tn=0,h=new P(e.b);h.aO&&(c&&(gc(fe,S),gc(on,ke(b.b-1)),Te(e.d,A),l.c.length=0),Qt=t.b,Ui+=S+n,S=0,p=k.Math.max(p,t.b+t.c+lt)),Gn(l.c,f),FJe(f,Qt,Ui),p=k.Math.max(p,Qt+lt+t.c),S=k.Math.max(S,y),Qt+=lt+n,A=f;if(Sr(e.a,l),Te(e.d,u(Pe(l,l.c.length-1),167)),p=k.Math.max(p,i),In=Ui+S+t.a,Inr.d.d+r.d.a?b.f.d=!0:(b.f.d=!0,b.f.a=!0))),i.b!=i.d.c&&(n=t);b&&(c=u(zn(e.f,o.d.i),60),n.bc.d.d+c.d.a?b.f.d=!0:(b.f.d=!0,b.f.a=!0))}for(l=new Un(Yn(cr(S).a.Jc(),new ee));ht(l);)o=u(rt(l),17),o.a.b!=0&&(n=u(If(o.a),8),o.d.j==(De(),Kn)&&(D=new lS(n,new Se(n.a,r.d.d),r,o),D.f.a=!0,D.a=o.d,Gn(O.c,D)),o.d.j==bt&&(D=new lS(n,new Se(n.a,r.d.d+r.d.a),r,o),D.f.d=!0,D.a=o.d,Gn(O.c,D)))}return O}function GRn(e,n,t){var i,r,c,o,l,f,h,b,p,y;for(f=new Oe,p=n.length,o=d1e(t),h=0;h=A&&(q>A&&(S.c.length=0,A=q),Gn(S.c,o));S.c.length!=0&&(y=u(Pe(S,fz(n,S.c.length)),132),In.a.Ac(y)!=null,y.s=O++,mbe(y,cn,fe),S.c.length=0)}for(te=e.c.length+1,l=new P(e);l.aTn.s&&(As(t),qo(Tn.i,i),i.c>0&&(i.a=Tn,Te(Tn.t,i),i.b=_e,Te(_e.i,i)))}function GVe(e,n,t,i,r){var c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn,In;for(O=new xo(n.b),te=new xo(n.b),y=new xo(n.b),on=new xo(n.b),D=new xo(n.b),_e=St(n,0);_e.b!=_e.d.c;)for(be=u(jt(_e),12),l=new P(be.g);l.a0,B=be.g.c.length>0,h&&B?Gn(y.c,be):h?Gn(O.c,be):B&&Gn(te.c,be);for(A=new P(O);A.aq.mh()-h.b&&(y=q.mh()-h.b),S>q.nh()-h.d&&(S=q.nh()-h.d),b0){for(V=St(e.f,0);V.b!=V.d.c;)q=u(jt(V),9),q.p+=y-e.e;_0e(e),qs(e.f),Dbe(e,i,S)}else{for(Vt(e.f,S),S.p=i,e.e=k.Math.max(e.e,i),c=new Un(Yn(cr(S).a.Jc(),new ee));ht(c);)r=u(rt(c),17),!r.c.i.c&&r.c.i.k==(Fn(),Uu)&&(Vt(e.f,r.c.i),r.c.i.p=i-1);e.c=i}else _0e(e),qs(e.f),i=0,ht(new Un(Yn(cr(S).a.Jc(),new ee)))?(y=0,y=qJe(y,S),i=y+2,Dbe(e,i,S)):(Vt(e.f,S),S.p=0,e.e=k.Math.max(e.e,0),e.b=u(Pe(e.d.b,0),25),e.c=0);for(e.f.b==0||_0e(e),e.d.a.c.length=0,B=new Oe,h=new P(e.d.b);h.a=48&&n<=57){for(i=n-48;r=48&&n<=57;)if(i=i*10+n-48,i<0)throw R(new Bt(Ht((Lt(),Z2e))))}else throw R(new Bt(Ht((Lt(),DZe))));if(t=i,n==44){if(r>=e.j)throw R(new Bt(Ht((Lt(),LZe))));if((n=rc(e.i,r++))>=48&&n<=57){for(t=n-48;r=48&&n<=57;)if(t=t*10+n-48,t<0)throw R(new Bt(Ht((Lt(),Z2e))));if(i>t)throw R(new Bt(Ht((Lt(),PZe))))}else t=-1}if(n!=125)throw R(new Bt(Ht((Lt(),_Ze))));e._l(r)?(c=(ai(),ai(),new D2(9,c)),e.d=r+1):(c=(ai(),ai(),new D2(3,c)),e.d=r),c.Mm(i),c.Lm(t),fi(e)}}return c}function YRn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be;for(r=1,S=new Oe,i=0;i=u(Pe(e.b,i),25).a.c.length/4)continue}if(u(Pe(e.b,i),25).a.c.length>n){for(te=new Oe,Te(te,u(Pe(e.b,i),25)),o=0;o1)for(A=new j4((!e.a&&(e.a=new we($i,e,6,6)),e.a));A.e!=A.i.gc();)VE(A);for(o=u(K((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170),D=Qt,Qt>be+te?D=be+te:Qtfe+O?B=fe+O:Uibe-te&&Dfe-O&&BQt+lt?on=Qt+lt:beUi+_e?cn=Ui+_e:feQt-lt&&onUi-_e&&cnt&&(y=t-1),S=c0+Ds(n,24)*kN*p-p/2,S<0?S=1:S>i&&(S=i-1),r=(j0(),f=new Jk,f),wB(r,y),pB(r,S),Et((!o.a&&(o.a=new mr(yl,o,5)),o.a),r)}function fZ(e,n){KW();var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e;if(V=e.e,b=e.d,r=e.a,V==0)switch(n){case 0:return"0";case 1:return z8;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return B=new y0,B.a+="0E",B.a+=-n,B.a}if(O=b*10+1+7,D=se(Wl,Eh,30,O+1,15,1),t=O,b==1)if(c=r[0],c<0){_e=Rr(c,Dc);do p=_e,_e=FO(_e,10),D[--t]=48+Rt(lf(p,hc(_e,10)))&yr;while(ao(_e,0)!=0)}else{_e=c;do p=_e,_e=_e/10|0,D[--t]=48+(p-_e*10)&yr;while(_e!=0)}else{te=se($t,ni,30,b,15,1),fe=b,Wu(r,0,te,0,fe);e:for(;;){for(q=0,l=fe-1;l>=0;l--)be=mc(qh(q,32),Rr(te[l],Dc)),S=tMn(be),te[l]=Rt(S),q=Rt(Sw(S,32));A=Rt(q),y=t;do D[--t]=48+A%10&yr;while((A=A/10|0)!=0&&t!=0);for(i=9-y+t,o=0;o0;o++)D[--t]=48;for(f=fe-1;te[f]==0;f--)if(f==0)break e;fe=f+1}for(;D[t]==48;)++t}return h=V<0,h&&(D[--t]=45),ph(D,t,O-t)}function KVe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe;switch(e.c=n,e.g=new wt,t=(Rb(),new v0(e.c)),i=new OP(t),ode(i),V=Pt(je(e.c,(HO(),q6e))),f=u(je(e.c,cce),330),be=u(je(e.c,uce),427),o=u(je(e.c,J6e),477),te=u(je(e.c,rce),428),e.j=ne(re(je(e.c,qln))),l=e.a,f.g){case 0:l=e.a;break;case 1:l=e.b;break;case 2:l=e.i;break;case 3:l=e.e;break;case 4:l=e.f;break;default:throw R(new qn(BF+(f.f!=null?f.f:""+f.g)))}if(e.d=new N_e(l,be,o),he(e.d,(Z9(),WS),ze(je(e.c,Hln))),e.d.c=Fe(ze(je(e.c,H6e))),OR(e.c).i==0)return e.d;for(p=new st(OR(e.c));p.e!=p.i.gc();){for(b=u(ft(p),26),S=b.g/2,y=b.f/2,fe=new Se(b.i+S,b.j+y);so(e.g,fe);)m2(fe,(k.Math.random()-.5)*xh,(k.Math.random()-.5)*xh);O=u(je(b,(Xt(),z7)),140),D=new X_e(fe,new _f(fe.a-S-e.j/2-O.b,fe.b-y-e.j/2-O.d,b.g+e.j+(O.b+O.c),b.f+e.j+(O.d+O.a))),Te(e.d.i,D),ei(e.g,fe,new jc(D,b))}switch(te.g){case 0:if(V==null)e.d.d=u(Pe(e.d.i,0),68);else for(q=new P(e.d.i);q.a0?lt+1:1);for(o=new P(fe.g);o.a0?lt+1:1)}e.d[h]==0?Vt(e.f,O):e.a[h]==0&&Vt(e.g,O),++h}for(A=-1,S=1,p=new Oe,e.e=u(C(n,(me(),Ly)),234);kl>0;){for(;e.f.b!=0;)Ui=u(nV(e.f),9),e.c[Ui.p]=A--,Ybe(e,Ui),--kl;for(;e.g.b!=0;)Es=u(nV(e.g),9),e.c[Es.p]=S++,Ybe(e,Es),--kl;if(kl>0){for(y=Xr,q=new P(V);q.a=y&&(te>y&&(p.c.length=0,y=te),Gn(p.c,O)));b=e.qg(p),e.c[b.p]=S++,Ybe(e,b),--kl}}for(Qt=V.c.length+1,h=0;he.c[eu]&&(Bd(i,!0),he(n,Ny,($n(),!0)));e.a=null,e.d=null,e.c=null,qs(e.g),qs(e.f),t.Ug()}function YVe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe;for(be=u(K((!e.a&&(e.a=new we($i,e,6,6)),e.a),0),170),b=new xs,te=new wt,fe=lKe(be),Ko(te.f,be,fe),y=new wt,i=new xi,A=Uh(Rl(F(z(Xl,1),On,20,0,[(!n.d&&(n.d=new Nn(pr,n,8,5)),n.d),(!n.e&&(n.e=new Nn(pr,n,7,4)),n.e)])));ht(A);){if(S=u(rt(A),85),(!e.a&&(e.a=new we($i,e,6,6)),e.a).i!=1)throw R(new qn(FWe+(!e.a&&(e.a=new we($i,e,6,6)),e.a).i));S!=e&&(D=u(K((!S.a&&(S.a=new we($i,S,6,6)),S.a),0),170),Ki(i,D,i.c.b,i.c),O=u(bu(Xc(te.f,D)),13),O||(O=lKe(D),Ko(te.f,D,O)),p=t?Nr(new wc(u(Pe(fe,fe.c.length-1),8)),u(Pe(O,O.c.length-1),8)):Nr(new wc((kn(0,fe.c.length),u(fe.c[0],8))),(kn(0,O.c.length),u(O.c[0],8))),Ko(y.f,D,p))}if(i.b!=0)for(B=u(Pe(fe,t?fe.c.length-1:0),8),h=1;h1&&Ki(b,B,b.c.b,b.c),OY(r)));B=q}return b}function QVe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn;for(t.Tg(WQe,1),Tn=u(gs(li(new mn(null,new vn(n,16)),new A_),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),16),b=u(gs(li(new mn(null,new vn(n,16)),new FEe(n)),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[Yo]))),16),A=u(gs(li(new mn(null,new vn(n,16)),new zEe(n)),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[Yo]))),16),O=se(PH,LF,40,n.gc(),0,1),o=0;o=0&&cn=0&&!O[S]){O[S]=r,b.ed(l),--l;break}if(S=cn-y,S=0&&!O[S]){O[S]=r,b.ed(l),--l;break}}for(A.gd(new OM),f=O.length-1;f>=0;f--)!O[f]&&!A.dc()&&(O[f]=u(A.Xb(0),40),A.ed(0));for(h=0;hy&&BO((kn(y,n.c.length),u(n.c[y],186)),b),b=null;n.c.length>y&&(kn(y,n.c.length),u(n.c[y],186)).a.c.length==0;)qo(n,(kn(y,n.c.length),n.c[y]));if(!b){--o;continue}if(!Fe(ze(u(Pe(b.b,0),26).mf((Ha(),CI))))&&m_n(n,A,c,b,D,t,y,i)){O=!0;continue}if(D){if(S=A.b,p=b.f,!Fe(ze(u(Pe(b.b,0),26).mf(CI)))&&BPn(n,A,c,b,t,y,i,r)){if(O=!0,S=e.j){e.a=-1,e.c=1;return}if(n=rc(e.i,e.d++),e.a=n,e.b==1){switch(n){case 92:if(i=10,e.d>=e.j)throw R(new Bt(Ht((Lt(),XF))));e.a=rc(e.i,e.d++);break;case 45:(e.e&512)==512&&e.d=e.j||rc(e.i,e.d)!=63)break;if(++e.d>=e.j)throw R(new Bt(Ht((Lt(),Nne))));switch(n=rc(e.i,e.d++),n){case 58:i=13;break;case 61:i=14;break;case 33:i=15;break;case 91:i=19;break;case 62:i=18;break;case 60:if(e.d>=e.j)throw R(new Bt(Ht((Lt(),Nne))));if(n=rc(e.i,e.d++),n==61)i=16;else if(n==33)i=17;else throw R(new Bt(Ht((Lt(),gZe))));break;case 35:for(;e.d=e.j)throw R(new Bt(Ht((Lt(),XF))));e.a=rc(e.i,e.d++);break;default:i=0}e.c=i}function uBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D;if(t.Tg("Process compaction",1),!!Fe(ze(C(n,(Mu(),Sye))))){for(r=u(C(n,kp),86),S=ne(re(C(n,jre))),NLn(e,n,r),yRn(n,S/2/2),A=n.b,Zb(A,new DEe(r)),h=St(A,0);h.b!=h.d.c;)if(f=u(jt(h),40),!Fe(ze(C(f,(Ti(),db))))){if(i=rDn(f,r),O=Z_n(f,n),p=0,y=0,i)switch(D=i.e,r.g){case 2:p=D.a-S-f.f.a,O.e.a-S-f.f.ap&&(p=O.e.a+O.f.a+S),y=p+f.f.a;break;case 4:p=D.b-S-f.f.b,O.e.b-S-f.f.bp&&(p=O.e.b+O.f.b+S),y=p+f.f.b}else if(O)switch(r.g){case 2:p=O.e.a-S-f.f.a,y=p+f.f.a;break;case 1:p=O.e.a+O.f.a+S,y=p+f.f.a;break;case 4:p=O.e.b-S-f.f.b,y=p+f.f.b;break;case 3:p=O.e.b+O.f.b+S,y=p+f.f.b}ue(C(n,kre))===ue((IE(),jI))?(c=p,o=y,l=R1(li(new mn(null,new vn(e.a,16)),new gCe(c,o))),l.a!=null?r==(vr(),Zc)||r==ru?f.e.a=p:f.e.b=p:(r==(vr(),Zc)||r==Vl?l=R1(li(nBe(new mn(null,new vn(e.a,16))),new _Ee(c))):l=R1(li(nBe(new mn(null,new vn(e.a,16))),new LEe(c))),l.a!=null&&(r==Zc||r==ru?f.e.a=ne(re((at(l.a!=null),u(l.a,49)).a)):f.e.b=ne(re((at(l.a!=null),u(l.a,49)).a)))),l.a!=null&&(b=pu(e.a,(at(l.a!=null),l.a),0),b>0&&b!=u(C(f,Dh),15).a&&(he(f,wye,($n(),!0)),he(f,Dh,ke(b))))):r==(vr(),Zc)||r==ru?f.e.a=p:f.e.b=p}t.Ug()}}function oBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be;if(t.Tg("Coffman-Graham Layering",1),n.a.c.length==0){t.Ug();return}for(be=u(C(n,(Ie(),e4e)),15).a,f=0,o=0,y=new P(n.a);y.a=be||!jEn(B,i))&&(i=RDe(n,b)),Or(B,i),c=new Un(Yn(cr(B).a.Jc(),new ee));ht(c);)r=u(rt(c),17),!e.a[r.p]&&(O=r.c.i,--e.e[O.p],e.e[O.p]==0&&C4(k8(S,O),F8));for(h=b.c.length-1;h>=0;--h)Te(n.b,(kn(h,b.c.length),u(b.c[h],25)));n.a.c.length=0,t.Ug()}function ZVe(e){var n,t,i,r,c,o,l,f,h;for(e.b=1,fi(e),n=null,e.c==0&&e.a==94?(fi(e),n=(ai(),ai(),new cl(4)),ho(n,0,a7),l=new cl(4)):l=(ai(),ai(),new cl(4)),r=!0;(h=e.c)!=1;){if(h==0&&e.a==93&&!r){n&&(bS(n,l),l=n);break}if(t=e.a,i=!1,h==10)switch(t){case 100:case 68:case 119:case 87:case 115:case 83:tm(l,O8(t)),i=!0;break;case 105:case 73:case 99:case 67:t=(tm(l,O8(t)),-1),t<0&&(i=!0);break;case 112:case 80:if(f=Q0e(e,t),!f)throw R(new Bt(Ht((Lt(),Ine))));tm(l,f),i=!0;break;default:t=Lbe(e)}else if(h==24&&!r){if(n&&(bS(n,l),l=n),c=ZVe(e),bS(l,c),e.c!=0||e.a!=93)throw R(new Bt(Ht((Lt(),xZe))));break}if(fi(e),!i){if(h==0){if(t==91)throw R(new Bt(Ht((Lt(),Q2e))));if(t==93)throw R(new Bt(Ht((Lt(),W2e))));if(t==45&&!r&&e.a!=93)throw R(new Bt(Ht((Lt(),Dne))))}if(e.c!=0||e.a!=45||t==45&&r)ho(l,t,t);else{if(fi(e),(h=e.c)==1)throw R(new Bt(Ht((Lt(),KF))));if(h==0&&e.a==93)ho(l,t,t),ho(l,45,45);else{if(h==0&&e.a==93||h==24)throw R(new Bt(Ht((Lt(),Dne))));if(o=e.a,h==0){if(o==91)throw R(new Bt(Ht((Lt(),Q2e))));if(o==93)throw R(new Bt(Ht((Lt(),W2e))));if(o==45)throw R(new Bt(Ht((Lt(),Dne))))}else h==10&&(o=Lbe(e));if(fi(e),t>o)throw R(new Bt(Ht((Lt(),CZe))));ho(l,t,o)}}}r=!1}if(e.c==1)throw R(new Bt(Ht((Lt(),KF))));return h3(l),hS(l),e.b=0,fi(e),l}function eYe(e,n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te;te=!1;do for(te=!1,c=n?new it(e.a.b).a.gc()-2:1;n?c>=0:cu(C(D,Oi),15).a)&&(V=!1);if(V){for(f=n?c+1:c-1,l=Pae(e.a,ke(f)),o=!1,q=!0,i=!1,b=St(l,0);b.b!=b.d.c;)h=u(jt(b),9),wi(h,Oi)?h.p!=p.p&&(o=o|(n?u(C(h,Oi),15).au(C(p,Oi),15).a),q=!1):!o&&q&&h.k==(Fn(),Uu)&&(i=!0,n?y=u(rt(new Un(Yn(cr(h).a.Jc(),new ee))),17).c.i:y=u(rt(new Un(Yn(Ii(h).a.Jc(),new ee))),17).d.i,y==p&&(n?t=u(rt(new Un(Yn(Ii(h).a.Jc(),new ee))),17).d.i:t=u(rt(new Un(Yn(cr(h).a.Jc(),new ee))),17).c.i,(n?u(p2(e.a,t),15).a-u(p2(e.a,y),15).a:u(p2(e.a,y),15).a-u(p2(e.a,t),15).a)<=2&&(q=!1)));if(i&&q&&(n?t=u(rt(new Un(Yn(Ii(p).a.Jc(),new ee))),17).d.i:t=u(rt(new Un(Yn(cr(p).a.Jc(),new ee))),17).c.i,(n?u(p2(e.a,t),15).a-u(p2(e.a,p),15).a:u(p2(e.a,p),15).a-u(p2(e.a,t),15).a)<=2&&t.k==(Fn(),Wi)&&(q=!1)),o||q){for(O=LUe(e,p,n);O.a.gc()!=0;)A=u(O.a.ec().Jc().Pb(),9),O.a.Ac(A)!=null,ac(O,LUe(e,A,n));--S,te=!0}}}while(te)}function sBn(e){Ct(e.c,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#decimal"])),Ct(e.d,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#integer"])),Ct(e.e,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#boolean"])),Ct(e.f,Ut,F(z(He,1),Me,2,6,[sc,"EBoolean",ui,"EBoolean:Object"])),Ct(e.i,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#byte"])),Ct(e.g,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#hexBinary"])),Ct(e.j,Ut,F(z(He,1),Me,2,6,[sc,"EByte",ui,"EByte:Object"])),Ct(e.n,Ut,F(z(He,1),Me,2,6,[sc,"EChar",ui,"EChar:Object"])),Ct(e.t,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#double"])),Ct(e.u,Ut,F(z(He,1),Me,2,6,[sc,"EDouble",ui,"EDouble:Object"])),Ct(e.F,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#float"])),Ct(e.G,Ut,F(z(He,1),Me,2,6,[sc,"EFloat",ui,"EFloat:Object"])),Ct(e.I,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#int"])),Ct(e.J,Ut,F(z(He,1),Me,2,6,[sc,"EInt",ui,"EInt:Object"])),Ct(e.N,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#long"])),Ct(e.O,Ut,F(z(He,1),Me,2,6,[sc,"ELong",ui,"ELong:Object"])),Ct(e.Z,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#short"])),Ct(e.$,Ut,F(z(He,1),Me,2,6,[sc,"EShort",ui,"EShort:Object"])),Ct(e._,Ut,F(z(He,1),Me,2,6,[sc,"http://www.w3.org/2001/XMLSchema#string"]))}function Ie(){Ie=Y,zie=(Xt(),_fn),w4e=Lfn,gI=Pfn,Kf=$fn,G3=q9e,Cg=U9e,Om=X9e,I7=K9e,D7=V9e,Fie=cG,Tg=Qd,Jie=Rfn,kx=W9e,jH=Xy,bI=(Dge(),Hcn),Tm=Gcn,lb=qcn,Nm=Ucn,Iun=new Yr(RI,ke(0)),N7=zcn,g4e=Fcn,zy=Jcn,x4e=bun,m4e=Vcn,v4e=Wcn,Gie=cun,y4e=nun,k4e=iun,EH=mun,qie=gun,E4e=fun,j4e=sun,S4e=hun,r4e=jcn,Pie=mcn,pH=pcn,$ie=ycn,mp=_cn,yx=Lcn,_ie=Urn,X5e=Krn,$un=J7,Run=uG,Pun=zm,Lun=F7,p4e=(V4(),Hm),new Yr(Ky,p4e),f4e=new yw(12),l4e=new Yr(s1,f4e),G5e=(z1(),q7),Y1=new Yr(j9e,G5e),Am=new Yr(Ps,0),Dun=new Yr(Sce,ke(1)),sH=new Yr(B7,q8),Mg=rG,Zi=Vx,O7=t5,xun=_I,Nh=kfn,Em=W3,_un=new Yr(xce,($n(),!0)),Sm=LI,xg=wce,Ag=Ig,kH=bb,Bie=$m,H5e=(vr(),nh),wl=new Yr(Ng,H5e),pp=e5,vH=O9e,Mm=Rm,Nun=Ece,d4e=H9e,h4e=(u3(),HI),new Yr(R9e,h4e),Cun=vce,Tun=yce,Oun=kce,Mun=mce,Hie=Kcn,wH=wcn,dI=gcn,jx=Xcn,ku=scn,By=Rrn,px=$rn,C7=jrn,z5e=Ern,Nie=Mrn,hI=Srn,Iie=Lrn,c4e=Ecn,u4e=Scn,Z5e=tcn,yH=Rcn,Rie=Mcn,Lie=Qrn,s4e=Icn,U5e=Grn,Die=qrn,Oie=DI,o4e=xcn,fH=rrn,P5e=irn,lH=trn,Y5e=ecn,V5e=Zrn,Q5e=ncn,T7=n5,Wc=Z3,Ud=xfn,Ih=gce,H3=bce,F5e=Trn,Xd=jce,dx=Sfn,gH=Mfn,vp=z9e,a4e=Ofn,xm=Nfn,n4e=fcn,t4e=hcn,Cm=Uy,Aie=nrn,i4e=bcn,bH=Frn,dH=zrn,mH=z7,e4e=ccn,vx=Tcn,wI=Y9e,J5e=Brn,b4e=Bcn,q5e=Jrn,jun=Nrn,Eun=Irn,Aun=ocn,Sun=Drn,W5e=pce,mx=lcn,hH=_rn,o1=krn,Cie=mrn,aI=urn,Mie=orn,aH=vrn,bx=crn,Tie=yrn,jm=prn,wx=wrn,kun=grn,Ry=srn,gx=brn,B5e=drn,$5e=lrn,R5e=arn,K5e=Wrn}function lBn(e,n,t,i,r,c,o){var l,f,h,b,p,y,S,A;return y=u(i.a,15).a,S=u(i.b,15).a,p=e.b,A=e.c,l=0,b=0,n==(vr(),Zc)||n==ru?(b=oT(LFe(C2(So(new mn(null,new vn(t.b,16)),new N_),new MM))),p.e.b+p.f.b/2>b?(h=++S,l=ne(re(Js(S2(So(new mn(null,new vn(t.b,16)),new mCe(r,h)),new uw))))):(f=++y,l=ne(re(Js(O4(So(new mn(null,new vn(t.b,16)),new vCe(r,f)),new Dk)))))):(b=oT(LFe(C2(So(new mn(null,new vn(t.b,16)),new E_),new L6))),p.e.a+p.f.a/2>b?(h=++S,l=ne(re(Js(S2(So(new mn(null,new vn(t.b,16)),new pCe(r,h)),new CM))))):(f=++y,l=ne(re(Js(O4(So(new mn(null,new vn(t.b,16)),new wCe(r,f)),new TM)))))),n==Zc?(gc(e.a,new Se(ne(re(C(p,(Ti(),Sa))))-r,l)),gc(e.a,new Se(A.e.a+A.f.a+r+c,l)),gc(e.a,new Se(A.e.a+A.f.a+r+c,A.e.b+A.f.b/2)),gc(e.a,new Se(A.e.a+A.f.a,A.e.b+A.f.b/2))):n==ru?(gc(e.a,new Se(ne(re(C(p,(Ti(),Vf))))+r,p.e.b+p.f.b/2)),gc(e.a,new Se(p.e.a+p.f.a+r,l)),gc(e.a,new Se(A.e.a-r-c,l)),gc(e.a,new Se(A.e.a-r-c,A.e.b+A.f.b/2)),gc(e.a,new Se(A.e.a,A.e.b+A.f.b/2))):n==Vl?(gc(e.a,new Se(l,ne(re(C(p,(Ti(),Sa))))-r)),gc(e.a,new Se(l,A.e.b+A.f.b+r+c)),gc(e.a,new Se(A.e.a+A.f.a/2,A.e.b+A.f.b+r+c)),gc(e.a,new Se(A.e.a+A.f.a/2,A.e.b+A.f.b+r))):(e.a.b==0||(u(If(e.a),8).b=ne(re(C(p,(Ti(),Vf))))+r*u(o.b,15).a),gc(e.a,new Se(l,ne(re(C(p,(Ti(),Vf))))+r*u(o.b,15).a)),gc(e.a,new Se(l,A.e.b-r*u(o.a,15).a-c))),new jc(ke(y),ke(S))}function fBn(e){var n,t,i,r,c,o,l,f,h,b,p,y,S;if(o=!0,p=null,i=null,r=null,n=!1,S=$an,h=null,c=null,l=0,f=IQ(e,l,U8e,X8e),f=0&&gn(e.substr(l,2),"//")?(l+=2,f=IQ(e,l,oA,sA),i=(Qr(l,f,e.length),e.substr(l,f-l)),l=f):p!=null&&(l==e.length||(Qn(l,e.length),e.charCodeAt(l)!=47))&&(o=!1,f=rle(e,Xo(35),l),f==-1&&(f=e.length),i=(Qr(l,f,e.length),e.substr(l,f-l)),l=f);if(!t&&l0&&rc(b,b.length-1)==58&&(r=b,l=f)),lo?(Ys(e,n,t),1):(Ys(e,t,n),-1)}for(q=e.f,V=0,te=q.length;V0?Ys(e,n,t):Ys(e,t,n),i;if(!wi(n,(me(),Oi))||!wi(t,Oi))return c=cW(e,n),l=cW(e,t),c>l?(Ys(e,n,t),1):(Ys(e,t,n),-1)}if(!y&&!A&&(i=tYe(e,n,t),i!=0))return i>0?Ys(e,n,t):Ys(e,t,n),i}return wi(n,(me(),Oi))&&wi(t,Oi)?(c=Kw(n,t,e.c,u(C(e.c,sb),15).a),l=Kw(t,n,e.c,u(C(e.c,sb),15).a),c>l?(Ys(e,n,t),1):(Ys(e,t,n),-1)):(Ys(e,t,n),-1)}function nYe(){nYe=Y,lZ(),Wt=new Nw,wn(Wt,(De(),ea),ih),wn(Wt,mf,ih),wn(Wt,ks,ih),wn(Wt,na,ih),wn(Wt,es,ih),wn(Wt,js,ih),wn(Wt,na,ea),wn(Wt,ih,Yl),wn(Wt,ea,Yl),wn(Wt,mf,Yl),wn(Wt,ks,Yl),wn(Wt,Zo,Yl),wn(Wt,na,Yl),wn(Wt,es,Yl),wn(Wt,js,Yl),wn(Wt,zo,Yl),wn(Wt,ih,ml),wn(Wt,ea,ml),wn(Wt,Yl,ml),wn(Wt,mf,ml),wn(Wt,ks,ml),wn(Wt,Zo,ml),wn(Wt,na,ml),wn(Wt,zo,ml),wn(Wt,vl,ml),wn(Wt,es,ml),wn(Wt,hs,ml),wn(Wt,js,ml),wn(Wt,ea,mf),wn(Wt,ks,mf),wn(Wt,na,mf),wn(Wt,js,mf),wn(Wt,ea,ks),wn(Wt,mf,ks),wn(Wt,na,ks),wn(Wt,ks,ks),wn(Wt,es,ks),wn(Wt,ih,Ql),wn(Wt,ea,Ql),wn(Wt,Yl,Ql),wn(Wt,ml,Ql),wn(Wt,mf,Ql),wn(Wt,ks,Ql),wn(Wt,Zo,Ql),wn(Wt,na,Ql),wn(Wt,vl,Ql),wn(Wt,zo,Ql),wn(Wt,js,Ql),wn(Wt,es,Ql),wn(Wt,mo,Ql),wn(Wt,ih,vl),wn(Wt,ea,vl),wn(Wt,Yl,vl),wn(Wt,mf,vl),wn(Wt,ks,vl),wn(Wt,Zo,vl),wn(Wt,na,vl),wn(Wt,zo,vl),wn(Wt,js,vl),wn(Wt,hs,vl),wn(Wt,mo,vl),wn(Wt,ea,zo),wn(Wt,mf,zo),wn(Wt,ks,zo),wn(Wt,na,zo),wn(Wt,vl,zo),wn(Wt,js,zo),wn(Wt,es,zo),wn(Wt,ih,Wo),wn(Wt,ea,Wo),wn(Wt,Yl,Wo),wn(Wt,mf,Wo),wn(Wt,ks,Wo),wn(Wt,Zo,Wo),wn(Wt,na,Wo),wn(Wt,zo,Wo),wn(Wt,js,Wo),wn(Wt,ea,es),wn(Wt,Yl,es),wn(Wt,ml,es),wn(Wt,ks,es),wn(Wt,ih,hs),wn(Wt,ea,hs),wn(Wt,ml,hs),wn(Wt,mf,hs),wn(Wt,ks,hs),wn(Wt,Zo,hs),wn(Wt,na,hs),wn(Wt,na,mo),wn(Wt,ks,mo),wn(Wt,zo,ih),wn(Wt,zo,mf),wn(Wt,zo,Yl),wn(Wt,Zo,ih),wn(Wt,Zo,ea),wn(Wt,Zo,ml)}function aBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe;switch(t.Tg("Brandes & Koepf node placement",1),e.a=n,e.c=G_n(n),i=u(C(n,(Ie(),Rie)),282),S=Fe(ze(C(n,vx))),e.d=i==(JO(),WJ)&&!S||i==lie,$Pn(e,n),be=null,fe=null,B=null,q=null,D=(sl(4,rm),new xo(4)),u(C(n,Rie),282).g){case 3:B=new b3(n,e.c.d,(Da(),Og),(dh(),Kd)),Gn(D.c,B);break;case 1:q=new b3(n,e.c.d,(Da(),Qa),(dh(),Kd)),Gn(D.c,q);break;case 4:be=new b3(n,e.c.d,(Da(),Og),(dh(),yp)),Gn(D.c,be);break;case 2:fe=new b3(n,e.c.d,(Da(),Qa),(dh(),yp)),Gn(D.c,fe);break;default:B=new b3(n,e.c.d,(Da(),Og),(dh(),Kd)),q=new b3(n,e.c.d,Qa,Kd),be=new b3(n,e.c.d,Og,yp),fe=new b3(n,e.c.d,Qa,yp),Gn(D.c,be),Gn(D.c,fe),Gn(D.c,B),Gn(D.c,q)}for(r=new fCe(n,e.c),l=new P(D);l.aAW(c))&&(p=c);for(!p&&(p=(kn(0,D.c.length),u(D.c[0],185))),O=new P(n.b);O.a0?(Ys(e,t,n),1):(Ys(e,n,t),-1);if(b&&V)return Ys(e,t,n),1;if(p&&q)return Ys(e,n,t),-1;if(p&&V)return 0}else for(cn=new P(h.j);cn.ap&&(In=0,lt+=b+_e,b=0),KXe(be,o,In,lt),n=k.Math.max(n,In+fe.a),b=k.Math.max(b,fe.b),In+=fe.a+_e;for(te=new wt,t=new wt,cn=new P(e);cn.a=-1900?1:0,t>=4?Kt(e,F(z(He,1),Me,2,6,[vYe,yYe])[l]):Kt(e,F(z(He,1),Me,2,6,["BC","AD"])[l]);break;case 121:WEn(e,t,i);break;case 77:XDn(e,t,i);break;case 107:f=r.q.getHours(),f==0?Vh(e,24,t):Vh(e,f,t);break;case 83:lNn(e,t,r);break;case 69:b=i.q.getDay(),t==5?Kt(e,F(z(He,1),Me,2,6,["S","M","T","W","T","F","S"])[b]):t==4?Kt(e,F(z(He,1),Me,2,6,[OZ,NZ,IZ,DZ,_Z,LZ,PZ])[b]):Kt(e,F(z(He,1),Me,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[b]);break;case 97:r.q.getHours()>=12&&r.q.getHours()<24?Kt(e,F(z(He,1),Me,2,6,["AM","PM"])[1]):Kt(e,F(z(He,1),Me,2,6,["AM","PM"])[0]);break;case 104:p=r.q.getHours()%12,p==0?Vh(e,12,t):Vh(e,p,t);break;case 75:y=r.q.getHours()%12,Vh(e,y,t);break;case 72:S=r.q.getHours(),Vh(e,S,t);break;case 99:A=i.q.getDay(),t==5?Kt(e,F(z(He,1),Me,2,6,["S","M","T","W","T","F","S"])[A]):t==4?Kt(e,F(z(He,1),Me,2,6,[OZ,NZ,IZ,DZ,_Z,LZ,PZ])[A]):t==3?Kt(e,F(z(He,1),Me,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[A]):Vh(e,A,1);break;case 76:O=i.q.getMonth(),t==5?Kt(e,F(z(He,1),Me,2,6,["J","F","M","A","M","J","J","A","S","O","N","D"])[O]):t==4?Kt(e,F(z(He,1),Me,2,6,[vZ,yZ,kZ,jZ,ay,EZ,SZ,xZ,AZ,MZ,CZ,TZ])[O]):t==3?Kt(e,F(z(He,1),Me,2,6,["Jan","Feb","Mar","Apr",ay,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"])[O]):Vh(e,O+1,t);break;case 81:D=i.q.getMonth()/3|0,t<4?Kt(e,F(z(He,1),Me,2,6,["Q1","Q2","Q3","Q4"])[D]):Kt(e,F(z(He,1),Me,2,6,["1st quarter","2nd quarter","3rd quarter","4th quarter"])[D]);break;case 100:B=i.q.getDate(),Vh(e,B,t);break;case 109:h=r.q.getMinutes(),Vh(e,h,t);break;case 115:o=r.q.getSeconds(),Vh(e,o,t);break;case 122:t<4?Kt(e,c.c[0]):Kt(e,c.c[1]);break;case 118:Kt(e,c.b);break;case 90:t<3?Kt(e,hTn(c)):t==3?Kt(e,wTn(c)):Kt(e,pTn(c.a));break;default:return!1}return!0}function Ige(e,n,t,i){var r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn,In,lt,Qt;if(PXe(n),f=u(K((!n.b&&(n.b=new Nn(mt,n,4,7)),n.b),0),84),b=u(K((!n.c&&(n.c=new Nn(mt,n,5,8)),n.c),0),84),l=iu(f),h=iu(b),o=(!n.a&&(n.a=new we($i,n,6,6)),n.a).i==0?null:u(K((!n.a&&(n.a=new we($i,n,6,6)),n.a),0),170),_e=u(zn(e.a,l),9),In=u(zn(e.a,h),9),on=null,lt=null,X(f,193)&&(fe=u(zn(e.a,f),246),X(fe,12)?on=u(fe,12):X(fe,9)&&(_e=u(fe,9),on=u(Pe(_e.j,0),12))),X(b,193)&&(Tn=u(zn(e.a,b),246),X(Tn,12)?lt=u(Tn,12):X(Tn,9)&&(In=u(Tn,9),lt=u(Pe(In.j,0),12))),!_e||!In)throw R(new a4("The source or the target of edge "+n+" could not be found. This usually happens when an edge connects a node laid out by ELK Layered to a node in another level of hierarchy laid out by either another instance of ELK Layered or another layout algorithm alltogether. The former can be solved by setting the hierarchyHandling option to INCLUDE_CHILDREN."));for(O=new Ow,Pu(O,n),he(O,(me(),mi),n),he(O,(Ie(),Wc),null),S=u(C(i,po),22),_e==In&&S.Ec((Ic(),ox)),on||(be=(Nc(),Io),cn=null,o&&$v(u(C(_e,Zi),102))&&(cn=new Se(o.j,o.k),aPe(cn,T2(n)),RPe(cn,t),P2(h,l)&&(be=ys,pi(cn,_e.n))),on=BKe(_e,cn,be,i)),lt||(be=(Nc(),ys),Qt=null,o&&$v(u(C(In,Zi),102))&&(Qt=new Se(o.b,o.c),aPe(Qt,T2(n)),RPe(Qt,t)),lt=BKe(In,Qt,be,_r(In))),fc(O,on),Gr(O,lt),(on.e.c.length>1||on.g.c.length>1||lt.e.c.length>1||lt.g.c.length>1)&&S.Ec((Ic(),ux)),y=new st((!n.n&&(n.n=new we(Eu,n,1,7)),n.n));y.e!=y.i.gc();)if(p=u(ft(y),157),!Fe(ze(je(p,Mg)))&&p.a)switch(D=aQ(p),Te(O.b,D),u(C(D,Ih),279).g){case 1:case 2:S.Ec((Ic(),x7));break;case 0:S.Ec((Ic(),S7)),he(D,Ih,(Ra(),H7))}if(c=u(C(i,px),301),B=u(C(i,yH),328),r=c==(zE(),tI)||B==(GE(),Zie),o&&(!o.a&&(o.a=new mr(yl,o,5)),o.a).i!=0&&r){for(q=hCn(o),A=new xs,te=St(q,0);te.b!=te.d.c;)V=u(jt(te),8),Vt(A,new wc(V));he(O,K3e,A)}return O}function gBn(e,n,t,i){var r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn,In,lt,Qt,Ui;for(cn=0,Tn=0,_e=new wt,be=u(Js(S2(So(new mn(null,new vn(e.b,16)),new j_),new Ik)),15).a+1,on=se($t,ni,30,be,15,1),D=se($t,ni,30,be,15,1),O=0;O1)for(l=lt+1;lh.b.e.b*(1-B)+h.c.e.b*B));A++);if(fe.gc()>0&&(Qt=h.a.b==0?pc(h.b.e):u(If(h.a),8),V=pi(pc(u(fe.Xb(fe.gc()-1),40).e),u(fe.Xb(fe.gc()-1),40).f),y=pi(pc(u(fe.Xb(0),40).e),u(fe.Xb(0),40).f),A>=fe.gc()-1&&Qt.b>V.b&&h.c.e.b>V.b||A<=0&&Qt.bh.b.e.a*(1-B)+h.c.e.a*B));A++);if(fe.gc()>0&&(Qt=h.a.b==0?pc(h.b.e):u(If(h.a),8),V=pi(pc(u(fe.Xb(fe.gc()-1),40).e),u(fe.Xb(fe.gc()-1),40).f),y=pi(pc(u(fe.Xb(0),40).e),u(fe.Xb(0),40).f),A>=fe.gc()-1&&Qt.a>V.a&&h.c.e.a>V.a||A<=0&&Qt.a=ne(re(C(e,(Ti(),vye))))&&++Tn):(S.f&&S.d.e.a<=ne(re(C(e,(Ti(),pre))))&&++cn,S.g&&S.c.e.a+S.c.f.a>=ne(re(C(e,(Ti(),mye))))&&++Tn)}else te==0?K0e(h):te<0&&(++on[lt],++D[Ui],In=lBn(h,n,e,new jc(ke(cn),ke(Tn)),t,i,new jc(ke(D[Ui]),ke(on[lt]))),cn=u(In.a,15).a,Tn=u(In.b,15).a)}function wBn(e){e.gb||(e.gb=!0,e.b=Au(e,0),Yi(e.b,18),_i(e.b,19),e.a=Au(e,1),Yi(e.a,1),_i(e.a,2),_i(e.a,3),_i(e.a,4),_i(e.a,5),e.o=Au(e,2),Yi(e.o,8),Yi(e.o,9),_i(e.o,10),_i(e.o,11),_i(e.o,12),_i(e.o,13),_i(e.o,14),_i(e.o,15),_i(e.o,16),_i(e.o,17),_i(e.o,18),_i(e.o,19),_i(e.o,20),_i(e.o,21),_i(e.o,22),_i(e.o,23),Yc(e.o),Yc(e.o),Yc(e.o),Yc(e.o),Yc(e.o),Yc(e.o),Yc(e.o),Yc(e.o),Yc(e.o),Yc(e.o),e.p=Au(e,3),Yi(e.p,2),Yi(e.p,3),Yi(e.p,4),Yi(e.p,5),_i(e.p,6),_i(e.p,7),Yc(e.p),Yc(e.p),e.q=Au(e,4),Yi(e.q,8),e.v=Au(e,5),_i(e.v,9),Yc(e.v),Yc(e.v),Yc(e.v),e.w=Au(e,6),Yi(e.w,2),Yi(e.w,3),Yi(e.w,4),_i(e.w,5),e.B=Au(e,7),_i(e.B,1),Yc(e.B),Yc(e.B),Yc(e.B),e.Q=Au(e,8),_i(e.Q,0),Yc(e.Q),e.R=Au(e,9),Yi(e.R,1),e.S=Au(e,10),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),Yc(e.S),e.T=Au(e,11),_i(e.T,10),_i(e.T,11),_i(e.T,12),_i(e.T,13),_i(e.T,14),Yc(e.T),Yc(e.T),e.U=Au(e,12),Yi(e.U,2),Yi(e.U,3),_i(e.U,4),_i(e.U,5),_i(e.U,6),_i(e.U,7),Yc(e.U),e.V=Au(e,13),_i(e.V,10),e.W=Au(e,14),Yi(e.W,18),Yi(e.W,19),Yi(e.W,20),_i(e.W,21),_i(e.W,22),_i(e.W,23),e.bb=Au(e,15),Yi(e.bb,10),Yi(e.bb,11),Yi(e.bb,12),Yi(e.bb,13),Yi(e.bb,14),Yi(e.bb,15),Yi(e.bb,16),_i(e.bb,17),Yc(e.bb),Yc(e.bb),e.eb=Au(e,16),Yi(e.eb,2),Yi(e.eb,3),Yi(e.eb,4),Yi(e.eb,5),Yi(e.eb,6),Yi(e.eb,7),_i(e.eb,8),_i(e.eb,9),e.ab=Au(e,17),Yi(e.ab,0),Yi(e.ab,1),e.H=Au(e,18),_i(e.H,0),_i(e.H,1),_i(e.H,2),_i(e.H,3),_i(e.H,4),_i(e.H,5),Yc(e.H),e.db=Au(e,19),_i(e.db,2),e.c=ci(e,20),e.d=ci(e,21),e.e=ci(e,22),e.f=ci(e,23),e.i=ci(e,24),e.g=ci(e,25),e.j=ci(e,26),e.k=ci(e,27),e.n=ci(e,28),e.r=ci(e,29),e.s=ci(e,30),e.t=ci(e,31),e.u=ci(e,32),e.fb=ci(e,33),e.A=ci(e,34),e.C=ci(e,35),e.D=ci(e,36),e.F=ci(e,37),e.G=ci(e,38),e.I=ci(e,39),e.J=ci(e,40),e.L=ci(e,41),e.M=ci(e,42),e.N=ci(e,43),e.O=ci(e,44),e.P=ci(e,45),e.X=ci(e,46),e.Y=ci(e,47),e.Z=ci(e,48),e.$=ci(e,49),e._=ci(e,50),e.cb=ci(e,51),e.K=ci(e,52))}function pBn(e,n,t,i){var r,c,o,l,f,h,b,p,y,S,A;for(p=St(e.b,0);p.b!=p.d.c;)if(b=u(jt(p),40),!gn(b.c,_F))for(c=u(gs(new mn(null,new vn(OTn(b,e),16)),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),16),n==(vr(),Zc)||n==ru?c.gd(new C_):c.gd(new T_),A=c.gc(),r=0;r0&&(l=u(If(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(If(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(f-S)/(k.Math.abs(l-y)/40)>50&&(S>f?gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a+i/5.3,b.e.b+b.f.b*o-i/2)):gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a+i/5.3,b.e.b+b.f.b*o+i/2)))),gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a,b.e.b+b.f.b*o))):n==ru?(h=ne(re(C(b,(Ti(),Sa)))),b.e.a-i>h?gc(u(c.Xb(r),65).a,new Se(h-t,b.e.b+b.f.b*o)):u(c.Xb(r),65).a.b>0&&(l=u(If(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(If(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(f-S)/(k.Math.abs(l-y)/40)>50&&(S>f?gc(u(c.Xb(r),65).a,new Se(b.e.a-i/5.3,b.e.b+b.f.b*o-i/2)):gc(u(c.Xb(r),65).a,new Se(b.e.a-i/5.3,b.e.b+b.f.b*o+i/2)))),gc(u(c.Xb(r),65).a,new Se(b.e.a,b.e.b+b.f.b*o))):n==Vl?(h=ne(re(C(b,(Ti(),Vf)))),b.e.b+b.f.b+i0&&(l=u(If(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(If(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(l-y)/(k.Math.abs(f-S)/40)>50&&(y>l?gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o-i/2,b.e.b+i/5.3+b.f.b)):gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o+i/2,b.e.b+i/5.3+b.f.b)))),gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o,b.e.b+b.f.b))):(h=ne(re(C(b,(Ti(),Sa)))),zze(u(c.Xb(r),65),e)?gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o,u(If(u(c.Xb(r),65).a),8).b)):b.e.b-i>h?gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o,h-t)):u(c.Xb(r),65).a.b>0&&(l=u(If(u(c.Xb(r),65).a),8).a,y=b.e.a+b.f.a/2,f=u(If(u(c.Xb(r),65).a),8).b,S=b.e.b+b.f.b/2,i>0&&k.Math.abs(l-y)/(k.Math.abs(f-S)/40)>50&&(y>l?gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o-i/2,b.e.b-i/5.3)):gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o+i/2,b.e.b-i/5.3)))),gc(u(c.Xb(r),65).a,new Se(b.e.a+b.f.a*o,b.e.b)))}function rYe(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe;if(o=n,y=t,so(e.a,o)){if(rf(u(zn(e.a,o),47),y))return 1}else ei(e.a,o,new ar);if(so(e.a,y)){if(rf(u(zn(e.a,y),47),o))return-1}else ei(e.a,y,new ar);if(so(e.e,o)){if(rf(u(zn(e.e,o),47),y))return-1}else ei(e.e,o,new ar);if(so(e.e,y)){if(rf(u(zn(e.a,y),47),o))return 1}else ei(e.e,y,new ar);if(o.j!=y.j)return be=uwn(o.j,y.j),be>0?Hl(e,o,y,1):Hl(e,y,o,1),be;if(fe=1,o.e.c.length!=0&&y.e.c.length!=0){if((o.j==(De(),Vn)&&y.j==Vn||o.j==Kn&&y.j==Kn||o.j==bt&&y.j==bt)&&(fe=-fe),b=u(Pe(o.e,0),17).c,D=u(Pe(y.e,0),17).c,f=b.i,A=D.i,f==A)for(V=new P(f.j);V.a0?(Hl(e,o,y,fe),fe):(Hl(e,y,o,fe),-fe);if(i=jFe(u(gs(vV(e.d),Cs(new zi,new bi,new Cc,F(z(Qo,1),Ee,130,0,[(zl(),Yo)]))),20),f,A),i!=0)return i>0?(Hl(e,o,y,fe),fe):(Hl(e,y,o,fe),-fe);if(e.c&&(be=WJe(e,o,y),be!=0))return be>0?(Hl(e,o,y,fe),fe):(Hl(e,y,o,fe),-fe)}return o.g.c.length!=0&&y.g.c.length!=0?((o.j==(De(),Vn)&&y.j==Vn||o.j==bt&&y.j==bt)&&(fe=-fe),p=u(C(o,(me(),vie)),9),B=u(C(y,vie),9),e.f==(F1(),tre)&&p&&B&&wi(p,Oi)&&wi(B,Oi)?(l=Kw(p,B,e.b,u(C(e.b,sb),15).a),S=Kw(B,p,e.b,u(C(e.b,sb),15).a),l>S?(Hl(e,o,y,fe),fe):(Hl(e,y,o,fe),-fe)):e.c&&(be=WJe(e,o,y),be!=0)?be>0?(Hl(e,o,y,fe),fe):(Hl(e,y,o,fe),-fe):(h=0,O=0,wi(u(Pe(o.g,0),17),Oi)&&(h=Kw(u(Pe(o.g,0),246),u(Pe(y.g,0),246),e.b,o.g.c.length+o.e.c.length)),wi(u(Pe(y.g,0),17),Oi)&&(O=Kw(u(Pe(y.g,0),246),u(Pe(o.g,0),246),e.b,y.g.c.length+y.e.c.length)),p&&p==B||e.g&&(e.g._b(p)&&(h=u(e.g.xc(p),15).a),e.g._b(B)&&(O=u(e.g.xc(B),15).a)),h>O?(Hl(e,o,y,fe),fe):(Hl(e,y,o,fe),-fe))):o.e.c.length!=0&&y.g.c.length!=0?(Hl(e,o,y,fe),1):o.g.c.length!=0&&y.e.c.length!=0?(Hl(e,y,o,fe),-1):wi(o,(me(),Oi))&&wi(y,Oi)?(c=o.i.j.c.length,l=Kw(o,y,e.b,c),S=Kw(y,o,e.b,c),(o.j==(De(),Vn)&&y.j==Vn||o.j==bt&&y.j==bt)&&(fe=-fe),l>S?(Hl(e,o,y,fe),fe):(Hl(e,y,o,fe),-fe)):(Hl(e,y,o,fe),-fe)}function me(){me=Y;var e,n;mi=new ki(owe),G3e=new ki("coordinateOrigin"),kie=new ki("processors"),H3e=new Pi("compoundNode",($n(),!1)),sI=new Pi("insideConnections",!1),K3e=new ki("originalBendpoints"),V3e=new ki("originalDummyNodePosition"),Y3e=new ki("originalLabelEdge"),lx=new ki("representedLabels"),sx=new ki("endLabels"),Iy=new ki("endLabel.origin"),_y=new Pi("labelSide",(fl(),JI)),R3=new Pi("maxEdgeThickness",0),qd=new Pi("reversed",!1),Ly=new ki(iQe),Ea=new Pi("longEdgeSource",null),gf=new Pi("longEdgeTarget",null),km=new Pi("longEdgeHasLabelDummies",!1),lI=new Pi("longEdgeBeforeLabelDummy",!1),rH=new Pi("edgeConstraint",(tg(),iie)),bp=new ki("inLayerLayoutUnit"),jg=new Pi("inLayerConstraint",(_1(),uI)),Dy=new Pi("inLayerSuccessorConstraint",new Oe),X3e=new Pi("inLayerSuccessorConstraintBetweenNonDummies",!1),vs=new ki("portDummy"),iH=new Pi("crossingHint",ke(0)),po=new Pi("graphProperties",(n=u(la(fie),10),new _l(n,u(Df(n,n.length),10),0))),Iu=new Pi("externalPortSide",(De(),ju)),U3e=new Pi("externalPortSize",new Vr),wie=new ki("externalPortReplacedDummies"),cH=new ki("externalPortReplacedDummy"),K1=new Pi("externalPortConnections",(e=u(la(xc),10),new _l(e,u(Df(e,e.length),10),0))),gp=new Pi(WYe,0),J3e=new ki("barycenterAssociates"),$y=new ki("TopSideComments"),Oy=new ki("BottomSideComments"),tH=new ki("CommentConnectionPort"),mie=new Pi("inputCollect",!1),yie=new Pi("outputCollect",!1),Ny=new Pi("cyclic",!1),q3e=new ki("crossHierarchyMap"),Eie=new ki("targetOffset"),new Pi("splineLabelSize",new Vr),z3=new ki("spacings"),uH=new Pi("partitionConstraint",!1),dp=new ki("breakingPoint.info"),Z3e=new ki("splines.survivingEdge"),Eg=new ki("splines.route.start"),F3=new ki("splines.edgeChain"),W3e=new ki("originalPortConstraints"),wp=new ki("selfLoopHolder"),M7=new ki("splines.nsPortY"),Oi=new ki("modelOrder"),sb=new ki("modelOrder.maximum"),oI=new ki("modelOrderGroups.cb.number"),vie=new ki("longEdgeTargetNode"),ob=new Pi(TQe,!1),B3=new Pi(TQe,!1),pie=new ki("layerConstraints.hiddenNodes"),Q3e=new ki("layerConstraints.opposidePort"),jie=new ki("targetNode.modelOrder"),Py=new Pi("tarjan.lowlink",ke(oi)),fx=new Pi("tarjan.id",ke(-1)),oH=new Pi("tarjan.onstack",!1),Win=new Pi("partOfCycle",!1),J3=new ki("medianHeuristic.weight")}function Xt(){Xt=Y;var e,n;qy=new ki(mWe),Bm=new ki(vWe),p9e=(Yh(),lce),kfn=new fn(ppe,p9e),B7=new fn(U8,null),jfn=new ki(N2e),v9e=(sg(),Ci(hce,F(z(dce,1),Ee,299,0,[ace]))),DI=new fn(OF,v9e),_I=new fn(PN,($n(),!1)),y9e=(vr(),nh),Ng=new fn(Jee,y9e),E9e=(z1(),Ace),j9e=new fn(LN,E9e),Afn=new fn(T2e,!1),x9e=(B1(),lG),W3=new fn(TF,x9e),P9e=new yw(12),s1=new fn(sm,P9e),PI=new fn(ES,!1),pce=new fn(IF,!1),$I=new fn(SS,!1),F9e=(Br(),pb),Vx=new fn(ZZ,F9e),Uy=new ki(NF),RI=new ki(xN),Sce=new ki(fF),xce=new ki(jS),C9e=new xs,Z3=new fn(Cpe,C9e),Sfn=new fn(Ipe,!1),Mfn=new fn(Dpe,!1),new fn(yWe,0),T9e=new pj,z7=new fn(Lpe,T9e),rG=new fn(gpe,!1),Dfn=new fn(kWe,1),Pm=new ki(jWe),Lm=new ki(EWe),J7=new fn(AN,!1),new fn(SWe,!0),ke(0),new fn(xWe,ke(100)),new fn(AWe,!1),ke(0),new fn(MWe,ke(4e3)),ke(0),new fn(CWe,ke(400)),new fn(TWe,!1),new fn(OWe,!1),new fn(NWe,!0),new fn(IWe,!1),m9e=(YB(),Ice),Efn=new fn(O2e,m9e),M9e=(EE(),qI),Tfn=new fn(DWe,M9e),A9e=(s8(),BI),Cfn=new fn(_We,A9e),_fn=new fn(ipe,10),Lfn=new fn(rpe,10),Pfn=new fn(cpe,20),$fn=new fn(upe,10),q9e=new fn(WZ,2),U9e=new fn(Fee,10),X9e=new fn(ope,0),cG=new fn(fpe,5),K9e=new fn(spe,1),V9e=new fn(lpe,1),Qd=new fn(om,20),Rfn=new fn(ape,10),W9e=new fn(hpe,10),Xy=new ki(dpe),Q9e=new mTe,Y9e=new fn(Ppe,Q9e),Nfn=new ki(Gee),$9e=!1,Ofn=new fn(Hee,$9e),N9e=new yw(5),O9e=new fn(ype,N9e),I9e=(Q2(),n=u(la($c),10),new _l(n,u(Df(n,n.length),10),0)),e5=new fn(K8,I9e),B9e=(u3(),wb),R9e=new fn(Epe,B9e),vce=new ki(Spe),yce=new ki(xpe),kce=new ki(Ape),mce=new ki(Mpe),D9e=(e=u(la(iA),10),new _l(e,u(Df(e,e.length),10),0)),Ig=new fn(k3,D9e),L9e=rn((_s(),X7)),bb=new fn(py,L9e),_9e=new Se(0,0),n5=new fn(my,_9e),$m=new fn(X8,!1),k9e=(Ra(),H7),gce=new fn(Ope,k9e),bce=new fn(aF,!1),ke(1),new fn(LWe,null),z9e=new ki(_pe),jce=new ki(Npe),G9e=(De(),ju),t5=new fn(wpe,G9e),Ps=new ki(bpe),J9e=(ps(),rn(mb)),Rm=new fn(V8,J9e),Ece=new fn(kpe,!1),H9e=new fn(jpe,!0),ke(1),Hfn=new fn(dne,ke(3)),ke(1),qfn=new fn(I2e,ke(4)),uG=new fn(MN,1),oG=new fn(bne,null),zm=new fn(CN,150),F7=new fn(TN,1.414),Ky=new fn(np,null),Bfn=new fn(D2e,1),LI=new fn(mpe,!1),wce=new fn(vpe,!1),xfn=new fn(Tpe,1),S9e=(Sz(),Cce),new fn(PWe,S9e),Ifn=!0,Gfn=(KR(),Nce),Ffn=(V4(),Hm),Jfn=Hm,zfn=Hm}function Ur(){Ur=Y,Bve=new br("DIRECTION_PREPROCESSOR",0),Pve=new br("COMMENT_PREPROCESSOR",1),N3=new br("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",2),_te=new br("INTERACTIVE_EXTERNAL_PORT_POSITIONER",3),r3e=new br("PARTITION_PREPROCESSOR",4),OJ=new br("LABEL_DUMMY_INSERTER",5),zJ=new br("SELF_LOOP_PREPROCESSOR",6),pm=new br("LAYER_CONSTRAINT_PREPROCESSOR",7),t3e=new br("PARTITION_MIDPROCESSOR",8),Xve=new br("HIGH_DEGREE_NODE_LAYER_PROCESSOR",9),e3e=new br("NODE_PROMOTION",10),wm=new br("LAYER_CONSTRAINT_POSTPROCESSOR",11),i3e=new br("PARTITION_POSTPROCESSOR",12),Gve=new br("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",13),c3e=new br("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",14),Ove=new br("BREAKING_POINT_INSERTER",15),_J=new br("LONG_EDGE_SPLITTER",16),Lte=new br("PORT_SIDE_PROCESSOR",17),CJ=new br("INVERTED_PORT_PROCESSOR",18),$J=new br("PORT_LIST_SORTER",19),o3e=new br("SORT_BY_INPUT_ORDER_OF_MODEL",20),PJ=new br("NORTH_SOUTH_PORT_PREPROCESSOR",21),Nve=new br("BREAKING_POINT_PROCESSOR",22),n3e=new br(kQe,23),s3e=new br(jQe,24),RJ=new br("SELF_LOOP_PORT_RESTORER",25),Tve=new br("ALTERNATING_LAYER_UNZIPPER",26),u3e=new br("SINGLE_EDGE_GRAPH_WRAPPER",27),TJ=new br("IN_LAYER_CONSTRAINT_PROCESSOR",28),Fve=new br("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",29),Wve=new br("LABEL_AND_NODE_SIZE_PROCESSOR",30),Qve=new br("INNERMOST_NODE_MARGIN_CALCULATOR",31),FJ=new br("SELF_LOOP_ROUTER",32),_ve=new br("COMMENT_NODE_MARGIN_CALCULATOR",33),MJ=new br("END_LABEL_PREPROCESSOR",34),IJ=new br("LABEL_DUMMY_SWITCHER",35),Dve=new br("CENTER_LABEL_MANAGEMENT_PROCESSOR",36),p7=new br("LABEL_SIDE_SELECTOR",37),Vve=new br("HYPEREDGE_DUMMY_MERGER",38),qve=new br("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",39),Zve=new br("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",40),tx=new br("HIERARCHICAL_PORT_POSITION_PROCESSOR",41),$ve=new br("CONSTRAINTS_POSTPROCESSOR",42),Lve=new br("COMMENT_POSTPROCESSOR",43),Yve=new br("HYPERNODE_PROCESSOR",44),Uve=new br("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",45),DJ=new br("LONG_EDGE_JOINER",46),BJ=new br("SELF_LOOP_POSTPROCESSOR",47),Ive=new br("BREAKING_POINT_REMOVER",48),LJ=new br("NORTH_SOUTH_PORT_POSTPROCESSOR",49),Kve=new br("HORIZONTAL_COMPACTOR",50),NJ=new br("LABEL_DUMMY_REMOVER",51),Jve=new br("FINAL_SPLINE_BENDPOINTS_CALCULATOR",52),zve=new br("END_LABEL_SORTER",53),Cy=new br("REVERSED_EDGE_RESTORER",54),AJ=new br("END_LABEL_POSTPROCESSOR",55),Hve=new br("HIERARCHICAL_NODE_RESIZER",56),Rve=new br("DIRECTION_POSTPROCESSOR",57)}function mBn(e,n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn,In,lt,Qt,Ui,Es,eu,kl,s5,c0,ta,nd,Zl,n6,wA,td,Ca,u0,$g,Rg,t6,Bg,zg,id,Qm,M7e,Mp,pA,Vce,i6,mA,Wm,vA,Yce,_hn;for(M7e=0,Qt=n,eu=0,c0=Qt.length;eu0&&(e.a[Ca.p]=M7e++)}for(mA=0,Ui=t,kl=0,ta=Ui.length;kl0;){for(Ca=(at(t6.b>0),u(t6.a.Xb(t6.c=--t6.b),12)),Rg=0,l=new P(Ca.e);l.a0&&(Ca.j==(De(),Kn)?(e.a[Ca.p]=mA,++mA):(e.a[Ca.p]=mA+nd+n6,++n6))}mA+=n6}for($g=new wt,A=new Fh,lt=n,Es=0,s5=lt.length;Esh.b&&(h.b=Bg)):Ca.i.c==Qm&&(Bgh.c&&(h.c=Bg));for(G9(O,0,O.length,null),i6=se($t,ni,30,O.length,15,1),i=se($t,ni,30,mA+1,15,1),B=0;B0;)_e%2>0&&(r+=Yce[_e+1]),_e=(_e-1)/2|0,++Yce[_e];for(cn=se(jon,On,370,O.length*2,0,1),te=0;te0&>(Es.f),je(B,oG)!=null&&(!B.a&&(B.a=new we(Ft,B,10,11)),!!B.a)&&(!B.a&&(B.a=new we(Ft,B,10,11)),B.a).i>0?(l=u(je(B,oG),521),Rg=l.Sg(B),vw(B,k.Math.max(B.g,Rg.a+nd.b+nd.c),k.Math.max(B.f,Rg.b+nd.d+nd.a))):(!B.a&&(B.a=new we(Ft,B,10,11)),B.a).i!=0&&(Rg=new Se(ne(re(je(B,zm))),ne(re(je(B,zm)))/ne(re(je(B,F7)))),vw(B,k.Math.max(B.g,Rg.a+nd.b+nd.c),k.Math.max(B.f,Rg.b+nd.d+nd.a)));if(ta=u(je(n,s1),104),S=n.g-(ta.b+ta.c),y=n.f-(ta.d+ta.a),zg.ah("Available Child Area: ("+S+"|"+y+")"),Ei(n,B7,S/y),DJe(n,r,i.dh(s5)),u(je(n,Ky),281)==gG&&(sZ(n),vw(n,ta.b+ne(re(je(n,Pm)))+ta.c,ta.d+ne(re(je(n,Lm)))+ta.a)),zg.ah("Executed layout algorithm: "+Pt(je(n,qy))+" on node "+n.k),u(je(n,Ky),281)==Hm){if(S<0||y<0)throw R(new md("The size defined by the parent parallel node is too small for the space provided by the paddings of the child hierarchical node. "+n.k));for(ba(n,Pm)||ba(n,Lm)||sZ(n),O=ne(re(je(n,Pm))),A=ne(re(je(n,Lm))),zg.ah("Desired Child Area: ("+O+"|"+A+")"),n6=S/O,wA=y/A,Zl=k.Math.min(n6,k.Math.min(wA,ne(re(je(n,Bfn))))),Ei(n,uG,Zl),zg.ah(n.k+" -- Local Scale Factor (X|Y): ("+n6+"|"+wA+")"),te=u(je(n,DI),22),c=0,o=0,Zl'?":gn(gZe,e)?"'(?<' or '(? toIndex: ",Yge=", toIndex: ",Qge="Index: ",Wge=", Size: ",J8="org.eclipse.elk.alg.common",Yt={51:1},_Ye="org.eclipse.elk.alg.common.compaction",LYe="Scanline/EventHandler",t1="org.eclipse.elk.alg.common.compaction.oned",PYe="CNode belongs to another CGroup.",$Ye="ISpacingsHandler/1",UZ="The ",XZ=" instance has been finished already.",RYe="The direction ",BYe=" is not supported by the CGraph instance.",zYe="OneDimensionalCompactor",FYe="OneDimensionalCompactor/lambda$0$Type",JYe="Quadruplet",HYe="ScanlineConstraintCalculator",GYe="ScanlineConstraintCalculator/ConstraintsScanlineHandler",qYe="ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type",UYe="ScanlineConstraintCalculator/Timestamp",XYe="ScanlineConstraintCalculator/lambda$0$Type",Sh={178:1,48:1},vS="org.eclipse.elk.alg.common.networksimplex",ma={171:1,3:1,4:1},KYe="org.eclipse.elk.alg.common.nodespacing",dg="org.eclipse.elk.alg.common.nodespacing.cellsystem",H8="CENTER",VYe={216:1,337:1},Zge={3:1,4:1,5:1,592:1},by="LEFT",gy="RIGHT",ewe="Vertical alignment cannot be null",nwe="BOTTOM",sF="org.eclipse.elk.alg.common.nodespacing.internal",yS="UNDEFINED",qa=.01,jN="org.eclipse.elk.alg.common.nodespacing.internal.algorithm",YYe="LabelPlacer/lambda$0$Type",QYe="LabelPlacer/lambda$1$Type",WYe="portRatioOrPosition",G8="org.eclipse.elk.alg.common.overlaps",KZ="DOWN",wy="org.eclipse.elk.alg.common.spore",um={3:1,4:1,5:1,198:1},ZYe={3:1,6:1,4:1,5:1,90:1,110:1},VZ="org.eclipse.elk.alg.force",twe="ComponentsProcessor",eQe="ComponentsProcessor/1",iwe="ElkGraphImporter/lambda$0$Type",ep={214:1},y3="org.eclipse.elk.core",EN="org.eclipse.elk.graph.properties",nQe="IPropertyHolder",SN="org.eclipse.elk.alg.force.graph",tQe="Component Layout",rwe="org.eclipse.elk.alg.force.model",yu="org.eclipse.elk.core.data",lF="org.eclipse.elk.force.model",cwe="org.eclipse.elk.force.iterations",uwe="org.eclipse.elk.force.repulsivePower",YZ="org.eclipse.elk.force.temperature",xh=.001,QZ="org.eclipse.elk.force.repulsion",Ua={148:1},kS="org.eclipse.elk.alg.force.options",q8=1.600000023841858,$o="org.eclipse.elk.force",xN="org.eclipse.elk.priority",om="org.eclipse.elk.spacing.nodeNode",WZ="org.eclipse.elk.spacing.edgeLabel",U8="org.eclipse.elk.aspectRatio",fF="org.eclipse.elk.randomSeed",jS="org.eclipse.elk.separateConnectedComponents",sm="org.eclipse.elk.padding",ES="org.eclipse.elk.interactive",ZZ="org.eclipse.elk.portConstraints",aF="org.eclipse.elk.edgeLabels.inline",SS="org.eclipse.elk.omitNodeMicroLayout",X8="org.eclipse.elk.nodeSize.fixedGraphSize",py="org.eclipse.elk.nodeSize.options",k3="org.eclipse.elk.nodeSize.constraints",K8="org.eclipse.elk.nodeLabels.placement",V8="org.eclipse.elk.portLabels.placement",AN="org.eclipse.elk.topdownLayout",MN="org.eclipse.elk.topdown.scaleFactor",CN="org.eclipse.elk.topdown.hierarchicalNodeWidth",TN="org.eclipse.elk.topdown.hierarchicalNodeAspectRatio",np="org.eclipse.elk.topdown.nodeType",owe="origin",iQe="random",rQe="boundingBox.upLeft",cQe="boundingBox.lowRight",swe="org.eclipse.elk.stress.fixed",lwe="org.eclipse.elk.stress.desiredEdgeLength",fwe="org.eclipse.elk.stress.dimension",awe="org.eclipse.elk.stress.epsilon",hwe="org.eclipse.elk.stress.iterationLimit",W0="org.eclipse.elk.stress",uQe="ELK Stress",my="org.eclipse.elk.nodeSize.minimum",hF="org.eclipse.elk.alg.force.stress",oQe="Layered layout",vy="org.eclipse.elk.alg.layered",ON="org.eclipse.elk.alg.layered.compaction.components",xS="org.eclipse.elk.alg.layered.compaction.oned",dF="org.eclipse.elk.alg.layered.compaction.oned.algs",bg="org.eclipse.elk.alg.layered.compaction.recthull",Xa="org.eclipse.elk.alg.layered.components",va="NONE",eee="MODEL_ORDER",qu={3:1,6:1,4:1,10:1,5:1,126:1},sQe={3:1,6:1,4:1,5:1,135:1,90:1,110:1},bF="org.eclipse.elk.alg.layered.compound",Mi={43:1},Zu="org.eclipse.elk.alg.layered.graph",nee=" -> ",lQe="Not supported by LGraph",dwe="Port side is undefined",Y8={3:1,6:1,4:1,5:1,323:1,135:1,90:1,110:1},Fd={3:1,6:1,4:1,5:1,135:1,199:1,209:1,90:1,110:1},fQe={3:1,6:1,4:1,5:1,135:1,2004:1,209:1,90:1,110:1},aQe=`([{"' \r +`,hQe=`)]}"' \r +`,dQe="The given string contains parts that cannot be parsed as numbers.",NN="org.eclipse.elk.core.math",bQe={3:1,4:1,140:1,213:1,414:1},gQe={3:1,4:1,104:1,213:1,414:1},Jd="org.eclipse.elk.alg.layered.graph.transform",wQe="ElkGraphImporter",pQe="ElkGraphImporter/lambda$1$Type",mQe="ElkGraphImporter/lambda$2$Type",vQe="ElkGraphImporter/lambda$4$Type",Wn="org.eclipse.elk.alg.layered.intermediate",yQe="Node margin calculation",kQe="ONE_SIDED_GREEDY_SWITCH",jQe="TWO_SIDED_GREEDY_SWITCH",tee="No implementation is available for the layout processor ",iee="IntermediateProcessorStrategy",ree="Node '",EQe="FIRST_SEPARATE",SQe="LAST_SEPARATE",xQe="Odd port side processing",lr="org.eclipse.elk.alg.layered.intermediate.compaction",AS="org.eclipse.elk.alg.layered.intermediate.greedyswitch",i1="org.eclipse.elk.alg.layered.p3order.counting",MS={220:1},yy="org.eclipse.elk.alg.layered.intermediate.loops",bl="org.eclipse.elk.alg.layered.intermediate.loops.ordering",Z0="org.eclipse.elk.alg.layered.intermediate.loops.routing",gF="org.eclipse.elk.alg.layered.intermediate.preserveorder",Ah="org.eclipse.elk.alg.layered.intermediate.wrapping",Tu="org.eclipse.elk.alg.layered.options",cee="INTERACTIVE",bwe="GREEDY",AQe="DEPTH_FIRST",MQe="EDGE_LENGTH",CQe="SELF_LOOPS",TQe="firstTryWithInitialOrder",gwe="org.eclipse.elk.layered.directionCongruency",wwe="org.eclipse.elk.layered.feedbackEdges",wF="org.eclipse.elk.layered.interactiveReferencePoint",pwe="org.eclipse.elk.layered.mergeEdges",mwe="org.eclipse.elk.layered.mergeHierarchyEdges",vwe="org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",ywe="org.eclipse.elk.layered.portSortingStrategy",kwe="org.eclipse.elk.layered.thoroughness",jwe="org.eclipse.elk.layered.unnecessaryBendpoints",Ewe="org.eclipse.elk.layered.generatePositionAndLayerIds",IN="org.eclipse.elk.layered.cycleBreaking.strategy",DN="org.eclipse.elk.layered.layering.strategy",Swe="org.eclipse.elk.layered.layering.layerConstraint",xwe="org.eclipse.elk.layered.layering.layerChoiceConstraint",Awe="org.eclipse.elk.layered.layering.layerId",uee="org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",oee="org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",see="org.eclipse.elk.layered.layering.nodePromotion.strategy",lee="org.eclipse.elk.layered.layering.nodePromotion.maxIterations",fee="org.eclipse.elk.layered.layering.coffmanGraham.layerBound",CS="org.eclipse.elk.layered.crossingMinimization.strategy",Mwe="org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",aee="org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",hee="org.eclipse.elk.layered.crossingMinimization.semiInteractive",Cwe="org.eclipse.elk.layered.crossingMinimization.inLayerPredOf",Twe="org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf",Owe="org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",Nwe="org.eclipse.elk.layered.crossingMinimization.positionId",Iwe="org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",dee="org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",pF="org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",j3="org.eclipse.elk.layered.nodePlacement.strategy",mF="org.eclipse.elk.layered.nodePlacement.favorStraightEdges",bee="org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",gee="org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",wee="org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",pee="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility",mee="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",Dwe="org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",_we="org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",vF="org.eclipse.elk.layered.edgeRouting.splines.mode",yF="org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",vee="org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",Lwe="org.eclipse.elk.layered.spacing.baseValue",Pwe="org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",$we="org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",Rwe="org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",Bwe="org.eclipse.elk.layered.priority.direction",zwe="org.eclipse.elk.layered.priority.shortness",Fwe="org.eclipse.elk.layered.priority.straightness",yee="org.eclipse.elk.layered.compaction.connectedComponents",Jwe="org.eclipse.elk.layered.compaction.postCompaction.strategy",Hwe="org.eclipse.elk.layered.compaction.postCompaction.constraints",kF="org.eclipse.elk.layered.highDegreeNodes.treatment",kee="org.eclipse.elk.layered.highDegreeNodes.threshold",jee="org.eclipse.elk.layered.highDegreeNodes.treeHeight",q1="org.eclipse.elk.layered.wrapping.strategy",jF="org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",EF="org.eclipse.elk.layered.wrapping.correctionFactor",TS="org.eclipse.elk.layered.wrapping.cutting.strategy",Eee="org.eclipse.elk.layered.wrapping.cutting.cuts",See="org.eclipse.elk.layered.wrapping.cutting.msd.freedom",SF="org.eclipse.elk.layered.wrapping.validify.strategy",xF="org.eclipse.elk.layered.wrapping.validify.forbiddenIndices",AF="org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",MF="org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",xee="org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",Aee="org.eclipse.elk.layered.layerUnzipping.strategy",Mee="org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",Cee="org.eclipse.elk.layered.layerUnzipping.layerSplit",Tee="org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",Gwe="org.eclipse.elk.layered.edgeLabels.sideSelection",qwe="org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",CF="org.eclipse.elk.layered.considerModelOrder.strategy",Uwe="org.eclipse.elk.layered.considerModelOrder.portModelOrder",_N="org.eclipse.elk.layered.considerModelOrder.noModelOrder",Oee="org.eclipse.elk.layered.considerModelOrder.components",Xwe="org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",Nee="org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",Iee="org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",Dee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",_ee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",Lee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.componentGroupId",Kwe="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbGroupOrderStrategy",Pee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredSourceId",$ee="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredTargetId",Vwe="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmGroupOrderStrategy",Ywe="org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmEnforcedGroupOrders",Ree="layering",OQe="layering.minWidth",NQe="layering.nodePromotion",Q8="crossingMinimization",TF="org.eclipse.elk.hierarchyHandling",IQe="crossingMinimization.greedySwitch",DQe="nodePlacement",_Qe="nodePlacement.bk",LQe="edgeRouting",LN="org.eclipse.elk.edgeRouting",Ka="spacing",Qwe="priority",Wwe="compaction",PQe="compaction.postCompaction",$Qe="Specifies whether and how post-process compaction is applied.",Zwe="highDegreeNodes",epe="wrapping",RQe="wrapping.cutting",BQe="wrapping.validify",npe="wrapping.multiEdge",Bee="layerUnzipping",zee="edgeLabels",OS="considerModelOrder",W8="considerModelOrder.groupModelOrder",tpe="Group ID of the Node Type",ipe="org.eclipse.elk.spacing.commentComment",rpe="org.eclipse.elk.spacing.commentNode",cpe="org.eclipse.elk.spacing.componentComponent",upe="org.eclipse.elk.spacing.edgeEdge",Fee="org.eclipse.elk.spacing.edgeNode",ope="org.eclipse.elk.spacing.labelLabel",spe="org.eclipse.elk.spacing.labelPortHorizontal",lpe="org.eclipse.elk.spacing.labelPortVertical",fpe="org.eclipse.elk.spacing.labelNode",ape="org.eclipse.elk.spacing.nodeSelfLoop",hpe="org.eclipse.elk.spacing.portPort",dpe="org.eclipse.elk.spacing.individual",bpe="org.eclipse.elk.port.borderOffset",gpe="org.eclipse.elk.noLayout",wpe="org.eclipse.elk.port.side",PN="org.eclipse.elk.debugMode",ppe="org.eclipse.elk.alignment",mpe="org.eclipse.elk.insideSelfLoops.activate",vpe="org.eclipse.elk.insideSelfLoops.yo",Jee="org.eclipse.elk.direction",ype="org.eclipse.elk.nodeLabels.padding",kpe="org.eclipse.elk.portLabels.nextToPortIfPossible",jpe="org.eclipse.elk.portLabels.treatAsGroup",Epe="org.eclipse.elk.portAlignment.default",Spe="org.eclipse.elk.portAlignment.north",xpe="org.eclipse.elk.portAlignment.south",Ape="org.eclipse.elk.portAlignment.west",Mpe="org.eclipse.elk.portAlignment.east",OF="org.eclipse.elk.contentAlignment",Cpe="org.eclipse.elk.junctionPoints",Tpe="org.eclipse.elk.edge.thickness",Ope="org.eclipse.elk.edgeLabels.placement",Npe="org.eclipse.elk.port.index",Ipe="org.eclipse.elk.commentBox",Dpe="org.eclipse.elk.hypernode",_pe="org.eclipse.elk.port.anchor",Hee="org.eclipse.elk.partitioning.activate",Gee="org.eclipse.elk.partitioning.partition",NF="org.eclipse.elk.position",Lpe="org.eclipse.elk.margins",Ppe="org.eclipse.elk.spacing.portsSurrounding",IF="org.eclipse.elk.interactiveLayout",$u="org.eclipse.elk.core.util",$pe={3:1,4:1,5:1,590:1},zQe="NETWORK_SIMPLEX",Rpe="SIMPLE",oc={95:1,43:1},tp="org.eclipse.elk.alg.layered.p1cycles",FQe="Depth-first cycle removal",JQe="Model order cycle breaking",U1="org.eclipse.elk.alg.layered.p2layers",Bpe={406:1,220:1},HQe={830:1,3:1,4:1},Ro="org.eclipse.elk.alg.layered.p3order",E3=17976931348623157e292,qee=5e-324,Lc="org.eclipse.elk.alg.layered.p4nodes",GQe={3:1,4:1,5:1,838:1},Mh=1e-5,eb="org.eclipse.elk.alg.layered.p4nodes.bk",Uee="org.eclipse.elk.alg.layered.p5edges",ya="org.eclipse.elk.alg.layered.p5edges.orthogonal",Xee="org.eclipse.elk.alg.layered.p5edges.orthogonal.direction",Kee=1e-6,lm="org.eclipse.elk.alg.layered.p5edges.splines",Vee=.09999999999999998,DF=1e-8,qQe=4.71238898038469,UQe=1.5707963267948966,zpe=3.141592653589793,X1="org.eclipse.elk.alg.mrtree",Yee=.10000000149011612,_F="SUPER_ROOT",NS="org.eclipse.elk.alg.mrtree.graph",Fpe=-17976931348623157e292,go="org.eclipse.elk.alg.mrtree.intermediate",XQe="Processor compute fanout",LF={3:1,6:1,4:1,5:1,522:1,90:1,110:1},KQe="Set neighbors in level",$N="org.eclipse.elk.alg.mrtree.options",VQe="DESCENDANTS",Jpe="org.eclipse.elk.mrtree.compaction",Hpe="org.eclipse.elk.mrtree.edgeEndTextureLength",Gpe="org.eclipse.elk.mrtree.treeLevel",qpe="org.eclipse.elk.mrtree.positionConstraint",Upe="org.eclipse.elk.mrtree.weighting",Xpe="org.eclipse.elk.mrtree.edgeRoutingMode",Kpe="org.eclipse.elk.mrtree.searchOrder",YQe="Position Constraint",Bo="org.eclipse.elk.mrtree",QQe="org.eclipse.elk.tree",WQe="Processor arrange level",Z8="org.eclipse.elk.alg.mrtree.p2order",Qs="org.eclipse.elk.alg.mrtree.p4route",Vpe="org.eclipse.elk.alg.radial",gg=6.283185307179586,Ype="Before",PF="After",Qpe="org.eclipse.elk.alg.radial.intermediate",ZQe="COMPACTION",Qee="org.eclipse.elk.alg.radial.intermediate.compaction",eWe={3:1,4:1,5:1,90:1},Wpe="org.eclipse.elk.alg.radial.intermediate.optimization",Wee="No implementation is available for the layout option ",IS="org.eclipse.elk.alg.radial.options",nWe="CompactionStrategy",Zpe="org.eclipse.elk.radial.centerOnRoot",e2e="org.eclipse.elk.radial.orderId",n2e="org.eclipse.elk.radial.radius",$F="org.eclipse.elk.radial.rotate",Zee="org.eclipse.elk.radial.compactor",ene="org.eclipse.elk.radial.compactionStepSize",t2e="org.eclipse.elk.radial.sorter",i2e="org.eclipse.elk.radial.wedgeCriteria",r2e="org.eclipse.elk.radial.optimizationCriteria",nne="org.eclipse.elk.radial.rotation.targetAngle",tne="org.eclipse.elk.radial.rotation.computeAdditionalWedgeSpace",c2e="org.eclipse.elk.radial.rotation.outgoingEdgeAngles",tWe="Compaction",u2e="rotation",Gl="org.eclipse.elk.radial",iWe="org.eclipse.elk.alg.radial.p1position.wedge",o2e="org.eclipse.elk.alg.radial.sorting",rWe=5.497787143782138,cWe=3.9269908169872414,uWe=2.356194490192345,oWe="org.eclipse.elk.alg.rectpacking",DS="org.eclipse.elk.alg.rectpacking.intermediate",ine="org.eclipse.elk.alg.rectpacking.options",s2e="org.eclipse.elk.rectpacking.trybox",l2e="org.eclipse.elk.rectpacking.currentPosition",f2e="org.eclipse.elk.rectpacking.desiredPosition",a2e="org.eclipse.elk.rectpacking.inNewRow",h2e="org.eclipse.elk.rectpacking.orderBySize",d2e="org.eclipse.elk.rectpacking.widthApproximation.strategy",b2e="org.eclipse.elk.rectpacking.widthApproximation.targetWidth",g2e="org.eclipse.elk.rectpacking.widthApproximation.optimizationGoal",w2e="org.eclipse.elk.rectpacking.widthApproximation.lastPlaceShift",p2e="org.eclipse.elk.rectpacking.packing.strategy",m2e="org.eclipse.elk.rectpacking.packing.compaction.rowHeightReevaluation",v2e="org.eclipse.elk.rectpacking.packing.compaction.iterations",y2e="org.eclipse.elk.rectpacking.whiteSpaceElimination.strategy",rne="widthApproximation",sWe="Compaction Strategy",lWe="packing.compaction",ms="org.eclipse.elk.rectpacking",e7="org.eclipse.elk.alg.rectpacking.p1widthapproximation",RF="org.eclipse.elk.alg.rectpacking.p2packing",fWe="No Compaction",k2e="org.eclipse.elk.alg.rectpacking.p3whitespaceelimination",RN="org.eclipse.elk.alg.rectpacking.util",BF="No implementation available for ",fm="org.eclipse.elk.alg.spore",am="org.eclipse.elk.alg.spore.options",ip="org.eclipse.elk.sporeCompaction",cne="org.eclipse.elk.underlyingLayoutAlgorithm",j2e="org.eclipse.elk.processingOrder.treeConstruction",E2e="org.eclipse.elk.processingOrder.spanningTreeCostFunction",une="org.eclipse.elk.processingOrder.preferredRoot",one="org.eclipse.elk.processingOrder.rootSelection",sne="org.eclipse.elk.structure.structureExtractionStrategy",S2e="org.eclipse.elk.compaction.compactionStrategy",x2e="org.eclipse.elk.compaction.orthogonal",A2e="org.eclipse.elk.overlapRemoval.maxIterations",M2e="org.eclipse.elk.overlapRemoval.runScanline",lne="processingOrder",aWe="overlapRemoval",n7="org.eclipse.elk.sporeOverlap",hWe="org.eclipse.elk.alg.spore.p1structure",fne="org.eclipse.elk.alg.spore.p2processingorder",ane="org.eclipse.elk.alg.spore.p3execution",dWe="Topdown Layout",bWe="Invalid index: ",t7="org.eclipse.elk.core.alg",S3={342:1},hm={296:1},gWe="Make sure its type is registered with the ",C2e=" utility class.",i7="true",hne="false",wWe="Couldn't clone property '",rp=.05,Oo="org.eclipse.elk.core.options",pWe=1.2999999523162842,cp="org.eclipse.elk.box",T2e="org.eclipse.elk.expandNodes",O2e="org.eclipse.elk.box.packingMode",mWe="org.eclipse.elk.algorithm",vWe="org.eclipse.elk.resolvedAlgorithm",N2e="org.eclipse.elk.bendPoints",EBn="org.eclipse.elk.labelManager",yWe="org.eclipse.elk.softwrappingFuzziness",kWe="org.eclipse.elk.scaleFactor",jWe="org.eclipse.elk.childAreaWidth",EWe="org.eclipse.elk.childAreaHeight",SWe="org.eclipse.elk.animate",xWe="org.eclipse.elk.animTimeFactor",AWe="org.eclipse.elk.layoutAncestors",MWe="org.eclipse.elk.maxAnimTime",CWe="org.eclipse.elk.minAnimTime",TWe="org.eclipse.elk.progressBar",OWe="org.eclipse.elk.validateGraph",NWe="org.eclipse.elk.validateOptions",IWe="org.eclipse.elk.zoomToFit",DWe="org.eclipse.elk.json.shapeCoords",_We="org.eclipse.elk.json.edgeCoords",SBn="org.eclipse.elk.font.name",LWe="org.eclipse.elk.font.size",dne="org.eclipse.elk.topdown.sizeCategories",I2e="org.eclipse.elk.topdown.sizeCategoriesHierarchicalNodeWeight",bne="org.eclipse.elk.topdown.sizeApproximator",D2e="org.eclipse.elk.topdown.scaleCap",PWe="org.eclipse.elk.edge.type",$We="partitioning",RWe="nodeLabels",zF="portAlignment",gne="nodeSize",wne="port",_2e="portLabels",r7="topdown",BWe="insideSelfLoops",L2e="INHERIT",c7="org.eclipse.elk.fixed",FF="org.eclipse.elk.random",JF={3:1,35:1,23:1,521:1,288:1},zWe="port must have a parent node to calculate the port side",FWe="The edge needs to have exactly one edge section. Found: ",_S="org.eclipse.elk.core.util.adapters",ql="org.eclipse.emf.ecore",x3="org.eclipse.elk.graph",JWe="EMapPropertyHolder",HWe="ElkBendPoint",GWe="ElkGraphElement",qWe="ElkConnectableShape",P2e="ElkEdge",UWe="ElkEdgeSection",XWe="EModelElement",KWe="ENamedElement",$2e="ElkLabel",R2e="ElkNode",B2e="ElkPort",VWe={94:1,93:1},ky="org.eclipse.emf.common.notify.impl",nb="The feature '",LS="' is not a valid changeable feature",YWe="Expecting null",pne="' is not a valid feature",QWe="The feature ID",WWe=" is not a valid feature ID",Ru=32768,ZWe={109:1,94:1,93:1,57:1,52:1,100:1},Jn="org.eclipse.emf.ecore.impl",wg="org.eclipse.elk.graph.impl",PS="Recursive containment not allowed for ",u7="The datatype '",up="' is not a valid classifier",mne="The value '",A3={195:1,3:1,4:1},vne="The class '",o7="http://www.eclipse.org/elk/ElkGraph",z2e="property",$S="value",yne="source",eZe="properties",nZe="identifier",kne="height",jne="width",Ene="parent",Sne="text",xne="children",tZe="hierarchical",F2e="sources",Ane="targets",Mne="sections",HF="bendPoints",J2e="outgoingShape",H2e="incomingShape",G2e="outgoingSections",q2e="incomingSections",yc="org.eclipse.emf.common.util",U2e="Severe implementation error in the Json to ElkGraph importer.",Ch="id",Wr="org.eclipse.elk.graph.json",s7="Unhandled parameter types: ",iZe="startPoint",rZe="An edge must have at least one source and one target (edge id: '",l7="').",cZe="Referenced edge section does not exist: ",uZe=" (edge id: '",X2e="target",oZe="sourcePoint",sZe="targetPoint",GF="group",ui="name",lZe="connectableShape cannot be null",fZe="edge cannot be null",aZe="Passed edge is not 'simple'.",qF="org.eclipse.elk.graph.util",BN="The 'no duplicates' constraint is violated",Cne="targetIndex=",pg=", size=",Tne="sourceIndex=",Th={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1},One={3:1,4:1,20:1,31:1,56:1,18:1,50:1,16:1,59:1,71:1,67:1,61:1,585:1},UF="logging",hZe="measureExecutionTime",dZe="parser.parse.1",bZe="parser.parse.2",XF="parser.next.1",Nne="parser.next.2",gZe="parser.next.3",wZe="parser.next.4",mg="parser.factor.1",K2e="parser.factor.2",pZe="parser.factor.3",mZe="parser.factor.4",vZe="parser.factor.5",yZe="parser.factor.6",kZe="parser.atom.1",jZe="parser.atom.2",EZe="parser.atom.3",V2e="parser.atom.4",Ine="parser.atom.5",Y2e="parser.cc.1",KF="parser.cc.2",SZe="parser.cc.3",xZe="parser.cc.5",Q2e="parser.cc.6",W2e="parser.cc.7",Dne="parser.cc.8",AZe="parser.ope.1",MZe="parser.ope.2",CZe="parser.ope.3",Hd="parser.descape.1",TZe="parser.descape.2",OZe="parser.descape.3",NZe="parser.descape.4",IZe="parser.descape.5",Ul="parser.process.1",DZe="parser.quantifier.1",_Ze="parser.quantifier.2",LZe="parser.quantifier.3",PZe="parser.quantifier.4",Z2e="parser.quantifier.5",$Ze="org.eclipse.emf.common.notify",eme={415:1,676:1},RZe={3:1,4:1,20:1,31:1,56:1,18:1,16:1,71:1,61:1},zN={373:1,151:1},RS="index=",_ne={3:1,4:1,5:1,129:1},BZe={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,61:1},nme={3:1,6:1,4:1,5:1,198:1},zZe={3:1,4:1,5:1,175:1,374:1},Gf=1024,FZe=";/?:@&=+$,",JZe="invalid authority: ",HZe="EAnnotation",GZe="ETypedElement",qZe="EStructuralFeature",UZe="EAttribute",XZe="EClassifier",KZe="EEnumLiteral",VZe="EGenericType",YZe="EOperation",QZe="EParameter",WZe="EReference",ZZe="ETypeParameter",Ri="org.eclipse.emf.ecore.util",Lne={77:1},tme={3:1,20:1,18:1,16:1,61:1,586:1,77:1,72:1,98:1},een="org.eclipse.emf.ecore.util.FeatureMap$Entry",as=8192,BS="byte",VF="char",zS="double",FS="float",JS="int",HS="long",GS="short",nen="java.lang.Object",M3={3:1,4:1,5:1,255:1},ime={3:1,4:1,5:1,678:1},ten={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,72:1},au={3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,77:1,72:1,98:1},FN="mixed",Ut="http:///org/eclipse/emf/ecore/util/ExtendedMetaData",af="kind",ien={3:1,4:1,5:1,679:1},rme={3:1,4:1,20:1,31:1,56:1,18:1,16:1,71:1,61:1,77:1,72:1,98:1},YF={20:1,31:1,56:1,18:1,16:1,61:1,72:1},QF={50:1,128:1,287:1},WF={75:1,344:1},ZF="The value of type '",eJ="' must be of type '",C3=1306,hf="http://www.eclipse.org/emf/2002/Ecore",nJ=-32768,op="constraints",sc="baseType",ren="getEStructuralFeature",cen="getFeatureID",qS="feature",uen="getOperationID",cme="operation",oen="defaultValue",sen="eTypeParameters",len="isInstance",fen="getEEnumLiteral",aen="eContainingClass",ii={58:1},hen={3:1,4:1,5:1,122:1},den="org.eclipse.emf.ecore.resource",ben={94:1,93:1,588:1,1996:1},Pne="org.eclipse.emf.ecore.resource.impl",ume="unspecified",JN="simple",tJ="attribute",gen="attributeWildcard",iJ="element",$ne="elementWildcard",ka="collapse",Rne="itemType",rJ="namespace",HN="##targetNamespace",df="whiteSpace",ome="wildcards",vg="http://www.eclipse.org/emf/2003/XMLType",Bne="##any",f7="uninitialized",GN="The multiplicity constraint is violated",cJ="org.eclipse.emf.ecore.xml.type",wen="ProcessingInstruction",pen="SimpleAnyType",men="XMLTypeDocumentRoot",kr="org.eclipse.emf.ecore.xml.type.impl",qN="INF",ven="processing",yen="ENTITIES_._base",sme="minLength",lme="ENTITY",uJ="NCName",ken="IDREFS_._base",fme="integer",zne="token",Fne="pattern",jen="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*",ame="\\i\\c*",Een="[\\i-[:]][\\c-[:]]*",Sen="nonPositiveInteger",UN="maxInclusive",hme="NMTOKEN",xen="NMTOKENS_._base",dme="nonNegativeInteger",XN="minInclusive",Aen="normalizedString",Men="unsignedByte",Cen="unsignedInt",Ten="18446744073709551615",Oen="unsignedShort",Nen="processingInstruction",Gd="org.eclipse.emf.ecore.xml.type.internal",a7=1114111,Ien="Internal Error: shorthands: \\u",US="xml:isDigit",Jne="xml:isWord",Hne="xml:isSpace",Gne="xml:isNameChar",qne="xml:isInitialNameChar",Den="09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩",_en="AZazÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣",Len="Private Use",Une="ASSIGNED",Xne="\0€ÿĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\uFEFF\uFEFF＀￯",bme="UNASSIGNED",h7={3:1,121:1},Pen="org.eclipse.emf.ecore.xml.type.util",oJ={3:1,4:1,5:1,376:1},gme="org.eclipse.xtext.xbase.lib",$en="Cannot add elements to a Range",Ren="Cannot set elements in a Range",Ben="Cannot remove elements from a Range",zen="user.agent",s,sJ,Kne;k.goog=k.goog||{},k.goog.global=k.goog.global||k,sJ={},m(1,null,{},U),s.Fb=function(n){return gTe(this,n)},s.Gb=function(){return this.Pm},s.Hb=function(){return jw(this)},s.Ib=function(){var n;return Pb(Us(this))+"@"+(n=Ni(this)>>>0,n.toString(16))},s.equals=function(e){return this.Fb(e)},s.hashCode=function(){return this.Hb()},s.toString=function(){return this.Ib()};var Fen,Jen,Hen;m(298,1,{298:1,2086:1},g1e),s.te=function(n){var t;return t=new g1e,t.i=4,n>1?t.c=G_e(this,n-1):t.c=this,t},s.ue=function(){return M1(this),this.b},s.ve=function(){return Pb(this)},s.we=function(){return M1(this),this.k},s.xe=function(){return(this.i&4)!=0},s.ye=function(){return(this.i&1)!=0},s.Ib=function(){return xhe(this)},s.i=0;var Mr=v(Cu,"Object",1),wme=v(Cu,"Class",298);m(2058,1,aN),v(hN,"Optional",2058),m(1160,2058,aN,G),s.Fb=function(n){return n===this},s.Hb=function(){return 2040732332},s.Ib=function(){return"Optional.absent()"},s.Jb=function(n){return Nt(n),vj(),Vne};var Vne;v(hN,"Absent",1160),m(627,1,{},IX),v(hN,"Joiner",627);var xBn=Gi(hN,"Predicate");m(577,1,{178:1,577:1,3:1,48:1},DC),s.Mb=function(n){return Hze(this,n)},s.Lb=function(n){return Hze(this,n)},s.Fb=function(n){var t;return X(n,577)?(t=u(n,577),abe(this.a,t.a)):!1},s.Hb=function(){return y1e(this.a)+306654252},s.Ib=function(){return xCn(this.a)},v(hN,"Predicates/AndPredicate",577),m(411,2058,{411:1,3:1},e9),s.Fb=function(n){var t;return X(n,411)?(t=u(n,411),gi(this.a,t.a)):!1},s.Hb=function(){return 1502476572+Ni(this.a)},s.Ib=function(){return lYe+this.a+")"},s.Jb=function(n){return new e9(NR(n.Kb(this.a),"the Function passed to Optional.transform() must not return null."))},v(hN,"Present",411),m(204,1,L8),s.Nb=function(n){Zr(this,n)},s.Qb=function(){cAe()},v(hn,"UnmodifiableIterator",204),m(2038,204,P8),s.Qb=function(){cAe()},s.Rb=function(n){throw R(new _t)},s.Wb=function(n){throw R(new _t)},v(hn,"UnmodifiableListIterator",2038),m(392,2038,P8),s.Ob=function(){return this.b0},s.Pb=function(){if(this.b>=this.c)throw R(new hu);return this.Xb(this.b++)},s.Tb=function(){return this.b},s.Ub=function(){if(this.b<=0)throw R(new hu);return this.Xb(--this.b)},s.Vb=function(){return this.b-1},s.b=0,s.c=0,v(hn,"AbstractIndexedListIterator",392),m(702,204,L8),s.Ob=function(){return PY(this)},s.Pb=function(){return vhe(this)},s.e=1,v(hn,"AbstractIterator",702),m(2046,1,{229:1}),s.Zb=function(){var n;return n=this.f,n||(this.f=this.ac())},s.Fb=function(n){return rQ(this,n)},s.Hb=function(){return Ni(this.Zb())},s.dc=function(){return this.gc()==0},s.ec=function(){return T4(this)},s.Ib=function(){return fu(this.Zb())},v(hn,"AbstractMultimap",2046),m(730,2046,ag),s.$b=function(){yB(this)},s._b=function(n){return jAe(this,n)},s.ac=function(){return new p9(this,this.c)},s.ic=function(n){return this.hc()},s.bc=function(){return new Hv(this,this.c)},s.jc=function(){return this.mc(this.hc())},s.kc=function(){return new Gxe(this)},s.lc=function(){return aW(this.c.vc().Lc(),new Z,64,this.d)},s.cc=function(n){return vi(this,n)},s.fc=function(n){return AO(this,n)},s.gc=function(){return this.d},s.mc=function(n){return En(),new Hr(n)},s.nc=function(){return new Hxe(this)},s.oc=function(){return aW(this.c.Bc().Lc(),new ie,64,this.d)},s.pc=function(n,t){return new nB(this,n,t,null)},s.d=0,v(hn,"AbstractMapBasedMultimap",730),m(1661,730,ag),s.hc=function(){return new xo(this.a)},s.jc=function(){return En(),En(),Sc},s.cc=function(n){return u(vi(this,n),16)},s.fc=function(n){return u(AO(this,n),16)},s.Zb=function(){return L4(this)},s.Fb=function(n){return rQ(this,n)},s.qc=function(n){return u(vi(this,n),16)},s.rc=function(n){return u(AO(this,n),16)},s.mc=function(n){return IR(u(n,16))},s.pc=function(n,t){return ZLe(this,n,u(t,16),null)},v(hn,"AbstractListMultimap",1661),m(736,1,Fr),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return this.c.Ob()||this.e.Ob()},s.Pb=function(){var n;return this.e.Ob()||(n=u(this.c.Pb(),45),this.b=n.jd(),this.a=u(n.kd(),18),this.e=this.a.Jc()),this.sc(this.b,this.e.Pb())},s.Qb=function(){this.e.Qb(),u(uf(this.a),18).dc()&&this.c.Qb(),--this.d.d},v(hn,"AbstractMapBasedMultimap/Itr",736),m(1098,736,Fr,Hxe),s.sc=function(n,t){return t},v(hn,"AbstractMapBasedMultimap/1",1098),m(1099,1,{},ie),s.Kb=function(n){return u(n,18).Lc()},v(hn,"AbstractMapBasedMultimap/1methodref$spliterator$Type",1099),m(1100,736,Fr,Gxe),s.sc=function(n,t){return new pw(n,t)},v(hn,"AbstractMapBasedMultimap/2",1100);var pme=Gi(pt,"Map");m(2027,1,Ww),s.wc=function(n){wO(this,n)},s.$b=function(){this.vc().$b()},s.tc=function(n){return XQ(this,n)},s._b=function(n){return!!l0e(this,n,!1)},s.uc=function(n){var t,i,r;for(i=this.vc().Jc();i.Ob();)if(t=u(i.Pb(),45),r=t.kd(),ue(n)===ue(r)||n!=null&&gi(n,r))return!0;return!1},s.Fb=function(n){var t,i,r;if(n===this)return!0;if(!X(n,92)||(r=u(n,92),this.gc()!=r.gc()))return!1;for(i=r.vc().Jc();i.Ob();)if(t=u(i.Pb(),45),!this.tc(t))return!1;return!0},s.xc=function(n){return bu(l0e(this,n,!1))},s.Hb=function(){return a1e(this.vc())},s.dc=function(){return this.gc()==0},s.ec=function(){return new it(this)},s.yc=function(n,t){throw R(new pd("Put not supported on this map"))},s.zc=function(n){AE(this,n)},s.Ac=function(n){return bu(l0e(this,n,!0))},s.gc=function(){return this.vc().gc()},s.Ib=function(){return sGe(this)},s.Bc=function(){return new ot(this)},v(pt,"AbstractMap",2027),m(2047,2027,Ww),s.bc=function(){return new QP(this)},s.vc=function(){return FIe(this)},s.ec=function(){var n;return n=this.g,n||(this.g=this.bc())},s.Bc=function(){var n;return n=this.i,n||(this.i=new dMe(this))},v(hn,"Maps/ViewCachingAbstractMap",2047),m(395,2047,Ww,p9),s.xc=function(n){return k8n(this,n)},s.Ac=function(n){return Ikn(this,n)},s.$b=function(){this.d==this.e.c?this.e.$b():sR(new yfe(this))},s._b=function(n){return kFe(this.d,n)},s.Dc=function(){return new gP(this)},s.Cc=function(){return this.Dc()},s.Fb=function(n){return this===n||gi(this.d,n)},s.Hb=function(){return Ni(this.d)},s.ec=function(){return this.e.ec()},s.gc=function(){return this.d.gc()},s.Ib=function(){return fu(this.d)},v(hn,"AbstractMapBasedMultimap/AsMap",395);var Xl=Gi(Cu,"Iterable");m(31,1,im),s.Ic=function(n){cc(this,n)},s.Lc=function(){return new vn(this,0)},s.Mc=function(){return new mn(null,this.Lc())},s.Ec=function(n){throw R(new pd("Add not supported on this collection"))},s.Fc=function(n){return ac(this,n)},s.$b=function(){rae(this)},s.Gc=function(n){return H2(this,n,!1)},s.Hc=function(n){return jO(this,n)},s.dc=function(){return this.gc()==0},s.Kc=function(n){return H2(this,n,!0)},s.Nc=function(){return Ofe(this)},s.Oc=function(n){return qE(this,n)},s.Ib=function(){return Ja(this)},v(pt,"AbstractCollection",31);var bf=Gi(pt,"Set");m(Ga,31,fs),s.Lc=function(){return new vn(this,1)},s.Fb=function(n){return EJe(this,n)},s.Hb=function(){return a1e(this)},v(pt,"AbstractSet",Ga),m(2030,Ga,fs),v(hn,"Sets/ImprovedAbstractSet",2030),m(2031,2030,fs),s.$b=function(){this.Pc().$b()},s.Gc=function(n){return rJe(this,n)},s.dc=function(){return this.Pc().dc()},s.Kc=function(n){var t;return this.Gc(n)&&X(n,45)?(t=u(n,45),this.Pc().ec().Kc(t.jd())):!1},s.gc=function(){return this.Pc().gc()},v(hn,"Maps/EntrySet",2031),m(1096,2031,fs,gP),s.Gc=function(n){return $1e(this.a.d.vc(),n)},s.Jc=function(){return new yfe(this.a)},s.Pc=function(){return this.a},s.Kc=function(n){var t;return $1e(this.a.d.vc(),n)?(t=u(uf(u(n,45)),45),c9n(this.a.e,t.jd()),!0):!1},s.Lc=function(){return DT(this.a.d.vc().Lc(),new wP(this.a))},v(hn,"AbstractMapBasedMultimap/AsMap/AsMapEntries",1096),m(1097,1,{},wP),s.Kb=function(n){return PPe(this.a,u(n,45))},v(hn,"AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type",1097),m(734,1,Fr,yfe),s.Nb=function(n){Zr(this,n)},s.Pb=function(){var n;return n=u(this.b.Pb(),45),this.a=u(n.kd(),18),PPe(this.c,n)},s.Ob=function(){return this.b.Ob()},s.Qb=function(){M9(!!this.a),this.b.Qb(),this.c.e.d-=this.a.gc(),this.a.$b(),this.a=null},v(hn,"AbstractMapBasedMultimap/AsMap/AsMapIterator",734),m(530,2030,fs,QP),s.$b=function(){this.b.$b()},s.Gc=function(n){return this.b._b(n)},s.Ic=function(n){Nt(n),this.b.wc(new uj(n))},s.dc=function(){return this.b.dc()},s.Jc=function(){return new yj(this.b.vc().Jc())},s.Kc=function(n){return this.b._b(n)?(this.b.Ac(n),!0):!1},s.gc=function(){return this.b.gc()},v(hn,"Maps/KeySet",530),m(332,530,fs,Hv),s.$b=function(){var n;sR((n=this.b.vc().Jc(),new Uoe(this,n)))},s.Hc=function(n){return this.b.ec().Hc(n)},s.Fb=function(n){return this===n||gi(this.b.ec(),n)},s.Hb=function(){return Ni(this.b.ec())},s.Jc=function(){var n;return n=this.b.vc().Jc(),new Uoe(this,n)},s.Kc=function(n){var t,i;return i=0,t=u(this.b.Ac(n),18),t&&(i=t.gc(),t.$b(),this.a.d-=i),i>0},s.Lc=function(){return this.b.ec().Lc()},v(hn,"AbstractMapBasedMultimap/KeySet",332),m(735,1,Fr,Uoe),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return this.c.Ob()},s.Pb=function(){return this.a=u(this.c.Pb(),45),this.a.jd()},s.Qb=function(){var n;M9(!!this.a),n=u(this.a.kd(),18),this.c.Qb(),this.b.a.d-=n.gc(),n.$b(),this.a=null},v(hn,"AbstractMapBasedMultimap/KeySet/1",735),m(489,395,{92:1,134:1},AT),s.bc=function(){return this.Qc()},s.ec=function(){return this.Sc()},s.Qc=function(){return new eT(this.c,this.Uc())},s.Rc=function(){return this.Uc().Rc()},s.Sc=function(){var n;return n=this.b,n||(this.b=this.Qc())},s.Tc=function(){return this.Uc().Tc()},s.Uc=function(){return u(this.d,134)},v(hn,"AbstractMapBasedMultimap/SortedAsMap",489),m(437,489,$ge,eE),s.bc=function(){return new m9(this.a,u(u(this.d,134),138))},s.Qc=function(){return new m9(this.a,u(u(this.d,134),138))},s.ec=function(){var n;return n=this.b,u(n||(this.b=new m9(this.a,u(u(this.d,134),138))),277)},s.Sc=function(){var n;return n=this.b,u(n||(this.b=new m9(this.a,u(u(this.d,134),138))),277)},s.Uc=function(){return u(u(this.d,134),138)},s.Vc=function(n){return u(u(this.d,134),138).Vc(n)},s.Wc=function(n){return u(u(this.d,134),138).Wc(n)},s.Xc=function(n,t){return new eE(this.a,u(u(this.d,134),138).Xc(n,t))},s.Yc=function(n){return u(u(this.d,134),138).Yc(n)},s.Zc=function(n){return u(u(this.d,134),138).Zc(n)},s.$c=function(n,t){return new eE(this.a,u(u(this.d,134),138).$c(n,t))},v(hn,"AbstractMapBasedMultimap/NavigableAsMap",437),m(488,332,fYe,eT),s.Lc=function(){return this.b.ec().Lc()},v(hn,"AbstractMapBasedMultimap/SortedKeySet",488),m(394,488,Rge,m9),v(hn,"AbstractMapBasedMultimap/NavigableKeySet",394),m(539,31,im,nB),s.Ec=function(n){var t,i;return Is(this),i=this.d.dc(),t=this.d.Ec(n),t&&(++this.f.d,i&&OT(this)),t},s.Fc=function(n){var t,i,r;return n.dc()?!1:(r=(Is(this),this.d.gc()),t=this.d.Fc(n),t&&(i=this.d.gc(),this.f.d+=i-r,r==0&&OT(this)),t)},s.$b=function(){var n;n=(Is(this),this.d.gc()),n!=0&&(this.d.$b(),this.f.d-=n,bR(this))},s.Gc=function(n){return Is(this),this.d.Gc(n)},s.Hc=function(n){return Is(this),this.d.Hc(n)},s.Fb=function(n){return n===this?!0:(Is(this),gi(this.d,n))},s.Hb=function(){return Is(this),Ni(this.d)},s.Jc=function(){return Is(this),new rfe(this)},s.Kc=function(n){var t;return Is(this),t=this.d.Kc(n),t&&(--this.f.d,bR(this)),t},s.gc=function(){return iTe(this)},s.Lc=function(){return Is(this),this.d.Lc()},s.Ib=function(){return Is(this),fu(this.d)},v(hn,"AbstractMapBasedMultimap/WrappedCollection",539);var gl=Gi(pt,"List");m(732,539,{20:1,31:1,18:1,16:1},Nfe),s.gd=function(n){Zb(this,n)},s.Lc=function(){return Is(this),this.d.Lc()},s._c=function(n,t){var i;Is(this),i=this.d.dc(),u(this.d,16)._c(n,t),++this.a.d,i&&OT(this)},s.ad=function(n,t){var i,r,c;return t.dc()?!1:(c=(Is(this),this.d.gc()),i=u(this.d,16).ad(n,t),i&&(r=this.d.gc(),this.a.d+=r-c,c==0&&OT(this)),i)},s.Xb=function(n){return Is(this),u(this.d,16).Xb(n)},s.bd=function(n){return Is(this),u(this.d,16).bd(n)},s.cd=function(){return Is(this),new _Te(this)},s.dd=function(n){return Is(this),new e_e(this,n)},s.ed=function(n){var t;return Is(this),t=u(this.d,16).ed(n),--this.a.d,bR(this),t},s.fd=function(n,t){return Is(this),u(this.d,16).fd(n,t)},s.hd=function(n,t){return Is(this),ZLe(this.a,this.e,u(this.d,16).hd(n,t),this.b?this.b:this)},v(hn,"AbstractMapBasedMultimap/WrappedList",732),m(1095,732,{20:1,31:1,18:1,16:1,59:1},jOe),v(hn,"AbstractMapBasedMultimap/RandomAccessWrappedList",1095),m(619,1,Fr,rfe),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return R9(this),this.b.Ob()},s.Pb=function(){return R9(this),this.b.Pb()},s.Qb=function(){cOe(this)},v(hn,"AbstractMapBasedMultimap/WrappedCollection/WrappedIterator",619),m(733,619,Wh,_Te,e_e),s.Qb=function(){cOe(this)},s.Rb=function(n){var t;t=iTe(this.a)==0,(R9(this),u(this.b,128)).Rb(n),++this.a.a.d,t&&OT(this.a)},s.Sb=function(){return(R9(this),u(this.b,128)).Sb()},s.Tb=function(){return(R9(this),u(this.b,128)).Tb()},s.Ub=function(){return(R9(this),u(this.b,128)).Ub()},s.Vb=function(){return(R9(this),u(this.b,128)).Vb()},s.Wb=function(n){(R9(this),u(this.b,128)).Wb(n)},v(hn,"AbstractMapBasedMultimap/WrappedList/WrappedListIterator",733),m(731,539,fYe,Sle),s.Lc=function(){return Is(this),this.d.Lc()},v(hn,"AbstractMapBasedMultimap/WrappedSortedSet",731),m(1094,731,Rge,TTe),v(hn,"AbstractMapBasedMultimap/WrappedNavigableSet",1094),m(1093,539,fs,KOe),s.Lc=function(){return Is(this),this.d.Lc()},v(hn,"AbstractMapBasedMultimap/WrappedSet",1093),m(1102,1,{},Z),s.Kb=function(n){return g9n(u(n,45))},v(hn,"AbstractMapBasedMultimap/lambda$1$Type",1102),m(1101,1,{},n9),s.Kb=function(n){return new pw(this.a,n)},v(hn,"AbstractMapBasedMultimap/lambda$2$Type",1101);var yg=Gi(pt,"Map/Entry");m(358,1,dZ),s.Fb=function(n){var t;return X(n,45)?(t=u(n,45),C1(this.jd(),t.jd())&&C1(this.kd(),t.kd())):!1},s.Hb=function(){var n,t;return n=this.jd(),t=this.kd(),(n==null?0:Ni(n))^(t==null?0:Ni(t))},s.ld=function(n){throw R(new _t)},s.Ib=function(){return this.jd()+"="+this.kd()},v(hn,aYe,358),m(V0,31,im),s.$b=function(){this.md().$b()},s.Gc=function(n){var t;return X(n,45)?(t=u(n,45),$yn(this.md(),t.jd(),t.kd())):!1},s.Kc=function(n){var t;return X(n,45)?(t=u(n,45),RLe(this.md(),t.jd(),t.kd())):!1},s.gc=function(){return this.md().d},v(hn,"Multimaps/Entries",V0),m(737,V0,im,E1),s.Jc=function(){return this.a.kc()},s.md=function(){return this.a},s.Lc=function(){return this.a.lc()},v(hn,"AbstractMultimap/Entries",737),m(738,737,fs,xoe),s.Lc=function(){return this.a.lc()},s.Fb=function(n){return T0e(this,n)},s.Hb=function(){return JBe(this)},v(hn,"AbstractMultimap/EntrySet",738),m(739,31,im,_C),s.$b=function(){this.a.$b()},s.Gc=function(n){return Ckn(this.a,n)},s.Jc=function(){return this.a.nc()},s.gc=function(){return this.a.d},s.Lc=function(){return this.a.oc()},v(hn,"AbstractMultimap/Values",739),m(2049,31,{833:1,20:1,31:1,18:1}),s.Ic=function(n){Nt(n),qv(this).Ic(new YU(n))},s.Lc=function(){var n;return n=qv(this).Lc(),aW(n,new Ne,64|n.wd()&1296,this.a.d)},s.Ec=function(n){return Noe(),!0},s.Fc=function(n){return Nt(this),Nt(n),X(n,540)?qyn(u(n,833)):!n.dc()&&MY(this,n.Jc())},s.Gc=function(n){var t;return t=u(J2(L4(this.a),n),18),(t?t.gc():0)>0},s.Fb=function(n){return jOn(this,n)},s.Hb=function(){return Ni(qv(this))},s.dc=function(){return qv(this).dc()},s.Kc=function(n){return Sqe(this,n,1)>0},s.Ib=function(){return fu(qv(this))},v(hn,"AbstractMultiset",2049),m(2051,2030,fs),s.$b=function(){yB(this.a.a)},s.Gc=function(n){var t,i;return X(n,490)?(i=u(n,416),u(i.a.kd(),18).gc()<=0?!1:(t=uLe(this.a,i.a.jd()),t==u(i.a.kd(),18).gc())):!1},s.Kc=function(n){var t,i,r,c;return X(n,490)&&(i=u(n,416),t=i.a.jd(),r=u(i.a.kd(),18).gc(),r!=0)?(c=this.a,yTn(c,t,r)):!1},v(hn,"Multisets/EntrySet",2051),m(1108,2051,fs,cj),s.Jc=function(){return new Vxe(FIe(L4(this.a.a)).Jc())},s.gc=function(){return L4(this.a.a).gc()},v(hn,"AbstractMultiset/EntrySet",1108),m(618,730,ag),s.hc=function(){return this.nd()},s.jc=function(){return this.od()},s.cc=function(n){return this.pd(n)},s.fc=function(n){return this.qd(n)},s.Zb=function(){var n;return n=this.f,n||(this.f=this.ac())},s.od=function(){return En(),En(),bJ},s.Fb=function(n){return rQ(this,n)},s.pd=function(n){return u(vi(this,n),22)},s.qd=function(n){return u(AO(this,n),22)},s.mc=function(n){return En(),new h9(u(n,22))},s.pc=function(n,t){return new KOe(this,n,u(t,22))},v(hn,"AbstractSetMultimap",618),m(1689,618,ag),s.hc=function(){return new kd(this.b)},s.nd=function(){return new kd(this.b)},s.jc=function(){return Ufe(new kd(this.b))},s.od=function(){return Ufe(new kd(this.b))},s.cc=function(n){return u(u(vi(this,n),22),83)},s.pd=function(n){return u(u(vi(this,n),22),83)},s.fc=function(n){return u(u(AO(this,n),22),83)},s.qd=function(n){return u(u(AO(this,n),22),83)},s.mc=function(n){return X(n,277)?Ufe(u(n,277)):(En(),new ole(u(n,83)))},s.Zb=function(){var n;return n=this.f,n||(this.f=X(this.c,138)?new eE(this,u(this.c,138)):X(this.c,134)?new AT(this,u(this.c,134)):new p9(this,this.c))},s.pc=function(n,t){return X(t,277)?new TTe(this,n,u(t,277)):new Sle(this,n,u(t,83))},v(hn,"AbstractSortedSetMultimap",1689),m(1690,1689,ag),s.Zb=function(){var n;return n=this.f,u(u(n||(this.f=X(this.c,138)?new eE(this,u(this.c,138)):X(this.c,134)?new AT(this,u(this.c,134)):new p9(this,this.c)),134),138)},s.ec=function(){var n;return n=this.i,u(u(n||(this.i=X(this.c,138)?new m9(this,u(this.c,138)):X(this.c,134)?new eT(this,u(this.c,134)):new Hv(this,this.c)),83),277)},s.bc=function(){return X(this.c,138)?new m9(this,u(this.c,138)):X(this.c,134)?new eT(this,u(this.c,134)):new Hv(this,this.c)},v(hn,"AbstractSortedKeySortedSetMultimap",1690),m(2071,1,{2008:1}),s.Fb=function(n){return aAn(this,n)},s.Hb=function(){var n;return a1e((n=this.g,n||(this.g=new p0(this))))},s.Ib=function(){var n;return sGe((n=this.f,n||(this.f=new ele(this))))},v(hn,"AbstractTable",2071),m(669,Ga,fs,p0),s.$b=function(){uAe()},s.Gc=function(n){var t,i;return X(n,468)?(t=u(n,687),i=u(J2(aDe(this.a),x0(t.c.e,t.b)),92),!!i&&$1e(i.vc(),new pw(x0(t.c.c,t.a),F4(t.c,t.b,t.a)))):!1},s.Jc=function(){return G5n(this.a)},s.Kc=function(n){var t,i;return X(n,468)?(t=u(n,687),i=u(J2(aDe(this.a),x0(t.c.e,t.b)),92),!!i&&Wkn(i.vc(),new pw(x0(t.c.c,t.a),F4(t.c,t.b,t.a)))):!1},s.gc=function(){return pIe(this.a)},s.Lc=function(){return Xyn(this.a)},v(hn,"AbstractTable/CellSet",669),m(1987,31,im,JU),s.$b=function(){uAe()},s.Gc=function(n){return nMn(this.a,n)},s.Jc=function(){return q5n(this.a)},s.gc=function(){return pIe(this.a)},s.Lc=function(){return NLe(this.a)},v(hn,"AbstractTable/Values",1987),m(1662,1661,ag),v(hn,"ArrayListMultimapGwtSerializationDependencies",1662),m(506,1662,ag,NX,Sae),s.hc=function(){return new xo(this.a)},s.a=0,v(hn,"ArrayListMultimap",506),m(668,2071,{668:1,2008:1,3:1},Eqe),v(hn,"ArrayTable",668),m(1983,392,P8,tOe),s.Xb=function(n){return new w1e(this.a,n)},v(hn,"ArrayTable/1",1983),m(1984,1,{},HU),s.rd=function(n){return new w1e(this.a,n)},v(hn,"ArrayTable/1methodref$getCell$Type",1984),m(2072,1,{687:1}),s.Fb=function(n){var t;return n===this?!0:X(n,468)?(t=u(n,687),C1(x0(this.c.e,this.b),x0(t.c.e,t.b))&&C1(x0(this.c.c,this.a),x0(t.c.c,t.a))&&C1(F4(this.c,this.b,this.a),F4(t.c,t.b,t.a))):!1},s.Hb=function(){return zB(F(z(Mr,1),On,1,5,[x0(this.c.e,this.b),x0(this.c.c,this.a),F4(this.c,this.b,this.a)]))},s.Ib=function(){return"("+x0(this.c.e,this.b)+","+x0(this.c.c,this.a)+")="+F4(this.c,this.b,this.a)},v(hn,"Tables/AbstractCell",2072),m(468,2072,{468:1,687:1},w1e),s.a=0,s.b=0,s.d=0,v(hn,"ArrayTable/2",468),m(1986,1,{},W5),s.rd=function(n){return F$e(this.a,n)},v(hn,"ArrayTable/2methodref$getValue$Type",1986),m(1985,392,P8,iOe),s.Xb=function(n){return F$e(this.a,n)},v(hn,"ArrayTable/3",1985),m(2039,2027,Ww),s.$b=function(){sR(this.kc())},s.vc=function(){return new oj(this)},s.lc=function(){return new GDe(this.kc(),this.gc())},v(hn,"Maps/IteratorBasedAbstractMap",2039),m(826,2039,Ww),s.$b=function(){throw R(new _t)},s._b=function(n){return EAe(this.c,n)},s.kc=function(){return new rOe(this,this.c.b.c.gc())},s.lc=function(){return rV(this.c.b.c.gc(),16,new pP(this))},s.xc=function(n){var t;return t=u(nE(this.c,n),15),t?this.td(t.a):null},s.dc=function(){return this.c.b.c.dc()},s.ec=function(){return dV(this.c)},s.yc=function(n,t){var i;if(i=u(nE(this.c,n),15),!i)throw R(new qn(this.sd()+" "+n+" not in "+dV(this.c)));return this.ud(i.a,t)},s.Ac=function(n){throw R(new _t)},s.gc=function(){return this.c.b.c.gc()},v(hn,"ArrayTable/ArrayMap",826),m(1982,1,{},pP),s.rd=function(n){return bDe(this.a,n)},v(hn,"ArrayTable/ArrayMap/0methodref$getEntry$Type",1982),m(1980,358,dZ,QAe),s.jd=function(){return bpn(this.a,this.b)},s.kd=function(){return this.a.td(this.b)},s.ld=function(n){return this.a.ud(this.b,n)},s.b=0,v(hn,"ArrayTable/ArrayMap/1",1980),m(1981,392,P8,rOe),s.Xb=function(n){return bDe(this.a,n)},v(hn,"ArrayTable/ArrayMap/2",1981),m(1979,826,Ww,tDe),s.sd=function(){return"Column"},s.td=function(n){return F4(this.b,this.a,n)},s.ud=function(n,t){return Eze(this.b,this.a,n,t)},s.a=0,v(hn,"ArrayTable/Row",1979),m(827,826,Ww,ele),s.td=function(n){return new tDe(this.a,n)},s.yc=function(n,t){return u(t,92),$bn()},s.ud=function(n,t){return u(t,92),Rbn()},s.sd=function(){return"Row"},v(hn,"ArrayTable/RowMap",827),m(1126,1,dl,WAe),s.yd=function(n){return(this.a.wd()&-262&n)!=0},s.wd=function(){return this.a.wd()&-262},s.xd=function(){return this.a.xd()},s.Nb=function(n){this.a.Nb(new eMe(n,this.b))},s.zd=function(n){return this.a.zd(new ZAe(n,this.b))},v(hn,"CollectSpliterators/1",1126),m(1127,1,ct,ZAe),s.Ad=function(n){this.a.Ad(this.b.Kb(n))},v(hn,"CollectSpliterators/1/lambda$0$Type",1127),m(1128,1,ct,eMe),s.Ad=function(n){this.a.Ad(this.b.Kb(n))},v(hn,"CollectSpliterators/1/lambda$1$Type",1128),m(1123,1,dl,ENe),s.yd=function(n){return((16464|this.b)&n)!=0},s.wd=function(){return 16464|this.b},s.xd=function(){return this.a.xd()},s.Nb=function(n){this.a.Oe(new tMe(n,this.c))},s.zd=function(n){return this.a.Pe(new nMe(n,this.c))},s.b=0,v(hn,"CollectSpliterators/1WithCharacteristics",1123),m(1124,1,dN,nMe),s.Bd=function(n){this.a.Ad(this.b.rd(n))},v(hn,"CollectSpliterators/1WithCharacteristics/lambda$0$Type",1124),m(1125,1,dN,tMe),s.Bd=function(n){this.a.Ad(this.b.rd(n))},v(hn,"CollectSpliterators/1WithCharacteristics/lambda$1$Type",1125),m(1119,1,dl),s.yd=function(n){return(this.a&n)!=0},s.wd=function(){return this.a},s.xd=function(){return this.e&&(this.b=Gse(this.b,this.e.xd())),Gse(this.b,0)},s.Nb=function(n){this.e&&(this.e.Nb(n),this.e=null),this.c.Nb(new iMe(this,n)),this.b=0},s.zd=function(n){for(;;){if(this.e&&this.e.zd(n))return qj(this.b,bN)&&(this.b=lf(this.b,1)),!0;if(this.e=null,!this.c.zd(new Z5(this)))return!1}},s.a=0,s.b=0,v(hn,"CollectSpliterators/FlatMapSpliterator",1119),m(1121,1,ct,Z5),s.Ad=function(n){s2n(this.a,n)},v(hn,"CollectSpliterators/FlatMapSpliterator/lambda$0$Type",1121),m(1122,1,ct,iMe),s.Ad=function(n){y5n(this.a,this.b,n)},v(hn,"CollectSpliterators/FlatMapSpliterator/lambda$1$Type",1122),m(1120,1119,dl,lPe),v(hn,"CollectSpliterators/FlatMapSpliteratorOfObject",1120),m(254,1,bZ),s.Dd=function(n){return this.Cd(u(n,254))},s.Cd=function(n){var t;return n==(SX(),Qne)?1:n==(EX(),Yne)?-1:(t=(tR(),gO(this.a,n.a)),t!=0?t:($n(),X(this,513)==X(n,513)?0:X(this,513)?1:-1))},s.Gd=function(){return this.a},s.Fb=function(n){return Lde(this,n)},v(hn,"Cut",254),m(1793,254,bZ,Jxe),s.Cd=function(n){return n==this?0:1},s.Ed=function(n){throw R(new loe)},s.Fd=function(n){n.a+="+∞)"},s.Gd=function(){throw R(new Uc(dYe))},s.Hb=function(){return jd(),jde(this)},s.Hd=function(n){return!1},s.Ib=function(){return"+∞"};var Yne;v(hn,"Cut/AboveAll",1793),m(513,254,{254:1,513:1,3:1,35:1},sOe),s.Ed=function(n){uo((n.a+="(",n),this.a)},s.Fd=function(n){qb(uo(n,this.a),93)},s.Hb=function(){return~Ni(this.a)},s.Hd=function(n){return tR(),gO(this.a,n)<0},s.Ib=function(){return"/"+this.a+"\\"},v(hn,"Cut/AboveValue",513),m(1792,254,bZ,Fxe),s.Cd=function(n){return n==this?0:-1},s.Ed=function(n){n.a+="(-∞"},s.Fd=function(n){throw R(new loe)},s.Gd=function(){throw R(new Uc(dYe))},s.Hb=function(){return jd(),jde(this)},s.Hd=function(n){return!0},s.Ib=function(){return"-∞"};var Qne;v(hn,"Cut/BelowAll",1792),m(1794,254,bZ,lOe),s.Ed=function(n){uo((n.a+="[",n),this.a)},s.Fd=function(n){qb(uo(n,this.a),41)},s.Hb=function(){return Ni(this.a)},s.Hd=function(n){return tR(),gO(this.a,n)<=0},s.Ib=function(){return"\\"+this.a+"/"},v(hn,"Cut/BelowValue",1794),m(535,1,Zh),s.Ic=function(n){cc(this,n)},s.Ib=function(){return Cjn(u(NR(this,"use Optional.orNull() instead of Optional.or(null)"),20).Jc())},v(hn,"FluentIterable",535),m(433,535,Zh,Kj),s.Jc=function(){return new Un(Yn(this.a.Jc(),new ee))},v(hn,"FluentIterable/2",433),m(36,1,{},ee),s.Kb=function(n){return u(n,20).Jc()},s.Fb=function(n){return this===n},v(hn,"FluentIterable/2/0methodref$iterator$Type",36),m(1040,535,Zh,ETe),s.Jc=function(){return Uh(this)},v(hn,"FluentIterable/3",1040),m(714,392,P8,sle),s.Xb=function(n){return this.a[n].Jc()},v(hn,"FluentIterable/3/1",714),m(2032,1,{}),s.Ib=function(){return fu(this.Id().b)},v(hn,"ForwardingObject",2032),m(2033,2032,bYe),s.Id=function(){return this.Jd()},s.Ic=function(n){cc(this,n)},s.Lc=function(){return new vn(this,0)},s.Mc=function(){return new mn(null,this.Lc())},s.Ec=function(n){return this.Jd(),MAe()},s.Fc=function(n){return this.Jd(),CAe()},s.$b=function(){this.Jd(),TAe()},s.Gc=function(n){return this.Jd().Gc(n)},s.Hc=function(n){return this.Jd().Hc(n)},s.dc=function(){return this.Jd().b.dc()},s.Jc=function(){return this.Jd().Jc()},s.Kc=function(n){return this.Jd(),OAe()},s.gc=function(){return this.Jd().b.gc()},s.Nc=function(){return this.Jd().Nc()},s.Oc=function(n){return this.Jd().Oc(n)},v(hn,"ForwardingCollection",2033),m(2040,31,Bge),s.Jc=function(){return this.Md()},s.Ec=function(n){throw R(new _t)},s.Fc=function(n){throw R(new _t)},s.Kd=function(){var n;return n=this.c,n||(this.c=this.Ld())},s.$b=function(){throw R(new _t)},s.Gc=function(n){return n!=null&&H2(this,n,!1)},s.Ld=function(){switch(this.gc()){case 0:return oR(),ete;case 1:return new GK(Nt(this.Md().Pb()));default:return new cfe(this,this.Nc())}},s.Kc=function(n){throw R(new _t)},v(hn,"ImmutableCollection",2040),m(1259,2040,Bge,vP),s.Jc=function(){return J4(new ic(this.a.b.Jc()))},s.Gc=function(n){return n!=null&&xj(this.a,n)},s.Hc=function(n){return Koe(this.a,n)},s.dc=function(){return this.a.b.dc()},s.Md=function(){return J4(new ic(this.a.b.Jc()))},s.gc=function(){return this.a.b.gc()},s.Nc=function(){return this.a.b.Nc()},s.Oc=function(n){return Voe(this.a,n)},s.Ib=function(){return fu(this.a.b)},v(hn,"ForwardingImmutableCollection",1259),m(311,2040,$8),s.Jc=function(){return this.Md()},s.cd=function(){return this.Nd(0)},s.dd=function(n){return this.Nd(n)},s.gd=function(n){Zb(this,n)},s.Lc=function(){return new vn(this,16)},s.hd=function(n,t){return this.Od(n,t)},s._c=function(n,t){throw R(new _t)},s.ad=function(n,t){throw R(new _t)},s.Kd=function(){return this},s.Fb=function(n){return hOn(this,n)},s.Hb=function(){return B7n(this)},s.bd=function(n){return n==null?-1:USn(this,n)},s.Md=function(){return this.Nd(0)},s.Nd=function(n){return PK(this,n)},s.ed=function(n){throw R(new _t)},s.fd=function(n,t){throw R(new _t)},s.Od=function(n,t){var i;return XB((i=new aMe(this),new N0(i,n,t)))},v(hn,"ImmutableList",311),m(2067,311,$8),s.Jc=function(){return J4(this.Pd().Jc())},s.hd=function(n,t){return XB(this.Pd().hd(n,t))},s.Gc=function(n){return n!=null&&this.Pd().Gc(n)},s.Hc=function(n){return this.Pd().Hc(n)},s.Fb=function(n){return gi(this.Pd(),n)},s.Xb=function(n){return x0(this,n)},s.Hb=function(){return Ni(this.Pd())},s.bd=function(n){return this.Pd().bd(n)},s.dc=function(){return this.Pd().dc()},s.Md=function(){return J4(this.Pd().Jc())},s.gc=function(){return this.Pd().gc()},s.Od=function(n,t){return XB(this.Pd().hd(n,t))},s.Nc=function(){return this.Pd().Oc(se(Mr,On,1,this.Pd().gc(),5,1))},s.Oc=function(n){return this.Pd().Oc(n)},s.Ib=function(){return fu(this.Pd())},v(hn,"ForwardingImmutableList",2067),m(717,1,R8),s.vc=function(){return Fb(this)},s.wc=function(n){wO(this,n)},s.ec=function(){return dV(this)},s.Bc=function(){return this.Td()},s.$b=function(){throw R(new _t)},s._b=function(n){return this.xc(n)!=null},s.uc=function(n){return this.Td().Gc(n)},s.Rd=function(){return new UU(this)},s.Sd=function(){return new XU(this)},s.Fb=function(n){return Tkn(this,n)},s.Hb=function(){return Fb(this).Hb()},s.dc=function(){return this.gc()==0},s.yc=function(n,t){return Bbn()},s.Ac=function(n){throw R(new _t)},s.Ib=function(){return VMn(this)},s.Td=function(){return this.e?this.e:this.e=this.Sd()},s.c=null,s.d=null,s.e=null,v(hn,"ImmutableMap",717),m(718,717,R8),s._b=function(n){return EAe(this,n)},s.uc=function(n){return mMe(this.b,n)},s.Qd=function(){return uFe(new mP(this))},s.Rd=function(){return uFe(PDe(this.b))},s.Sd=function(){return new vP($De(this.b))},s.Fb=function(n){return yMe(this.b,n)},s.xc=function(n){return nE(this,n)},s.Hb=function(){return Ni(this.b.c)},s.dc=function(){return this.b.c.dc()},s.gc=function(){return this.b.c.gc()},s.Ib=function(){return fu(this.b.c)},v(hn,"ForwardingImmutableMap",718),m(2034,2033,gZ),s.Id=function(){return this.Ud()},s.Jd=function(){return this.Ud()},s.Lc=function(){return new vn(this,1)},s.Fb=function(n){return n===this||this.Ud().Fb(n)},s.Hb=function(){return this.Ud().Hb()},v(hn,"ForwardingSet",2034),m(1055,2034,gZ,mP),s.Id=function(){return P9(this.a.b)},s.Jd=function(){return P9(this.a.b)},s.Gc=function(n){if(X(n,45)&&u(n,45).jd()==null)return!1;try{return vMe(P9(this.a.b),n)}catch(t){if(t=sr(t),X(t,211))return!1;throw R(t)}},s.Ud=function(){return P9(this.a.b)},s.Oc=function(n){var t,i;return t=j_e(P9(this.a.b),n),P9(this.a.b).b.gc()=0?"+":"")+(i/60|0),t=_$(k.Math.abs(i)%60),(yGe(),lnn)[this.q.getDay()]+" "+fnn[this.q.getMonth()]+" "+_$(this.q.getDate())+" "+_$(this.q.getHours())+":"+_$(this.q.getMinutes())+":"+_$(this.q.getSeconds())+" GMT"+n+t+" "+this.q.getFullYear()};var aJ=v(pt,"Date",205);m(1977,205,EYe,FHe),s.a=!1,s.b=0,s.c=0,s.d=0,s.e=0,s.f=0,s.g=!1,s.i=0,s.j=0,s.k=0,s.n=0,s.o=0,s.p=0,v("com.google.gwt.i18n.shared.impl","DateRecord",1977),m(2026,1,{}),s.ne=function(){return null},s.oe=function(){return null},s.pe=function(){return null},s.qe=function(){return null},s.re=function(){return null},v(hy,"JSONValue",2026),m(139,2026,{139:1},wd,i9),s.Fb=function(n){return X(n,139)?Mae(this.a,u(n,139).a):!1},s.me=function(){return cbn},s.Hb=function(){return aae(this.a)},s.ne=function(){return this},s.Ib=function(){var n,t,i;for(i=new tl("["),t=0,n=this.a.length;t0&&(i.a+=","),uo(i,L2(this,t));return i.a+="]",i.a},v(hy,"JSONArray",139),m(479,2026,{479:1},r9),s.me=function(){return ubn},s.oe=function(){return this},s.Ib=function(){return $n(),""+this.a},s.a=!1;var Qen,Wen;v(hy,"JSONBoolean",479),m(981,63,H1,Yxe),v(hy,"JSONException",981),m(1017,2026,{},nt),s.me=function(){return fbn},s.Ib=function(){return Vo};var Zen;v(hy,"JSONNull",1017),m(265,2026,{265:1},Av),s.Fb=function(n){return X(n,265)?this.a==u(n,265).a:!1},s.me=function(){return obn},s.Hb=function(){return v4(this.a)},s.pe=function(){return this},s.Ib=function(){return this.a+""},s.a=0,v(hy,"JSONNumber",265),m(149,2026,{149:1},l4,c9),s.Fb=function(n){return X(n,149)?Mae(this.a,u(n,149).a):!1},s.me=function(){return sbn},s.Hb=function(){return aae(this.a)},s.qe=function(){return this},s.Ib=function(){var n,t,i,r,c,o,l;for(l=new tl("{"),n=!0,o=zY(this,se(He,Me,2,0,6,1)),i=o,r=0,c=i.length;r=0?":"+this.c:"")+")"},s.c=0;var _me=v(Cu,"StackTraceElement",324);Hen={3:1,472:1,35:1,2:1};var He=v(Cu,zge,2);m(111,418,{472:1},vd,Ej,cf),v(Cu,"StringBuffer",111),m(106,418,{472:1},y0,h4,tl),v(Cu,"StringBuilder",106),m(691,99,cF,Ioe),v(Cu,"StringIndexOutOfBoundsException",691),m(2107,1,{});var inn;m(46,63,{3:1,101:1,63:1,80:1,46:1},_t,pd),v(Cu,"UnsupportedOperationException",46),m(247,242,{3:1,35:1,242:1,247:1},TO,Joe),s.Dd=function(n){return yKe(this,u(n,247))},s.se=function(){return K2(XKe(this))},s.Fb=function(n){var t;return this===n?!0:X(n,247)?(t=u(n,247),this.e==t.e&&yKe(this,t)==0):!1},s.Hb=function(){var n;return this.b!=0?this.b:this.a<54?(n=Lu(this.f),this.b=Rt(Rr(n,-1)),this.b=33*this.b+Rt(Rr(Sw(n,32),-1)),this.b=17*this.b+lc(this.e),this.b):(this.b=17*pFe(this.c)+lc(this.e),this.b)},s.Ib=function(){return XKe(this)},s.a=0,s.b=0,s.d=0,s.e=0,s.f=0;var rnn,kg,Lme,Pme,$me,Rme,Bme,zme,ute=v("java.math","BigDecimal",247);m(91,242,{3:1,35:1,242:1,91:1},I1,dLe,Gb,AJe,A0),s.Dd=function(n){return kJe(this,u(n,91))},s.se=function(){return K2(fZ(this,0))},s.Fb=function(n){return ude(this,n)},s.Hb=function(){return pFe(this)},s.Ib=function(){return fZ(this,0)},s.b=-2,s.c=0,s.d=0,s.e=0;var cnn,hJ,unn,ote,dJ,VS,T3=v("java.math","BigInteger",91),onn,snn,Ey,YS;m(484,2027,Ww),s.$b=function(){Hu(this)},s._b=function(n){return so(this,n)},s.uc=function(n){return nFe(this,n,this.i)||nFe(this,n,this.f)},s.vc=function(){return new sn(this)},s.xc=function(n){return zn(this,n)},s.yc=function(n,t){return ei(this,n,t)},s.Ac=function(n){return z4(this,n)},s.gc=function(){return Aj(this)},s.g=0,v(pt,"AbstractHashMap",484),m(306,Ga,fs,sn),s.$b=function(){this.a.$b()},s.Gc=function(n){return HLe(this,n)},s.Jc=function(){return new B2(this.a)},s.Kc=function(n){var t;return HLe(this,n)?(t=u(n,45).jd(),this.a.Ac(t),!0):!1},s.gc=function(){return this.a.gc()},v(pt,"AbstractHashMap/EntrySet",306),m(307,1,Fr,B2),s.Nb=function(n){Zr(this,n)},s.Pb=function(){return t3(this)},s.Ob=function(){return this.b},s.Qb=function(){wRe(this)},s.b=!1,s.d=0,v(pt,"AbstractHashMap/EntrySetIterator",307),m(417,1,Fr,qc),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return FX(this)},s.Pb=function(){return oae(this)},s.Qb=function(){As(this)},s.b=0,s.c=-1,v(pt,"AbstractList/IteratorImpl",417),m(97,417,Wh,qr),s.Qb=function(){As(this)},s.Rb=function(n){y2(this,n)},s.Sb=function(){return this.b>0},s.Tb=function(){return this.b},s.Ub=function(){return at(this.b>0),this.a.Xb(this.c=--this.b)},s.Vb=function(){return this.b-1},s.Wb=function(n){w2(this.c!=-1),this.a.fd(this.c,n)},v(pt,"AbstractList/ListIteratorImpl",97),m(258,56,B8,N0),s._c=function(n,t){N2(n,this.b),this.c._c(this.a+n,t),++this.b},s.Xb=function(n){return kn(n,this.b),this.c.Xb(this.a+n)},s.ed=function(n){var t;return kn(n,this.b),t=this.c.ed(this.a+n),--this.b,t},s.fd=function(n,t){return kn(n,this.b),this.c.fd(this.a+n,t)},s.gc=function(){return this.b},s.a=0,s.b=0,v(pt,"AbstractList/SubList",258),m(232,Ga,fs,it),s.$b=function(){this.a.$b()},s.Gc=function(n){return this.a._b(n)},s.Jc=function(){var n;return n=this.a.vc().Jc(),new gt(n)},s.Kc=function(n){return this.a._b(n)?(this.a.Ac(n),!0):!1},s.gc=function(){return this.a.gc()},v(pt,"AbstractMap/1",232),m(529,1,Fr,gt),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return this.a.Ob()},s.Pb=function(){var n;return n=u(this.a.Pb(),45),n.jd()},s.Qb=function(){this.a.Qb()},v(pt,"AbstractMap/1/1",529),m(230,31,im,ot),s.$b=function(){this.a.$b()},s.Gc=function(n){return this.a.uc(n)},s.Jc=function(){var n;return n=this.a.vc().Jc(),new Hi(n)},s.gc=function(){return this.a.gc()},v(pt,"AbstractMap/2",230),m(304,1,Fr,Hi),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return this.a.Ob()},s.Pb=function(){var n;return n=u(this.a.Pb(),45),n.kd()},s.Qb=function(){this.a.Qb()},v(pt,"AbstractMap/2/1",304),m(480,1,{480:1,45:1}),s.Fb=function(n){var t;return X(n,45)?(t=u(n,45),Ku(this.d,t.jd())&&Ku(this.e,t.kd())):!1},s.jd=function(){return this.d},s.kd=function(){return this.e},s.Hb=function(){return Bv(this.d)^Bv(this.e)},s.ld=function(n){return Ile(this,n)},s.Ib=function(){return this.d+"="+this.e},v(pt,"AbstractMap/AbstractEntry",480),m(390,480,{480:1,390:1,45:1},u$),v(pt,"AbstractMap/SimpleEntry",390),m(2044,1,BZ),s.Fb=function(n){var t;return X(n,45)?(t=u(n,45),Ku(this.jd(),t.jd())&&Ku(this.kd(),t.kd())):!1},s.Hb=function(){return Bv(this.jd())^Bv(this.kd())},s.Ib=function(){return this.jd()+"="+this.kd()},v(pt,aYe,2044),m(2052,2027,$ge),s.Vc=function(n){return LX(this.Ce(n))},s.tc=function(n){return $Pe(this,n)},s._b=function(n){return Dle(this,n)},s.vc=function(){return new Xi(this)},s.Rc=function(){return iDe(this.Ee())},s.Wc=function(n){return LX(this.Fe(n))},s.xc=function(n){var t;return t=n,bu(this.De(t))},s.Yc=function(n){return LX(this.Ge(n))},s.ec=function(){return new _u(this)},s.Tc=function(){return iDe(this.He())},s.Zc=function(n){return LX(this.Ie(n))},v(pt,"AbstractNavigableMap",2052),m(620,Ga,fs,Xi),s.Gc=function(n){return X(n,45)&&$Pe(this.b,u(n,45))},s.Jc=function(){return this.b.Be()},s.Kc=function(n){var t;return X(n,45)?(t=u(n,45),this.b.Je(t)):!1},s.gc=function(){return this.b.gc()},v(pt,"AbstractNavigableMap/EntrySet",620),m(1115,Ga,Rge,_u),s.Lc=function(){return new l$(this)},s.$b=function(){this.a.$b()},s.Gc=function(n){return Dle(this.a,n)},s.Jc=function(){var n;return n=this.a.vc().b.Be(),new Lke(n)},s.Kc=function(n){return Dle(this.a,n)?(this.a.Ac(n),!0):!1},s.gc=function(){return this.a.gc()},v(pt,"AbstractNavigableMap/NavigableKeySet",1115),m(1116,1,Fr,Lke),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return FX(this.a.a)},s.Pb=function(){var n;return n=TOe(this.a),n.jd()},s.Qb=function(){INe(this.a)},v(pt,"AbstractNavigableMap/NavigableKeySet/1",1116),m(2065,31,im),s.Ec=function(n){return C4(k8(this,n),F8),!0},s.Fc=function(n){return _n(n),LT(n!=this,"Can't add a queue to itself"),ac(this,n)},s.$b=function(){for(;CY(this)!=null;);},v(pt,"AbstractQueue",2065),m(314,31,{4:1,20:1,31:1,18:1},Fv,_Le),s.Ec=function(n){return Lae(this,n),!0},s.$b=function(){zae(this)},s.Gc=function(n){return vze(new dE(this),n)},s.dc=function(){return jj(this)},s.Jc=function(){return new dE(this)},s.Kc=function(n){return x4n(new dE(this),n)},s.gc=function(){return this.c-this.b&this.a.length-1},s.Lc=function(){return new vn(this,272)},s.Oc=function(n){var t;return t=this.c-this.b&this.a.length-1,n.lengtht&&ir(n,t,null),n},s.b=0,s.c=0,v(pt,"ArrayDeque",314),m(448,1,Fr,dE),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return this.a!=this.b},s.Pb=function(){return JB(this)},s.Qb=function(){vBe(this)},s.a=0,s.b=0,s.c=-1,v(pt,"ArrayDeque/IteratorImpl",448),m(13,56,MYe,Oe,xo,bs),s._c=function(n,t){zb(this,n,t)},s.Ec=function(n){return Te(this,n)},s.ad=function(n,t){return N1e(this,n,t)},s.Fc=function(n){return Sr(this,n)},s.$b=function(){r2(this.c,0)},s.Gc=function(n){return pu(this,n,0)!=-1},s.Ic=function(n){Ao(this,n)},s.Xb=function(n){return Pe(this,n)},s.bd=function(n){return pu(this,n,0)},s.dc=function(){return this.c.length==0},s.Jc=function(){return new P(this)},s.ed=function(n){return Cd(this,n)},s.Kc=function(n){return qo(this,n)},s.ae=function(n,t){cLe(this,n,t)},s.fd=function(n,t){return ul(this,n,t)},s.gc=function(){return this.c.length},s.gd=function(n){Tr(this,n)},s.Nc=function(){return iR(this.c)},s.Oc=function(n){return Ba(this,n)};var ABn=v(pt,"ArrayList",13);m(7,1,Fr,P),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return gu(this)},s.Pb=function(){return _(this)},s.Qb=function(){sE(this)},s.a=0,s.b=-1,v(pt,"ArrayList/1",7),m(2074,k.Function,{},pn),s.Ke=function(n,t){return ji(n,t)},m(123,56,CYe,Su),s.Gc=function(n){return mBe(this,n)!=-1},s.Ic=function(n){var t,i,r,c;for(_n(n),i=this.a,r=0,c=i.length;r0)throw R(new qn(Kge+n+" greater than "+this.e));return this.f.Re()?C_e(this.c,this.b,this.a,n,t):iLe(this.c,n,t)},s.yc=function(n,t){if(!eW(this.c,this.f,n,this.b,this.a,this.e,this.d))throw R(new qn(n+" outside the range "+this.b+" to "+this.e));return $ze(this.c,n,t)},s.Ac=function(n){var t;return t=n,eW(this.c,this.f,t,this.b,this.a,this.e,this.d)?T_e(this.c,t):null},s.Je=function(n){return xR(this,n.jd())&&uhe(this.c,n)},s.gc=function(){var n,t,i;if(this.f.Re()?this.a?t=b8(this.c,this.b,!0):t=b8(this.c,this.b,!1):t=mhe(this.c),!(t&&xR(this,t.d)&&t))return 0;for(n=0,i=new FY(this.c,this.f,this.b,this.a,this.e,this.d);FX(i.a);i.b=u(oae(i.a),45))++n;return n},s.$c=function(n,t){if(this.f.Re()&&this.c.a.Le(n,this.b)<0)throw R(new qn(Kge+n+NYe+this.b));return this.f.Se()?C_e(this.c,n,t,this.e,this.d):rLe(this.c,n,t)},s.a=!1,s.d=!1,v(pt,"TreeMap/SubMap",622),m(309,23,HZ,o$),s.Re=function(){return!1},s.Se=function(){return!1};var fte,ate,hte,dte,gJ=yt(pt,"TreeMap/SubMapType",309,Tt,n6n,M2n);m(1112,309,HZ,MTe),s.Se=function(){return!0},yt(pt,"TreeMap/SubMapType/1",1112,gJ,null,null),m(1113,309,HZ,BTe),s.Re=function(){return!0},s.Se=function(){return!0},yt(pt,"TreeMap/SubMapType/2",1113,gJ,null,null),m(1114,309,HZ,CTe),s.Re=function(){return!0},yt(pt,"TreeMap/SubMapType/3",1114,gJ,null,null);var wnn;m(141,Ga,{3:1,20:1,31:1,18:1,277:1,22:1,83:1,141:1},pX,lle,kd,o9),s.Lc=function(){return new l$(this)},s.Ec=function(n){return RT(this,n)},s.$b=function(){this.a.$b()},s.Gc=function(n){return this.a._b(n)},s.Jc=function(){return this.a.ec().Jc()},s.Kc=function(n){return DK(this,n)},s.gc=function(){return this.a.gc()};var IBn=v(pt,"TreeSet",141);m(1052,1,{},Rke),s.Te=function(n,t){return Xpn(this.a,n,t)},v(GZ,"BinaryOperator/lambda$0$Type",1052),m(1053,1,{},Bke),s.Te=function(n,t){return Kpn(this.a,n,t)},v(GZ,"BinaryOperator/lambda$1$Type",1053),m(935,1,{},Fu),s.Kb=function(n){return n},v(GZ,"Function/lambda$0$Type",935),m(388,1,zt,s9),s.Mb=function(n){return!this.a.Mb(n)},v(GZ,"Predicate/lambda$2$Type",388),m(567,1,{567:1});var pnn=v(mS,"Handler",567);m(2069,1,aN),s.ve=function(){return"DUMMY"},s.Ib=function(){return this.ve()};var Xme;v(mS,"Level",2069),m(1672,2069,aN,Rs),s.ve=function(){return"INFO"},v(mS,"Level/LevelInfo",1672),m(1824,1,{},ixe);var bte;v(mS,"LogManager",1824),m(1866,1,aN,NNe),s.b=null,v(mS,"LogRecord",1866),m(511,1,{511:1},oY),s.e=!1;var mnn=!1,vnn=!1,Va=!1,ynn=!1,knn=!1;v(mS,"Logger",511),m(819,567,{567:1},Er),v(mS,"SimpleConsoleLogHandler",819),m(130,23,{3:1,35:1,23:1,130:1},GX);var Kme,Yo,Vme,Qo=yt(_c,"Collector/Characteristics",130,Tt,B4n,C2n),jnn;m(746,1,{},Bfe),v(_c,"CollectorImpl",746),m(1050,1,{},Kr),s.Te=function(n,t){return ajn(u(n,212),u(t,212))},v(_c,"Collectors/10methodref$merge$Type",1050),m(1051,1,{},Mt),s.Kb=function(n){return DLe(u(n,212))},v(_c,"Collectors/11methodref$toString$Type",1051),m(152,1,{},bi),s.Wd=function(n,t){u(n,18).Ec(t)},v(_c,"Collectors/20methodref$add$Type",152),m(154,1,{},zi),s.Ve=function(){return new Oe},v(_c,"Collectors/21methodref$ctor$Type",154),m(1049,1,{},cu),s.Wd=function(n,t){D1(u(n,212),u(t,472))},v(_c,"Collectors/9methodref$add$Type",1049),m(1048,1,{},YNe),s.Ve=function(){return new ng(this.a,this.b,this.c)},v(_c,"Collectors/lambda$15$Type",1048),m(153,1,{},Cc),s.Te=function(n,t){return Egn(u(n,18),u(t,18))},v(_c,"Collectors/lambda$45$Type",153),m(538,1,{}),s.Ye=function(){hE(this)},s.d=!1,v(_c,"TerminatableStream",538),m(768,538,Vge,xle),s.Ye=function(){hE(this)},v(_c,"DoubleStreamImpl",768),m(1297,724,dl,QNe),s.Pe=function(n){return RSn(this,u(n,189))},s.a=null,v(_c,"DoubleStreamImpl/2",1297),m(1298,1,yN,zke),s.Ne=function(n){wwn(this.a,n)},v(_c,"DoubleStreamImpl/2/lambda$0$Type",1298),m(1295,1,yN,Fke),s.Ne=function(n){gwn(this.a,n)},v(_c,"DoubleStreamImpl/lambda$0$Type",1295),m(1296,1,yN,Jke),s.Ne=function(n){lJe(this.a,n)},v(_c,"DoubleStreamImpl/lambda$2$Type",1296),m(1351,723,dl,HPe),s.Pe=function(n){return Gyn(this,u(n,202))},s.a=0,s.b=0,s.c=0,v(_c,"IntStream/5",1351),m(793,538,Vge,Ale),s.Ye=function(){hE(this)},s.Ze=function(){return T0(this),this.a},v(_c,"IntStreamImpl",793),m(794,538,Vge,Yoe),s.Ye=function(){hE(this)},s.Ze=function(){return T0(this),Yse(),gnn},v(_c,"IntStreamImpl/Empty",794),m(1651,1,dN,Hke),s.Bd=function(n){nze(this.a,n)},v(_c,"IntStreamImpl/lambda$4$Type",1651);var DBn=Gi(_c,"Stream");m(28,538,{520:1,677:1,832:1},mn),s.Ye=function(){hE(this)};var Sy;v(_c,"StreamImpl",28),m(1072,486,dl,jNe),s.zd=function(n){for(;G9n(this);){if(this.a.zd(n))return!0;hE(this.b),this.b=null,this.a=null}return!1},v(_c,"StreamImpl/1",1072),m(1073,1,ct,Gke),s.Ad=function(n){Ivn(this.a,u(n,832))},v(_c,"StreamImpl/1/lambda$0$Type",1073),m(1074,1,zt,qke),s.Mb=function(n){return hr(this.a,n)},v(_c,"StreamImpl/1methodref$add$Type",1074),m(1075,486,dl,n_e),s.zd=function(n){var t;return this.a||(t=new Oe,this.b.a.Nb(new Uke(t)),En(),Tr(t,this.c),this.a=new vn(t,16)),HRe(this.a,n)},s.a=null,v(_c,"StreamImpl/5",1075),m(1076,1,ct,Uke),s.Ad=function(n){Te(this.a,n)},v(_c,"StreamImpl/5/2methodref$add$Type",1076),m(725,486,dl,whe),s.zd=function(n){for(this.b=!1;!this.b&&this.c.zd(new zMe(this,n)););return this.b},s.b=!1,v(_c,"StreamImpl/FilterSpliterator",725),m(1066,1,ct,zMe),s.Ad=function(n){S3n(this.a,this.b,n)},v(_c,"StreamImpl/FilterSpliterator/lambda$0$Type",1066),m(1061,724,dl,ZPe),s.Pe=function(n){return m2n(this,u(n,189))},v(_c,"StreamImpl/MapToDoubleSpliterator",1061),m(1065,1,ct,FMe),s.Ad=function(n){Bgn(this.a,this.b,n)},v(_c,"StreamImpl/MapToDoubleSpliterator/lambda$0$Type",1065),m(1060,723,dl,e$e),s.Pe=function(n){return v2n(this,u(n,202))},v(_c,"StreamImpl/MapToIntSpliterator",1060),m(1064,1,ct,JMe),s.Ad=function(n){zgn(this.a,this.b,n)},v(_c,"StreamImpl/MapToIntSpliterator/lambda$0$Type",1064),m(722,486,dl,the),s.zd=function(n){return SNe(this,n)},v(_c,"StreamImpl/MapToObjSpliterator",722),m(1063,1,ct,HMe),s.Ad=function(n){Fgn(this.a,this.b,n)},v(_c,"StreamImpl/MapToObjSpliterator/lambda$0$Type",1063),m(1062,486,dl,yBe),s.zd=function(n){for(;JX(this.b,0);){if(!this.a.zd(new ef))return!1;this.b=lf(this.b,1)}return this.a.zd(n)},s.b=0,v(_c,"StreamImpl/SkipSpliterator",1062),m(1067,1,ct,ef),s.Ad=function(n){},v(_c,"StreamImpl/SkipSpliterator/lambda$0$Type",1067),m(617,1,ct,Oa),s.Ad=function(n){SP(this,n)},v(_c,"StreamImpl/ValueConsumer",617),m(1068,1,ct,ia),s.Ad=function(n){$b()},v(_c,"StreamImpl/lambda$0$Type",1068),m(1069,1,ct,o0),s.Ad=function(n){$b()},v(_c,"StreamImpl/lambda$1$Type",1069),m(1070,1,{},Xke),s.Te=function(n,t){return x2n(this.a,n,t)},v(_c,"StreamImpl/lambda$4$Type",1070),m(1071,1,ct,GMe),s.Ad=function(n){e2n(this.b,this.a,n)},v(_c,"StreamImpl/lambda$5$Type",1071),m(1077,1,ct,Kke),s.Ad=function(n){J7n(this.a,u(n,375))},v(_c,"TerminatableStream/lambda$0$Type",1077),m(2104,1,{}),m(1976,1,{},xb),v("javaemul.internal","ConsoleLogger",1976);var _Bn=0;m(2096,1,{}),m(1800,1,ct,Sl),s.Ad=function(n){u(n,321)},v(J8,"BowyerWatsonTriangulation/lambda$0$Type",1800),m(1801,1,ct,Vke),s.Ad=function(n){ac(this.a,u(n,321).e)},v(J8,"BowyerWatsonTriangulation/lambda$1$Type",1801),m(1802,1,ct,cd),s.Ad=function(n){u(n,177)},v(J8,"BowyerWatsonTriangulation/lambda$2$Type",1802),m(1797,1,Yt,Yke),s.Le=function(n,t){return T6n(this.a,u(n,177),u(t,177))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(J8,"NaiveMinST/lambda$0$Type",1797),m(440,1,{},dj),v(J8,"NodeMicroLayout",440),m(177,1,{177:1},g4),s.Fb=function(n){var t;return X(n,177)?(t=u(n,177),Ku(this.a,t.a)&&Ku(this.b,t.b)||Ku(this.a,t.b)&&Ku(this.b,t.a)):!1},s.Hb=function(){return Bv(this.a)+Bv(this.b)};var LBn=v(J8,"TEdge",177);m(321,1,{321:1},lge),s.Fb=function(n){var t;return X(n,321)?(t=u(n,321),oB(this,t.a)&&oB(this,t.b)&&oB(this,t.c)):!1},s.Hb=function(){return Bv(this.a)+Bv(this.b)+Bv(this.c)},v(J8,"TTriangle",321),m(225,1,{225:1},P$),v(J8,"Tree",225),m(1183,1,{},q_e),v(_Ye,"Scanline",1183);var Enn=Gi(_Ye,LYe);m(1728,1,{},qRe),v(t1,"CGraph",1728),m(320,1,{320:1},R_e),s.b=0,s.c=0,s.d=0,s.g=0,s.i=0,s.k=Ir,v(t1,"CGroup",320),m(814,1,{},doe),v(t1,"CGroup/CGroupBuilder",814),m(60,1,{60:1},rNe),s.Ib=function(){var n;return this.j?Pt(this.j.Kb(this)):(M1(wJ),wJ.o+"@"+(n=jw(this)>>>0,n.toString(16)))},s.f=0,s.i=Ir;var wJ=v(t1,"CNode",60);m(813,1,{},boe),v(t1,"CNode/CNodeBuilder",813);var Snn;m(1551,1,{},s0),s.df=function(n,t){return 0},s.ef=function(n,t){return 0},v(t1,$Ye,1551),m(1830,1,{},uh),s.af=function(n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D;for(b=Vi,r=new P(n.a.b);r.ar.d.c||r.d.c==o.d.c&&r.d.b0?n+this.n.d+this.n.a:0},s.gf=function(){var n,t,i,r,c;if(c=0,this.e)this.b?c=this.b.a:this.a[1][1]&&(c=this.a[1][1].gf());else if(this.g)c=ide(this,tW(this,null,!0));else for(t=(wa(),F(z(dm,1),Ee,237,0,[Ou,No,Nu])),i=0,r=t.length;i0?c+this.n.b+this.n.c:0},s.hf=function(){var n,t,i,r,c;if(this.g)for(n=tW(this,null,!1),i=(wa(),F(z(dm,1),Ee,237,0,[Ou,No,Nu])),r=0,c=i.length;r0&&(r[0]+=this.d,i-=r[0]),r[2]>0&&(r[2]+=this.d,i-=r[2]),this.c.a=k.Math.max(0,i),this.c.d=t.d+n.d+(this.c.a-i)/2,r[1]=k.Math.max(r[1],i),Wae(this,No,t.d+n.d+r[0]-(r[1]-i)/2,r)},s.b=null,s.d=0,s.e=!1,s.f=!1,s.g=!1;var wte=0,pJ=0;v(dg,"GridContainerCell",1499),m(461,23,{3:1,35:1,23:1,461:1},UX);var rb,Oh,qf,Nnn=yt(dg,"HorizontalLabelAlignment",461,Tt,nyn,T2n),Inn;m(318,216,{216:1,318:1},O_e,GRe,E_e),s.ff=function(){return sIe(this)},s.gf=function(){return wfe(this)},s.a=0,s.c=!1;var PBn=v(dg,"LabelCell",318);m(253,337,{216:1,337:1,253:1},HE),s.ff=function(){return QE(this)},s.gf=function(){return WE(this)},s.hf=function(){GW(this)},s.jf=function(){qW(this)},s.b=0,s.c=0,s.d=!1,v(dg,"StripContainerCell",253),m(1655,1,zt,b5),s.Mb=function(n){return _bn(u(n,216))},v(dg,"StripContainerCell/lambda$0$Type",1655),m(1656,1,{},l0),s.We=function(n){return u(n,216).gf()},v(dg,"StripContainerCell/lambda$1$Type",1656),m(1657,1,zt,ud),s.Mb=function(n){return Lbn(u(n,216))},v(dg,"StripContainerCell/lambda$2$Type",1657),m(1658,1,{},Cp),s.We=function(n){return u(n,216).ff()},v(dg,"StripContainerCell/lambda$3$Type",1658),m(462,23,{3:1,35:1,23:1,462:1},XX);var Uf,cb,ja,Dnn=yt(dg,"VerticalLabelAlignment",462,Tt,tyn,O2n),_nn;m(787,1,{},Mge),s.c=0,s.d=0,s.k=0,s.s=0,s.t=0,s.v=!1,s.w=0,s.D=!1,s.F=!1,v(sF,"NodeContext",787),m(1497,1,Yt,oh),s.Le=function(n,t){return vTe(u(n,64),u(t,64))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(sF,"NodeContext/0methodref$comparePortSides$Type",1497),m(1498,1,Yt,Tp),s.Le=function(n,t){return mMn(u(n,115),u(t,115))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(sF,"NodeContext/1methodref$comparePortContexts$Type",1498),m(168,23,{3:1,35:1,23:1,168:1},Bl);var Lnn,Pnn,$nn,Rnn,Bnn,znn,Fnn,Jnn,Hnn,Gnn,qnn,Unn,Xnn,Knn,Vnn,Ynn,Qnn,Wnn,Znn,etn,ntn,pte,ttn=yt(sF,"NodeLabelLocation",168,Tt,DQ,N2n),itn;m(115,1,{115:1},zqe),s.a=!1,v(sF,"PortContext",115),m(1502,1,ct,Gg),s.Ad=function(n){_Ae(u(n,318))},v(jN,YYe,1502),m(1503,1,zt,qg),s.Mb=function(n){return!!u(n,115).c},v(jN,QYe,1503),m(1504,1,ct,Ug),s.Ad=function(n){_Ae(u(n,115).c)},v(jN,"LabelPlacer/lambda$2$Type",1504);var Qme;m(1501,1,ct,sd),s.Ad=function(n){v2(),dbn(u(n,115))},v(jN,"NodeLabelAndSizeUtilities/lambda$0$Type",1501),m(788,1,ct,Kle),s.Ad=function(n){Mgn(this.b,this.c,this.a,u(n,187))},s.a=!1,s.c=!1,v(jN,"NodeLabelCellCreator/lambda$0$Type",788),m(1500,1,ct,Zke),s.Ad=function(n){pbn(this.a,u(n,187))},v(jN,"PortContextCreator/lambda$0$Type",1500);var mJ;m(1872,1,{},Xg),v(G8,"GreedyRectangleStripOverlapRemover",1872),m(1873,1,Yt,Mb),s.Le=function(n,t){return cpn(u(n,226),u(t,226))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(G8,"GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type",1873),m(1826,1,{},sxe),s.a=5,s.e=0,v(G8,"RectangleStripOverlapRemover",1826),m(1827,1,Yt,g5),s.Le=function(n,t){return upn(u(n,226),u(t,226))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(G8,"RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type",1827),m(1829,1,Yt,Op),s.Le=function(n,t){return z3n(u(n,226),u(t,226))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(G8,"RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type",1829),m(409,23,{3:1,35:1,23:1,409:1},s$);var KN,mte,vte,VN,rtn=yt(G8,"RectangleStripOverlapRemover/OverlapRemovalDirection",409,Tt,Zyn,I2n),ctn;m(226,1,{226:1},aV),v(G8,"RectangleStripOverlapRemover/RectangleNode",226),m(1828,1,ct,eje),s.Ad=function(n){VSn(this.a,u(n,226))},v(G8,"RectangleStripOverlapRemover/lambda$1$Type",1828);var utn=!1,QS,Wme;m(1798,1,ct,Np),s.Ad=function(n){KKe(u(n,225))},v(wy,"DepthFirstCompaction/0methodref$compactTree$Type",1798),m(810,1,ct,Wue),s.Ad=function(n){b5n(this.a,u(n,225))},v(wy,"DepthFirstCompaction/lambda$1$Type",810),m(1799,1,ct,LNe),s.Ad=function(n){PEn(this.a,this.b,this.c,u(n,225))},v(wy,"DepthFirstCompaction/lambda$2$Type",1799);var WS,Zme;m(68,1,{68:1},X_e),v(wy,"Node",68),m(1179,1,{},$Te),v(wy,"ScanlineOverlapCheck",1179),m(1180,1,{683:1},m_e),s._e=function(n){Gpn(this,u(n,442))},v(wy,"ScanlineOverlapCheck/OverlapsScanlineHandler",1180),m(1181,1,Yt,uu),s.Le=function(n,t){return Ejn(u(n,68),u(t,68))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(wy,"ScanlineOverlapCheck/OverlapsScanlineHandler/lambda$0$Type",1181),m(442,1,{442:1},lse),s.a=!1,v(wy,"ScanlineOverlapCheck/Timestamp",442),m(1182,1,Yt,w5),s.Le=function(n,t){return Vxn(u(n,442),u(t,442))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(wy,"ScanlineOverlapCheck/lambda$0$Type",1182),m(545,1,{},Kg),v("org.eclipse.elk.alg.common.utils","SVGImage",545),m(748,1,{},rv),v(VZ,twe,748),m(1164,1,Yt,p5),s.Le=function(n,t){return ETn(u(n,235),u(t,235))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(VZ,eQe,1164),m(1165,1,ct,qMe),s.Ad=function(n){gyn(this.b,this.a,u(n,251))},v(VZ,iwe,1165),m(214,1,ep),v(y3,"AbstractLayoutProvider",214),m(726,214,ep,goe),s.kf=function(n,t){OUe(this,n,t)},v(VZ,"ForceLayoutProvider",726);var $Bn=Gi(EN,nQe);m(150,1,{3:1,105:1,150:1},Vg),s.of=function(n,t){return SO(this,n,t)},s.lf=function(){return EIe(this)},s.mf=function(n){return C(this,n)},s.nf=function(n){return wi(this,n)},v(EN,"MapPropertyHolder",150),m(313,150,{3:1,313:1,105:1,150:1}),v(SN,"FParticle",313),m(251,313,{3:1,251:1,313:1,105:1,150:1},sDe),s.Ib=function(){var n;return this.a?(n=pu(this.a.a,this,0),n>=0?"b"+n+"["+iY(this.a)+"]":"b["+iY(this.a)+"]"):"b_"+jw(this)},v(SN,"FBendpoint",251),m(291,150,{3:1,291:1,105:1,150:1},tNe),s.Ib=function(){return iY(this)},v(SN,"FEdge",291),m(235,150,{3:1,235:1,105:1,150:1},WR);var RBn=v(SN,"FGraph",235);m(445,313,{3:1,445:1,313:1,105:1,150:1},fPe),s.Ib=function(){return this.b==null||this.b.length==0?"l["+iY(this.a)+"]":"l_"+this.b},v(SN,"FLabel",445),m(155,313,{3:1,155:1,313:1,105:1,150:1},RTe),s.Ib=function(){return Aae(this)},s.a=0,v(SN,"FNode",155),m(2062,1,{}),s.qf=function(n){ige(this,n)},s.rf=function(){bHe(this)},s.d=0,v(rwe,"AbstractForceModel",2062),m(631,2062,{631:1},ize),s.pf=function(n,t){var i,r,c,o,l;return QKe(this.f,n,t),c=Nr(pc(t.d),n.d),l=k.Math.sqrt(c.a*c.a+c.b*c.b),r=k.Math.max(0,l-aE(n.e)/2-aE(t.e)/2),i=Oqe(this.e,n,t),i>0?o=-N3n(r,this.c)*i:o=ypn(r,this.b)*u(C(n,(Hf(),Ay)),15).a,A1(c,o/l),c},s.qf=function(n){ige(this,n),this.a=u(C(n,(Hf(),yJ)),15).a,this.c=ne(re(C(n,kJ))),this.b=ne(re(C(n,kte)))},s.sf=function(n){return n0&&(o-=Obn(r,this.a)*i),A1(c,o*this.b/l),c},s.qf=function(n){var t,i,r,c,o,l,f;for(ige(this,n),this.b=ne(re(C(n,(Hf(),jte)))),this.c=this.b/u(C(n,yJ),15).a,r=n.e.c.length,o=0,c=0,f=new P(n.e);f.a0},s.a=0,s.b=0,s.c=0,v(rwe,"FruchtermanReingoldModel",632);var xy=Gi(yu,"ILayoutMetaDataProvider");m(844,1,Ua,vC),s.tf=function(n){en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,lF),""),"Force Model"),"Determines the model for force calculation."),eve),(lg(),Bi)),nve),rn((vh(),Cn))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,cwe),""),"Iterations"),"The number of iterations on the force model."),ke(300)),dc),jr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,uwe),""),"Repulsive Power"),"Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model"),ke(0)),dc),jr),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,YZ),""),"FR Temperature"),"The temperature is used as a scaling factor for particle displacements."),xh),ec),gr),rn(Cn)))),qi(n,YZ,lF,dtn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,QZ),""),"Eades Repulsion"),"Factor for repulsive forces in Eades' model."),5),ec),gr),rn(Cn)))),qi(n,QZ,lF,ftn),BVe((new tP,n))};var otn,stn,eve,ltn,ftn,atn,htn,dtn;v(kS,"ForceMetaDataProvider",844),m(424,23,{3:1,35:1,23:1,424:1},fse);var yte,vJ,nve=yt(kS,"ForceModelStrategy",424,Tt,a4n,_2n),btn;m(984,1,Ua,tP),s.tf=function(n){BVe(n)};var gtn,wtn,tve,yJ,ive,ptn,mtn,vtn,ytn,rve,ktn,cve,uve,jtn,Ay,Etn,kte,ove,Stn,xtn,kJ,jte,Atn,Mtn,Ctn,sve,Ttn;v(kS,"ForceOptions",984),m(985,1,{},cv),s.uf=function(){var n;return n=new goe,n},s.vf=function(n){},v(kS,"ForceOptions/ForceFactory",985);var YN,ZS,My,jJ;m(845,1,Ua,iP),s.tf=function(n){en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,swe),""),"Fixed Position"),"Prevent that the node is moved by the layout algorithm."),($n(),!1)),(lg(),xr)),Qi),rn((vh(),fr))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,lwe),""),"Desired Edge Length"),"Either specified for parent nodes or for individual edges, where the latter takes higher precedence."),100),ec),gr),Ci(Cn,F(z(Wa,1),Ee,160,0,[xa]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,fwe),""),"Layout Dimension"),"Dimensions that are permitted to be altered during layout."),lve),Bi),wve),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,awe),""),"Stress Epsilon"),"Termination criterion for the iterative process."),xh),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,hwe),""),"Iteration Limit"),"Maximum number of performed iterations. Takes higher precedence than 'epsilon'."),ke(oi)),dc),jr),rn(Cn)))),dVe((new AU,n))};var Otn,Ntn,lve,Itn,Dtn,_tn;v(kS,"StressMetaDataProvider",845),m(988,1,Ua,AU),s.tf=function(n){dVe(n)};var EJ,fve,ave,hve,dve,bve,Ltn,Ptn,$tn,Rtn,gve,Btn;v(kS,"StressOptions",988),m(989,1,{},m5),s.uf=function(){var n;return n=new iNe,n},s.vf=function(n){},v(kS,"StressOptions/StressFactory",989),m(1080,214,ep,iNe),s.kf=function(n,t){var i,r,c,o,l;for(t.Tg(uQe,1),Fe(ze(je(n,(RO(),dve))))?Fe(ze(je(n,gve)))||qT((i=new dj((Rb(),new v0(n))),i)):OUe(new goe,n,t.dh(1)),c=Ize(n),r=SKe(this.a,c),l=r.Jc();l.Ob();)o=u(l.Pb(),235),!(o.e.c.length<=1)&&(ULn(this.b,o),mOn(this.b),Ao(o.d,new v5));c=PVe(r),qVe(c),t.Ug()},v(hF,"StressLayoutProvider",1080),m(1081,1,ct,v5),s.Ad=function(n){hge(u(n,445))},v(hF,"StressLayoutProvider/lambda$0$Type",1081),m(986,1,{},txe),s.c=0,s.e=0,s.g=0,v(hF,"StressMajorization",986),m(384,23,{3:1,35:1,23:1,384:1},KX);var Ete,Ste,xte,wve=yt(hF,"StressMajorization/Dimension",384,Tt,Z4n,L2n),ztn;m(987,1,Yt,nje),s.Le=function(n,t){return a2n(this.a,u(n,155),u(t,155))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(hF,"StressMajorization/lambda$0$Type",987),m(1161,1,{},pLe),v(vy,"ElkLayered",1161),m(1162,1,ct,tje),s.Ad=function(n){uTn(this.a,u(n,37))},v(vy,"ElkLayered/lambda$0$Type",1162),m(1163,1,ct,ije),s.Ad=function(n){p2n(this.a,u(n,37))},v(vy,"ElkLayered/lambda$1$Type",1163),m(1246,1,{},PTe);var Ftn,Jtn,Htn;v(vy,"GraphConfigurator",1246),m(757,1,ct,Zue),s.Ad=function(n){NGe(this.a,u(n,9))},v(vy,"GraphConfigurator/lambda$0$Type",757),m(758,1,{},b1),s.Kb=function(n){return Vde(),new mn(null,new vn(u(n,25).a,16))},v(vy,"GraphConfigurator/lambda$1$Type",758),m(759,1,ct,eoe),s.Ad=function(n){NGe(this.a,u(n,9))},v(vy,"GraphConfigurator/lambda$2$Type",759),m(1079,214,ep,rxe),s.kf=function(n,t){var i;i=SLn(new fxe,n),ue(je(n,(Ie(),Em)))===ue((B1(),Wd))?Djn(this.a,i,t):bOn(this.a,i,t),t.Zg()||TVe(new kC,i)},v(vy,"LayeredLayoutProvider",1079),m(363,23,{3:1,35:1,23:1,363:1},sT);var Xf,c1,eo,no,Pc,pve=yt(vy,"LayeredPhases",363,Tt,V6n,P2n),Gtn;m(1683,1,{},EBe),s.i=0;var qtn;v(ON,"ComponentsToCGraphTransformer",1683);var Utn;m(1684,1,{},Ws),s.wf=function(n,t){return k.Math.min(n.a!=null?ne(n.a):n.c.i,t.a!=null?ne(t.a):t.c.i)},s.xf=function(n,t){return k.Math.min(n.a!=null?ne(n.a):n.c.i,t.a!=null?ne(t.a):t.c.i)},v(ON,"ComponentsToCGraphTransformer/1",1684),m(82,1,{82:1}),s.i=0,s.k=!0,s.o=Ir;var Ate=v(xS,"CNode",82);m(460,82,{460:1,82:1},hle,Sde),s.Ib=function(){return""},v(ON,"ComponentsToCGraphTransformer/CRectNode",460),m(1652,1,{},xf);var Mte,Cte;v(ON,"OneDimensionalComponentsCompaction",1652),m(1653,1,{},vt),s.Kb=function(n){return N4n(u(n,49))},s.Fb=function(n){return this===n},v(ON,"OneDimensionalComponentsCompaction/lambda$0$Type",1653),m(1654,1,{},kc),s.Kb=function(n){return Rjn(u(n,49))},s.Fb=function(n){return this===n},v(ON,"OneDimensionalComponentsCompaction/lambda$1$Type",1654),m(1686,1,{},yDe),v(xS,"CGraph",1686),m(194,1,{194:1},OQ),s.b=0,s.c=0,s.e=0,s.g=!0,s.i=Ir,v(xS,"CGroup",194),m(1685,1,{},tc),s.wf=function(n,t){return k.Math.max(n.a!=null?ne(n.a):n.c.i,t.a!=null?ne(t.a):t.c.i)},s.xf=function(n,t){return k.Math.max(n.a!=null?ne(n.a):n.c.i,t.a!=null?ne(t.a):t.c.i)},v(xS,$Ye,1685),m(1687,1,{},Iqe),s.d=!1;var Xtn,Tte=v(xS,zYe,1687);m(1688,1,{},tk),s.Kb=function(n){return Zoe(),$n(),u(u(n,49).a,82).d.e!=0},s.Fb=function(n){return this===n},v(xS,FYe,1688),m(817,1,{},mfe),s.a=!1,s.b=!1,s.c=!1,s.d=!1,v(xS,JYe,817),m(1868,1,{},_Ie),v(dF,HYe,1868);var QN=Gi(bg,LYe);m(1869,1,{377:1},p_e),s._e=function(n){kIn(this,u(n,465))},v(dF,GYe,1869),m(1870,1,Yt,f0),s.Le=function(n,t){return S5n(u(n,82),u(t,82))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(dF,qYe,1870),m(465,1,{465:1},ase),s.a=!1,v(dF,UYe,465),m(1871,1,Yt,Yg),s.Le=function(n,t){return Yxn(u(n,465),u(t,465))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(dF,XYe,1871),m(146,1,{146:1},k9,ofe),s.Fb=function(n){var t;return n==null||BBn!=Us(n)?!1:(t=u(n,146),Ku(this.c,t.c)&&Ku(this.d,t.d))},s.Hb=function(){return zB(F(z(Mr,1),On,1,5,[this.c,this.d]))},s.Ib=function(){return"("+this.c+To+this.d+(this.a?"cx":"")+this.b+")"},s.a=!0,s.c=0,s.d=0;var BBn=v(bg,"Point",146);m(408,23,{3:1,35:1,23:1,408:1},f$);var fp,bm,O3,gm,Ktn=yt(bg,"Point/Quadrant",408,Tt,e6n,D2n),Vtn;m(1674,1,{},cxe),s.b=null,s.c=null,s.d=null,s.e=null,s.f=null;var Ytn,Qtn,Wtn,Ztn,ein;v(bg,"RectilinearConvexHull",1674),m(569,1,{377:1},oz),s._e=function(n){z9n(this,u(n,146))},s.b=0;var mve;v(bg,"RectilinearConvexHull/MaximalElementsEventHandler",569),m(1676,1,Yt,a6),s.Le=function(n,t){return j5n(re(n),re(t))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(bg,"RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type",1676),m(1675,1,{377:1},TRe),s._e=function(n){$Nn(this,u(n,146))},s.a=0,s.b=null,s.c=null,s.d=null,s.e=null,v(bg,"RectilinearConvexHull/RectangleEventHandler",1675),m(1677,1,Yt,Ip),s.Le=function(n,t){return Syn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(bg,"RectilinearConvexHull/lambda$0$Type",1677),m(1678,1,Yt,Dp),s.Le=function(n,t){return xyn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(bg,"RectilinearConvexHull/lambda$1$Type",1678),m(1679,1,Yt,_p),s.Le=function(n,t){return Myn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(bg,"RectilinearConvexHull/lambda$2$Type",1679),m(1680,1,Yt,Lp),s.Le=function(n,t){return Ayn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(bg,"RectilinearConvexHull/lambda$3$Type",1680),m(1681,1,Yt,xl),s.Le=function(n,t){return DMn(u(n,146),u(t,146))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(bg,"RectilinearConvexHull/lambda$4$Type",1681),m(1682,1,{},U_e),v(bg,"Scanline",1682),m(2066,1,{}),v(Xa,"AbstractGraphPlacer",2066),m(336,1,{336:1},MOe),s.Df=function(n){return this.Ef(n)?(wn(this.b,u(C(n,(me(),K1)),22),n),!0):!1},s.Ef=function(n){var t,i,r,c;for(t=u(C(n,(me(),K1)),22),c=u(vi(Ai,t),22),r=c.Jc();r.Ob();)if(i=u(r.Pb(),22),!u(vi(this.b,i),16).dc())return!1;return!0};var Ai;v(Xa,"ComponentGroup",336),m(766,2066,{},woe),s.Ff=function(n){var t,i;for(i=new P(this.a);i.ai&&(p=0,y+=f+r,f=0),h=o.c,T8(o,p+h.a,y+h.b),fa(h),c=k.Math.max(c,p+b.a),f=k.Math.max(f,b.b),p+=b.a+r;t.f.a=c,t.f.b=y+f},s.Hf=function(n,t){var i,r,c,o,l;if(ue(C(t,(Ie(),bx)))===ue((W4(),ex))){for(r=n.Jc();r.Ob();){for(i=u(r.Pb(),37),l=0,o=new P(i.a);o.ai&&!u(C(o,(me(),K1)),22).Gc((De(),Kn))||h&&u(C(h,(me(),K1)),22).Gc((De(),et))||u(C(o,(me(),K1)),22).Gc((De(),Vn)))&&(S=y,A+=f+r,f=0),b=o.c,u(C(o,(me(),K1)),22).Gc((De(),Kn))&&(S=c+r),T8(o,S+b.a,A+b.b),c=k.Math.max(c,S+p.a),u(C(o,K1),22).Gc(bt)&&(y=k.Math.max(y,S+p.a+r)),fa(b),f=k.Math.max(f,p.b),S+=p.a+r,h=o;t.f.a=c,t.f.b=A+f},s.Hf=function(n,t){},v(Xa,"ModelOrderRowGraphPlacer",1277),m(1275,1,Yt,OA),s.Le=function(n,t){return z7n(u(n,37),u(t,37))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Xa,"SimpleRowGraphPlacer/1",1275);var tin;m(1245,1,Sh,h6),s.Lb=function(n){var t;return t=u(C(u(n,250).b,(Ie(),Wc)),78),!!t&&t.b!=0},s.Fb=function(n){return this===n},s.Mb=function(n){var t;return t=u(C(u(n,250).b,(Ie(),Wc)),78),!!t&&t.b!=0},v(bF,"CompoundGraphPostprocessor/1",1245),m(1244,1,Mi,axe),s.If=function(n,t){YJe(this,u(n,37),t)},v(bF,"CompoundGraphPreprocessor",1244),m(444,1,{444:1},$Fe),s.c=!1,v(bF,"CompoundGraphPreprocessor/ExternalPort",444),m(250,1,{250:1},W$),s.Ib=function(){return RK(this.c)+":"+Aqe(this.b)},v(bF,"CrossHierarchyEdge",250),m(764,1,Yt,noe),s.Le=function(n,t){return jxn(this,u(n,250),u(t,250))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(bF,"CrossHierarchyEdgeComparator",764),m(246,150,{3:1,246:1,105:1,150:1}),s.p=0,v(Zu,"LGraphElement",246),m(17,246,{3:1,17:1,246:1,105:1,150:1},Ow),s.Ib=function(){return Aqe(this)};var w7=v(Zu,"LEdge",17);m(37,246,{3:1,20:1,37:1,246:1,105:1,150:1},$he),s.Ic=function(n){cc(this,n)},s.Jc=function(){return new P(this.b)},s.Ib=function(){return this.b.c.length==0?"G-unlayered"+Ja(this.a):this.a.c.length==0?"G-layered"+Ja(this.b):"G[layerless"+Ja(this.a)+", layers"+Ja(this.b)+"]"};var iin=v(Zu,"LGraph",37),rin;m(655,1,{}),s.Jf=function(){return this.e.n},s.mf=function(n){return C(this.e,n)},s.Kf=function(){return this.e.o},s.Lf=function(){return this.e.p},s.nf=function(n){return wi(this.e,n)},s.Mf=function(n){this.e.n.a=n.a,this.e.n.b=n.b},s.Nf=function(n){this.e.o.a=n.a,this.e.o.b=n.b},s.Of=function(n){this.e.p=n},v(Zu,"LGraphAdapters/AbstractLShapeAdapter",655),m(464,1,{837:1},bj),s.Pf=function(){var n,t;if(!this.b)for(this.b=Jh(this.a.b.c.length),t=new P(this.a.b);t.a0&&dFe((Qn(t-1,n.length),n.charCodeAt(t-1)),hQe);)--t;if(o> ",n),wz(i)),Kt(uo((n.a+="[",n),i.i),"]")),n.a},s.c=!0,s.d=!1;var Eve,Sve,xve,Ave,Mve,Cve,uin=v(Zu,"LPort",12);m(399,1,Zh,l9),s.Ic=function(n){cc(this,n)},s.Jc=function(){var n;return n=new P(this.a.e),new rje(n)},v(Zu,"LPort/1",399),m(1273,1,Fr,rje),s.Nb=function(n){Zr(this,n)},s.Pb=function(){return u(_(this.a),17).c},s.Ob=function(){return gu(this.a)},s.Qb=function(){sE(this.a)},v(Zu,"LPort/1/1",1273),m(365,1,Zh,i4),s.Ic=function(n){cc(this,n)},s.Jc=function(){var n;return n=new P(this.a.g),new toe(n)},v(Zu,"LPort/2",365),m(763,1,Fr,toe),s.Nb=function(n){Zr(this,n)},s.Pb=function(){return u(_(this.a),17).d},s.Ob=function(){return gu(this.a)},s.Qb=function(){sE(this.a)},v(Zu,"LPort/2/1",763),m(1266,1,Zh,XMe),s.Ic=function(n){cc(this,n)},s.Jc=function(){return new Pa(this)},v(Zu,"LPort/CombineIter",1266),m(207,1,Fr,Pa),s.Nb=function(n){Zr(this,n)},s.Qb=function(){AAe()},s.Ob=function(){return Zj(this)},s.Pb=function(){return gu(this.a)?_(this.a):_(this.b)},v(Zu,"LPort/CombineIter/1",207),m(1267,1,Sh,k5),s.Lb=function(n){return qIe(n)},s.Fb=function(n){return this===n},s.Mb=function(n){return ss(),u(n,12).g.c.length!=0},v(Zu,"LPort/lambda$0$Type",1267),m(1268,1,Sh,a0),s.Lb=function(n){return UIe(n)},s.Fb=function(n){return this===n},s.Mb=function(n){return ss(),u(n,12).e.c.length!=0},v(Zu,"LPort/lambda$1$Type",1268),m(1269,1,Sh,_h),s.Lb=function(n){return ss(),u(n,12).j==(De(),Kn)},s.Fb=function(n){return this===n},s.Mb=function(n){return ss(),u(n,12).j==(De(),Kn)},v(Zu,"LPort/lambda$2$Type",1269),m(1270,1,Sh,uk),s.Lb=function(n){return ss(),u(n,12).j==(De(),et)},s.Fb=function(n){return this===n},s.Mb=function(n){return ss(),u(n,12).j==(De(),et)},v(Zu,"LPort/lambda$3$Type",1270),m(1271,1,Sh,NA),s.Lb=function(n){return ss(),u(n,12).j==(De(),bt)},s.Fb=function(n){return this===n},s.Mb=function(n){return ss(),u(n,12).j==(De(),bt)},v(Zu,"LPort/lambda$4$Type",1271),m(1272,1,Sh,j5),s.Lb=function(n){return ss(),u(n,12).j==(De(),Vn)},s.Fb=function(n){return this===n},s.Mb=function(n){return ss(),u(n,12).j==(De(),Vn)},v(Zu,"LPort/lambda$5$Type",1272),m(25,246,{3:1,20:1,246:1,25:1,105:1,150:1},Xu),s.Ic=function(n){cc(this,n)},s.Jc=function(){return new P(this.a)},s.Ib=function(){return"L_"+pu(this.b.b,this,0)+Ja(this.a)},v(Zu,"Layer",25),m(1659,1,{},L$e),s.b=0,v(Zu,"Tarjan",1659),m(1282,1,{},fxe),v(Jd,wQe,1282),m(1286,1,{},ok),s.Kb=function(n){return iu(u(n,84))},v(Jd,"ElkGraphImporter/0methodref$connectableShapeToNode$Type",1286),m(1289,1,{},ov),s.Kb=function(n){return iu(u(n,84))},v(Jd,"ElkGraphImporter/1methodref$connectableShapeToNode$Type",1289),m(1283,1,ct,cje),s.Ad=function(n){Hqe(this.a,u(n,125))},v(Jd,iwe,1283),m(1284,1,ct,uje),s.Ad=function(n){Hqe(this.a,u(n,125))},v(Jd,pQe,1284),m(1285,1,{},Lh),s.Kb=function(n){return new mn(null,new vn(tae(u(n,85)),16))},v(Jd,mQe,1285),m(1287,1,zt,oje),s.Mb=function(n){return dwn(this.a,u(n,26))},v(Jd,vQe,1287),m(1288,1,{},sv),s.Kb=function(n){return new mn(null,new vn(v5n(u(n,85)),16))},v(Jd,"ElkGraphImporter/lambda$5$Type",1288),m(1290,1,zt,sje),s.Mb=function(n){return bwn(this.a,u(n,26))},v(Jd,"ElkGraphImporter/lambda$7$Type",1290),m(1291,1,zt,sk),s.Mb=function(n){return _5n(u(n,85))},v(Jd,"ElkGraphImporter/lambda$8$Type",1291),m(1261,1,{},kC);var oin;v(Jd,"ElkGraphLayoutTransferrer",1261),m(1262,1,zt,lje),s.Mb=function(n){return c2n(this.a,u(n,17))},v(Jd,"ElkGraphLayoutTransferrer/lambda$0$Type",1262),m(1263,1,ct,fje),s.Ad=function(n){cT(),Te(this.a,u(n,17))},v(Jd,"ElkGraphLayoutTransferrer/lambda$1$Type",1263),m(1264,1,zt,aje),s.Mb=function(n){return qpn(this.a,u(n,17))},v(Jd,"ElkGraphLayoutTransferrer/lambda$2$Type",1264),m(1265,1,ct,hje),s.Ad=function(n){cT(),Te(this.a,u(n,17))},v(Jd,"ElkGraphLayoutTransferrer/lambda$3$Type",1265),m(806,1,{},Lle),v(Wn,"BiLinkedHashMultiMap",806),m(1511,1,Mi,d6),s.If=function(n,t){c7n(u(n,37),t)},v(Wn,"CommentNodeMarginCalculator",1511),m(1512,1,{},Wg),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"CommentNodeMarginCalculator/lambda$0$Type",1512),m(1513,1,ct,kD),s.Ad=function(n){kLn(u(n,9))},v(Wn,"CommentNodeMarginCalculator/lambda$1$Type",1513),m(1514,1,Mi,IA),s.If=function(n,t){CIn(u(n,37),t)},v(Wn,"CommentPostprocessor",1514),m(1515,1,Mi,jD),s.If=function(n,t){K$n(u(n,37),t)},v(Wn,"CommentPreprocessor",1515),m(1516,1,Mi,E5),s.If=function(n,t){FNn(u(n,37),t)},v(Wn,"ConstraintsPostprocessor",1516),m(1517,1,Mi,oq),s.If=function(n,t){O7n(u(n,37),t)},v(Wn,"EdgeAndLayerConstraintEdgeReverser",1517),m(1518,1,Mi,ED),s.If=function(n,t){cEn(u(n,37),t)},v(Wn,"EndLabelPostprocessor",1518),m(1519,1,{},SD),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"EndLabelPostprocessor/lambda$0$Type",1519),m(1520,1,zt,DA),s.Mb=function(n){return H6n(u(n,9))},v(Wn,"EndLabelPostprocessor/lambda$1$Type",1520),m(1521,1,ct,sq),s.Ad=function(n){Qxn(u(n,9))},v(Wn,"EndLabelPostprocessor/lambda$2$Type",1521),m(1522,1,Mi,lq),s.If=function(n,t){DCn(u(n,37),t)},v(Wn,"EndLabelPreprocessor",1522),m(1523,1,{},lk),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"EndLabelPreprocessor/lambda$0$Type",1523),m(1524,1,ct,PNe),s.Ad=function(n){Cgn(this.a,this.b,this.c,u(n,9))},s.a=0,s.b=0,s.c=!1,v(Wn,"EndLabelPreprocessor/lambda$1$Type",1524),m(1525,1,zt,Zg),s.Mb=function(n){return ue(C(u(n,70),(Ie(),Ih)))===ue((Ra(),G7))},v(Wn,"EndLabelPreprocessor/lambda$2$Type",1525),m(1526,1,ct,dje),s.Ad=function(n){Vt(this.a,u(n,70))},v(Wn,"EndLabelPreprocessor/lambda$3$Type",1526),m(1527,1,zt,_A),s.Mb=function(n){return ue(C(u(n,70),(Ie(),Ih)))===ue((Ra(),Fm))},v(Wn,"EndLabelPreprocessor/lambda$4$Type",1527),m(1528,1,ct,bje),s.Ad=function(n){Vt(this.a,u(n,70))},v(Wn,"EndLabelPreprocessor/lambda$5$Type",1528),m(1576,1,Mi,MU),s.If=function(n,t){yjn(u(n,37),t)};var sin;v(Wn,"EndLabelSorter",1576),m(1577,1,Yt,LA),s.Le=function(n,t){return FEn(u(n,455),u(t,455))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"EndLabelSorter/1",1577),m(455,1,{455:1},s_e),v(Wn,"EndLabelSorter/LabelGroup",455),m(1578,1,{},S5),s.Kb=function(n){return rT(),new mn(null,new vn(u(n,25).a,16))},v(Wn,"EndLabelSorter/lambda$0$Type",1578),m(1579,1,zt,x5),s.Mb=function(n){return rT(),u(n,9).k==(Fn(),Wi)},v(Wn,"EndLabelSorter/lambda$1$Type",1579),m(1580,1,ct,xD),s.Ad=function(n){XMn(u(n,9))},v(Wn,"EndLabelSorter/lambda$2$Type",1580),m(1581,1,zt,PA),s.Mb=function(n){return rT(),ue(C(u(n,70),(Ie(),Ih)))===ue((Ra(),Fm))},v(Wn,"EndLabelSorter/lambda$3$Type",1581),m(1582,1,zt,AD),s.Mb=function(n){return rT(),ue(C(u(n,70),(Ie(),Ih)))===ue((Ra(),G7))},v(Wn,"EndLabelSorter/lambda$4$Type",1582),m(1529,1,Mi,b6),s.If=function(n,t){RLn(this,u(n,37))},s.b=0,s.c=0,v(Wn,"FinalSplineBendpointsCalculator",1529),m(1530,1,{},ew),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"FinalSplineBendpointsCalculator/lambda$0$Type",1530),m(1531,1,{},$A),s.Kb=function(n){return new mn(null,new A2(new Un(Yn(Ii(u(n,9)).a.Jc(),new ee))))},v(Wn,"FinalSplineBendpointsCalculator/lambda$1$Type",1531),m(1532,1,zt,g6),s.Mb=function(n){return!uc(u(n,17))},v(Wn,"FinalSplineBendpointsCalculator/lambda$2$Type",1532),m(1533,1,zt,$p),s.Mb=function(n){return wi(u(n,17),(me(),Eg))},v(Wn,"FinalSplineBendpointsCalculator/lambda$3$Type",1533),m(1534,1,ct,gje),s.Ad=function(n){UDn(this.a,u(n,132))},v(Wn,"FinalSplineBendpointsCalculator/lambda$4$Type",1534),m(1535,1,ct,RA),s.Ad=function(n){qO(u(n,17).a)},v(Wn,"FinalSplineBendpointsCalculator/lambda$5$Type",1535),m(790,1,Mi,ioe),s.If=function(n,t){IPn(this,u(n,37),t)},v(Wn,"GraphTransformer",790),m(502,23,{3:1,35:1,23:1,502:1},hse);var Dte,ZN,lin=yt(Wn,"GraphTransformer/Mode",502,Tt,h4n,B2n),fin;m(1536,1,Mi,fk),s.If=function(n,t){eNn(u(n,37),t)},v(Wn,"HierarchicalNodeResizingProcessor",1536),m(1537,1,Mi,MD),s.If=function(n,t){U8n(u(n,37),t)},v(Wn,"HierarchicalPortConstraintProcessor",1537),m(1538,1,Yt,ak),s.Le=function(n,t){return oSn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"HierarchicalPortConstraintProcessor/NodeComparator",1538),m(1539,1,Mi,hk),s.If=function(n,t){B_n(u(n,37),t)},v(Wn,"HierarchicalPortDummySizeProcessor",1539),m(1540,1,Mi,CD),s.If=function(n,t){WIn(this,u(n,37),t)},s.a=0,v(Wn,"HierarchicalPortOrthogonalEdgeRouter",1540),m(1541,1,Yt,Ph),s.Le=function(n,t){return opn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"HierarchicalPortOrthogonalEdgeRouter/1",1541),m(1542,1,Yt,lv),s.Le=function(n,t){return q9n(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"HierarchicalPortOrthogonalEdgeRouter/2",1542),m(1543,1,Mi,dk),s.If=function(n,t){OMn(u(n,37),t)},v(Wn,"HierarchicalPortPositionProcessor",1543),m(1544,1,Mi,yC),s.If=function(n,t){NRn(this,u(n,37))},s.a=0,s.c=0;var SJ,xJ;v(Wn,"HighDegreeNodeLayeringProcessor",1544),m(566,1,{566:1},w6),s.b=-1,s.d=-1,v(Wn,"HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation",566),m(1545,1,{},fq),s.Kb=function(n){return IT(),cr(u(n,9))},s.Fb=function(n){return this===n},v(Wn,"HighDegreeNodeLayeringProcessor/lambda$0$Type",1545),m(1546,1,{},BA),s.Kb=function(n){return IT(),Ii(u(n,9))},s.Fb=function(n){return this===n},v(Wn,"HighDegreeNodeLayeringProcessor/lambda$1$Type",1546),m(1552,1,Mi,zA),s.If=function(n,t){O_n(this,u(n,37),t)},v(Wn,"HyperedgeDummyMerger",1552),m(791,1,{},Wle),s.a=!1,s.b=!1,s.c=!1,v(Wn,"HyperedgeDummyMerger/MergeState",791),m(1553,1,{},p6),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"HyperedgeDummyMerger/lambda$0$Type",1553),m(1554,1,{},bk),s.Kb=function(n){return new mn(null,new vn(u(n,9).j,16))},v(Wn,"HyperedgeDummyMerger/lambda$1$Type",1554),m(1555,1,ct,TD),s.Ad=function(n){u(n,12).p=-1},v(Wn,"HyperedgeDummyMerger/lambda$2$Type",1555),m(1556,1,Mi,hq),s.If=function(n,t){T_n(u(n,37),t)},v(Wn,"HypernodesProcessor",1556),m(1557,1,Mi,dq),s.If=function(n,t){R_n(u(n,37),t)},v(Wn,"InLayerConstraintProcessor",1557),m(1558,1,Mi,FA),s.If=function(n,t){y7n(u(n,37),t)},v(Wn,"InnermostNodeMarginCalculator",1558),m(1559,1,Mi,bq),s.If=function(n,t){G$n(this,u(n,37))},s.a=Ir,s.b=Ir,s.c=Vi,s.d=Vi;var zBn=v(Wn,"InteractiveExternalPortPositioner",1559);m(1560,1,{},gq),s.Kb=function(n){return u(n,17).d.i},s.Fb=function(n){return this===n},v(Wn,"InteractiveExternalPortPositioner/lambda$0$Type",1560),m(1561,1,{},wje),s.Kb=function(n){return spn(this.a,re(n))},s.Fb=function(n){return this===n},v(Wn,"InteractiveExternalPortPositioner/lambda$1$Type",1561),m(1562,1,{},wq),s.Kb=function(n){return u(n,17).c.i},s.Fb=function(n){return this===n},v(Wn,"InteractiveExternalPortPositioner/lambda$2$Type",1562),m(1563,1,{},pje),s.Kb=function(n){return lpn(this.a,re(n))},s.Fb=function(n){return this===n},v(Wn,"InteractiveExternalPortPositioner/lambda$3$Type",1563),m(1564,1,{},mje),s.Kb=function(n){return i2n(this.a,re(n))},s.Fb=function(n){return this===n},v(Wn,"InteractiveExternalPortPositioner/lambda$4$Type",1564),m(1565,1,{},vje),s.Kb=function(n){return r2n(this.a,re(n))},s.Fb=function(n){return this===n},v(Wn,"InteractiveExternalPortPositioner/lambda$5$Type",1565),m(79,23,{3:1,35:1,23:1,79:1,196:1},br),s.bg=function(){switch(this.g){case 15:return new iw;case 22:return new Hp;case 48:return new sM;case 29:case 36:return new Sq;case 33:return new d6;case 43:return new IA;case 1:return new jD;case 42:return new E5;case 57:return new ioe((Y9(),ZN));case 0:return new ioe((Y9(),Dte));case 2:return new oq;case 55:return new ED;case 34:return new lq;case 52:return new b6;case 56:return new fk;case 13:return new MD;case 39:return new hk;case 45:return new CD;case 41:return new dk;case 9:return new yC;case 50:return new yOe;case 38:return new zA;case 44:return new hq;case 28:return new dq;case 31:return new FA;case 3:return new bq;case 18:return new aq;case 30:return new pq;case 5:return new CU;case 51:return new yq;case 35:return new W6;case 37:return new xq;case 53:return new MU;case 11:return new ND;case 7:return new TU;case 40:return new Aq;case 46:return new Mq;case 16:return new Cq;case 10:return new jCe;case 49:return new Iq;case 21:return new Dq;case 23:return new JP((rg(),Cx));case 8:return new HA;case 12:return new Lq;case 4:return new ID;case 19:return new rP;case 17:return new RD;case 54:return new v6;case 6:return new Jq;case 25:return new dxe;case 26:return new uM;case 47:return new qA;case 32:return new oNe;case 14:return new UD;case 27:return new Yq;case 20:return new j6;case 24:return new JP((rg(),NH));default:throw R(new qn(tee+(this.f!=null?this.f:""+this.g)))}};var Tve,Ove,Nve,Ive,Dve,_ve,Lve,Pve,$ve,Rve,Bve,N3,AJ,MJ,zve,Fve,Jve,Hve,Gve,qve,Uve,tx,Xve,Kve,Vve,Yve,Qve,_te,CJ,TJ,Wve,OJ,NJ,IJ,p7,wm,pm,Zve,DJ,_J,e3e,LJ,PJ,n3e,t3e,i3e,r3e,$J,Lte,Cy,RJ,BJ,zJ,FJ,c3e,u3e,o3e,s3e,FBn=yt(Wn,iee,79,Tt,JUe,z2n),ain;m(1566,1,Mi,aq),s.If=function(n,t){F$n(u(n,37),t)},v(Wn,"InvertedPortProcessor",1566),m(1567,1,Mi,pq),s.If=function(n,t){zDn(u(n,37),t)},v(Wn,"LabelAndNodeSizeProcessor",1567),m(1568,1,zt,mq),s.Mb=function(n){return u(n,9).k==(Fn(),Wi)},v(Wn,"LabelAndNodeSizeProcessor/lambda$0$Type",1568),m(1569,1,zt,OD),s.Mb=function(n){return u(n,9).k==(Fn(),wr)},v(Wn,"LabelAndNodeSizeProcessor/lambda$1$Type",1569),m(1570,1,ct,BNe),s.Ad=function(n){Tgn(this.b,this.a,this.c,u(n,9))},s.a=!1,s.c=!1,v(Wn,"LabelAndNodeSizeProcessor/lambda$2$Type",1570),m(1571,1,Mi,CU),s.If=function(n,t){v$n(u(n,37),t)};var hin;v(Wn,"LabelDummyInserter",1571),m(1572,1,Sh,vq),s.Lb=function(n){return ue(C(u(n,70),(Ie(),Ih)))===ue((Ra(),H7))},s.Fb=function(n){return this===n},s.Mb=function(n){return ue(C(u(n,70),(Ie(),Ih)))===ue((Ra(),H7))},v(Wn,"LabelDummyInserter/1",1572),m(1573,1,Mi,yq),s.If=function(n,t){u$n(u(n,37),t)},v(Wn,"LabelDummyRemover",1573),m(1574,1,zt,kq),s.Mb=function(n){return Fe(ze(C(u(n,70),(Ie(),H3))))},v(Wn,"LabelDummyRemover/lambda$0$Type",1574),m(1332,1,Mi,W6),s.If=function(n,t){e$n(this,u(n,37),t)},s.a=null;var Pte;v(Wn,"LabelDummySwitcher",1332),m(294,1,{294:1},RXe),s.c=0,s.d=null,s.f=0,v(Wn,"LabelDummySwitcher/LabelDummyInfo",294),m(1333,1,{},jq),s.Kb=function(n){return q4(),new mn(null,new vn(u(n,25).a,16))},v(Wn,"LabelDummySwitcher/lambda$0$Type",1333),m(1334,1,zt,JA),s.Mb=function(n){return q4(),u(n,9).k==(Fn(),Uu)},v(Wn,"LabelDummySwitcher/lambda$1$Type",1334),m(1335,1,{},yje),s.Kb=function(n){return Upn(this.a,u(n,9))},v(Wn,"LabelDummySwitcher/lambda$2$Type",1335),m(1336,1,ct,kje),s.Ad=function(n){K3n(this.a,u(n,294))},v(Wn,"LabelDummySwitcher/lambda$3$Type",1336),m(1337,1,Yt,Eq),s.Le=function(n,t){return E3n(u(n,294),u(t,294))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"LabelDummySwitcher/lambda$4$Type",1337),m(789,1,Mi,Sq),s.If=function(n,t){x9n(u(n,37),t)},v(Wn,"LabelManagementProcessor",789),m(1575,1,Mi,xq),s.If=function(n,t){pIn(u(n,37),t)},v(Wn,"LabelSideSelector",1575),m(1583,1,Mi,ND),s.If=function(n,t){tLn(u(n,37),t)},v(Wn,"LayerConstraintPostprocessor",1583),m(1584,1,Mi,TU),s.If=function(n,t){eOn(u(n,37),t)};var l3e;v(Wn,"LayerConstraintPreprocessor",1584),m(367,23,{3:1,35:1,23:1,367:1},h$);var eI,JJ,HJ,$te,din=yt(Wn,"LayerConstraintPreprocessor/HiddenNodeConnections",367,Tt,i6n,jmn),bin;m(1585,1,Mi,Aq),s.If=function(n,t){yPn(u(n,37),t)},v(Wn,"LayerSizeAndGraphHeightCalculator",1585),m(1586,1,Mi,Mq),s.If=function(n,t){nNn(u(n,37),t)},v(Wn,"LongEdgeJoiner",1586),m(1587,1,Mi,Cq),s.If=function(n,t){YLn(u(n,37),t)},v(Wn,"LongEdgeSplitter",1587),m(1588,1,Mi,jCe),s.If=function(n,t){D$n(this,u(n,37),t)},s.e=0,s.f=0,s.j=0,s.k=0,s.n=0,s.o=0;var gin,win;v(Wn,"NodePromotion",1588),m(1589,1,Yt,Tq),s.Le=function(n,t){return Skn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"NodePromotion/1",1589),m(1590,1,Yt,Oq),s.Le=function(n,t){return xkn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"NodePromotion/2",1590),m(1591,1,{},Nq),s.Kb=function(n){return u(n,49),Y$(),$n(),!0},s.Fb=function(n){return this===n},v(Wn,"NodePromotion/lambda$0$Type",1591),m(1592,1,{},jje),s.Kb=function(n){return O4n(this.a,u(n,49))},s.Fb=function(n){return this===n},s.a=0,v(Wn,"NodePromotion/lambda$1$Type",1592),m(1593,1,{},Eje),s.Kb=function(n){return T4n(this.a,u(n,49))},s.Fb=function(n){return this===n},s.a=0,v(Wn,"NodePromotion/lambda$2$Type",1593),m(1594,1,Mi,Iq),s.If=function(n,t){jRn(u(n,37),t)},v(Wn,"NorthSouthPortPostprocessor",1594),m(1595,1,Mi,Dq),s.If=function(n,t){CRn(u(n,37),t)},v(Wn,"NorthSouthPortPreprocessor",1595),m(1596,1,Yt,_q),s.Le=function(n,t){return H7n(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"NorthSouthPortPreprocessor/lambda$0$Type",1596),m(1597,1,Mi,HA),s.If=function(n,t){v_n(u(n,37),t)},v(Wn,"PartitionMidprocessor",1597),m(1598,1,zt,m6),s.Mb=function(n){return wi(u(n,9),(Ie(),xm))},v(Wn,"PartitionMidprocessor/lambda$0$Type",1598),m(1599,1,ct,Sje),s.Ad=function(n){D5n(this.a,u(n,9))},v(Wn,"PartitionMidprocessor/lambda$1$Type",1599),m(1600,1,Mi,Lq),s.If=function(n,t){jNn(u(n,37),t)},v(Wn,"PartitionPostprocessor",1600),m(1601,1,Mi,ID),s.If=function(n,t){xDn(u(n,37),t)},v(Wn,"PartitionPreprocessor",1601),m(1602,1,zt,DD),s.Mb=function(n){return wi(u(n,9),(Ie(),xm))},v(Wn,"PartitionPreprocessor/lambda$0$Type",1602),m(1603,1,zt,_D),s.Mb=function(n){return wi(u(n,9),(Ie(),xm))},v(Wn,"PartitionPreprocessor/lambda$1$Type",1603),m(1604,1,{},LD),s.Kb=function(n){return new mn(null,new A2(new Un(Yn(Ii(u(n,9)).a.Jc(),new ee))))},v(Wn,"PartitionPreprocessor/lambda$2$Type",1604),m(1605,1,zt,xje),s.Mb=function(n){return hgn(this.a,u(n,17))},v(Wn,"PartitionPreprocessor/lambda$3$Type",1605),m(1606,1,ct,PD),s.Ad=function(n){tkn(u(n,17))},v(Wn,"PartitionPreprocessor/lambda$4$Type",1606),m(1607,1,zt,Aje),s.Mb=function(n){return V3n(this.a,u(n,9))},s.a=0,v(Wn,"PartitionPreprocessor/lambda$5$Type",1607),m(1608,1,Mi,rP),s.If=function(n,t){ZDn(u(n,37),t)};var f3e,pin,min,vin,a3e,h3e;v(Wn,"PortListSorter",1608),m(1609,1,{},A5),s.Kb=function(n){return i8(),u(n,12).e},v(Wn,"PortListSorter/lambda$0$Type",1609),m(1610,1,{},Pq),s.Kb=function(n){return i8(),u(n,12).g},v(Wn,"PortListSorter/lambda$1$Type",1610),m(1611,1,Yt,$q),s.Le=function(n,t){return hPe(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"PortListSorter/lambda$2$Type",1611),m(1612,1,Yt,Rq),s.Le=function(n,t){return gxn(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"PortListSorter/lambda$3$Type",1612),m(1613,1,Yt,$D),s.Le=function(n,t){return fKe(u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"PortListSorter/lambda$4$Type",1613),m(1614,1,Mi,RD),s.If=function(n,t){oOn(u(n,37),t)},v(Wn,"PortSideProcessor",1614),m(1615,1,Mi,v6),s.If=function(n,t){aDn(u(n,37),t)},v(Wn,"ReversedEdgeRestorer",1615),m(1620,1,Mi,dxe),s.If=function(n,t){WSn(this,u(n,37),t)},v(Wn,"SelfLoopPortRestorer",1620),m(1621,1,{},y6),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"SelfLoopPortRestorer/lambda$0$Type",1621),m(1622,1,zt,Bq),s.Mb=function(n){return u(n,9).k==(Fn(),Wi)},v(Wn,"SelfLoopPortRestorer/lambda$1$Type",1622),m(1623,1,zt,gk),s.Mb=function(n){return wi(u(n,9),(me(),wp))},v(Wn,"SelfLoopPortRestorer/lambda$2$Type",1623),m(1624,1,{},BD),s.Kb=function(n){return u(C(u(n,9),(me(),wp)),338)},v(Wn,"SelfLoopPortRestorer/lambda$3$Type",1624),m(1625,1,ct,Mje),s.Ad=function(n){oCn(this.a,u(n,338))},v(Wn,"SelfLoopPortRestorer/lambda$4$Type",1625),m(792,1,ct,GA),s.Ad=function(n){mCn(u(n,107))},v(Wn,"SelfLoopPortRestorer/lambda$5$Type",792),m(1627,1,Mi,qA),s.If=function(n,t){fSn(u(n,37),t)},v(Wn,"SelfLoopPostProcessor",1627),m(1628,1,{},UA),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"SelfLoopPostProcessor/lambda$0$Type",1628),m(1629,1,zt,zD),s.Mb=function(n){return u(n,9).k==(Fn(),Wi)},v(Wn,"SelfLoopPostProcessor/lambda$1$Type",1629),m(1630,1,zt,FD),s.Mb=function(n){return wi(u(n,9),(me(),wp))},v(Wn,"SelfLoopPostProcessor/lambda$2$Type",1630),m(1631,1,ct,JD),s.Ad=function(n){bAn(u(n,9))},v(Wn,"SelfLoopPostProcessor/lambda$3$Type",1631),m(1632,1,{},zq),s.Kb=function(n){return new mn(null,new vn(u(n,107).f,1))},v(Wn,"SelfLoopPostProcessor/lambda$4$Type",1632),m(1633,1,ct,Cje),s.Ad=function(n){Qyn(this.a,u(n,341))},v(Wn,"SelfLoopPostProcessor/lambda$5$Type",1633),m(1634,1,zt,Fq),s.Mb=function(n){return!!u(n,107).i},v(Wn,"SelfLoopPostProcessor/lambda$6$Type",1634),m(1635,1,ct,Tje),s.Ad=function(n){Tbn(this.a,u(n,107))},v(Wn,"SelfLoopPostProcessor/lambda$7$Type",1635),m(1616,1,Mi,Jq),s.If=function(n,t){zOn(u(n,37),t)},v(Wn,"SelfLoopPreProcessor",1616),m(1617,1,{},Hq),s.Kb=function(n){return new mn(null,new vn(u(n,107).f,1))},v(Wn,"SelfLoopPreProcessor/lambda$0$Type",1617),m(1618,1,{},Gq),s.Kb=function(n){return u(n,341).a},v(Wn,"SelfLoopPreProcessor/lambda$1$Type",1618),m(1619,1,ct,g1),s.Ad=function(n){Nwn(u(n,17))},v(Wn,"SelfLoopPreProcessor/lambda$2$Type",1619),m(1636,1,Mi,oNe),s.If=function(n,t){GMn(this,u(n,37),t)},v(Wn,"SelfLoopRouter",1636),m(1637,1,{},k6),s.Kb=function(n){return new mn(null,new vn(u(n,25).a,16))},v(Wn,"SelfLoopRouter/lambda$0$Type",1637),m(1638,1,zt,HD),s.Mb=function(n){return u(n,9).k==(Fn(),Wi)},v(Wn,"SelfLoopRouter/lambda$1$Type",1638),m(1639,1,zt,GD),s.Mb=function(n){return wi(u(n,9),(me(),wp))},v(Wn,"SelfLoopRouter/lambda$2$Type",1639),m(1640,1,{},qD),s.Kb=function(n){return u(C(u(n,9),(me(),wp)),338)},v(Wn,"SelfLoopRouter/lambda$3$Type",1640),m(1641,1,ct,KMe),s.Ad=function(n){M5n(this.a,this.b,u(n,338))},v(Wn,"SelfLoopRouter/lambda$4$Type",1641),m(1642,1,Mi,UD),s.If=function(n,t){rIn(u(n,37),t)},v(Wn,"SemiInteractiveCrossMinProcessor",1642),m(1643,1,zt,XA),s.Mb=function(n){return u(n,9).k==(Fn(),Wi)},v(Wn,"SemiInteractiveCrossMinProcessor/lambda$0$Type",1643),m(1644,1,zt,qq),s.Mb=function(n){return EIe(u(n,9))._b((Ie(),Cm))},v(Wn,"SemiInteractiveCrossMinProcessor/lambda$1$Type",1644),m(1645,1,Yt,M5),s.Le=function(n,t){return t7n(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Wn,"SemiInteractiveCrossMinProcessor/lambda$2$Type",1645),m(1646,1,{},KA),s.Te=function(n,t){return I5n(u(n,9),u(t,9))},v(Wn,"SemiInteractiveCrossMinProcessor/lambda$3$Type",1646),m(1648,1,Mi,j6),s.If=function(n,t){RPn(u(n,37),t)},v(Wn,"SortByInputModelProcessor",1648),m(1649,1,zt,VA),s.Mb=function(n){return u(n,12).g.c.length!=0},v(Wn,"SortByInputModelProcessor/lambda$0$Type",1649),m(1650,1,ct,Oje),s.Ad=function(n){ECn(this.a,u(n,12))},v(Wn,"SortByInputModelProcessor/lambda$1$Type",1650),m(1729,804,{},PBe),s.bf=function(n){var t,i,r,c;switch(this.c=n,this.a.g){case 2:t=new Oe,er(li(new mn(null,new vn(this.c.a.b,16)),new ZD),new ZMe(this,t)),UO(this,new fv),Ao(t,new C5),t.c.length=0,er(li(new mn(null,new vn(this.c.a.b,16)),new YA),new Ije(t)),UO(this,new KD),Ao(t,new av),t.c.length=0,i=LTe(GY(C2(new mn(null,new vn(this.c.a.b,16)),new Dje(this))),new VD),er(new mn(null,new vn(this.c.a.a,16)),new YMe(i,t)),UO(this,new QD),Ao(t,new Uq),t.c.length=0;break;case 3:r=new Oe,UO(this,new XD),c=LTe(GY(C2(new mn(null,new vn(this.c.a.b,16)),new Nje(this))),new YD),er(li(new mn(null,new vn(this.c.a.b,16)),new Xq),new WMe(c,r)),UO(this,new Kq),Ao(r,new WD),r.c.length=0;break;default:throw R(new nxe)}},s.b=0,v(lr,"EdgeAwareScanlineConstraintCalculation",1729),m(1730,1,Sh,XD),s.Lb=function(n){return X(u(n,60).g,156)},s.Fb=function(n){return this===n},s.Mb=function(n){return X(u(n,60).g,156)},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$0$Type",1730),m(1731,1,{},Nje),s.We=function(n){return YCn(this.a,u(n,60))},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$1$Type",1731),m(1739,1,iF,VMe),s.be=function(){XE(this.a,this.b,-1)},s.b=0,v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$10$Type",1739),m(1741,1,Sh,fv),s.Lb=function(n){return X(u(n,60).g,156)},s.Fb=function(n){return this===n},s.Mb=function(n){return X(u(n,60).g,156)},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$11$Type",1741),m(1742,1,ct,C5),s.Ad=function(n){u(n,375).be()},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$12$Type",1742),m(1743,1,zt,YA),s.Mb=function(n){return X(u(n,60).g,9)},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$13$Type",1743),m(1745,1,ct,Ije),s.Ad=function(n){Bjn(this.a,u(n,60))},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$14$Type",1745),m(1744,1,iF,tCe),s.be=function(){XE(this.b,this.a,-1)},s.a=0,v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$15$Type",1744),m(1746,1,Sh,KD),s.Lb=function(n){return X(u(n,60).g,9)},s.Fb=function(n){return this===n},s.Mb=function(n){return X(u(n,60).g,9)},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$16$Type",1746),m(1747,1,ct,av),s.Ad=function(n){u(n,375).be()},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$17$Type",1747),m(1748,1,{},Dje),s.We=function(n){return QCn(this.a,u(n,60))},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$18$Type",1748),m(1749,1,{},VD),s.Ue=function(){return 0},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$19$Type",1749),m(1732,1,{},YD),s.Ue=function(){return 0},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$2$Type",1732),m(1751,1,ct,YMe),s.Ad=function(n){g3n(this.a,this.b,u(n,320))},s.a=0,v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$20$Type",1751),m(1750,1,iF,QMe),s.be=function(){hUe(this.a,this.b,-1)},s.b=0,v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$21$Type",1750),m(1752,1,Sh,QD),s.Lb=function(n){return u(n,60),!0},s.Fb=function(n){return this===n},s.Mb=function(n){return u(n,60),!0},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$22$Type",1752),m(1753,1,ct,Uq),s.Ad=function(n){u(n,375).be()},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$23$Type",1753),m(1733,1,zt,Xq),s.Mb=function(n){return X(u(n,60).g,9)},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$3$Type",1733),m(1735,1,ct,WMe),s.Ad=function(n){w3n(this.a,this.b,u(n,60))},s.a=0,v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$4$Type",1735),m(1734,1,iF,iCe),s.be=function(){XE(this.b,this.a,-1)},s.a=0,v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$5$Type",1734),m(1736,1,Sh,Kq),s.Lb=function(n){return u(n,60),!0},s.Fb=function(n){return this===n},s.Mb=function(n){return u(n,60),!0},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$6$Type",1736),m(1737,1,ct,WD),s.Ad=function(n){u(n,375).be()},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$7$Type",1737),m(1738,1,zt,ZD),s.Mb=function(n){return X(u(n,60).g,156)},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$8$Type",1738),m(1740,1,ct,ZMe),s.Ad=function(n){x8n(this.a,this.b,u(n,60))},v(lr,"EdgeAwareScanlineConstraintCalculation/lambda$9$Type",1740),m(1547,1,Mi,yOe),s.If=function(n,t){ZLn(this,u(n,37),t)};var yin;v(lr,"HorizontalGraphCompactor",1547),m(1548,1,{},_je),s.df=function(n,t){var i,r,c;return yhe(n,t)||(i=Xv(n),r=Xv(t),i&&i.k==(Fn(),wr)||r&&r.k==(Fn(),wr))?0:(c=u(C(this.a.a,(me(),z3)),316),hpn(c,i?i.k:(Fn(),dr),r?r.k:(Fn(),dr)))},s.ef=function(n,t){var i,r,c;return yhe(n,t)?1:(i=Xv(n),r=Xv(t),c=u(C(this.a.a,(me(),z3)),316),ale(c,i?i.k:(Fn(),dr),r?r.k:(Fn(),dr)))},v(lr,"HorizontalGraphCompactor/1",1548),m(1549,1,{},QA),s.cf=function(n,t){return Cj(),n.a.i==0},v(lr,"HorizontalGraphCompactor/lambda$0$Type",1549),m(1550,1,{},Lje),s.cf=function(n,t){return L5n(this.a,n,t)},v(lr,"HorizontalGraphCompactor/lambda$1$Type",1550),m(1696,1,{},bRe);var kin,jin;v(lr,"LGraphToCGraphTransformer",1696),m(1704,1,zt,h0),s.Mb=function(n){return n!=null},v(lr,"LGraphToCGraphTransformer/0methodref$nonNull$Type",1704),m(1697,1,{},wk),s.Kb=function(n){return il(),fu(C(u(u(n,60).g,9),(me(),mi)))},v(lr,"LGraphToCGraphTransformer/lambda$0$Type",1697),m(1698,1,{},ld),s.Kb=function(n){return il(),CFe(u(u(n,60).g,156))},v(lr,"LGraphToCGraphTransformer/lambda$1$Type",1698),m(1707,1,zt,T5),s.Mb=function(n){return il(),X(u(n,60).g,9)},v(lr,"LGraphToCGraphTransformer/lambda$10$Type",1707),m(1708,1,ct,WA),s.Ad=function(n){A5n(u(n,60))},v(lr,"LGraphToCGraphTransformer/lambda$11$Type",1708),m(1709,1,zt,pk),s.Mb=function(n){return il(),X(u(n,60).g,156)},v(lr,"LGraphToCGraphTransformer/lambda$12$Type",1709),m(1713,1,ct,mk),s.Ad=function(n){rjn(u(n,60))},v(lr,"LGraphToCGraphTransformer/lambda$13$Type",1713),m(1710,1,ct,Pje),s.Ad=function(n){own(this.a,u(n,8))},s.a=0,v(lr,"LGraphToCGraphTransformer/lambda$14$Type",1710),m(1711,1,ct,$je),s.Ad=function(n){lwn(this.a,u(n,119))},s.a=0,v(lr,"LGraphToCGraphTransformer/lambda$15$Type",1711),m(1712,1,ct,Rje),s.Ad=function(n){swn(this.a,u(n,8))},s.a=0,v(lr,"LGraphToCGraphTransformer/lambda$16$Type",1712),m(1714,1,{},ZA),s.Kb=function(n){return il(),new mn(null,new A2(new Un(Yn(Ii(u(n,9)).a.Jc(),new ee))))},v(lr,"LGraphToCGraphTransformer/lambda$17$Type",1714),m(1715,1,zt,hv),s.Mb=function(n){return il(),uc(u(n,17))},v(lr,"LGraphToCGraphTransformer/lambda$18$Type",1715),m(1716,1,ct,Bje),s.Ad=function(n){n8n(this.a,u(n,17))},v(lr,"LGraphToCGraphTransformer/lambda$19$Type",1716),m(1700,1,ct,zje),s.Ad=function(n){Oyn(this.a,u(n,156))},v(lr,"LGraphToCGraphTransformer/lambda$2$Type",1700),m(1717,1,{},e_),s.Kb=function(n){return il(),new mn(null,new vn(u(n,25).a,16))},v(lr,"LGraphToCGraphTransformer/lambda$20$Type",1717),m(1718,1,{},vk),s.Kb=function(n){return il(),new mn(null,new A2(new Un(Yn(Ii(u(n,9)).a.Jc(),new ee))))},v(lr,"LGraphToCGraphTransformer/lambda$21$Type",1718),m(1719,1,{},O5),s.Kb=function(n){return il(),u(C(u(n,17),(me(),Eg)),16)},v(lr,"LGraphToCGraphTransformer/lambda$22$Type",1719),m(1720,1,zt,Vq),s.Mb=function(n){return dpn(u(n,16))},v(lr,"LGraphToCGraphTransformer/lambda$23$Type",1720),m(1721,1,ct,Fje),s.Ad=function(n){WCn(this.a,u(n,16))},v(lr,"LGraphToCGraphTransformer/lambda$24$Type",1721),m(1722,1,{},w1),s.Kb=function(n){return il(),new mn(null,new A2(new Un(Yn(Ii(u(n,9)).a.Jc(),new ee))))},v(lr,"LGraphToCGraphTransformer/lambda$25$Type",1722),m(1723,1,zt,eM),s.Mb=function(n){return il(),uc(u(n,17))},v(lr,"LGraphToCGraphTransformer/lambda$26$Type",1723),m(1725,1,ct,Jje),s.Ad=function(n){K8n(this.a,u(n,17))},v(lr,"LGraphToCGraphTransformer/lambda$27$Type",1725),m(1724,1,ct,Hje),s.Ad=function(n){egn(this.a,u(n,70))},s.a=0,v(lr,"LGraphToCGraphTransformer/lambda$28$Type",1724),m(1699,1,ct,eCe),s.Ad=function(n){O6n(this.a,this.b,u(n,156))},v(lr,"LGraphToCGraphTransformer/lambda$3$Type",1699),m(1701,1,{},nw),s.Kb=function(n){return il(),new mn(null,new vn(u(n,25).a,16))},v(lr,"LGraphToCGraphTransformer/lambda$4$Type",1701),m(1702,1,{},n_),s.Kb=function(n){return il(),new mn(null,new A2(new Un(Yn(Ii(u(n,9)).a.Jc(),new ee))))},v(lr,"LGraphToCGraphTransformer/lambda$5$Type",1702),m(1703,1,{},yk),s.Kb=function(n){return il(),u(C(u(n,17),(me(),Eg)),16)},v(lr,"LGraphToCGraphTransformer/lambda$6$Type",1703),m(1705,1,ct,Gje),s.Ad=function(n){lTn(this.a,u(n,16))},v(lr,"LGraphToCGraphTransformer/lambda$8$Type",1705),m(1706,1,ct,nCe),s.Ad=function(n){Iwn(this.a,this.b,u(n,156))},v(lr,"LGraphToCGraphTransformer/lambda$9$Type",1706),m(1695,1,{},dv),s.af=function(n){var t,i,r,c,o;for(this.a=n,this.d=new wX,this.c=se(Yme,On,124,this.a.a.a.c.length,0,1),this.b=0,i=new P(this.a.a.a);i.a=D&&(Te(o,ke(p)),V=k.Math.max(V,te[p-1]-y),f+=O,B+=te[p-1]-B,y=te[p-1],O=h[p]),O=k.Math.max(O,h[p]),++p;f+=O}A=k.Math.min(1/V,1/t.b/f),A>r&&(r=A,i=o)}return i},s.ng=function(){return!1},v(Ah,"MSDCutIndexHeuristic",803),m(1647,1,Mi,Yq),s.If=function(n,t){iLn(u(n,37),t)},v(Ah,"SingleEdgeGraphWrapper",1647),m(231,23,{3:1,35:1,23:1,231:1},Lj);var D3,y7,k7,vm,ix,_3,j7=yt(Tu,"CenterEdgeLabelPlacementStrategy",231,Tt,M9n,q2n),_in;m(422,23,{3:1,35:1,23:1,422:1},dse);var b3e,Kte,g3e=yt(Tu,"ConstraintCalculationStrategy",422,Tt,Q5n,U2n),Lin;m(301,23,{3:1,35:1,23:1,301:1,188:1,196:1},b$),s.bg=function(){return kUe(this)},s.og=function(){return kUe(this)};var tI,rx,w3e,p3e,m3e=yt(Tu,"CrossingMinimizationStrategy",301,Tt,r6n,X2n),Pin;m(350,23,{3:1,35:1,23:1,350:1},VX);var v3e,Vte,KJ,y3e=yt(Tu,"CuttingStrategy",350,Tt,F4n,K2n),$in;m(267,23,{3:1,35:1,23:1,267:1,188:1,196:1},Nv),s.bg=function(){return xXe(this)},s.og=function(){return xXe(this)};var Yte,k3e,Qte,Wte,Zte,eie,nie,tie,iI,j3e=yt(Tu,"CycleBreakingStrategy",267,Tt,F8n,V2n),Rin;m(419,23,{3:1,35:1,23:1,419:1},bse);var VJ,E3e,S3e=yt(Tu,"DirectionCongruency",419,Tt,W5n,Y2n),Bin;m(449,23,{3:1,35:1,23:1,449:1},QX);var E7,iie,L3,zin=yt(Tu,"EdgeConstraint",449,Tt,J4n,Q2n),Fin;m(284,23,{3:1,35:1,23:1,284:1},Rj);var rie,cie,uie,oie,YJ,sie,x3e=yt(Tu,"EdgeLabelSideSelection",284,Tt,C9n,W2n),Jin;m(476,23,{3:1,35:1,23:1,476:1},gse);var QJ,A3e,M3e=yt(Tu,"EdgeStraighteningStrategy",476,Tt,Z5n,Z2n),Hin;m(282,23,{3:1,35:1,23:1,282:1},Pj);var lie,C3e,T3e,WJ,O3e,N3e,I3e=yt(Tu,"FixedAlignment",282,Tt,T9n,emn),Gin;m(283,23,{3:1,35:1,23:1,283:1},$j);var D3e,_3e,L3e,P3e,cx,$3e,R3e=yt(Tu,"GraphCompactionStrategy",283,Tt,O9n,nmn),qin;m(261,23,{3:1,35:1,23:1,261:1},h2);var S7,ZJ,x7,Kl,ux,eH,A7,P3,nH,ox,fie=yt(Tu,"GraphProperties",261,Tt,b7n,tmn),Uin;m(302,23,{3:1,35:1,23:1,302:1},WX);var rI,aie,hie,die=yt(Tu,"GreedySwitchType",302,Tt,H4n,imn),Xin;m(329,23,{3:1,35:1,23:1,329:1},ZX);var ym,B3e,cI,bie=yt(Tu,"GroupOrderStrategy",329,Tt,G4n,rmn),Kin;m(315,23,{3:1,35:1,23:1,315:1},eK);var Ty,uI,$3,Vin=yt(Tu,"InLayerConstraint",315,Tt,q4n,cmn),Yin;m(420,23,{3:1,35:1,23:1,420:1},wse);var gie,z3e,F3e=yt(Tu,"InteractiveReferencePoint",420,Tt,e4n,umn),Qin,J3e,Oy,dp,oI,tH,H3e,G3e,iH,q3e,Ny,rH,sx,Iy,K1,wie,cH,Iu,U3e,ob,po,pie,mie,sI,jg,bp,Dy,X3e,Win,_y,lI,km,Ea,gf,vie,R3,sb,Oi,mi,K3e,V3e,Y3e,Q3e,W3e,yie,uH,vs,gp,kie,Ly,lx,qd,B3,wp,z3,F3,M7,Eg,Z3e,jie,Eie,fx,Py,oH,$y,J3;m(165,23,{3:1,35:1,23:1,165:1},fT);var ax,V1,hx,Sg,fI,e5e=yt(Tu,"LayerConstraint",165,Tt,Z6n,omn),Zin;m(423,23,{3:1,35:1,23:1,423:1},pse);var Sie,xie,n5e=yt(Tu,"LayerUnzippingStrategy",423,Tt,n4n,smn),ern;m(843,1,Ua,xC),s.tf=function(n){en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,gwe),""),"Direction Congruency"),"Specifies how drawings of the same graph with different layout directions compare to each other: either a natural reading direction is preserved or the drawings are rotated versions of each other."),b5e),(lg(),Bi)),S3e),rn((vh(),Cn))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,wwe),""),"Feedback Edges"),"Whether feedback edges should be highlighted by routing around the nodes."),($n(),!1)),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,wF),""),"Interactive Reference Point"),"Determines which point of a node is considered by interactive layout phases."),y5e),Bi),F3e),rn(Cn)))),qi(n,wF,IN,rcn),qi(n,wF,CS,icn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,pwe),""),"Merge Edges"),"Edges that have no ports are merged so they touch the connected nodes at the same points. When this option is disabled, one port is created for each edge directly connected to a node. When it is enabled, all such incoming edges share an input port, and all outgoing edges share an output port."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,mwe),""),"Merge Hierarchy-Crossing Edges"),"If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible. They are broken by the algorithm, with hierarchical ports inserted as required. Usually, one such port is created for each edge at each hierarchy crossing point. With this option set to true, we try to create as few hierarchical ports as possible in the process. In particular, all edges that form a hyperedge can share a port."),!0),xr),Qi),rn(Cn)))),en(n,new qe(tgn(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,vwe),""),"Allow Non-Flow Ports To Switch Sides"),"Specifies whether non-flow ports may switch sides if their node's port constraints are either FIXED_SIDE or FIXED_ORDER. A non-flow port is a port on a side that is not part of the currently configured layout flow. For instance, given a left-to-right layout direction, north and south ports would be considered non-flow ports. Further note that the underlying criterium whether to switch sides or not solely relies on the minimization of edge crossings. Hence, edge length and other aesthetics criteria are not addressed."),!1),xr),Qi),rn(Yd)),F(z(He,1),Me,2,6,["org.eclipse.elk.layered.northOrSouthPort"])))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ywe),""),"Port Sorting Strategy"),"Only relevant for nodes with FIXED_SIDE port constraints. Determines the way a node's ports are distributed on the sides of a node if their order is not prescribed. The option is set on parent nodes."),N5e),Bi),J4e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,kwe),""),"Thoroughness"),"How much effort should be spent to produce a nice layout."),ke(7)),dc),jr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,jwe),""),"Add Unnecessary Bendpoints"),"Adds bend points even if an edge does not change direction. If true, each long edge dummy will contribute a bend point to its edges and hierarchy-crossing edges will always get a bend point where they cross hierarchy boundaries. By default, bend points are only added where an edge changes direction."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Ewe),""),"Generate Position and Layer IDs"),"If enabled position id and layer id are generated, which are usually only used internally when setting the interactiveLayout option. This option should be specified on the root node."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,IN),"cycleBreaking"),"Cycle Breaking Strategy"),"Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right)."),d5e),Bi),j3e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,DN),Ree),"Node Layering Strategy"),"Strategy for node layering."),E5e),Bi),O4e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Swe),Ree),"Layer Constraint"),"Determines a constraint on the placement of the node regarding the layering."),k5e),Bi),e5e),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,xwe),Ree),"Layer Choice Constraint"),"Allows to set a constraint regarding the layer placement of a node. Let i be the value of teh constraint. Assumed the drawing has n layers and i < n. If set to i, it expresses that the node should be placed in i-th layer. Should i>=n be true then the node is placed in the last layer of the drawing. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),null),dc),jr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Awe),Ree),"Layer ID"),"Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),ke(-1)),dc),jr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,uee),OQe),"Upper Bound On Width [MinWidth Layerer]"),"Defines a loose upper bound on the width of the MinWidth layerer. If set to '-1' multiple values are tested and the best result is selected."),ke(4)),dc),jr),rn(Cn)))),qi(n,uee,DN,acn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,oee),OQe),"Upper Layer Estimation Scaling Factor [MinWidth Layerer]"),"Multiplied with Upper Bound On Width for defining an upper bound on the width of layers which haven't been determined yet, but whose maximum width had been (roughly) estimated by the MinWidth algorithm. Compensates for too high estimations. If set to '-1' multiple values are tested and the best result is selected."),ke(2)),dc),jr),rn(Cn)))),qi(n,oee,DN,dcn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,see),NQe),"Node Promotion Strategy"),"Reduces number of dummy nodes after layering phase (if possible)."),j5e),Bi),B4e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,lee),NQe),"Max Node Promotion Iterations"),"Limits the number of iterations for node promotion."),ke(0)),dc),jr),rn(Cn)))),qi(n,lee,see,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,fee),"layering.coffmanGraham"),"Layer Bound"),"The maximum number of nodes allowed per layer."),ke(oi)),dc),jr),rn(Cn)))),qi(n,fee,DN,ucn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,CS),Q8),"Crossing Minimization Strategy"),"Strategy for crossing minimization."),h5e),Bi),m3e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Mwe),Q8),"Force Node Model Order"),"The node order given by the model does not change to produce a better layout. E.g. if node A is before node B in the model this is not changed during crossing minimization. This assumes that the node model order is already respected before crossing minimization. This can be achieved by setting considerModelOrder.strategy to NODES_AND_EDGES."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,aee),Q8),"Hierarchical Sweepiness"),"How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."),.1),ec),gr),rn(Cn)))),qi(n,aee,TF,Orn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,hee),Q8),"Semi-Interactive Crossing Minimization"),"Preserves the order of nodes within a layer but still minimizes crossings between edges connecting long edge dummies. Derives the desired order from positions specified by the 'org.eclipse.elk.position' layout option. Requires a crossing minimization strategy that is able to process 'in-layer' constraints."),!1),xr),Qi),rn(Cn)))),qi(n,hee,CS,Prn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Cwe),Q8),"In Layer Predecessor of"),"Allows to set a constraint which specifies of which node the current node is the predecessor. If set to 's' then the node is the predecessor of 's' and is in the same layer"),null),Gy),He),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Twe),Q8),"In Layer Successor of"),"Allows to set a constraint which specifies of which node the current node is the successor. If set to 's' then the node is the successor of 's' and is in the same layer"),null),Gy),He),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Owe),Q8),"Position Choice Constraint"),"Allows to set a constraint regarding the position placement of a node in a layer. Assumed the layer in which the node placed includes n other nodes and i < n. If set to i, it expresses that the node should be placed at the i-th position. Should i>=n be true then the node is placed at the last position in the layer. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),null),dc),jr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Nwe),Q8),"Position ID"),"Position within a layer that was determined by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),ke(-1)),dc),jr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Iwe),IQe),"Greedy Switch Activation Threshold"),"By default it is decided automatically if the greedy switch is activated or not. The decision is based on whether the size of the input graph (without dummy nodes) is smaller than the value of this option. A '0' enforces the activation."),ke(40)),dc),jr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,dee),IQe),"Greedy Switch Crossing Minimization"),"Greedy Switch strategy for crossing minimization. The greedy switch heuristic is executed after the regular crossing minimization as a post-processor. Note that if 'hierarchyHandling' is set to 'INCLUDE_CHILDREN', the 'greedySwitchHierarchical.type' option must be used."),a5e),Bi),die),rn(Cn)))),qi(n,dee,CS,Crn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,pF),"crossingMinimization.greedySwitchHierarchical"),"Greedy Switch Crossing Minimization (hierarchical)"),"Activates the greedy switch heuristic in case hierarchical layout is used. The differences to the non-hierarchical case (see 'greedySwitch.type') are: 1) greedy switch is inactive by default, 3) only the option value set on the node at which hierarchical layout starts is relevant, and 2) if it's activated by the user, it properly addresses hierarchy-crossing edges."),f5e),Bi),die),rn(Cn)))),qi(n,pF,CS,xrn),qi(n,pF,TF,Arn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,j3),DQe),"Node Placement Strategy"),"Strategy for node placement."),O5e),Bi),_4e),rn(Cn)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,mF),DQe),"Favor Straight Edges Over Balancing"),"Favor straight edges over a balanced node placement. The default behavior is determined automatically based on the used 'edgeRouting'. For an orthogonal style it is set to true, for all other styles to false."),xr),Qi),rn(Cn)))),qi(n,mF,j3,Ocn),qi(n,mF,j3,Ncn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,bee),_Qe),"BK Edge Straightening"),"Specifies whether the Brandes Koepf node placer tries to increase the number of straight edges at the expense of diagram size. There is a subtle difference to the 'favorStraightEdges' option, which decides whether a balanced placement of the nodes is desired, or not. In bk terms this means combining the four alignments into a single balanced one, or not. This option on the other hand tries to straighten additional edges during the creation of each of the four alignments."),M5e),Bi),M3e),rn(Cn)))),qi(n,bee,j3,Acn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,gee),_Qe),"BK Fixed Alignment"),"Tells the BK node placer to use a certain alignment (out of its four) instead of the one producing the smallest height, or the combination of all four."),C5e),Bi),I3e),rn(Cn)))),qi(n,gee,j3,Ccn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,wee),"nodePlacement.linearSegments"),"Linear Segments Deflection Dampening"),"Dampens the movement of nodes to keep the diagram from getting too large."),.3),ec),gr),rn(Cn)))),qi(n,wee,j3,Dcn),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,pee),"nodePlacement.networkSimplex"),"Node Flexibility"),"Aims at shorter and straighter edges. Two configurations are possible: (a) allow ports to move freely on the side they are assigned to (the order is always defined beforehand), (b) additionally allow to enlarge a node wherever it helps. If this option is not configured for a node, the 'nodeFlexibility.default' value is used, which is specified for the node's parent."),Bi),Wie),rn(fr)))),qi(n,pee,j3,$cn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,mee),"nodePlacement.networkSimplex.nodeFlexibility"),"Node Flexibility Default"),"Default value of the 'nodeFlexibility' option for the children of a hierarchical node."),T5e),Bi),Wie),rn(Cn)))),qi(n,mee,j3,Pcn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Dwe),LQe),"Self-Loop Distribution"),"Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."),p5e),Bi),q4e),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,_we),LQe),"Self-Loop Ordering"),"Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE."),m5e),Bi),U4e),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,vF),"edgeRouting.splines"),"Spline Routing Mode"),"Specifies the way control points are assembled for each individual edge. CONSERVATIVE ensures that edges are properly routed around the nodes but feels rather orthogonal at times. SLOPPY uses fewer control points to obtain curvier edge routes but may result in edges overlapping nodes."),v5e),Bi),K4e),rn(Cn)))),qi(n,vF,LN,Xrn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,yF),"edgeRouting.splines.sloppy"),"Sloppy Spline Layer Spacing Factor"),"Spacing factor for routing area between layers when using sloppy spline routing."),.2),ec),gr),rn(Cn)))),qi(n,yF,LN,Vrn),qi(n,yF,vF,Yrn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,vee),"edgeRouting.polyline"),"Sloped Edge Zone Width"),"Width of the strip to the left and to the right of each layer where the polyline edge router is allowed to refrain from ensuring that edges are routed horizontally. This prevents awkward bend points for nodes that extent almost to the edge of their layer."),2),ec),gr),rn(Cn)))),qi(n,vee,LN,Hrn),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Lwe),Ka),"Spacing Base Value"),"An optional base value for all other layout options of the 'spacing' group. It can be used to conveniently alter the overall 'spaciousness' of the drawing. Whenever an explicit value is set for the other layout options, this base value will have no effect. The base value is not inherited, i.e. it must be set for each hierarchical node."),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Pwe),Ka),"Edge Node Between Layers Spacing"),"The spacing to be preserved between nodes and edges that are routed next to the node's layer. For the spacing between nodes and edges that cross the node's layer 'spacing.edgeNode' is used."),10),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,$we),Ka),"Edge Edge Between Layer Spacing"),"Spacing to be preserved between pairs of edges that are routed between the same pair of layers. Note that 'spacing.edgeEdge' is used for the spacing between pairs of edges crossing the same layer."),10),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Rwe),Ka),"Node Node Between Layers Spacing"),"The spacing to be preserved between any pair of nodes of two adjacent layers. Note that 'spacing.nodeNode' is used for the spacing between nodes within the layer itself."),20),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Bwe),Qwe),"Direction Priority"),"Defines how important it is to have a certain edge point into the direction of the overall layout. This option is evaluated during the cycle breaking phase."),ke(0)),dc),jr),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,zwe),Qwe),"Shortness Priority"),"Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase."),ke(0)),dc),jr),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Fwe),Qwe),"Straightness Priority"),"Defines how important it is to keep an edge straight, i.e. aligned with one of the two axes. This option is evaluated during node placement."),ke(0)),dc),jr),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,yee),Wwe),"Connected Components Compaction"),"Tries to further compact components (disconnected sub-graphs)."),!1),xr),Qi),rn(Cn)))),qi(n,yee,jS,!0),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Jwe),PQe),"Post Compaction Strategy"),$Qe),i5e),Bi),R3e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Hwe),PQe),"Post Compaction Constraint Calculation"),$Qe),t5e),Bi),g3e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,kF),Zwe),"High Degree Node Treatment"),"Makes room around high degree nodes to place leafs and trees."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,kee),Zwe),"High Degree Node Threshold"),"Whether a node is considered to have a high degree."),ke(16)),dc),jr),rn(Cn)))),qi(n,kee,kF,!0),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,jee),Zwe),"High Degree Node Maximum Tree Height"),"Maximum height of a subtree connected to a high degree node to be moved to separate layers."),ke(5)),dc),jr),rn(Cn)))),qi(n,jee,kF,!0),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,q1),epe),"Graph Wrapping Strategy"),"For certain graphs and certain prescribed drawing areas it may be desirable to split the laid out graph into chunks that are placed side by side. The edges that connect different chunks are 'wrapped' around from the end of one chunk to the start of the other chunk. The points between the chunks are referred to as 'cuts'."),_5e),Bi),W4e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,jF),epe),"Additional Wrapped Edges Spacing"),"To visually separate edges that are wrapped from regularly routed edges an additional spacing value can be specified in form of this layout option. The spacing is added to the regular edgeNode spacing."),10),ec),gr),rn(Cn)))),qi(n,jF,q1,Ycn),qi(n,jF,q1,Qcn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,EF),epe),"Correction Factor for Wrapping"),"At times and for certain types of graphs the executed wrapping may produce results that are consistently biased in the same fashion: either wrapping to often or to rarely. This factor can be used to correct the bias. Internally, it is simply multiplied with the 'aspect ratio' layout option."),1),ec),gr),rn(Cn)))),qi(n,EF,q1,Zcn),qi(n,EF,q1,eun),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,TS),RQe),"Cutting Strategy"),"The strategy by which the layer indexes are determined at which the layering crumbles into chunks."),D5e),Bi),y3e),rn(Cn)))),qi(n,TS,q1,uun),qi(n,TS,q1,oun),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Eee),RQe),"Manually Specified Cuts"),"Allows the user to specify her own cuts for a certain graph."),Za),gl),rn(Cn)))),qi(n,Eee,TS,tun),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,See),"wrapping.cutting.msd"),"MSD Freedom"),"The MSD cutting strategy starts with an initial guess on the number of chunks the graph should be split into. The freedom specifies how much the strategy may deviate from this guess. E.g. if an initial number of 3 is computed, a freedom of 1 allows 2, 3, and 4 cuts."),I5e),dc),jr),rn(Cn)))),qi(n,See,TS,run),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,SF),BQe),"Validification Strategy"),"When wrapping graphs, one can specify indices that are not allowed as split points. The validification strategy makes sure every computed split point is allowed."),L5e),Bi),Q4e),rn(Cn)))),qi(n,SF,q1,vun),qi(n,SF,q1,yun),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,xF),BQe),"Valid Indices for Wrapping"),null),Za),gl),rn(Cn)))),qi(n,xF,q1,wun),qi(n,xF,q1,pun),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,AF),npe),"Improve Cuts"),"For general graphs it is important that not too many edges wrap backwards. Thus a compromise between evenly-distributed cuts and the total number of cut edges is sought."),!0),xr),Qi),rn(Cn)))),qi(n,AF,q1,aun),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,MF),npe),"Distance Penalty When Improving Cuts"),null),2),ec),gr),rn(Cn)))),qi(n,MF,q1,lun),qi(n,MF,AF,!0),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,xee),npe),"Improve Wrapped Edges"),"The initial wrapping is performed in a very simple way. As a consequence, edges that wrap from one chunk to another may be unnecessarily long. Activating this option tries to shorten such edges."),!0),xr),Qi),rn(Cn)))),qi(n,xee,q1,dun),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Aee),Bee),"Layer Unzipping Strategy"),"The strategy to use for unzipping a layer into multiple sublayers while maintaining the existing ordering of nodes and edges after crossing minimization. The default value is 'NONE'."),A5e),Bi),n5e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Mee),Bee),"Minimize Edge Length Heuristic"),"Use a heuristic to decide whether or not to actually perform the layer split with the goal of minimizing the total edge length. This option only works when layerSplit is set to 2. The property can be set to the nodes in a layer, which then applies the property for the layer. If any node sets the value to true, then the value is set to true for the entire layer."),!1),xr),Qi),rn(fr)))),qi(n,Mee,Cee,vcn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Cee),Bee),"Unzipping Layer Split"),"Defines the number of sublayers to split a layer into. The property can be set to the nodes in a layer, which then applies the property for the layer. If multiple nodes set the value to different values, then the lowest value is chosen."),S5e),dc),jr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Tee),Bee),"Reset Alternation on Long Edges"),"If set to true, nodes will always be placed in the first sublayer after a long edge when using the ALTERNATING strategy. Otherwise long edge dummies are treated the same as regular nodes. The default value is true. The property can be set to the nodes in a layer, which then applies the property for the layer. If any node sets the value to false, then the value is set to false for the entire layer."),x5e),xr),Qi),rn(fr)))),qi(n,Tee,Aee,kcn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Gwe),zee),"Edge Label Side Selection"),"Method to decide on edge label sides."),w5e),Bi),x3e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,qwe),zee),"Edge Center Label Placement Strategy"),"Determines in which layer center labels of long edges should be placed."),g5e),Bi),j7),Ci(Cn,F(z(Wa,1),Ee,160,0,[Q1]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,CF),OS),"Consider Model Order"),"Preserves the order of nodes and edges in the model file if this does not lead to additional edge crossings. Depending on the strategy this is not always possible since the node and edge order might be conflicting."),l5e),Bi),F4e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Uwe),OS),"Consider Port Order"),"If disabled the port order of output ports is derived from the edge order and input ports are ordered by their incoming connections. If enabled all ports are ordered by the port model order."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,_N),OS),"No Model Order"),"Set on a node to not set a model order for this node even though it is a real node."),!1),xr),Qi),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Oee),OS),"Consider Model Order for Components"),"If set to NONE the usual ordering strategy (by cumulative node priority and size of nodes) is used. INSIDE_PORT_SIDES orders the components with external ports only inside the groups with the same port side. FORCE_MODEL_ORDER enforces the mode order on components. This option might produce bad alignments and sub optimal drawings in terms of used area since the ordering should be respected."),r5e),Bi),yve),rn(Cn)))),qi(n,Oee,jS,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Xwe),OS),"Long Edge Ordering Strategy"),"Indicates whether long edges are sorted under, over, or equal to nodes that have no connection to a previous layer in a left-to-right or right-to-left layout. Under and over changes to right and left in a vertical layout."),s5e),Bi),I4e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Nee),OS),"Crossing Counter Node Order Influence"),"Indicates with what percentage (1 for 100%) violations of the node model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal node order. Defaults to no influence (0)."),0),ec),gr),rn(Cn)))),qi(n,Nee,CF,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Iee),OS),"Crossing Counter Port Order Influence"),"Indicates with what percentage (1 for 100%) violations of the port model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal port order. Defaults to no influence (0)."),0),ec),gr),rn(Cn)))),qi(n,Iee,CF,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Dee),W8),tpe),"Used to define partial ordering groups during cycle breaking. A lower group id means that the group is sorted before other groups. A group model order of 0 is the default group."),ke(0)),dc),jr),rn(fr)))),qi(n,Dee,_N,!1),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,_ee),W8),tpe),"Used to define partial ordering groups during crossing minimization. A lower group id means that the group is sorted before other groups. A group model order of 0 is the default group."),ke(0)),dc),jr),Ci(fr,F(z(Wa,1),Ee,160,0,[xa,Yd]))))),qi(n,_ee,_N,!1),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Lee),W8),tpe),"Used to define partial ordering groups during component packing. A lower group id means that the group is sorted before other groups. A group model order of 0 is the default group."),ke(0)),dc),jr),Ci(fr,F(z(Wa,1),Ee,160,0,[xa,Yd]))))),qi(n,Lee,_N,!1),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Kwe),W8),"Cycle Breaking Group Ordering Strategy"),"Determines how to count ordering violations during cycle breaking. NONE: They do not count. ENFORCED: A group with a higher model order is before a node with a smaller. MODEL_ORDER: The model order counts instead of the model order group id ordering."),c5e),Bi),bie),rn(Cn)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Pee),W8),"Cycle Breaking Preferred Source Id"),"The model order group id for which should be preferred as a source if possible."),dc),jr),rn(Cn)))),qi(n,Pee,IN,frn),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,$ee),W8),"Cycle Breaking Preferred Target Id"),"The model order group id for which should be preferred as a target if possible."),dc),jr),rn(Cn)))),qi(n,$ee,IN,hrn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Vwe),W8),"Crossing Minimization Group Ordering Strategy"),"Determines how to count ordering violations during crossing minimization. NONE: They do not count. ENFORCED: A group with a lower id is before a group with a higher id. MODEL_ORDER: The model order counts instead of the model order group id ordering."),o5e),Bi),bie),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Ywe),W8),"Crossing Minimization Enforced Group Orders"),"Holds all group ids which are enforcing their order during crossing minimization strategies. E.g. if only groups 2 and -1 (default) enforce their ordering. Other groups e.g. the group of timer nodes can be ordered arbitrarily if it helps and the mentioned groups may not change their order."),u5e),Za),gl),rn(Cn)))),cYe((new NU,n))};var nrn,trn,irn,t5e,rrn,i5e,crn,r5e,urn,orn,srn,c5e,lrn,frn,arn,hrn,drn,u5e,brn,o5e,grn,wrn,prn,mrn,s5e,vrn,yrn,krn,l5e,jrn,Ern,Srn,f5e,xrn,Arn,Mrn,a5e,Crn,Trn,Orn,Nrn,Irn,Drn,_rn,Lrn,Prn,$rn,h5e,Rrn,d5e,Brn,b5e,zrn,g5e,Frn,w5e,Jrn,Hrn,Grn,p5e,qrn,m5e,Urn,v5e,Xrn,Krn,Vrn,Yrn,Qrn,Wrn,Zrn,ecn,ncn,tcn,y5e,icn,rcn,ccn,ucn,ocn,scn,k5e,lcn,fcn,acn,hcn,dcn,bcn,gcn,j5e,wcn,E5e,pcn,S5e,mcn,vcn,ycn,x5e,kcn,jcn,A5e,Ecn,Scn,xcn,M5e,Acn,Mcn,C5e,Ccn,Tcn,Ocn,Ncn,Icn,Dcn,_cn,Lcn,T5e,Pcn,$cn,Rcn,O5e,Bcn,N5e,zcn,Fcn,Jcn,Hcn,Gcn,qcn,Ucn,Xcn,Kcn,Vcn,Ycn,Qcn,Wcn,Zcn,eun,nun,tun,iun,I5e,run,cun,D5e,uun,oun,sun,lun,fun,aun,hun,dun,bun,_5e,gun,wun,pun,mun,L5e,vun,yun;v(Tu,"LayeredMetaDataProvider",843),m(982,1,Ua,NU),s.tf=function(n){cYe(n)};var Nh,Aie,sH,dx,lH,P5e,fH,bx,aI,Mie,Ry,$5e,R5e,B5e,gx,kun,wx,jm,Cie,aH,Tie,o1,Oie,C7,z5e,hI,Nie,F5e,jun,Eun,Sun,hH,Iie,px,By,xun,wl,J5e,H5e,dH,H3,Ih,bH,Y1,G5e,q5e,U5e,Die,_ie,X5e,Ud,Lie,K5e,Em,V5e,Y5e,Q5e,gH,Sm,xg,W5e,Z5e,Wc,e4e,Aun,ku,mx,n4e,t4e,i4e,dI,wH,pH,Pie,$ie,r4e,mH,c4e,u4e,vH,pp,o4e,Rie,vx,s4e,mp,yx,yH,Ag,Bie,T7,kH,Mg,l4e,f4e,a4e,xm,h4e,Mun,Cun,Tun,Oun,vp,Am,Zi,Xd,Nun,Mm,d4e,O7,b4e,Cm,Iun,N7,g4e,zy,Dun,_un,bI,zie,w4e,gI,Kf,Tm,G3,Cg,lb,jH,Om,Fie,I7,D7,Tg,Nm,Jie,wI,kx,jx,Lun,Pun,$un,p4e,Run,Hie,m4e,v4e,y4e,k4e,Gie,j4e,E4e,S4e,x4e,qie,EH;v(Tu,"LayeredOptions",982),m(983,1,{},Qq),s.uf=function(){var n;return n=new rxe,n},s.vf=function(n){},v(Tu,"LayeredOptions/LayeredFactory",983),m(1345,1,{}),s.a=0;var Bun;v($u,"ElkSpacings/AbstractSpacingsBuilder",1345),m(778,1345,{},tde);var SH,zun;v(Tu,"LayeredSpacings/LayeredSpacingsBuilder",778),m(268,23,{3:1,35:1,23:1,268:1,188:1,196:1},Iv),s.bg=function(){return kXe(this)},s.og=function(){return kXe(this)};var Uie,Xie,Kie,A4e,M4e,C4e,xH,Vie,T4e,O4e=yt(Tu,"LayeringStrategy",268,Tt,J8n,lmn),Fun;m(352,23,{3:1,35:1,23:1,352:1},nK);var Yie,N4e,AH,I4e=yt(Tu,"LongEdgeOrderingStrategy",352,Tt,U4n,fmn),Jun;m(203,23,{3:1,35:1,23:1,203:1},g$);var q3,U3,MH,Qie,Wie=yt(Tu,"NodeFlexibility",203,Tt,c6n,amn),Hun;m(328,23,{3:1,35:1,23:1,328:1,188:1,196:1},aT),s.bg=function(){return lUe(this)},s.og=function(){return lUe(this)};var Ex,Zie,ere,Sx,D4e,_4e=yt(Tu,"NodePlacementStrategy",328,Tt,W6n,hmn),Gun;m(243,23,{3:1,35:1,23:1,243:1},d2);var L4e,_7,xx,pI,P4e,$4e,mI,R4e,CH,TH,B4e=yt(Tu,"NodePromotionStrategy",243,Tt,d7n,dmn),qun;m(269,23,{3:1,35:1,23:1,269:1},w$);var z4e,fb,nre,tre,F4e=yt(Tu,"OrderingStrategy",269,Tt,u6n,bmn),Uun;m(421,23,{3:1,35:1,23:1,421:1},mse);var ire,rre,J4e=yt(Tu,"PortSortingStrategy",421,Tt,t4n,gmn),Xun;m(452,23,{3:1,35:1,23:1,452:1},tK);var ys,Io,Ax,Kun=yt(Tu,"PortType",452,Tt,X4n,wmn),Vun;m(381,23,{3:1,35:1,23:1,381:1},iK);var H4e,cre,G4e,q4e=yt(Tu,"SelfLoopDistributionStrategy",381,Tt,K4n,pmn),Yun;m(348,23,{3:1,35:1,23:1,348:1},rK);var ure,vI,ore,U4e=yt(Tu,"SelfLoopOrderingStrategy",348,Tt,V4n,mmn),Qun;m(316,1,{316:1},iVe),v(Tu,"Spacings",316),m(349,23,{3:1,35:1,23:1,349:1},cK);var sre,X4e,Mx,K4e=yt(Tu,"SplineRoutingMode",349,Tt,Y4n,vmn),Wun;m(351,23,{3:1,35:1,23:1,351:1},uK);var lre,V4e,Y4e,Q4e=yt(Tu,"ValidifyStrategy",351,Tt,Q4n,ymn),Zun;m(382,23,{3:1,35:1,23:1,382:1},oK);var Im,fre,L7,W4e=yt(Tu,"WrappingStrategy",382,Tt,W4n,kmn),eon;m(1361,1,oc,SC),s.pg=function(n){return u(n,37),non},s.If=function(n,t){FPn(this,u(n,37),t)};var non;v(tp,"BFSNodeOrderCycleBreaker",1361),m(1359,1,oc,cP),s.pg=function(n){return u(n,37),ton},s.If=function(n,t){PLn(this,u(n,37),t)};var ton;v(tp,"DFSNodeOrderCycleBreaker",1359),m(1360,1,ct,RNe),s.Ad=function(n){RDn(this.a,this.c,this.b,u(n,17))},s.b=!1,v(tp,"DFSNodeOrderCycleBreaker/lambda$0$Type",1360),m(1353,1,oc,Z6),s.pg=function(n){return u(n,37),ion},s.If=function(n,t){LLn(this,u(n,37),t)};var ion;v(tp,"DepthFirstCycleBreaker",1353),m(779,1,oc,Afe),s.pg=function(n){return u(n,37),ron},s.If=function(n,t){tBn(this,u(n,37),t)},s.qg=function(n){return u(Pe(n,fz(this.e,n.c.length)),9)};var ron;v(tp,"GreedyCycleBreaker",779),m(1356,779,oc,xCe),s.qg=function(n){var t,i,r,c,o,l,f,h,b;for(b=null,r=oi,h=k.Math.max(this.b.a.c.length,u(C(this.b,(me(),sb)),15).a),t=h*u(C(this.b,oI),15).a,c=new A6,i=ue(C(this.b,(Ie(),Ry)))===ue(($0(),ym)),f=new P(n);f.ao&&(r=o,b=l));return b||u(Pe(n,fz(this.e,n.c.length)),9)},v(tp,"GreedyModelOrderCycleBreaker",1356),m(505,1,{},A6),s.a=0,s.b=0,v(tp,"GroupModelOrderCalculator",505),m(1354,1,oc,tj),s.pg=function(n){return u(n,37),con},s.If=function(n,t){sPn(this,u(n,37),t)};var con;v(tp,"InteractiveCycleBreaker",1354),m(1355,1,oc,nj),s.pg=function(n){return u(n,37),uon},s.If=function(n,t){fPn(u(n,37),t)};var uon;v(tp,"ModelOrderCycleBreaker",1355),m(780,1,oc),s.pg=function(n){return u(n,37),oon},s.If=function(n,t){W_n(this,u(n,37),t)},s.rg=function(n,t){var i,r,c,o,l,f,h,b,p,y;for(l=0;lb&&(h=S,y=b),pha(new Un(Yn(Ii(f).a.Jc(),new ee))))for(c=new Un(Yn(cr(h).a.Jc(),new ee));ht(c);)r=u(rt(c),17),u(Yu(this.d,l),22).Gc(r.c.i)&&Te(this.c,r);else for(c=new Un(Yn(Ii(f).a.Jc(),new ee));ht(c);)r=u(rt(c),17),u(Yu(this.d,l),22).Gc(r.d.i)&&Te(this.c,r)}},v(tp,"SCCNodeTypeCycleBreaker",1358),m(1357,780,oc,MCe),s.rg=function(n,t){var i,r,c,o,l,f,h,b,p,y,S,A;for(l=0;lb&&(h=S,y=b),pha(new Un(Yn(Ii(f).a.Jc(),new ee))))for(c=new Un(Yn(cr(h).a.Jc(),new ee));ht(c);)r=u(rt(c),17),u(Yu(this.d,l),22).Gc(r.c.i)&&Te(this.c,r);else for(c=new Un(Yn(Ii(f).a.Jc(),new ee));ht(c);)r=u(rt(c),17),u(Yu(this.d,l),22).Gc(r.d.i)&&Te(this.c,r)}},v(tp,"SCConnectivity",1357),m(1373,1,oc,EC),s.pg=function(n){return u(n,37),son},s.If=function(n,t){uRn(this,u(n,37),t)};var son;v(U1,"BreadthFirstModelOrderLayerer",1373),m(1374,1,Yt,fM),s.Le=function(n,t){return qCn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(U1,"BreadthFirstModelOrderLayerer/lambda$0$Type",1374),m(1364,1,oc,OMe),s.pg=function(n){return u(n,37),lon},s.If=function(n,t){oBn(this,u(n,37),t)};var lon;v(U1,"CoffmanGrahamLayerer",1364),m(1365,1,Yt,Zje),s.Le=function(n,t){return WNn(this.a,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(U1,"CoffmanGrahamLayerer/0methodref$compareNodesInTopo$Type",1365),m(1366,1,Yt,eEe),s.Le=function(n,t){return d3n(this.a,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(U1,"CoffmanGrahamLayerer/lambda$1$Type",1366),m(1375,1,oc,jC),s.pg=function(n){return u(n,37),fon},s.If=function(n,t){XRn(this,u(n,37),t)},s.c=0,s.e=0;var fon;v(U1,"DepthFirstModelOrderLayerer",1375),m(1376,1,Yt,M6),s.Le=function(n,t){return UCn(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(U1,"DepthFirstModelOrderLayerer/lambda$0$Type",1376),m(1367,1,oc,C6),s.pg=function(n){return u(n,37),qt(qt(qt(new or,(zr(),Xf),(Ur(),_te)),c1,pm),eo,wm)},s.If=function(n,t){pRn(u(n,37),t)},v(U1,"InteractiveLayerer",1367),m(564,1,{564:1},hxe),s.a=0,s.c=0,v(U1,"InteractiveLayerer/LayerSpan",564),m(1363,1,oc,oP),s.pg=function(n){return u(n,37),aon},s.If=function(n,t){UNn(this,u(n,37),t)};var aon;v(U1,"LongestPathLayerer",1363),m(1372,1,oc,sP),s.pg=function(n){return u(n,37),hon},s.If=function(n,t){dIn(this,u(n,37),t)};var hon;v(U1,"LongestPathSourceLayerer",1372),m(1370,1,oc,ko),s.pg=function(n){return u(n,37),qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)},s.If=function(n,t){MRn(this,u(n,37),t)},s.a=0,s.b=0,s.d=0;var Z4e,eye;v(U1,"MinWidthLayerer",1370),m(1371,1,Yt,nEe),s.Le=function(n,t){return _7n(this,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(U1,"MinWidthLayerer/MinOutgoingEdgesComparator",1371),m(1362,1,oc,uP),s.pg=function(n){return u(n,37),don},s.If=function(n,t){GPn(this,u(n,37),t)};var don;v(U1,"NetworkSimplexLayerer",1362),m(1368,1,oc,cNe),s.pg=function(n){return u(n,37),qt(qt(qt(new or,(zr(),Xf),(Ur(),N3)),c1,pm),eo,wm)},s.If=function(n,t){T$n(this,u(n,37),t)},s.d=0,s.f=0,s.g=0,s.i=0,s.s=0,s.t=0,s.u=0,v(U1,"StretchWidthLayerer",1368),m(1369,1,Yt,Zq),s.Le=function(n,t){return b9n(u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(U1,"StretchWidthLayerer/1",1369),m(406,1,Bpe),s.eg=function(n,t,i,r,c,o){},s.tg=function(n,t,i){return QXe(this,n,t,i)},s.dg=function(){this.g=se(Ym,HQe,30,this.d,15,1),this.f=se(Ym,HQe,30,this.d,15,1)},s.fg=function(n,t){this.e[n]=se($t,ni,30,t[n].length,15,1)},s.gg=function(n,t,i){var r;r=i[n][t],r.p=t,this.e[n][t]=t},s.hg=function(n,t,i,r){u(Pe(r[n][t].j,i),12).p=this.d++},s.b=0,s.c=0,s.d=0,v(Ro,"AbstractBarycenterPortDistributor",406),m(1663,1,Yt,tEe),s.Le=function(n,t){return JEn(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Ro,"AbstractBarycenterPortDistributor/lambda$0$Type",1663),m(816,1,MS,Dae),s.eg=function(n,t,i,r,c,o){},s.gg=function(n,t,i){},s.hg=function(n,t,i,r){},s.cg=function(){return!1},s.dg=function(){this.c=this.e.a,this.g=this.f.g},s.fg=function(n,t){t[n][0].c.p=n},s.ig=function(){return!1},s.ug=function(n,t,i,r){i?JHe(this,n):(KHe(this,n,r),bVe(this,n,t)),n.c.length>1&&(Fe(ze(C(_r((kn(0,n.c.length),u(n.c[0],9))),(Ie(),C7))))?yUe(n,this.d,u(this,660)):(En(),Tr(n,this.d)),fze(this.e,n))},s.jg=function(n,t,i,r){var c,o,l,f,h,b,p;for(t!=xIe(i,n.length)&&(o=n[t-(i?1:-1)],rhe(this.f,o,i?(Nc(),Io):(Nc(),ys))),c=n[t][0],p=!r||c.k==(Fn(),wr),b=Pf(n[t]),this.ug(b,p,!1,i),l=0,h=new P(b);h.a"),n0?GV(this.a,n[t-1],n[t]):!i&&t1&&(Fe(ze(C(_r((kn(0,n.c.length),u(n.c[0],9))),(Ie(),C7))))?yUe(n,this.d,this):(En(),Tr(n,this.d)),Fe(ze(C(_r((kn(0,n.c.length),u(n.c[0],9))),C7)))||fze(this.e,n))},v(Ro,"ModelOrderBarycenterHeuristic",660),m(1843,1,Yt,fEe),s.Le=function(n,t){return xLn(this.a,u(n,9),u(t,9))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Ro,"ModelOrderBarycenterHeuristic/lambda$0$Type",1843),m(1383,1,oc,fP),s.pg=function(n){var t;return u(n,37),t=L$(kon),qt(t,(zr(),eo),(Ur(),$J)),t},s.If=function(n,t){F5n((u(n,37),t))};var kon;v(Ro,"NoCrossingMinimizer",1383),m(796,406,Bpe,Roe),s.sg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A;switch(y=this.g,i.g){case 1:{for(c=0,o=0,p=new P(n.j);p.a1&&(c.j==(De(),et)?this.b[n]=!0:c.j==Vn&&n>0&&(this.b[n-1]=!0))},s.f=0,v(i1,"AllCrossingsCounter",1838),m(583,1,{},CB),s.b=0,s.d=0,v(i1,"BinaryIndexedTree",583),m(519,1,{},NT);var nye,IH;v(i1,"CrossingsCounter",519),m(1912,1,Yt,aEe),s.Le=function(n,t){return i3n(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(i1,"CrossingsCounter/lambda$0$Type",1912),m(1913,1,Yt,hEe),s.Le=function(n,t){return r3n(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(i1,"CrossingsCounter/lambda$1$Type",1913),m(1914,1,Yt,dEe),s.Le=function(n,t){return c3n(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(i1,"CrossingsCounter/lambda$2$Type",1914),m(1915,1,Yt,bEe),s.Le=function(n,t){return u3n(this.a,u(n,12),u(t,12))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(i1,"CrossingsCounter/lambda$3$Type",1915),m(1916,1,ct,gEe),s.Ad=function(n){Q9n(this.a,u(n,12))},v(i1,"CrossingsCounter/lambda$4$Type",1916),m(1917,1,zt,wEe),s.Mb=function(n){return Ggn(this.a,u(n,12))},v(i1,"CrossingsCounter/lambda$5$Type",1917),m(1918,1,ct,pEe),s.Ad=function(n){nTe(this,n)},v(i1,"CrossingsCounter/lambda$6$Type",1918),m(1919,1,ct,uCe),s.Ad=function(n){var t;C9(),I0(this.b,(t=this.a,u(n,12),t))},v(i1,"CrossingsCounter/lambda$7$Type",1919),m(823,1,Sh,bM),s.Lb=function(n){return C9(),wi(u(n,12),(me(),vs))},s.Fb=function(n){return this===n},s.Mb=function(n){return C9(),wi(u(n,12),(me(),vs))},v(i1,"CrossingsCounter/lambda$8$Type",823),m(1911,1,{},mEe),v(i1,"HyperedgeCrossingsCounter",1911),m(467,1,{35:1,467:1},uNe),s.Dd=function(n){return NEn(this,u(n,467))},s.b=0,s.c=0,s.e=0,s.f=0;var JBn=v(i1,"HyperedgeCrossingsCounter/Hyperedge",467);m(370,1,{35:1,370:1},CR),s.Dd=function(n){return SOn(this,u(n,370))},s.b=0,s.c=0;var jon=v(i1,"HyperedgeCrossingsCounter/HyperedgeCorner",370);m(518,23,{3:1,35:1,23:1,518:1},vse);var Tx,Ox,Eon=yt(i1,"HyperedgeCrossingsCounter/HyperedgeCorner/Type",518,Tt,i4n,xmn),Son;m(1385,1,oc,OU),s.pg=function(n){return u(C(u(n,37),(me(),po)),22).Gc((Ic(),Kl))?xon:null},s.If=function(n,t){eAn(this,u(n,37),t)};var xon;v(Lc,"InteractiveNodePlacer",1385),m(1386,1,oc,CC),s.pg=function(n){return u(C(u(n,37),(me(),po)),22).Gc((Ic(),Kl))?Aon:null},s.If=function(n,t){zSn(this,u(n,37),t)};var Aon,DH,_H;v(Lc,"LinearSegmentsNodePlacer",1386),m(263,1,{35:1,263:1},poe),s.Dd=function(n){return rgn(this,u(n,263))},s.Fb=function(n){var t;return X(n,263)?(t=u(n,263),this.b==t.b):!1},s.Hb=function(){return this.b},s.Ib=function(){return"ls"+Ja(this.e)},s.a=0,s.b=0,s.c=-1,s.d=-1,s.g=0;var Mon=v(Lc,"LinearSegmentsNodePlacer/LinearSegment",263);m(1388,1,oc,LIe),s.pg=function(n){return u(C(u(n,37),(me(),po)),22).Gc((Ic(),Kl))?Con:null},s.If=function(n,t){KRn(this,u(n,37),t)},s.b=0,s.g=0;var Con;v(Lc,"NetworkSimplexPlacer",1388),m(1407,1,Yt,gv),s.Le=function(n,t){return oo(u(n,15).a,u(t,15).a)},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Lc,"NetworkSimplexPlacer/0methodref$compare$Type",1407),m(1409,1,Yt,hM),s.Le=function(n,t){return oo(u(n,15).a,u(t,15).a)},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Lc,"NetworkSimplexPlacer/1methodref$compare$Type",1409),m(644,1,{644:1},oCe);var HBn=v(Lc,"NetworkSimplexPlacer/EdgeRep",644);m(405,1,{405:1},cae),s.b=!1;var GBn=v(Lc,"NetworkSimplexPlacer/NodeRep",405);m(500,13,{3:1,4:1,20:1,31:1,56:1,13:1,18:1,16:1,59:1,500:1},mxe),v(Lc,"NetworkSimplexPlacer/Path",500),m(1389,1,{},jk),s.Kb=function(n){return u(n,17).d.i.k},v(Lc,"NetworkSimplexPlacer/Path/lambda$0$Type",1389),m(1390,1,zt,l_),s.Mb=function(n){return u(n,249)==(Fn(),dr)},v(Lc,"NetworkSimplexPlacer/Path/lambda$1$Type",1390),m(1391,1,{},f_),s.Kb=function(n){return u(n,17).d.i},v(Lc,"NetworkSimplexPlacer/Path/lambda$2$Type",1391),m(1392,1,zt,vEe),s.Mb=function(n){return UOe(cJe(u(n,9)))},v(Lc,"NetworkSimplexPlacer/Path/lambda$3$Type",1392),m(1393,1,zt,R5),s.Mb=function(n){return Gvn(u(n,12))},v(Lc,"NetworkSimplexPlacer/lambda$0$Type",1393),m(1394,1,ct,sCe),s.Ad=function(n){Pwn(this.a,this.b,u(n,12))},v(Lc,"NetworkSimplexPlacer/lambda$1$Type",1394),m(1403,1,ct,yEe),s.Ad=function(n){aTn(this.a,u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$10$Type",1403),m(1404,1,{},dM),s.Kb=function(n){return rl(),new mn(null,new vn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$11$Type",1404),m(1405,1,ct,kEe),s.Ad=function(n){qIn(this.a,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$12$Type",1405),m(1406,1,{},Ek),s.Kb=function(n){return rl(),ke(u(n,124).e)},v(Lc,"NetworkSimplexPlacer/lambda$13$Type",1406),m(1408,1,{},Sk),s.Kb=function(n){return rl(),ke(u(n,124).e)},v(Lc,"NetworkSimplexPlacer/lambda$15$Type",1408),m(1410,1,zt,a_),s.Mb=function(n){return rl(),u(n,405).c.k==(Fn(),Wi)},v(Lc,"NetworkSimplexPlacer/lambda$17$Type",1410),m(1411,1,zt,h_),s.Mb=function(n){return rl(),u(n,405).c.j.c.length>1},v(Lc,"NetworkSimplexPlacer/lambda$18$Type",1411),m(1412,1,ct,JDe),s.Ad=function(n){nEn(this.c,this.b,this.d,this.a,u(n,405))},s.c=0,s.d=0,v(Lc,"NetworkSimplexPlacer/lambda$19$Type",1412),m(1395,1,{},wv),s.Kb=function(n){return rl(),new mn(null,new vn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$2$Type",1395),m(1413,1,ct,jEe),s.Ad=function(n){zwn(this.a,u(n,12))},s.a=0,v(Lc,"NetworkSimplexPlacer/lambda$20$Type",1413),m(1414,1,{},pv),s.Kb=function(n){return rl(),new mn(null,new vn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$21$Type",1414),m(1415,1,ct,EEe),s.Ad=function(n){Uwn(this.a,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$22$Type",1415),m(1416,1,zt,d_),s.Mb=function(n){return UOe(n)},v(Lc,"NetworkSimplexPlacer/lambda$23$Type",1416),m(1417,1,{},B5),s.Kb=function(n){return rl(),new mn(null,new vn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$24$Type",1417),m(1418,1,zt,SEe),s.Mb=function(n){return Zgn(this.a,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$25$Type",1418),m(1419,1,ct,lCe),s.Ad=function(n){bCn(this.a,this.b,u(n,9))},v(Lc,"NetworkSimplexPlacer/lambda$26$Type",1419),m(1420,1,zt,T6),s.Mb=function(n){return rl(),!uc(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$27$Type",1420),m(1421,1,zt,xk),s.Mb=function(n){return rl(),!uc(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$28$Type",1421),m(1422,1,{},xEe),s.Te=function(n,t){return Bwn(this.a,u(n,25),u(t,25))},v(Lc,"NetworkSimplexPlacer/lambda$29$Type",1422),m(1396,1,{},O6),s.Kb=function(n){return rl(),new mn(null,new A2(new Un(Yn(Ii(u(n,9)).a.Jc(),new ee))))},v(Lc,"NetworkSimplexPlacer/lambda$3$Type",1396),m(1397,1,zt,Ak),s.Mb=function(n){return rl(),Fyn(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$4$Type",1397),m(1398,1,ct,AEe),s.Ad=function(n){eLn(this.a,u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$5$Type",1398),m(1399,1,{},b_),s.Kb=function(n){return rl(),new mn(null,new vn(u(n,25).a,16))},v(Lc,"NetworkSimplexPlacer/lambda$6$Type",1399),m(1400,1,zt,mv),s.Mb=function(n){return rl(),u(n,9).k==(Fn(),Wi)},v(Lc,"NetworkSimplexPlacer/lambda$7$Type",1400),m(1401,1,{},g_),s.Kb=function(n){return rl(),new mn(null,new A2(new Un(Yn(wh(u(n,9)).a.Jc(),new ee))))},v(Lc,"NetworkSimplexPlacer/lambda$8$Type",1401),m(1402,1,zt,qp),s.Mb=function(n){return rl(),Jvn(u(n,17))},v(Lc,"NetworkSimplexPlacer/lambda$9$Type",1402),m(1384,1,oc,TC),s.pg=function(n){return u(C(u(n,37),(me(),po)),22).Gc((Ic(),Kl))?Ton:null},s.If=function(n,t){ILn(u(n,37),t)};var Ton;v(Lc,"SimpleNodePlacer",1384),m(185,1,{185:1},b3),s.Ib=function(){var n;return n="",this.c==(dh(),yp)?n+=gy:this.c==Kd&&(n+=by),this.o==(Da(),Og)?n+=KZ:this.o==Qa?n+="UP":n+="BALANCED",n},v(eb,"BKAlignedLayout",185),m(509,23,{3:1,35:1,23:1,509:1},yse);var Kd,yp,Oon=yt(eb,"BKAlignedLayout/HDirection",509,Tt,c4n,Amn),Non;m(508,23,{3:1,35:1,23:1,508:1},kse);var Og,Qa,Ion=yt(eb,"BKAlignedLayout/VDirection",508,Tt,r4n,Mmn),Don;m(1664,1,{},fCe),v(eb,"BKAligner",1664),m(1667,1,{},NHe),v(eb,"BKCompactor",1667),m(652,1,{652:1},gM),s.a=0,v(eb,"BKCompactor/ClassEdge",652),m(456,1,{456:1},bxe),s.a=null,s.b=0,v(eb,"BKCompactor/ClassNode",456),m(1387,1,oc,SCe),s.pg=function(n){return u(C(u(n,37),(me(),po)),22).Gc((Ic(),Kl))?_on:null},s.If=function(n,t){aBn(this,u(n,37),t)},s.d=!1;var _on;v(eb,"BKNodePlacer",1387),m(1665,1,{},wM),s.d=0,v(eb,"NeighborhoodInformation",1665),m(1666,1,Yt,MEe),s.Le=function(n,t){return h8n(this,u(n,49),u(t,49))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(eb,"NeighborhoodInformation/NeighborComparator",1666),m(809,1,{}),v(eb,"ThresholdStrategy",809),m(1795,809,{},vxe),s.vg=function(n,t,i){return this.a.o==(Da(),Qa)?Vi:Ir},s.wg=function(){},v(eb,"ThresholdStrategy/NullThresholdStrategy",1795),m(576,1,{576:1},dCe),s.c=!1,s.d=!1,v(eb,"ThresholdStrategy/Postprocessable",576),m(1796,809,{},yxe),s.vg=function(n,t,i){var r,c,o;return c=t==i,r=this.a.a[i.p]==t,c||r?(o=n,this.a.c==(dh(),yp)?(c&&(o=YW(this,t,!0)),!isNaN(o)&&!isFinite(o)&&r&&(o=YW(this,i,!1))):(c&&(o=YW(this,t,!0)),!isNaN(o)&&!isFinite(o)&&r&&(o=YW(this,i,!1))),o):n},s.wg=function(){for(var n,t,i,r,c;this.d.b!=0;)c=u(M_e(this.d),576),r=dKe(this,c),r.a&&(n=r.a,i=Fe(this.a.f[this.a.g[c.b.p].p]),!(!i&&!uc(n)&&n.c.i.c==n.d.i.c)&&(t=gUe(this,c),t||yTe(this.e,c)));for(;this.e.a.c.length!=0;)gUe(this,u(T1e(this.e),576))},v(eb,"ThresholdStrategy/SimpleThresholdStrategy",1796),m(635,1,{635:1,188:1,196:1},Up),s.bg=function(){return lze(this)},s.og=function(){return lze(this)};var are;v(Uee,"EdgeRouterFactory",635),m(1445,1,oc,LU),s.pg=function(n){return jIn(u(n,37))},s.If=function(n,t){FLn(u(n,37),t)};var Lon,Pon,$on,Ron,Bon,tye,zon,Fon;v(Uee,"OrthogonalEdgeRouter",1445),m(1438,1,oc,ECe),s.pg=function(n){return lAn(u(n,37))},s.If=function(n,t){fRn(this,u(n,37),t)};var Jon,Hon,Gon,qon,kI,Uon;v(Uee,"PolylineEdgeRouter",1438),m(1439,1,Sh,Xp),s.Lb=function(n){return u1e(u(n,9))},s.Fb=function(n){return this===n},s.Mb=function(n){return u1e(u(n,9))},v(Uee,"PolylineEdgeRouter/1",1439),m(1851,1,zt,N6),s.Mb=function(n){return u(n,133).c==(da(),ab)},v(ya,"HyperEdgeCycleDetector/lambda$0$Type",1851),m(1852,1,{},pM),s.Xe=function(n){return u(n,133).d},v(ya,"HyperEdgeCycleDetector/lambda$1$Type",1852),m(1853,1,zt,mM),s.Mb=function(n){return u(n,133).c==(da(),ab)},v(ya,"HyperEdgeCycleDetector/lambda$2$Type",1853),m(1854,1,{},I6),s.Xe=function(n){return u(n,133).d},v(ya,"HyperEdgeCycleDetector/lambda$3$Type",1854),m(1855,1,{},D6),s.Xe=function(n){return u(n,133).d},v(ya,"HyperEdgeCycleDetector/lambda$4$Type",1855),m(1856,1,{},w_),s.Xe=function(n){return u(n,133).d},v(ya,"HyperEdgeCycleDetector/lambda$5$Type",1856),m(116,1,{35:1,116:1},yO),s.Dd=function(n){return cgn(this,u(n,116))},s.Fb=function(n){var t;return X(n,116)?(t=u(n,116),this.g==t.g):!1},s.Hb=function(){return this.g},s.Ib=function(){var n,t,i,r;for(n=new tl("{"),r=new P(this.n);r.a"+this.b+" ("+jpn(this.c)+")"},s.d=0,v(ya,"HyperEdgeSegmentDependency",133),m(515,23,{3:1,35:1,23:1,515:1},jse);var ab,Dm,Xon=yt(ya,"HyperEdgeSegmentDependency/DependencyType",515,Tt,u4n,Cmn),Kon;m(1857,1,{},CEe),v(ya,"HyperEdgeSegmentSplitter",1857),m(1858,1,{},bAe),s.a=0,s.b=0,v(ya,"HyperEdgeSegmentSplitter/AreaRating",1858),m(340,1,{340:1},WK),s.a=0,s.b=0,s.c=0,v(ya,"HyperEdgeSegmentSplitter/FreeArea",340),m(1859,1,Yt,p_),s.Le=function(n,t){return b2n(u(n,116),u(t,116))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(ya,"HyperEdgeSegmentSplitter/lambda$0$Type",1859),m(1860,1,ct,HDe),s.Ad=function(n){N6n(this.a,this.d,this.c,this.b,u(n,116))},s.b=0,v(ya,"HyperEdgeSegmentSplitter/lambda$1$Type",1860),m(1861,1,{},z5),s.Kb=function(n){return new mn(null,new vn(u(n,116).e,16))},v(ya,"HyperEdgeSegmentSplitter/lambda$2$Type",1861),m(1862,1,{},Mk),s.Kb=function(n){return new mn(null,new vn(u(n,116).j,16))},v(ya,"HyperEdgeSegmentSplitter/lambda$3$Type",1862),m(1863,1,{},m_),s.We=function(n){return ne(re(n))},v(ya,"HyperEdgeSegmentSplitter/lambda$4$Type",1863),m(653,1,{},EV),s.a=0,s.b=0,s.c=0,v(ya,"OrthogonalRoutingGenerator",653),m(1668,1,{},vM),s.Kb=function(n){return new mn(null,new vn(u(n,116).e,16))},v(ya,"OrthogonalRoutingGenerator/lambda$0$Type",1668),m(1669,1,{},yM),s.Kb=function(n){return new mn(null,new vn(u(n,116).j,16))},v(ya,"OrthogonalRoutingGenerator/lambda$1$Type",1669),m(661,1,{}),v(Xee,"BaseRoutingDirectionStrategy",661),m(1849,661,{},kxe),s.xg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A,O,D;if(!(n.r&&!n.q))for(p=t+n.o*i,b=new P(n.n);b.axh&&(o=p,c=n,r=new Se(y,o),Vt(l.a,r),Vw(this,l,c,r,!1),S=n.r,S&&(A=ne(re(Yu(S.e,0))),r=new Se(A,o),Vt(l.a,r),Vw(this,l,c,r,!1),o=t+S.o*i,c=S,r=new Se(A,o),Vt(l.a,r),Vw(this,l,c,r,!1)),r=new Se(D,o),Vt(l.a,r),Vw(this,l,c,r,!1)))},s.yg=function(n){return n.i.n.a+n.n.a+n.a.a},s.zg=function(){return De(),bt},s.Ag=function(){return De(),Kn},v(Xee,"NorthToSouthRoutingStrategy",1849),m(1850,661,{},jxe),s.xg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A,O,D;if(!(n.r&&!n.q))for(p=t-n.o*i,b=new P(n.n);b.axh&&(o=p,c=n,r=new Se(y,o),Vt(l.a,r),Vw(this,l,c,r,!1),S=n.r,S&&(A=ne(re(Yu(S.e,0))),r=new Se(A,o),Vt(l.a,r),Vw(this,l,c,r,!1),o=t-S.o*i,c=S,r=new Se(A,o),Vt(l.a,r),Vw(this,l,c,r,!1)),r=new Se(D,o),Vt(l.a,r),Vw(this,l,c,r,!1)))},s.yg=function(n){return n.i.n.a+n.n.a+n.a.a},s.zg=function(){return De(),Kn},s.Ag=function(){return De(),bt},v(Xee,"SouthToNorthRoutingStrategy",1850),m(1848,661,{},Exe),s.xg=function(n,t,i){var r,c,o,l,f,h,b,p,y,S,A,O,D;if(!(n.r&&!n.q))for(p=t+n.o*i,b=new P(n.n);b.axh&&(o=p,c=n,r=new Se(o,y),Vt(l.a,r),Vw(this,l,c,r,!0),S=n.r,S&&(A=ne(re(Yu(S.e,0))),r=new Se(o,A),Vt(l.a,r),Vw(this,l,c,r,!0),o=t+S.o*i,c=S,r=new Se(o,A),Vt(l.a,r),Vw(this,l,c,r,!0)),r=new Se(o,D),Vt(l.a,r),Vw(this,l,c,r,!0)))},s.yg=function(n){return n.i.n.b+n.n.b+n.a.b},s.zg=function(){return De(),et},s.Ag=function(){return De(),Vn},v(Xee,"WestToEastRoutingStrategy",1848),m(812,1,{},fge),s.Ib=function(){return Ja(this.a)},s.b=0,s.c=!1,s.d=!1,s.f=0,v(lm,"NubSpline",812),m(410,1,{410:1},YUe,x_e),v(lm,"NubSpline/PolarCP",410),m(1440,1,oc,kHe),s.pg=function(n){return YAn(u(n,37))},s.If=function(n,t){ORn(this,u(n,37),t)};var Von,Yon,Qon,Won,Zon;v(lm,"SplineEdgeRouter",1440),m(273,1,{273:1},ZR),s.Ib=function(){return this.a+" ->("+this.c+") "+this.b},s.c=0,v(lm,"SplineEdgeRouter/Dependency",273),m(454,23,{3:1,35:1,23:1,454:1},Ese);var hb,X3,esn=yt(lm,"SplineEdgeRouter/SideToProcess",454,Tt,o4n,Tmn),nsn;m(1441,1,zt,p1),s.Mb=function(n){return rS(),!u(n,132).o},v(lm,"SplineEdgeRouter/lambda$0$Type",1441),m(1442,1,{},bd),s.Xe=function(n){return rS(),u(n,132).v+1},v(lm,"SplineEdgeRouter/lambda$1$Type",1442),m(1443,1,ct,aCe),s.Ad=function(n){Xvn(this.a,this.b,u(n,49))},v(lm,"SplineEdgeRouter/lambda$2$Type",1443),m(1444,1,ct,hCe),s.Ad=function(n){Kvn(this.a,this.b,u(n,49))},v(lm,"SplineEdgeRouter/lambda$3$Type",1444),m(132,1,{35:1,132:1},rqe,wge),s.Dd=function(n){return ugn(this,u(n,132))},s.b=0,s.e=!1,s.f=0,s.g=0,s.j=!1,s.k=!1,s.n=0,s.o=!1,s.p=!1,s.q=!1,s.s=0,s.u=0,s.v=0,s.F=0,v(lm,"SplineSegment",132),m(457,1,{457:1},Kp),s.a=0,s.b=!1,s.c=!1,s.d=!1,s.e=!1,s.f=0,v(lm,"SplineSegment/EdgeInformation",457),m(1167,1,{},kM),v(X1,twe,1167),m(1168,1,Yt,v_),s.Le=function(n,t){return STn(u(n,120),u(t,120))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(X1,eQe,1168),m(1166,1,{},LAe),v(X1,"MrTree",1166),m(398,23,{3:1,35:1,23:1,398:1,188:1,196:1},m$),s.bg=function(){return Mqe(this)},s.og=function(){return Mqe(this)};var LH,Nx,Ix,Dx,iye=yt(X1,"TreeLayoutPhases",398,Tt,l6n,Omn),tsn;m(1082,214,ep,sNe),s.kf=function(n,t){var i,r,c,o,l,f,h,b;for(Fe(ze(je(n,(Mu(),Cye))))||qT((i=new dj((Rb(),new v0(n))),i)),l=t.dh(Yee),l.Tg("build tGraph",1),f=(h=new ZT,Pu(h,n),he(h,(Ti(),Lx),n),b=new wt,u_n(n,h,b),E_n(n,h,b),h),l.Ug(),l=t.dh(Yee),l.Tg("Split graph",1),o=h_n(this.a,f),l.Ug(),c=new P(o);c.a"+Yb(this.c):"e_"+Ni(this)},v(NS,"TEdge",65),m(120,150,{3:1,120:1,105:1,150:1},ZT),s.Ib=function(){var n,t,i,r,c;for(c=null,r=St(this.b,0);r.b!=r.d.c;)i=u(jt(r),40),c+=(i.c==null||i.c.length==0?"n_"+i.g:"n_"+i.c)+` +`;for(t=St(this.a,0);t.b!=t.d.c;)n=u(jt(t),65),c+=(n.b&&n.c?Yb(n.b)+"->"+Yb(n.c):"e_"+Ni(n))+` +`;return c};var qBn=v(NS,"TGraph",120);m(633,494,{3:1,494:1,633:1,105:1,150:1}),v(NS,"TShape",633),m(40,633,{3:1,494:1,40:1,633:1,105:1,150:1},tQ),s.Ib=function(){return Yb(this)};var PH=v(NS,"TNode",40);m(236,1,Zh,S1),s.Ic=function(n){cc(this,n)},s.Jc=function(){var n;return n=St(this.a.d,0),new Cv(n)},v(NS,"TNode/2",236),m(334,1,Fr,Cv),s.Nb=function(n){Zr(this,n)},s.Pb=function(){return u(jt(this.a),65).c},s.Ob=function(){return WC(this.a)},s.Qb=function(){OY(this.a)},v(NS,"TNode/2/1",334),m(1893,1,Mi,vo),s.If=function(n,t){uBn(this,u(n,120),t)},v(go,"CompactionProcessor",1893),m(1894,1,Yt,DEe),s.Le=function(n,t){return I7n(this.a,u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(go,"CompactionProcessor/lambda$0$Type",1894),m(1895,1,zt,gCe),s.Mb=function(n){return K5n(this.b,this.a,u(n,49))},s.a=0,s.b=0,v(go,"CompactionProcessor/lambda$1$Type",1895),m(1904,1,Yt,Ml),s.Le=function(n,t){return F3n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(go,"CompactionProcessor/lambda$10$Type",1904),m(1905,1,Yt,Tk),s.Le=function(n,t){return fpn(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(go,"CompactionProcessor/lambda$11$Type",1905),m(1906,1,Yt,F5),s.Le=function(n,t){return J3n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(go,"CompactionProcessor/lambda$12$Type",1906),m(1896,1,zt,_Ee),s.Mb=function(n){return Ywn(this.a,u(n,49))},s.a=0,v(go,"CompactionProcessor/lambda$2$Type",1896),m(1897,1,zt,LEe),s.Mb=function(n){return Qwn(this.a,u(n,49))},s.a=0,v(go,"CompactionProcessor/lambda$3$Type",1897),m(1898,1,zt,vv),s.Mb=function(n){return u(n,40).c.indexOf(_F)==-1},v(go,"CompactionProcessor/lambda$4$Type",1898),m(1899,1,{},PEe),s.Kb=function(n){return Byn(this.a,u(n,40))},s.a=0,v(go,"CompactionProcessor/lambda$5$Type",1899),m(Q0,1,{},$Ee),s.Kb=function(n){return Z9n(this.a,u(n,40))},s.a=0,v(go,"CompactionProcessor/lambda$6$Type",Q0),m(1901,1,Yt,REe),s.Le=function(n,t){return o9n(this.a,u(n,240),u(t,240))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(go,"CompactionProcessor/lambda$7$Type",1901),m(1902,1,Yt,BEe),s.Le=function(n,t){return s9n(this.a,u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(go,"CompactionProcessor/lambda$8$Type",1902),m(1903,1,Yt,Ok),s.Le=function(n,t){return apn(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(go,"CompactionProcessor/lambda$9$Type",1903),m(1891,1,Mi,_6),s.If=function(n,t){tDn(u(n,120),t)},v(go,"DirectionProcessor",1891),m(1883,1,Mi,lNe),s.If=function(n,t){j_n(this,u(n,120),t)},v(go,"FanProcessor",1883),m(1251,1,Mi,J5),s.If=function(n,t){wXe(u(n,120),t)},v(go,"GraphBoundsProcessor",1251),m(1252,1,{},eU),s.We=function(n){return u(n,40).e.a},v(go,"GraphBoundsProcessor/lambda$0$Type",1252),m(1253,1,{},Bs),s.We=function(n){return u(n,40).e.b},v(go,"GraphBoundsProcessor/lambda$1$Type",1253),m(1254,1,{},jM),s.We=function(n){return Ign(u(n,40))},v(go,"GraphBoundsProcessor/lambda$2$Type",1254),m(1255,1,{},EM),s.We=function(n){return Dgn(u(n,40))},v(go,"GraphBoundsProcessor/lambda$3$Type",1255),m(264,23,{3:1,35:1,23:1,264:1,196:1},mw),s.bg=function(){switch(this.g){case 0:return new $xe;case 1:return new lNe;case 2:return new Pxe;case 3:return new xM;case 4:return new k_;case 8:return new y_;case 5:return new _6;case 6:return new sh;case 7:return new vo;case 9:return new J5;case 10:return new el;default:throw R(new qn(tee+(this.f!=null?this.f:""+this.g)))}};var rye,cye,uye,oye,sye,lye,fye,aye,hye,dye,hre,UBn=yt(go,iee,264,Tt,sze,Nmn),isn;m(1890,1,Mi,y_),s.If=function(n,t){rRn(u(n,120),t)},v(go,"LevelCoordinatesProcessor",1890),m(1888,1,Mi,k_),s.If=function(n,t){ANn(this,u(n,120),t)},s.a=0,v(go,"LevelHeightProcessor",1888),m(1889,1,Zh,nU),s.Ic=function(n){cc(this,n)},s.Jc=function(){return En(),v9(),g7},v(go,"LevelHeightProcessor/1",1889),m(1884,1,Mi,Pxe),s.If=function(n,t){BIn(this,u(n,120),t)},v(go,"LevelProcessor",1884),m(1885,1,zt,SM),s.Mb=function(n){return Fe(ze(C(u(n,40),(Ti(),db))))},v(go,"LevelProcessor/lambda$0$Type",1885),m(1886,1,Mi,xM),s.If=function(n,t){_Cn(this,u(n,120),t)},s.a=0,v(go,"NeighborsProcessor",1886),m(1887,1,Zh,AM),s.Ic=function(n){cc(this,n)},s.Jc=function(){return En(),v9(),g7},v(go,"NeighborsProcessor/1",1887),m(1892,1,Mi,sh),s.If=function(n,t){y_n(this,u(n,120),t)},s.a=0,v(go,"NodePositionProcessor",1892),m(1882,1,Mi,$xe),s.If=function(n,t){cPn(this,u(n,120),t)},v(go,"RootProcessor",1882),m(1907,1,Mi,el),s.If=function(n,t){jSn(u(n,120),t)},v(go,"Untreeifyer",1907),m(385,23,{3:1,35:1,23:1,385:1},lK);var jI,dre,bye,gye=yt($N,"EdgeRoutingMode",385,Tt,iyn,Imn),rsn,EI,P7,bre,wye,pye,gre,wre,mye,pre,vye,mre,_x,vre,$H,RH,Vf,Sa,$7,Lx,Px,Vd,yye,csn,yre,db,SI,xI;m(846,1,Ua,MC),s.tf=function(n){en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Jpe),""),YQe),"Turns on Tree compaction which decreases the size of the whole tree by placing nodes of multiple levels in one large level"),($n(),!1)),(lg(),xr)),Qi),rn((vh(),Cn))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Hpe),""),"Edge End Texture Length"),"Should be set to the length of the texture at the end of an edge. This value can be used to improve the Edge Routing."),7),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Gpe),""),"Tree Level"),"The index for the tree level the node is in"),ke(0)),dc),jr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,qpe),""),YQe),"When set to a positive number this option will force the algorithm to place the node to the specified position within the trees layer if weighting is set to constraint"),ke(-1)),dc),jr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Upe),""),"Weighting of Nodes"),"Which weighting to use when computing a node order."),Eye),Bi),Lye),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Xpe),""),"Edge Routing Mode"),"Chooses an Edge Routing algorithm."),kye),Bi),gye),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Kpe),""),"Search Order"),"Which search order to use when computing a spanning tree."),jye),Bi),$ye),rn(Cn)))),zVe((new hP,n))};var usn,osn,ssn,kye,lsn,fsn,jye,asn,hsn,Eye;v($N,"MrTreeMetaDataProvider",846),m(990,1,Ua,hP),s.tf=function(n){zVe(n)};var dsn,Sye,xye,kp,Aye,Mye,kre,bsn,gsn,wsn,psn,msn,vsn,ysn,Cye,Tye,Oye,ksn,K3,BH,Nye,jsn,Iye,jre,Esn,Ssn,xsn,Dye,Asn,Dh,_ye;v($N,"MrTreeOptions",990),m(991,1,{},Nk),s.uf=function(){var n;return n=new sNe,n},s.vf=function(n){},v($N,"MrTreeOptions/MrtreeFactory",991),m(353,23,{3:1,35:1,23:1,353:1},v$);var Ere,zH,Sre,xre,Lye=yt($N,"OrderWeighting",353,Tt,d6n,Dmn),Msn;m(425,23,{3:1,35:1,23:1,425:1},Sse);var Pye,Are,$ye=yt($N,"TreeifyingOrder",425,Tt,s4n,_mn),Csn;m(1446,1,oc,DU),s.pg=function(n){return u(n,120),Tsn},s.If=function(n,t){s7n(this,u(n,120),t)};var Tsn;v("org.eclipse.elk.alg.mrtree.p1treeify","DFSTreeifyer",1446),m(1447,1,oc,lP),s.pg=function(n){return u(n,120),Osn},s.If=function(n,t){HIn(this,u(n,120),t)};var Osn;v(Z8,"NodeOrderer",1447),m(1454,1,{},tU),s.rd=function(n){return aIe(n)},v(Z8,"NodeOrderer/0methodref$lambda$6$Type",1454),m(1448,1,zt,x_),s.Mb=function(n){return H4(),Fe(ze(C(u(n,40),(Ti(),db))))},v(Z8,"NodeOrderer/lambda$0$Type",1448),m(1449,1,zt,A_),s.Mb=function(n){return H4(),u(C(u(n,40),(Mu(),K3)),15).a<0},v(Z8,"NodeOrderer/lambda$1$Type",1449),m(1450,1,zt,FEe),s.Mb=function(n){return V8n(this.a,u(n,40))},v(Z8,"NodeOrderer/lambda$2$Type",1450),m(1451,1,zt,zEe),s.Mb=function(n){return zyn(this.a,u(n,40))},v(Z8,"NodeOrderer/lambda$3$Type",1451),m(1452,1,Yt,OM),s.Le=function(n,t){return b8n(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Z8,"NodeOrderer/lambda$4$Type",1452),m(1453,1,zt,M_),s.Mb=function(n){return H4(),u(C(u(n,40),(Ti(),wre)),15).a!=0},v(Z8,"NodeOrderer/lambda$5$Type",1453),m(1455,1,oc,_U),s.pg=function(n){return u(n,120),Nsn},s.If=function(n,t){VDn(this,u(n,120),t)},s.b=0;var Nsn;v("org.eclipse.elk.alg.mrtree.p3place","NodePlacer",1455),m(1456,1,oc,AC),s.pg=function(n){return u(n,120),Isn},s.If=function(n,t){ODn(u(n,120),t)};var Isn,XBn=v(Qs,"EdgeRouter",1456);m(1458,1,Yt,Ik),s.Le=function(n,t){return oo(u(n,15).a,u(t,15).a)},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/0methodref$compare$Type",1458),m(1463,1,{},MM),s.We=function(n){return ne(re(n))},v(Qs,"EdgeRouter/1methodref$doubleValue$Type",1463),m(1465,1,Yt,uw),s.Le=function(n,t){return ji(ne(re(n)),ne(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/2methodref$compare$Type",1465),m(1467,1,Yt,Dk),s.Le=function(n,t){return ji(ne(re(n)),ne(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/3methodref$compare$Type",1467),m(1469,1,{},L6),s.We=function(n){return ne(re(n))},v(Qs,"EdgeRouter/4methodref$doubleValue$Type",1469),m(1471,1,Yt,CM),s.Le=function(n,t){return ji(ne(re(n)),ne(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/5methodref$compare$Type",1471),m(1473,1,Yt,TM),s.Le=function(n,t){return ji(ne(re(n)),ne(re(t)))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/6methodref$compare$Type",1473),m(1457,1,{},j_),s.Kb=function(n){return P1(),u(C(u(n,40),(Mu(),Dh)),15)},v(Qs,"EdgeRouter/lambda$0$Type",1457),m(1468,1,{},E_),s.Kb=function(n){return Epn(u(n,40))},v(Qs,"EdgeRouter/lambda$11$Type",1468),m(1470,1,{},pCe),s.Kb=function(n){return qvn(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(Qs,"EdgeRouter/lambda$13$Type",1470),m(1472,1,{},wCe),s.Kb=function(n){return Apn(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(Qs,"EdgeRouter/lambda$15$Type",1472),m(1474,1,Yt,S_),s.Le=function(n,t){return eSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/lambda$17$Type",1474),m(1475,1,Yt,iU),s.Le=function(n,t){return nSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/lambda$18$Type",1475),m(1476,1,Yt,C_),s.Le=function(n,t){return iSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/lambda$19$Type",1476),m(1459,1,zt,JEe),s.Mb=function(n){return E4n(this.a,u(n,40))},s.a=0,v(Qs,"EdgeRouter/lambda$2$Type",1459),m(1477,1,Yt,T_),s.Le=function(n,t){return tSn(u(n,65),u(t,65))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/lambda$20$Type",1477),m(1460,1,Yt,O_),s.Le=function(n,t){return _vn(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/lambda$3$Type",1460),m(1461,1,Yt,NM),s.Le=function(n,t){return Lvn(u(n,40),u(t,40))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"EdgeRouter/lambda$4$Type",1461),m(1462,1,{},N_),s.Kb=function(n){return Spn(u(n,40))},v(Qs,"EdgeRouter/lambda$5$Type",1462),m(1464,1,{},mCe),s.Kb=function(n){return Uvn(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(Qs,"EdgeRouter/lambda$7$Type",1464),m(1466,1,{},vCe),s.Kb=function(n){return xpn(this.b,this.a,u(n,40))},s.a=0,s.b=0,v(Qs,"EdgeRouter/lambda$9$Type",1466),m(662,1,{662:1},fHe),s.e=0,s.f=!1,s.g=!1,v(Qs,"MultiLevelEdgeNodeNodeGap",662),m(1864,1,Yt,I_),s.Le=function(n,t){return P4n(u(n,240),u(t,240))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"MultiLevelEdgeNodeNodeGap/lambda$0$Type",1864),m(1865,1,Yt,D_),s.Le=function(n,t){return $4n(u(n,240),u(t,240))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(Qs,"MultiLevelEdgeNodeNodeGap/lambda$1$Type",1865);var V3;m(487,23,{3:1,35:1,23:1,487:1,188:1,196:1},xse),s.bg=function(){return KFe(this)},s.og=function(){return KFe(this)};var FH,Y3,Rye=yt(Vpe,"RadialLayoutPhases",487,Tt,l4n,Lmn),Dsn;m(1083,214,ep,RAe),s.kf=function(n,t){var i,r,c,o,l,f;if(i=UUe(this,n),t.Tg("Radial layout",i.c.length),Fe(ze(je(n,(q0(),Vye))))||qT((r=new dj((Rb(),new v0(n))),r)),f=ZAn(n),Ei(n,(Gv(),V3),f),!f)throw R(new qn("The given graph is not a tree!"));for(c=ne(re(je(n,GH))),c==0&&(c=yqe(n)),Ei(n,GH,c),l=new P(UUe(this,n));l.a=3)for(fe=u(K(te,0),26),_e=u(K(te,1),26),o=0;o+2=fe.f+_e.f+p||_e.f>=be.f+fe.f+p){on=!0;break}else++o;else on=!0;if(!on){for(S=te.i,f=new st(te);f.e!=f.i.gc();)l=u(ft(f),26),Ei(l,(Xt(),RI),ke(S)),--S;jKe(n,new s4),t.Ug();return}for(i=(zT(this.a),aa(this.a,(ez(),$x),u(je(n,A6e),188)),aa(this.a,qH,u(je(n,y6e),188)),aa(this.a,Rre,u(je(n,E6e),188)),Fse(this.a,(Tn=new or,qt(Tn,$x,(Ez(),Fre)),qt(Tn,qH,zre),Fe(ze(je(n,m6e)))&&qt(Tn,$x,Jre),Fe(ze(je(n,p6e)))&&qt(Tn,$x,Bre),Tn)),uN(this.a,n)),b=1/i.c.length,O=new P(i);O.a0&&wFe((Qn(t-1,n.length),n.charCodeAt(t-1)),hQe);)--t;if(r>=t)throw R(new qn("The given string does not contain any numbers."));if(c=nm((Qr(r,t,n.length),n.substr(r,t-r)),`,|;|\r| +`),c.length!=2)throw R(new qn("Exactly two numbers are expected, "+c.length+" were found."));try{this.a=K2(V2(c[0])),this.b=K2(V2(c[1]))}catch(o){throw o=sr(o),X(o,131)?(i=o,R(new qn(dQe+i))):R(o)}},s.Ib=function(){return"("+this.a+","+this.b+")"},s.a=0,s.b=0;var Lr=v(NN,"KVector",8);m(78,66,{3:1,4:1,20:1,31:1,56:1,18:1,66:1,16:1,78:1,414:1},xs,XP,IOe),s.Nc=function(){return Okn(this)},s.ag=function(n){var t,i,r,c,o,l;r=nm(n,`,|;|\\(|\\)|\\[|\\]|\\{|\\}| | | +`),qs(this);try{for(i=0,o=0,c=0,l=0;i0&&(o%2==0?c=K2(r[i]):l=K2(r[i]),o>0&&o%2!=0&&Vt(this,new Se(c,l)),++o),++i}catch(f){throw f=sr(f),X(f,131)?(t=f,R(new qn("The given string does not match the expected format for vectors."+t))):R(f)}},s.Ib=function(){var n,t,i;for(n=new tl("("),t=St(this,0);t.b!=t.d.c;)i=u(jt(t),8),Kt(n,i.a+","+i.b),t.b!=t.d.c&&(n.a+="; ");return(n.a+=")",n).a};var l9e=v(NN,"KVectorChain",78);m(256,23,{3:1,35:1,23:1,256:1},Bj);var lce,nG,tG,NI,II,iG,f9e=yt(Oo,"Alignment",256,Tt,N9n,svn),bfn;m(975,1,Ua,NC),s.tf=function(n){cKe(n)};var a9e,fce,gfn,h9e,d9e,wfn,b9e,pfn,mfn,g9e,w9e,vfn;v(Oo,"BoxLayouterOptions",975),m(976,1,{},UM),s.uf=function(){var n;return n=new bL,n},s.vf=function(n){},v(Oo,"BoxLayouterOptions/BoxFactory",976),m(299,23,{3:1,35:1,23:1,299:1},zj);var qx,ace,Ux,Xx,Kx,hce,dce=yt(Oo,"ContentAlignment",299,Tt,I9n,lvn),yfn;m(689,1,Ua,OC),s.tf=function(n){en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,mWe),""),"Layout Algorithm"),"Select a specific layout algorithm."),(lg(),Gy)),He),rn((vh(),Cn))))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,vWe),""),"Resolved Layout Algorithm"),"Meta data associated with the selected algorithm."),Za),YBn),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ppe),""),"Alignment"),"Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."),p9e),Bi),f9e),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,U8),""),"Aspect Ratio"),"The desired aspect ratio of the drawing, that is the quotient of width by height."),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,N2e),""),"Bend Points"),"A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points."),Za),l9e),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,OF),""),"Content Alignment"),"Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option."),v9e),Hy),dce),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,PN),""),"Debug Mode"),"Whether additional debug information shall be generated."),($n(),!1)),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Jee),""),"Direction"),"Overall direction of edges: horizontal (right / left) or vertical (down / up)."),y9e),Bi),Yx),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,LN),""),"Edge Routing"),"What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline."),E9e),Bi),Mce),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,T2e),""),"Expand Nodes"),"If active, nodes are expanded to fill the area of their parent."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,TF),""),"Hierarchy Handling"),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),x9e),Bi),b8e),Ci(Cn,F(z(Wa,1),Ee,160,0,[fr]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,sm),""),"Padding"),"The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately."),P9e),Za),jve),Ci(Cn,F(z(Wa,1),Ee,160,0,[fr]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ES),""),"Interactive"),"Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,IF),""),"interactive Layout"),"Whether the graph should be changeable interactively and by setting constraints"),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,SS),""),"Omit Node Micro Layout"),"Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ZZ),""),"Port Constraints"),"Defines constraints of the position of the ports of a node."),F9e),Bi),p8e),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,NF),""),"Position"),"The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."),Za),Lr),Ci(fr,F(z(Wa,1),Ee,160,0,[Yd,Q1]))))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,xN),""),"Priority"),"Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."),dc),jr),Ci(fr,F(z(Wa,1),Ee,160,0,[xa]))))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,fF),""),"Randomization Seed"),"Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time)."),dc),jr),rn(Cn)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,jS),""),"Separate Connected Components"),"Whether each connected component should be processed separately."),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Cpe),""),"Junction Points"),"This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order."),C9e),Za),l9e),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Ipe),""),"Comment Box"),"Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related."),!1),xr),Qi),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Dpe),""),"Hypernode"),"Whether the node should be handled as a hypernode."),!1),xr),Qi),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,EBn),""),"Label Manager"),"Label managers can shorten labels upon a layout algorithm's request."),Za),tzn),Ci(Cn,F(z(Wa,1),Ee,160,0,[Q1]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,yWe),""),"Softwrapping Fuzziness"),"Determines the amount of fuzziness to be used when performing softwrapping on labels. The value expresses the percent of overhang that is permitted for each line. If the next line would take up less space than this threshold, it is appended to the current line instead of being placed in a new line."),0),ec),gr),rn(Q1)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Lpe),""),"Margins"),"Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels."),T9e),Za),kve),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,gpe),""),"No Layout"),"No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node."),!1),xr),Qi),Ci(fr,F(z(Wa,1),Ee,160,0,[xa,Yd,Q1]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,kWe),""),"Scale Factor"),"The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set."),1),ec),gr),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,jWe),""),"Child Area Width"),"The width of the area occupied by the laid out children of a node."),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,EWe),""),"Child Area Height"),"The height of the area occupied by the laid out children of a node."),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,AN),""),dWe),"Turns topdown layout on and off. If this option is enabled, hierarchical layout will be computed first for the root node and then for its children recursively. Layouts are then scaled down to fit the area provided by their parents. Graphs must follow a certain structure for topdown layout to work properly. {@link TopdownNodeTypes.PARALLEL_NODE} nodes must have children of type {@link TopdownNodeTypes.HIERARCHICAL_NODE} and must define {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} for their children. Furthermore they need to be laid out using an algorithm that is a {@link TopdownLayoutProvider}. Hierarchical nodes can also be parents of other hierarchical nodes and can optionally use a {@link TopdownSizeApproximator} to dynamically set sizes during topdown layout. In this case {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} should be set on the node itself rather than the parent. The values are then used by the size approximator as base values. Hierarchical nodes require the layout option {@link nodeSize.fixedGraphSize} to be true to prevent the algorithm used there from resizing the hierarchical node. This option is not supported if 'Hierarchy Handling' is set to 'INCLUDE_CHILDREN'"),!1),xr),Qi),rn(Cn)))),qi(n,AN,np,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,SWe),""),"Animate"),"Whether the shift from the old layout to the new computed layout shall be animated."),!0),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,xWe),""),"Animation Time Factor"),"Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'."),ke(100)),dc),jr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,AWe),""),"Layout Ancestors"),"Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,MWe),""),"Maximal Animation Time"),"The maximal time for animations, in milliseconds."),ke(4e3)),dc),jr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,CWe),""),"Minimal Animation Time"),"The minimal time for animations, in milliseconds."),ke(400)),dc),jr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,TWe),""),"Progress Bar"),"Whether a progress bar shall be displayed during layout computations."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,OWe),""),"Validate Graph"),"Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,NWe),""),"Validate Options"),"Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!0),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,IWe),""),"Zoom to Fit"),"Whether the zoom level shall be set to view the whole diagram after layout."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,O2e),"box"),"Box Layout Mode"),"Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better."),m9e),Bi),O8e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,DWe),"json"),"Shape Coords"),"For layouts transferred into JSON graphs, specify the coordinate system to be used for nodes, ports, and labels of nodes and ports."),M9e),Bi),y8e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,_We),"json"),"Edge Coords"),"For layouts transferred into JSON graphs, specify the coordinate system to be used for edge route points and edge labels."),A9e),Bi),n8e),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ipe),Ka),"Comment Comment Spacing"),"Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing."),10),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,rpe),Ka),"Comment Node Spacing"),"Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing."),10),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,cpe),Ka),"Components Spacing"),"Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."),20),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,upe),Ka),"Edge Spacing"),"Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines."),10),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,WZ),Ka),"Edge Label Spacing"),"The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option."),2),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Fee),Ka),"Edge Node Spacing"),"Spacing to be preserved between nodes and edges."),10),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ope),Ka),"Label Spacing"),"Determines the amount of space to be left between two labels of the same graph element."),0),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,fpe),Ka),"Label Node Spacing"),"Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option."),5),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,spe),Ka),"Horizontal spacing between Label and Port"),"Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,lpe),Ka),"Vertical spacing between Label and Port"),"Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,om),Ka),"Node Spacing"),"The minimal distance to be preserved between each two nodes."),20),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ape),Ka),"Node Self Loop Spacing"),"Spacing to be preserved between a node and its self loops."),10),ec),gr),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,hpe),Ka),"Port Spacing"),"Spacing between pairs of ports of the same node."),10),ec),gr),Ci(Cn,F(z(Wa,1),Ee,160,0,[fr]))))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,dpe),Ka),"Individual Spacing"),"Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."),Za),wan),Ci(fr,F(z(Wa,1),Ee,160,0,[xa,Yd,Q1]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Ppe),Ka),"Additional Port Space"),"Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border."),Q9e),Za),kve),rn(Cn)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Gee),$We),"Layout Partition"),"Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction)."),dc),jr),Ci(Cn,F(z(Wa,1),Ee,160,0,[fr]))))),qi(n,Gee,Hee,Ifn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Hee),$We),"Layout Partitioning"),"Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle."),$9e),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,ype),RWe),"Node Label Padding"),"Define padding for node labels that are placed inside of a node."),N9e),Za),jve),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,K8),RWe),"Node Label Placement"),"Hints for where node labels are to be placed; if empty, the node label's position is not modified."),I9e),Hy),$c),Ci(fr,F(z(Wa,1),Ee,160,0,[Q1]))))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Epe),zF),"Port Alignment"),"Defines the default port distribution for a node. May be overridden for each side individually."),B9e),Bi),eA),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Spe),zF),"Port Alignment (North)"),"Defines how ports on the northern side are placed, overriding the node's general port alignment."),Bi),eA),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,xpe),zF),"Port Alignment (South)"),"Defines how ports on the southern side are placed, overriding the node's general port alignment."),Bi),eA),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Ape),zF),"Port Alignment (West)"),"Defines how ports on the western side are placed, overriding the node's general port alignment."),Bi),eA),rn(fr)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Mpe),zF),"Port Alignment (East)"),"Defines how ports on the eastern side are placed, overriding the node's general port alignment."),Bi),eA),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,k3),gne),"Node Size Constraints"),"What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed."),D9e),Hy),iA),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,py),gne),"Node Size Options"),"Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications."),L9e),Hy),k8e),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,my),gne),"Node Size Minimum"),"The minimal size to which a node can be reduced."),_9e),Za),Lr),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,X8),gne),"Fixed Graph Size"),"By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so."),!1),xr),Qi),rn(Cn)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Ope),zee),"Edge Label Placement"),"Gives a hint on where to put edge labels."),k9e),Bi),t8e),rn(Q1)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,aF),zee),"Inline Edge Labels"),"If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible."),!1),xr),Qi),rn(Q1)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,SBn),"font"),"Font Name"),"Font name used for a label."),Gy),He),rn(Q1)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,LWe),"font"),"Font Size"),"Font size used for a label."),dc),jr),rn(Q1)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,_pe),wne),"Port Anchor Offset"),"The offset to the port position where connections shall be attached."),Za),Lr),rn(Yd)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,Npe),wne),"Port Index"),"The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case."),dc),jr),rn(Yd)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,wpe),wne),"Port Side"),"The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports."),G9e),Bi),xc),rn(Yd)))),en(n,new qe(We(Qe(Ze(Xe(Ye(Ke(Ve(new Ge,bpe),wne),"Port Border Offset"),"The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border."),ec),gr),rn(Yd)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,V8),_2e),"Port Label Placement"),"Decides on a placement method for port labels; if empty, the node label's position is not modified."),J9e),Hy),fG),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,kpe),_2e),"Port Labels Next to Port"),"Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."),!1),xr),Qi),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,jpe),_2e),"Treat Port Labels as Group"),"If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port."),!0),xr),Qi),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,dne),r7),"Number of size categories"),"Defines the number of categories to use for the FIXED_INTEGER_RATIO_BOXES size approximator."),ke(3)),dc),jr),rn(Cn)))),qi(n,dne,bne,Gfn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,I2e),r7),"Weight of a node containing children for determining the graph size"),"When determining the graph size for the size categorisation, this value determines how many times a node containing children is weighted more than a simple node. For example setting this value to four would result in a graph containing a simple node and a hierarchical node to be counted as having a size of five."),ke(4)),dc),jr),rn(Cn)))),qi(n,I2e,dne,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,MN),r7),"Topdown Scale Factor"),"The scaling factor to be applied to the nodes laid out within the node in recursive topdown layout. The difference to 'Scale Factor' is that the node itself is not scaled. This value has to be set on hierarchical nodes."),1),ec),gr),rn(Cn)))),qi(n,MN,np,Ffn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,bne),r7),"Topdown Size Approximator"),"The size approximator to be used to set sizes of hierarchical nodes during topdown layout. The default value is null, which results in nodes keeping whatever size is defined for them e.g. through parent parallel node or by manually setting the size."),null),Za),QBn),rn(fr)))),qi(n,bne,np,Jfn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,CN),r7),"Topdown Hierarchical Node Width"),"The fixed size of a hierarchical node when using topdown layout. If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."),150),ec),gr),Ci(Cn,F(z(Wa,1),Ee,160,0,[fr]))))),qi(n,CN,np,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,TN),r7),"Topdown Hierarchical Node Aspect Ratio"),"The fixed aspect ratio of a hierarchical node when using topdown layout. Default is 1/sqrt(2). If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."),1.414),ec),gr),Ci(Cn,F(z(Wa,1),Ee,160,0,[fr]))))),qi(n,TN,np,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,np),r7),"Topdown Node Type"),"The different node types used for topdown layout. If the node type is set to {@link TopdownNodeTypes.PARALLEL_NODE} the algorithm must be set to a {@link TopdownLayoutProvider} such as {@link TopdownPacking}. The {@link nodeSize.fixedGraphSize} option is technically only required for hierarchical nodes."),null),Bi),E8e),rn(fr)))),qi(n,np,X8,null),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,D2e),r7),"Topdown Scale Cap"),"Determines the upper limit for the topdown scale factor. The default value is 1.0 which ensures that nested children never end up appearing larger than their parents in terms of unit sizes such as the font size. If the limit is larger, nodes will fully utilize the available space, but it is counteriniuitive for inner nodes to have a larger scale than outer nodes."),1),ec),gr),rn(Cn)))),qi(n,D2e,np,zfn),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,mpe),BWe),"Activate Inside Self Loops"),"Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports."),!1),xr),Qi),rn(fr)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,vpe),BWe),"Inside Self Loop"),"Whether a self loop should be routed inside a node instead of around that node."),!1),xr),Qi),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,Tpe),"edge"),"Edge Thickness"),"The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it."),1),ec),gr),rn(xa)))),en(n,new qe(We(Qe(Ze(an(Xe(Ye(Ke(Ve(new Ge,PWe),"edge"),"Edge Type"),"The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."),S9e),Bi),s8e),rn(xa)))),Oj(n,new P4(Sj(b9(d9(new d0,Rn),"Layered"),'The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.'))),Oj(n,new P4(Sj(b9(d9(new d0,"org.eclipse.elk.orthogonal"),"Orthogonal"),`Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia '86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.`))),Oj(n,new P4(Sj(b9(d9(new d0,$o),"Force"),"Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984."))),Oj(n,new P4(Sj(b9(d9(new d0,"org.eclipse.elk.circle"),"Circle"),"Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph."))),Oj(n,new P4(Sj(b9(d9(new d0,QQe),"Tree"),"Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type."))),Oj(n,new P4(Sj(b9(d9(new d0,"org.eclipse.elk.planar"),"Planar"),"Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable."))),Oj(n,new P4(Sj(b9(d9(new d0,Gl),"Radial"),"Radial layout algorithms usually position the nodes of the graph on concentric circles."))),HXe((new BU,n)),cKe((new NC,n)),gXe((new zU,n))};var qy,kfn,p9e,B7,jfn,Efn,m9e,Lm,Pm,Sfn,DI,v9e,_I,Ng,y9e,bce,gce,k9e,j9e,E9e,xfn,S9e,Afn,W3,x9e,Mfn,LI,wce,PI,pce,Cfn,A9e,Tfn,M9e,Z3,C9e,z7,T9e,O9e,N9e,e5,I9e,Ig,D9e,$m,n5,_9e,bb,L9e,rG,$I,s1,P9e,Ofn,$9e,Nfn,Ifn,R9e,B9e,mce,vce,yce,kce,z9e,Ps,Vx,F9e,jce,Ece,Rm,J9e,H9e,t5,G9e,Uy,RI,Sce,Bm,Dfn,xce,_fn,Lfn,Pfn,$fn,q9e,U9e,Xy,X9e,cG,K9e,V9e,Qd,Rfn,Y9e,Q9e,W9e,F7,zm,J7,Ky,Bfn,zfn,uG,Ffn,oG,Jfn,Hfn,Gfn,qfn;v(Oo,"CoreOptions",689),m(86,23,{3:1,35:1,23:1,86:1},wT);var eh,Zc,ru,nh,Vl,Yx=yt(Oo,"Direction",86,Tt,q6n,cvn),Ufn;m(278,23,{3:1,35:1,23:1,278:1},j$);var sG,BI,Z9e,e8e,n8e=yt(Oo,"EdgeCoords",278,Tt,b6n,uvn),Xfn;m(279,23,{3:1,35:1,23:1,279:1},pK);var H7,Fm,G7,t8e=yt(Oo,"EdgeLabelPlacement",279,Tt,ayn,ovn),Kfn;m(222,23,{3:1,35:1,23:1,222:1},E$);var q7,zI,Vy,Ace,Mce=yt(Oo,"EdgeRouting",222,Tt,g6n,rvn),Vfn;m(327,23,{3:1,35:1,23:1,327:1},Fj);var i8e,r8e,c8e,u8e,Cce,o8e,s8e=yt(Oo,"EdgeType",327,Tt,L9n,gvn),Yfn;m(973,1,Ua,BU),s.tf=function(n){HXe(n)};var l8e,f8e,a8e,h8e,Qfn,d8e,Qx;v(Oo,"FixedLayouterOptions",973),m(974,1,{},XM),s.uf=function(){var n;return n=new ow,n},s.vf=function(n){},v(Oo,"FixedLayouterOptions/FixedFactory",974),m(347,23,{3:1,35:1,23:1,347:1},mK);var Wd,lG,Wx,b8e=yt(Oo,"HierarchyHandling",347,Tt,hyn,wvn),Wfn,QBn=Gi(Oo,"ITopdownSizeApproximator");m(292,23,{3:1,35:1,23:1,292:1},S$);var l1,gb,FI,JI,Zfn=yt(Oo,"LabelSide",292,Tt,w6n,bvn),ean;m(96,23,{3:1,35:1,23:1,96:1},Dv);var W1,Yf,wf,Qf,pl,Wf,pf,f1,Zf,$c=yt(Oo,"NodeLabelPlacement",96,Tt,P8n,fvn),nan;m(257,23,{3:1,35:1,23:1,257:1},pT);var g8e,Zx,wb,w8e,HI,eA=yt(Oo,"PortAlignment",257,Tt,i9n,avn),tan;m(102,23,{3:1,35:1,23:1,102:1},Jj);var Dg,to,a1,U7,th,pb,p8e=yt(Oo,"PortConstraints",102,Tt,_9n,hvn),ian;m(280,23,{3:1,35:1,23:1,280:1},Hj);var nA,tA,Z1,GI,mb,Yy,fG=yt(Oo,"PortLabelPlacement",280,Tt,D9n,dvn),ran;m(64,23,{3:1,35:1,23:1,64:1},mT);var et,Kn,Yl,Ql,Wo,zo,ih,ea,ks,hs,mo,js,Zo,es,na,ml,vl,mf,bt,ju,Vn,xc=yt(Oo,"PortSide",64,Tt,U6n,yvn),can;m(977,1,Ua,zU),s.tf=function(n){gXe(n)};var uan,oan,m8e,san,lan;v(Oo,"RandomLayouterOptions",977),m(978,1,{},KM),s.uf=function(){var n;return n=new WM,n},s.vf=function(n){},v(Oo,"RandomLayouterOptions/RandomFactory",978),m(300,23,{3:1,35:1,23:1,300:1},vK);var qI,Tce,v8e,y8e=yt(Oo,"ShapeCoords",300,Tt,dyn,kvn),fan;m(380,23,{3:1,35:1,23:1,380:1},x$);var Jm,UI,XI,_g,iA=yt(Oo,"SizeConstraint",380,Tt,m6n,jvn),aan;m(266,23,{3:1,35:1,23:1,266:1},_v);var KI,aG,X7,Oce,VI,rA,hG,dG,bG,k8e=yt(Oo,"SizeOptions",266,Tt,H8n,mvn),han;m(281,23,{3:1,35:1,23:1,281:1},yK);var Hm,j8e,gG,E8e=yt(Oo,"TopdownNodeTypes",281,Tt,byn,vvn),dan;m(288,23,JF);var S8e,Nce,x8e,A8e,YI=yt(Oo,"TopdownSizeApproximator",288,Tt,p6n,pvn);m(969,288,JF,wIe),s.Sg=function(n){return ZJe(n)},yt(Oo,"TopdownSizeApproximator/1",969,YI,null,null),m(970,288,JF,WIe),s.Sg=function(n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn,Tn;for(t=u(je(n,(Xt(),Bm)),144),_e=(j0(),A=new mj,A),QO(_e,n),on=new wt,o=new st((!n.a&&(n.a=new we(Ft,n,10,11)),n.a));o.e!=o.i.gc();)r=u(ft(o),26),V=(S=new mj,S),Lz(V,_e),QO(V,r),Tn=ZJe(r),vw(V,k.Math.max(r.g,Tn.a),k.Math.max(r.f,Tn.b)),Ko(on.f,r,V);for(c=new st((!n.a&&(n.a=new we(Ft,n,10,11)),n.a));c.e!=c.i.gc();)for(r=u(ft(c),26),p=new st((!r.e&&(r.e=new Nn(pr,r,7,4)),r.e));p.e!=p.i.gc();)b=u(ft(p),85),be=u(bu(Xc(on.f,r)),26),fe=u(zn(on,K((!b.c&&(b.c=new Nn(mt,b,5,8)),b.c),0)),26),te=(y=new kv,y),Et((!te.b&&(te.b=new Nn(mt,te,4,7)),te.b),be),Et((!te.c&&(te.c=new Nn(mt,te,5,8)),te.c),fe),_z(te,Fi(be)),QO(te,b);D=u(GT(t.f),214);try{D.kf(_e,new b0),Wfe(t.f,D)}catch(In){throw In=sr(In),X(In,101)?(O=In,R(O)):R(In)}return ba(_e,Pm)||ba(_e,Lm)||sZ(_e),h=ne(re(je(_e,Pm))),f=ne(re(je(_e,Lm))),l=h/f,i=ne(re(je(_e,zm)))*k.Math.sqrt((!_e.a&&(_e.a=new we(Ft,_e,10,11)),_e.a).i),cn=u(je(_e,s1),104),q=cn.b+cn.c+1,B=cn.d+cn.a+1,new Se(k.Math.max(q,i),k.Math.max(B,i/l))},yt(Oo,"TopdownSizeApproximator/2",970,YI,null,null),m(971,288,JF,S_e),s.Sg=function(n){var t,i,r,c,o,l;return i=ne(re(je(n,(Xt(),zm)))),t=i/ne(re(je(n,F7))),r=H_n(n),o=u(je(n,s1),104),c=ne(re(Le(Qd))),Fi(n)&&(c=ne(re(je(Fi(n),Qd)))),l=A1(new Se(i,t),r),pi(l,new Se(-(o.b+o.c)-c,-(o.d+o.a)-c))},yt(Oo,"TopdownSizeApproximator/3",971,YI,null,null),m(972,288,JF,ZIe),s.Sg=function(n){var t,i,r,c,o,l,f,h,b,p;for(l=new st((!n.a&&(n.a=new we(Ft,n,10,11)),n.a));l.e!=l.i.gc();)o=u(ft(l),26),je(o,(Xt(),oG))!=null&&(!o.a&&(o.a=new we(Ft,o,10,11)),!!o.a)&&(!o.a&&(o.a=new we(Ft,o,10,11)),o.a).i>0?(i=u(je(o,oG),521),p=i.Sg(o),b=u(je(o,s1),104),vw(o,k.Math.max(o.g,p.a+b.b+b.c),k.Math.max(o.f,p.b+b.d+b.a))):(!o.a&&(o.a=new we(Ft,o,10,11)),o.a).i!=0&&vw(o,ne(re(je(o,zm))),ne(re(je(o,zm)))/ne(re(je(o,F7))));t=u(je(n,(Xt(),Bm)),144),h=u(GT(t.f),214);try{h.kf(n,new b0),Wfe(t.f,h)}catch(y){throw y=sr(y),X(y,101)?(f=y,R(f)):R(y)}return Ei(n,qy,c7),bPe(n),sZ(n),c=ne(re(je(n,Pm))),r=ne(re(je(n,Lm))),new Se(c,r)},yt(Oo,"TopdownSizeApproximator/4",972,YI,null,null);var ban;m(345,1,{852:1},s4),s.Tg=function(n,t){return hGe(this,n,t)},s.Ug=function(){RGe(this)},s.Vg=function(){return this.q},s.Wg=function(){return this.f?IR(this.f):null},s.Xg=function(){return IR(this.a)},s.Yg=function(){return this.p},s.Zg=function(){return!1},s.$g=function(){return this.n},s._g=function(){return this.p!=null&&!this.b},s.ah=function(n){var t;this.n&&(t=n,Te(this.f,t))},s.bh=function(n,t){var i,r;this.n&&n&&Iyn(this,(i=new dDe,r=FW(i,n),C$n(i),r),(RB(),Dce))},s.dh=function(n){var t;return this.b?null:(t=v8n(this,this.g),Vt(this.a,t),t.i=this,this.d=n,t)},s.eh=function(n){n>0&&!this.b&&Vhe(this,n)},s.b=!1,s.c=0,s.d=-1,s.e=null,s.f=null,s.g=-1,s.j=!1,s.k=!1,s.n=!1,s.o=0,s.q=0,s.r=0,v($u,"BasicProgressMonitor",345),m(706,214,ep,bL),s.kf=function(n,t){jKe(n,t)},v($u,"BoxLayoutProvider",706),m(965,1,Yt,eSe),s.Le=function(n,t){return CNn(this,u(n,26),u(t,26))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},s.a=!1,v($u,"BoxLayoutProvider/1",965),m(167,1,{167:1},gB,NOe),s.Ib=function(){return this.c?Jbe(this.c):Ja(this.b)},v($u,"BoxLayoutProvider/Group",167),m(326,23,{3:1,35:1,23:1,326:1},A$);var M8e,C8e,T8e,Ice,O8e=yt($u,"BoxLayoutProvider/PackingMode",326,Tt,v6n,Evn),gan;m(966,1,Yt,VM),s.Le=function(n,t){return R5n(u(n,167),u(t,167))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v($u,"BoxLayoutProvider/lambda$0$Type",966),m(967,1,Yt,zk),s.Le=function(n,t){return C5n(u(n,167),u(t,167))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v($u,"BoxLayoutProvider/lambda$1$Type",967),m(968,1,Yt,YM),s.Le=function(n,t){return T5n(u(n,167),u(t,167))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v($u,"BoxLayoutProvider/lambda$2$Type",968),m(1338,1,{829:1},gL),s.Lg=function(n,t){return e$(),!X(t,174)||DAe((X4(),u(n,174)),t)},v($u,"ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type",1338),m(1339,1,ct,nSe),s.Ad=function(n){Nkn(this.a,u(n,147))},v($u,"ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type",1339),m(1340,1,ct,QM),s.Ad=function(n){u(n,105),e$()},v($u,"ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type",1340),m(1344,1,ct,tSe),s.Ad=function(n){i7n(this.a,u(n,105))},v($u,"ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type",1344),m(1342,1,zt,CCe),s.Mb=function(n){return dkn(this.a,this.b,u(n,147))},v($u,"ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type",1342),m(1341,1,zt,TCe),s.Mb=function(n){return Mpn(this.a,this.b,u(n,829))},v($u,"ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type",1341),m(1343,1,ct,OCe),s.Ad=function(n){A3n(this.a,this.b,u(n,147))},v($u,"ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type",1343),m(930,1,{},wL),s.Kb=function(n){return xTe(n)},s.Fb=function(n){return this===n},v($u,"ElkUtil/lambda$0$Type",930),m(931,1,ct,NCe),s.Ad=function(n){ITn(this.a,this.b,u(n,85))},s.a=0,s.b=0,v($u,"ElkUtil/lambda$1$Type",931),m(932,1,ct,ICe),s.Ad=function(n){Cbn(this.a,this.b,u(n,170))},s.a=0,s.b=0,v($u,"ElkUtil/lambda$2$Type",932),m(933,1,ct,DCe),s.Ad=function(n){jwn(this.a,this.b,u(n,157))},s.a=0,s.b=0,v($u,"ElkUtil/lambda$3$Type",933),m(934,1,ct,iSe),s.Ad=function(n){Vvn(this.a,u(n,372))},v($u,"ElkUtil/lambda$4$Type",934),m(331,1,{35:1,331:1},ibn),s.Dd=function(n){return Xwn(this,u(n,242))},s.Fb=function(n){var t;return X(n,331)?(t=u(n,331),this.a==t.a):!1},s.Hb=function(){return lc(this.a)},s.Ib=function(){return this.a+" (exclusive)"},s.a=0,v($u,"ExclusiveBounds/ExclusiveLowerBound",331),m(1088,214,ep,ow),s.kf=function(n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q,V,te,be,fe,_e,on,cn;for(t.Tg("Fixed Layout",1),o=u(je(n,(Xt(),j9e)),222),y=0,S=0,V=new st((!n.a&&(n.a=new we(Ft,n,10,11)),n.a));V.e!=V.i.gc();){for(B=u(ft(V),26),cn=u(je(B,(BB(),Qx)),8),cn&&(Il(B,cn.a,cn.b),u(je(B,f8e),182).Gc((Vs(),Jm))&&(A=u(je(B,h8e),8),A.a>0&&A.b>0&&Yw(B,A.a,A.b,!0,!0))),y=k.Math.max(y,B.i+B.g),S=k.Math.max(S,B.j+B.f),b=new st((!B.n&&(B.n=new we(Eu,B,1,7)),B.n));b.e!=b.i.gc();)f=u(ft(b),157),cn=u(je(f,Qx),8),cn&&Il(f,cn.a,cn.b),y=k.Math.max(y,B.i+f.i+f.g),S=k.Math.max(S,B.j+f.j+f.f);for(fe=new st((!B.c&&(B.c=new we($s,B,9,9)),B.c));fe.e!=fe.i.gc();)for(be=u(ft(fe),125),cn=u(je(be,Qx),8),cn&&Il(be,cn.a,cn.b),_e=B.i+be.i,on=B.j+be.j,y=k.Math.max(y,_e+be.g),S=k.Math.max(S,on+be.f),h=new st((!be.n&&(be.n=new we(Eu,be,1,7)),be.n));h.e!=h.i.gc();)f=u(ft(h),157),cn=u(je(f,Qx),8),cn&&Il(f,cn.a,cn.b),y=k.Math.max(y,_e+f.i+f.g),S=k.Math.max(S,on+f.j+f.f);for(c=new Un(Yn(U0(B).a.Jc(),new ee));ht(c);)i=u(rt(c),85),p=_Ve(i),y=k.Math.max(y,p.a),S=k.Math.max(S,p.b);for(r=new Un(Yn(MW(B).a.Jc(),new ee));ht(r);)i=u(rt(r),85),Fi(dW(i))!=n&&(p=_Ve(i),y=k.Math.max(y,p.a),S=k.Math.max(S,p.b))}if(o==(z1(),q7))for(q=new st((!n.a&&(n.a=new we(Ft,n,10,11)),n.a));q.e!=q.i.gc();)for(B=u(ft(q),26),r=new Un(Yn(U0(B).a.Jc(),new ee));ht(r);)i=u(rt(r),85),l=C_n(i),l.b==0?Ei(i,Z3,null):Ei(i,Z3,l);Fe(ze(je(n,(BB(),a8e))))||(te=u(je(n,Qfn),104),D=y+te.b+te.c,O=S+te.d+te.a,Yw(n,D,O,!0,!0)),t.Ug()},v($u,"FixedLayoutProvider",1088),m(379,150,{3:1,414:1,379:1,105:1,150:1},z6,jRe),s.ag=function(n){var t,i,r,c,o,l,f,h,b;if(n)try{for(h=nm(n,";,;"),o=h,l=0,f=o.length;l>16&yr|t^r<<16},s.Jc=function(){return new rSe(this)},s.Ib=function(){return this.a==null&&this.b==null?"pair(null,null)":this.a==null?"pair(null,"+fu(this.b)+")":this.b==null?"pair("+fu(this.a)+",null)":"pair("+fu(this.a)+","+fu(this.b)+")"},v($u,"Pair",49),m(979,1,Fr,rSe),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return!this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)},s.Pb=function(){if(!this.c&&!this.b&&this.a.a!=null)return this.b=!0,this.a.a;if(!this.c&&this.a.b!=null)return this.c=!0,this.a.b;throw R(new hu)},s.Qb=function(){throw this.c&&this.a.b!=null?this.a.b=null:this.b&&this.a.a!=null&&(this.a.a=null),R(new is)},s.b=!1,s.c=!1,v($u,"Pair/1",979),m(1078,214,ep,WM),s.kf=function(n,t){var i,r,c,o,l;if(t.Tg("Random Layout",1),(!n.a&&(n.a=new we(Ft,n,10,11)),n.a).i==0){t.Ug();return}o=u(je(n,(bde(),san)),15),o&&o.a!=0?c=new VR(o.a):c=new yQ,i=QC(re(je(n,uan))),l=QC(re(je(n,lan))),r=u(je(n,oan),104),V$n(n,c,i,l,r),t.Ug()},v($u,"RandomLayoutProvider",1078),m(240,1,{240:1},eV),s.Fb=function(n){return Ku(this.a,u(n,240).a)&&Ku(this.b,u(n,240).b)&&Ku(this.c,u(n,240).c)},s.Hb=function(){return zB(F(z(Mr,1),On,1,5,[this.a,this.b,this.c]))},s.Ib=function(){return"("+this.a+To+this.b+To+this.c+")"},v($u,"Triple",240);var van;m(550,1,{}),s.Jf=function(){return new Se(this.f.i,this.f.j)},s.mf=function(n){return k_e(n,(Xt(),Ps))?je(this.f,yan):je(this.f,n)},s.Kf=function(){return new Se(this.f.g,this.f.f)},s.Lf=function(){return this.g},s.nf=function(n){return ba(this.f,n)},s.Mf=function(n){Os(this.f,n.a),Ns(this.f,n.b)},s.Nf=function(n){Pw(this.f,n.a),Lw(this.f,n.b)},s.Of=function(n){this.g=n},s.g=0;var yan;v(_S,"ElkGraphAdapters/AbstractElkGraphElementAdapter",550),m(552,1,{837:1},NP),s.Pf=function(){var n,t;if(!this.b)for(this.b=JR(NV(this.a).i),t=new st(NV(this.a));t.e!=t.i.gc();)n=u(ft(t),157),Te(this.b,new MX(n));return this.b},s.b=null,v(_S,"ElkGraphAdapters/ElkEdgeAdapter",552),m(260,550,{},v0),s.Qf=function(){return vHe(this)},s.a=null,v(_S,"ElkGraphAdapters/ElkGraphAdapter",260),m(630,550,{187:1},MX),v(_S,"ElkGraphAdapters/ElkLabelAdapter",630),m(551,550,{685:1},q$),s.Pf=function(){return txn(this)},s.Tf=function(){var n;return n=u(je(this.f,(Xt(),z7)),140),!n&&(n=new pj),n},s.Vf=function(){return ixn(this)},s.Xf=function(n){var t;t=new QK(n),Ei(this.f,(Xt(),z7),t)},s.Yf=function(n){Ei(this.f,(Xt(),s1),new Yle(n))},s.Rf=function(){return this.d},s.Sf=function(){var n,t;if(!this.a)for(this.a=new Oe,t=new Un(Yn(MW(u(this.f,26)).a.Jc(),new ee));ht(t);)n=u(rt(t),85),Te(this.a,new NP(n));return this.a},s.Uf=function(){var n,t;if(!this.c)for(this.c=new Oe,t=new Un(Yn(U0(u(this.f,26)).a.Jc(),new ee));ht(t);)n=u(rt(t),85),Te(this.c,new NP(n));return this.c},s.Wf=function(){return OR(u(this.f,26)).i!=0||Fe(ze(u(this.f,26).mf((Xt(),LI))))},s.Zf=function(){e8n(this,(Rb(),van))},s.a=null,s.b=null,s.c=null,s.d=null,s.e=null,v(_S,"ElkGraphAdapters/ElkNodeAdapter",551),m(1249,550,{836:1},cSe),s.Pf=function(){return fxn(this)},s.Sf=function(){var n,t;if(!this.a)for(this.a=Jh(u(this.f,125).gh().i),t=new st(u(this.f,125).gh());t.e!=t.i.gc();)n=u(ft(t),85),Te(this.a,new NP(n));return this.a},s.Uf=function(){var n,t;if(!this.c)for(this.c=Jh(u(this.f,125).hh().i),t=new st(u(this.f,125).hh());t.e!=t.i.gc();)n=u(ft(t),85),Te(this.c,new NP(n));return this.c},s.$f=function(){return u(u(this.f,125).mf((Xt(),t5)),64)},s._f=function(){var n,t,i,r,c,o,l,f;for(r=_a(u(this.f,125)),i=new st(u(this.f,125).hh());i.e!=i.i.gc();)for(n=u(ft(i),85),f=new st((!n.c&&(n.c=new Nn(mt,n,5,8)),n.c));f.e!=f.i.gc();){if(l=u(ft(f),84),P2(iu(l),r))return!0;if(iu(l)==r&&Fe(ze(je(n,(Xt(),wce)))))return!0}for(t=new st(u(this.f,125).gh());t.e!=t.i.gc();)for(n=u(ft(t),85),o=new st((!n.b&&(n.b=new Nn(mt,n,4,7)),n.b));o.e!=o.i.gc();)if(c=u(ft(o),84),P2(iu(c),r))return!0;return!1},s.a=null,s.b=null,s.c=null,v(_S,"ElkGraphAdapters/ElkPortAdapter",1249),m(1250,1,Yt,mL),s.Le=function(n,t){return yDn(u(n,125),u(t,125))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(_S,"ElkGraphAdapters/PortComparator",1250);var vb=Gi(ql,"EObject"),K7=Gi(x3,JWe),yl=Gi(x3,HWe),QI=Gi(x3,GWe),WI=Gi(x3,"ElkShape"),mt=Gi(x3,qWe),pr=Gi(x3,P2e),$i=Gi(x3,UWe),ZI=Gi(ql,XWe),cA=Gi(ql,"EFactory"),kan,_ce=Gi(ql,KWe),Aa=Gi(ql,"EPackage"),Pr,jan,Ean,_8e,wG,San,L8e,P8e,$8e,h1,xan,Aan,Eu=Gi(x3,$2e),Ft=Gi(x3,R2e),$s=Gi(x3,B2e);m(93,1,VWe),s.qh=function(){return this.rh(),null},s.rh=function(){return null},s.sh=function(){return this.rh(),!1},s.th=function(){return!1},s.uh=function(n){hi(this,n)},v(ky,"BasicNotifierImpl",93),m(100,93,ZWe),s.Vh=function(){return Fs(this)},s.vh=function(n,t){return n},s.wh=function(){throw R(new _t)},s.xh=function(n){var t;return t=Oc(u(Mn(this.Ah(),this.Ch()),19)),this.Mh().Qh(this,t.n,t.f,n)},s.yh=function(n,t){throw R(new _t)},s.zh=function(n,t,i){return hl(this,n,t,i)},s.Ah=function(){var n;return this.wh()&&(n=this.wh().Lk(),n)?n:this.fi()},s.Bh=function(){return xW(this)},s.Ch=function(){throw R(new _t)},s.Dh=function(){var n,t;return t=this.Xh().Mk(),!t&&this.wh().Rk(t=(Ij(),n=dae(kh(this.Ah())),n==null?Jce:new ST(this,n))),t},s.Eh=function(n,t){return n},s.Fh=function(n){var t;return t=n.nk(),t?n.Jj():Ji(this.Ah(),n)},s.Gh=function(){var n;return n=this.wh(),n?n.Ok():null},s.Hh=function(){return this.wh()?this.wh().Lk():null},s.Ih=function(n,t,i){return sz(this,n,t,i)},s.Jh=function(n){return H9(this,n)},s.Kh=function(n,t){return aY(this,n,t)},s.Lh=function(){var n;return n=this.wh(),!!n&&n.Pk()},s.Mh=function(){throw R(new _t)},s.Nh=function(){return iz(this)},s.Oh=function(n,t,i,r){return Z4(this,n,t,r)},s.Ph=function(n,t,i){var r;return r=u(Mn(this.Ah(),t),69),r.uk().xk(this,this.ei(),t-this.gi(),n,i)},s.Qh=function(n,t,i,r){return LR(this,n,t,r)},s.Rh=function(n,t,i){var r;return r=u(Mn(this.Ah(),t),69),r.uk().yk(this,this.ei(),t-this.gi(),n,i)},s.Sh=function(){return!!this.wh()&&!!this.wh().Nk()},s.Th=function(n){return LQ(this,n)},s.Uh=function(n){return P_e(this,n)},s.Wh=function(n){return pVe(this,n)},s.Xh=function(){throw R(new _t)},s.Yh=function(){return this.wh()?this.wh().Nk():null},s.Zh=function(){return iz(this)},s.$h=function(n,t){yW(this,n,t)},s._h=function(n){this.Xh().Qk(n)},s.ai=function(n){this.Xh().Tk(n)},s.bi=function(n){this.Xh().Sk(n)},s.ci=function(n,t){var i,r,c,o;return o=this.Gh(),o&&n&&(t=vc(o.Cl(),this,t),o.Gl(this)),r=this.Mh(),r&&((RW(this,this.Mh(),this.Ch()).Bb&Ec)!=0?(c=r.Nh(),c&&(n?!o&&c.Gl(this):c.Fl(this))):(t=(i=this.Ch(),i>=0?this.xh(t):this.Mh().Qh(this,-1-i,null,t)),t=this.zh(null,-1,t))),this.ai(n),t},s.di=function(n){var t,i,r,c,o,l,f,h;if(i=this.Ah(),o=Ji(i,n),t=this.gi(),o>=t)return u(n,69).uk().Bk(this,this.ei(),o-t);if(o<=-1)if(l=w3((ls(),nc),i,n),l){if(Tc(),u(l,69).vk()||(l=$4(Vc(nc,l))),c=(r=this.Fh(l),u(r>=0?this.Ih(r,!0,!0):Xw(this,l,!0),163)),h=l.Gk(),h>1||h==-1)return u(u(c,219).Ql(n,!1),77)}else throw R(new qn(nb+n.ve()+pne));else if(n.Hk())return r=this.Fh(n),u(r>=0?this.Ih(r,!1,!0):Xw(this,n,!1),77);return f=new VCe(this,n),f},s.ei=function(){return khe(this)},s.fi=function(){return(C0(),Bn).S},s.gi=function(){return dt(this.fi())},s.hi=function(n){pW(this,n)},s.Ib=function(){return Ff(this)},v(Jn,"BasicEObjectImpl",100);var Man;m(117,100,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1}),s.ii=function(n){var t;return t=jhe(this),t[n]},s.ji=function(n,t){var i;i=jhe(this),ir(i,n,t)},s.ki=function(n){var t;t=jhe(this),ir(t,n,null)},s.qh=function(){return u(Xn(this,4),129)},s.rh=function(){throw R(new _t)},s.sh=function(){return(this.Db&4)!=0},s.wh=function(){throw R(new _t)},s.li=function(n){Q4(this,2,n)},s.yh=function(n,t){this.Db=t<<16|this.Db&255,this.li(n)},s.Ah=function(){return Go(this)},s.Ch=function(){return this.Db>>16},s.Dh=function(){var n,t;return Ij(),t=dae(kh((n=u(Xn(this,16),29),n||this.fi()))),t==null?Jce:new ST(this,t)},s.th=function(){return(this.Db&1)==0},s.Gh=function(){return u(Xn(this,128),1996)},s.Hh=function(){return u(Xn(this,16),29)},s.Lh=function(){return(this.Db&32)!=0},s.Mh=function(){return u(Xn(this,2),52)},s.Sh=function(){return(this.Db&64)!=0},s.Xh=function(){throw R(new _t)},s.Yh=function(){return u(Xn(this,64),290)},s._h=function(n){Q4(this,16,n)},s.ai=function(n){Q4(this,128,n)},s.bi=function(n){Q4(this,64,n)},s.ei=function(){return Lo(this)},s.Db=0,v(Jn,"MinimalEObjectImpl",117),m(118,117,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.li=function(n){this.Cb=n},s.Mh=function(){return this.Cb},v(Jn,"MinimalEObjectImpl/Container",118),m(2045,118,{109:1,343:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return $de(this,n,t,i)},s.Rh=function(n,t,i){return A0e(this,n,t,i)},s.Th=function(n){return Oae(this,n)},s.$h=function(n,t){E1e(this,n,t)},s.fi=function(){return Gu(),Aan},s.hi=function(n){f1e(this,n)},s.lf=function(){return BJe(this)},s.fh=function(){return!this.o&&(this.o=new os((Gu(),h1),Zd,this,0)),this.o},s.mf=function(n){return je(this,n)},s.nf=function(n){return ba(this,n)},s.of=function(n,t){return Ei(this,n,t)},v(wg,"EMapPropertyHolderImpl",2045),m(559,118,{109:1,372:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Jk),s.Ih=function(n,t,i){switch(n){case 0:return this.a;case 1:return this.b}return sz(this,n,t,i)},s.Th=function(n){switch(n){case 0:return this.a!=0;case 1:return this.b!=0}return LQ(this,n)},s.$h=function(n,t){switch(n){case 0:wB(this,ne(re(t)));return;case 1:pB(this,ne(re(t)));return}yW(this,n,t)},s.fi=function(){return Gu(),jan},s.hi=function(n){switch(n){case 0:wB(this,0);return;case 1:pB(this,0);return}pW(this,n)},s.Ib=function(){var n;return(this.Db&64)!=0?Ff(this):(n=new cf(Ff(this)),n.a+=" (x: ",Tv(n,this.a),n.a+=", y: ",Tv(n,this.b),n.a+=")",n.a)},s.a=0,s.b=0,v(wg,"ElkBendPointImpl",559),m(727,2045,{109:1,343:1,174:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return J1e(this,n,t,i)},s.Ph=function(n,t,i){return lW(this,n,t,i)},s.Rh=function(n,t,i){return KY(this,n,t,i)},s.Th=function(n){return r1e(this,n)},s.$h=function(n,t){t0e(this,n,t)},s.fi=function(){return Gu(),San},s.hi=function(n){R1e(this,n)},s.ih=function(){return this.k},s.jh=function(){return NV(this)},s.Ib=function(){return vQ(this)},s.k=null,v(wg,"ElkGraphElementImpl",727),m(728,727,{109:1,343:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return nde(this,n,t,i)},s.Th=function(n){return sde(this,n)},s.$h=function(n,t){i0e(this,n,t)},s.fi=function(){return Gu(),xan},s.hi=function(n){dde(this,n)},s.kh=function(){return this.f},s.lh=function(){return this.g},s.mh=function(){return this.i},s.nh=function(){return this.j},s.oh=function(n,t){vw(this,n,t)},s.ph=function(n,t){Il(this,n,t)},s.Ib=function(){return gW(this)},s.f=0,s.g=0,s.i=0,s.j=0,v(wg,"ElkShapeImpl",728),m(729,728,{109:1,343:1,84:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),s.Ih=function(n,t,i){return Nde(this,n,t,i)},s.Ph=function(n,t,i){return Yde(this,n,t,i)},s.Rh=function(n,t,i){return Qde(this,n,t,i)},s.Th=function(n){return v1e(this,n)},s.$h=function(n,t){fbe(this,n,t)},s.fi=function(){return Gu(),Ean},s.hi=function(n){Ade(this,n)},s.gh=function(){return!this.d&&(this.d=new Nn(pr,this,8,5)),this.d},s.hh=function(){return!this.e&&(this.e=new Nn(pr,this,7,4)),this.e},v(wg,"ElkConnectableShapeImpl",729),m(271,727,{109:1,343:1,85:1,174:1,271:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},kv),s.xh=function(n){return Ude(this,n)},s.Ih=function(n,t,i){switch(n){case 3:return T2(this);case 4:return!this.b&&(this.b=new Nn(mt,this,4,7)),this.b;case 5:return!this.c&&(this.c=new Nn(mt,this,5,8)),this.c;case 6:return!this.a&&(this.a=new we($i,this,6,6)),this.a;case 7:return $n(),!this.b&&(this.b=new Nn(mt,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new Nn(mt,this,5,8)),this.c.i<=1));case 8:return $n(),!!eS(this);case 9:return $n(),!!Uw(this);case 10:return $n(),!this.b&&(this.b=new Nn(mt,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new Nn(mt,this,5,8)),this.c.i!=0)}return J1e(this,n,t,i)},s.Ph=function(n,t,i){var r;switch(t){case 3:return this.Cb&&(i=(r=this.Db>>16,r>=0?Ude(this,i):this.Cb.Qh(this,-1-r,null,i))),Cle(this,u(n,26),i);case 4:return!this.b&&(this.b=new Nn(mt,this,4,7)),Co(this.b,n,i);case 5:return!this.c&&(this.c=new Nn(mt,this,5,8)),Co(this.c,n,i);case 6:return!this.a&&(this.a=new we($i,this,6,6)),Co(this.a,n,i)}return lW(this,n,t,i)},s.Rh=function(n,t,i){switch(t){case 3:return Cle(this,null,i);case 4:return!this.b&&(this.b=new Nn(mt,this,4,7)),vc(this.b,n,i);case 5:return!this.c&&(this.c=new Nn(mt,this,5,8)),vc(this.c,n,i);case 6:return!this.a&&(this.a=new we($i,this,6,6)),vc(this.a,n,i)}return KY(this,n,t,i)},s.Th=function(n){switch(n){case 3:return!!T2(this);case 4:return!!this.b&&this.b.i!=0;case 5:return!!this.c&&this.c.i!=0;case 6:return!!this.a&&this.a.i!=0;case 7:return!this.b&&(this.b=new Nn(mt,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new Nn(mt,this,5,8)),this.c.i<=1));case 8:return eS(this);case 9:return Uw(this);case 10:return!this.b&&(this.b=new Nn(mt,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new Nn(mt,this,5,8)),this.c.i!=0)}return r1e(this,n)},s.$h=function(n,t){switch(n){case 3:_z(this,u(t,26));return;case 4:!this.b&&(this.b=new Nn(mt,this,4,7)),kt(this.b),!this.b&&(this.b=new Nn(mt,this,4,7)),nr(this.b,u(t,18));return;case 5:!this.c&&(this.c=new Nn(mt,this,5,8)),kt(this.c),!this.c&&(this.c=new Nn(mt,this,5,8)),nr(this.c,u(t,18));return;case 6:!this.a&&(this.a=new we($i,this,6,6)),kt(this.a),!this.a&&(this.a=new we($i,this,6,6)),nr(this.a,u(t,18));return}t0e(this,n,t)},s.fi=function(){return Gu(),_8e},s.hi=function(n){switch(n){case 3:_z(this,null);return;case 4:!this.b&&(this.b=new Nn(mt,this,4,7)),kt(this.b);return;case 5:!this.c&&(this.c=new Nn(mt,this,5,8)),kt(this.c);return;case 6:!this.a&&(this.a=new we($i,this,6,6)),kt(this.a);return}R1e(this,n)},s.Ib=function(){return RKe(this)},v(wg,"ElkEdgeImpl",271),m(443,2045,{109:1,343:1,170:1,443:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},yo),s.xh=function(n){return Jde(this,n)},s.Ih=function(n,t,i){switch(n){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return!this.a&&(this.a=new mr(yl,this,5)),this.a;case 6:return L_e(this);case 7:return t?zQ(this):this.i;case 8:return t?BQ(this):this.f;case 9:return!this.g&&(this.g=new Nn($i,this,9,10)),this.g;case 10:return!this.e&&(this.e=new Nn($i,this,10,9)),this.e;case 11:return this.d}return $de(this,n,t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 6:return this.Cb&&(i=(c=this.Db>>16,c>=0?Jde(this,i):this.Cb.Qh(this,-1-c,null,i))),Tle(this,u(n,85),i);case 9:return!this.g&&(this.g=new Nn($i,this,9,10)),Co(this.g,n,i);case 10:return!this.e&&(this.e=new Nn($i,this,10,9)),Co(this.e,n,i)}return o=u(Mn((r=u(Xn(this,16),29),r||(Gu(),wG)),t),69),o.uk().xk(this,Lo(this),t-dt((Gu(),wG)),n,i)},s.Rh=function(n,t,i){switch(t){case 5:return!this.a&&(this.a=new mr(yl,this,5)),vc(this.a,n,i);case 6:return Tle(this,null,i);case 9:return!this.g&&(this.g=new Nn($i,this,9,10)),vc(this.g,n,i);case 10:return!this.e&&(this.e=new Nn($i,this,10,9)),vc(this.e,n,i)}return A0e(this,n,t,i)},s.Th=function(n){switch(n){case 1:return this.j!=0;case 2:return this.k!=0;case 3:return this.b!=0;case 4:return this.c!=0;case 5:return!!this.a&&this.a.i!=0;case 6:return!!L_e(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&this.g.i!=0;case 10:return!!this.e&&this.e.i!=0;case 11:return this.d!=null}return Oae(this,n)},s.$h=function(n,t){switch(n){case 1:e3(this,ne(re(t)));return;case 2:n3(this,ne(re(t)));return;case 3:Wv(this,ne(re(t)));return;case 4:Zv(this,ne(re(t)));return;case 5:!this.a&&(this.a=new mr(yl,this,5)),kt(this.a),!this.a&&(this.a=new mr(yl,this,5)),nr(this.a,u(t,18));return;case 6:$Ue(this,u(t,85));return;case 7:SB(this,u(t,84));return;case 8:EB(this,u(t,84));return;case 9:!this.g&&(this.g=new Nn($i,this,9,10)),kt(this.g),!this.g&&(this.g=new Nn($i,this,9,10)),nr(this.g,u(t,18));return;case 10:!this.e&&(this.e=new Nn($i,this,10,9)),kt(this.e),!this.e&&(this.e=new Nn($i,this,10,9)),nr(this.e,u(t,18));return;case 11:Xhe(this,Pt(t));return}E1e(this,n,t)},s.fi=function(){return Gu(),wG},s.hi=function(n){switch(n){case 1:e3(this,0);return;case 2:n3(this,0);return;case 3:Wv(this,0);return;case 4:Zv(this,0);return;case 5:!this.a&&(this.a=new mr(yl,this,5)),kt(this.a);return;case 6:$Ue(this,null);return;case 7:SB(this,null);return;case 8:EB(this,null);return;case 9:!this.g&&(this.g=new Nn($i,this,9,10)),kt(this.g);return;case 10:!this.e&&(this.e=new Nn($i,this,10,9)),kt(this.e);return;case 11:Xhe(this,null);return}f1e(this,n)},s.Ib=function(){return Kqe(this)},s.b=0,s.c=0,s.d=null,s.j=0,s.k=0,v(wg,"ElkEdgeSectionImpl",443),m(161,118,{109:1,94:1,93:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),s.Ih=function(n,t,i){var r;return n==0?(!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab):Pl(this,n-dt(this.fi()),Mn((r=u(Xn(this,16),29),r||this.fi()),n),t,i)},s.Ph=function(n,t,i){var r,c;return t==0?(!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i)):(c=u(Mn((r=u(Xn(this,16),29),r||this.fi()),t),69),c.uk().xk(this,Lo(this),t-dt(this.fi()),n,i))},s.Rh=function(n,t,i){var r,c;return t==0?(!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i)):(c=u(Mn((r=u(Xn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i))},s.Th=function(n){var t;return n==0?!!this.Ab&&this.Ab.i!=0:Ll(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.Wh=function(n){return Cge(this,n)},s.$h=function(n,t){var i;if(n===0){!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return}Jl(this,n-dt(this.fi()),Mn((i=u(Xn(this,16),29),i||this.fi()),n),t)},s.ai=function(n){Q4(this,128,n)},s.fi=function(){return jn(),qan},s.hi=function(n){var t;if(n===0){!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return}Fl(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.mi=function(){this.Bb|=1},s.ni=function(n){return oS(this,n)},s.Bb=0,v(Jn,"EModelElementImpl",161),m(710,161,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},IC),s.oi=function(n,t){return fVe(this,n,t)},s.pi=function(n){var t,i,r,c,o;if(this.a!=ol(n)||(n.Bb&256)!=0)throw R(new qn(vne+n.zb+up));for(r=tu(n);Vu(r.a).i!=0;){if(i=u(oN(r,0,(t=u(K(Vu(r.a),0),87),o=t.c,X(o,88)?u(o,29):(jn(),jf))),29),Gw(i))return c=ol(i).ti().pi(i),u(c,52)._h(n),c;r=tu(i)}return(n.D!=null?n.D:n.B)=="java.util.Map$Entry"?new gIe(n):new bfe(n)},s.qi=function(n,t){return Qw(this,n,t)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.a}return Pl(this,n-dt((jn(),jb)),Mn((r=u(Xn(this,16),29),r||jb),n),t,i)},s.Ph=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 1:return this.a&&(i=u(this.a,52).Qh(this,4,Aa,i)),P1e(this,u(n,241),i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),jb)),t),69),c.uk().xk(this,Lo(this),t-dt((jn(),jb)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 1:return P1e(this,null,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),jb)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),jb)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return!!this.a}return Ll(this,n-dt((jn(),jb)),Mn((t=u(Xn(this,16),29),t||jb),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:SGe(this,u(t,241));return}Jl(this,n-dt((jn(),jb)),Mn((i=u(Xn(this,16),29),i||jb),n),t)},s.fi=function(){return jn(),jb},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:SGe(this,null);return}Fl(this,n-dt((jn(),jb)),Mn((t=u(Xn(this,16),29),t||jb),n))};var uA,R8e,Can;v(Jn,"EFactoryImpl",710),m(1018,710,{109:1,2075:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},hU),s.oi=function(n,t){switch(n.fk()){case 12:return u(t,147).Og();case 13:return fu(t);default:throw R(new qn(u7+n.ve()+up))}},s.pi=function(n){var t,i,r,c,o,l,f,h;switch(n.G==-1&&(n.G=(t=ol(n),t?$d(t.si(),n):-1)),n.G){case 4:return o=new ZM,o;case 6:return l=new mj,l;case 7:return f=new voe,f;case 8:return r=new kv,r;case 9:return i=new Jk,i;case 10:return c=new yo,c;case 11:return h=new F6,h;default:throw R(new qn(vne+n.zb+up))}},s.qi=function(n,t){switch(n.fk()){case 13:case 12:return null;default:throw R(new qn(u7+n.ve()+up))}},v(wg,"ElkGraphFactoryImpl",1018),m(439,161,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),s.Dh=function(){var n,t;return t=(n=u(Xn(this,16),29),dae(kh(n||this.fi()))),t==null?(Ij(),Ij(),Jce):new POe(this,t)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.ve()}return Pl(this,n-dt(this.fi()),Mn((r=u(Xn(this,16),29),r||this.fi()),n),t,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null}return Ll(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:this.ri(Pt(t));return}Jl(this,n-dt(this.fi()),Mn((i=u(Xn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return jn(),Uan},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:this.ri(null);return}Fl(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.ve=function(){return this.zb},s.ri=function(n){Mo(this,n)},s.Ib=function(){return LE(this)},s.zb=null,v(Jn,"ENamedElementImpl",439),m(184,439,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},u_e),s.xh=function(n){return LHe(this,n)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return!this.rb&&(this.rb=new x2(this,Ma,this)),this.rb;case 6:return!this.vb&&(this.vb=new x4(Aa,this,6,7)),this.vb;case 7:return t?this.Db>>16==7?u(this.Cb,241):null:J_e(this)}return Pl(this,n-dt((jn(),i0)),Mn((r=u(Xn(this,16),29),r||i0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 4:return this.sb&&(i=u(this.sb,52).Qh(this,1,cA,i)),B1e(this,u(n,469),i);case 5:return!this.rb&&(this.rb=new x2(this,Ma,this)),Co(this.rb,n,i);case 6:return!this.vb&&(this.vb=new x4(Aa,this,6,7)),Co(this.vb,n,i);case 7:return this.Cb&&(i=(c=this.Db>>16,c>=0?LHe(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,7,i)}return o=u(Mn((r=u(Xn(this,16),29),r||(jn(),i0)),t),69),o.uk().xk(this,Lo(this),t-dt((jn(),i0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 4:return B1e(this,null,i);case 5:return!this.rb&&(this.rb=new x2(this,Ma,this)),vc(this.rb,n,i);case 6:return!this.vb&&(this.vb=new x4(Aa,this,6,7)),vc(this.vb,n,i);case 7:return hl(this,null,7,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),i0)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),i0)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.yb!=null;case 3:return this.xb!=null;case 4:return!!this.sb;case 5:return!!this.rb&&this.rb.i!=0;case 6:return!!this.vb&&this.vb.i!=0;case 7:return!!J_e(this)}return Ll(this,n-dt((jn(),i0)),Mn((t=u(Xn(this,16),29),t||i0),n))},s.Wh=function(n){var t;return t=RNn(this,n),t||Cge(this,n)},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:Mo(this,Pt(t));return;case 2:OB(this,Pt(t));return;case 3:TB(this,Pt(t));return;case 4:bW(this,u(t,469));return;case 5:!this.rb&&(this.rb=new x2(this,Ma,this)),kt(this.rb),!this.rb&&(this.rb=new x2(this,Ma,this)),nr(this.rb,u(t,18));return;case 6:!this.vb&&(this.vb=new x4(Aa,this,6,7)),kt(this.vb),!this.vb&&(this.vb=new x4(Aa,this,6,7)),nr(this.vb,u(t,18));return}Jl(this,n-dt((jn(),i0)),Mn((i=u(Xn(this,16),29),i||i0),n),t)},s.bi=function(n){var t,i;if(n&&this.rb)for(i=new st(this.rb);i.e!=i.i.gc();)t=ft(i),X(t,360)&&(u(t,360).w=null);Q4(this,64,n)},s.fi=function(){return jn(),i0},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:Mo(this,null);return;case 2:OB(this,null);return;case 3:TB(this,null);return;case 4:bW(this,null);return;case 5:!this.rb&&(this.rb=new x2(this,Ma,this)),kt(this.rb);return;case 6:!this.vb&&(this.vb=new x4(Aa,this,6,7)),kt(this.vb);return}Fl(this,n-dt((jn(),i0)),Mn((t=u(Xn(this,16),29),t||i0),n))},s.mi=function(){ZQ(this)},s.si=function(){return!this.rb&&(this.rb=new x2(this,Ma,this)),this.rb},s.ti=function(){return this.sb},s.ui=function(){return this.ub},s.vi=function(){return this.xb},s.wi=function(){return this.yb},s.xi=function(n){this.ub=n},s.Ib=function(){var n;return(this.Db&64)!=0?LE(this):(n=new cf(LE(this)),n.a+=" (nsURI: ",Bc(n,this.yb),n.a+=", nsPrefix: ",Bc(n,this.xb),n.a+=")",n.a)},s.xb=null,s.yb=null,v(Jn,"EPackageImpl",184),m(556,184,{109:1,2077:1,556:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},tUe),s.q=!1,s.r=!1;var Tan=!1;v(wg,"ElkGraphPackageImpl",556),m(362,728,{109:1,343:1,174:1,157:1,276:1,362:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},ZM),s.xh=function(n){return Hde(this,n)},s.Ih=function(n,t,i){switch(n){case 7:return vae(this);case 8:return this.a}return nde(this,n,t,i)},s.Ph=function(n,t,i){var r;return t===7?(this.Cb&&(i=(r=this.Db>>16,r>=0?Hde(this,i):this.Cb.Qh(this,-1-r,null,i))),Mfe(this,u(n,174),i)):lW(this,n,t,i)},s.Rh=function(n,t,i){return t==7?Mfe(this,null,i):KY(this,n,t,i)},s.Th=function(n){switch(n){case 7:return!!vae(this);case 8:return!gn("",this.a)}return sde(this,n)},s.$h=function(n,t){switch(n){case 7:Abe(this,u(t,174));return;case 8:Ghe(this,Pt(t));return}i0e(this,n,t)},s.fi=function(){return Gu(),L8e},s.hi=function(n){switch(n){case 7:Abe(this,null);return;case 8:Ghe(this,"");return}dde(this,n)},s.Ib=function(){return HGe(this)},s.a="",v(wg,"ElkLabelImpl",362),m(206,729,{109:1,343:1,84:1,174:1,26:1,276:1,206:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},mj),s.xh=function(n){return Xde(this,n)},s.Ih=function(n,t,i){switch(n){case 9:return!this.c&&(this.c=new we($s,this,9,9)),this.c;case 10:return!this.a&&(this.a=new we(Ft,this,10,11)),this.a;case 11:return Fi(this);case 12:return!this.b&&(this.b=new we(pr,this,12,3)),this.b;case 13:return $n(),!this.a&&(this.a=new we(Ft,this,10,11)),this.a.i>0}return Nde(this,n,t,i)},s.Ph=function(n,t,i){var r;switch(t){case 9:return!this.c&&(this.c=new we($s,this,9,9)),Co(this.c,n,i);case 10:return!this.a&&(this.a=new we(Ft,this,10,11)),Co(this.a,n,i);case 11:return this.Cb&&(i=(r=this.Db>>16,r>=0?Xde(this,i):this.Cb.Qh(this,-1-r,null,i))),Gle(this,u(n,26),i);case 12:return!this.b&&(this.b=new we(pr,this,12,3)),Co(this.b,n,i)}return Yde(this,n,t,i)},s.Rh=function(n,t,i){switch(t){case 9:return!this.c&&(this.c=new we($s,this,9,9)),vc(this.c,n,i);case 10:return!this.a&&(this.a=new we(Ft,this,10,11)),vc(this.a,n,i);case 11:return Gle(this,null,i);case 12:return!this.b&&(this.b=new we(pr,this,12,3)),vc(this.b,n,i)}return Qde(this,n,t,i)},s.Th=function(n){switch(n){case 9:return!!this.c&&this.c.i!=0;case 10:return!!this.a&&this.a.i!=0;case 11:return!!Fi(this);case 12:return!!this.b&&this.b.i!=0;case 13:return!this.a&&(this.a=new we(Ft,this,10,11)),this.a.i>0}return v1e(this,n)},s.$h=function(n,t){switch(n){case 9:!this.c&&(this.c=new we($s,this,9,9)),kt(this.c),!this.c&&(this.c=new we($s,this,9,9)),nr(this.c,u(t,18));return;case 10:!this.a&&(this.a=new we(Ft,this,10,11)),kt(this.a),!this.a&&(this.a=new we(Ft,this,10,11)),nr(this.a,u(t,18));return;case 11:Lz(this,u(t,26));return;case 12:!this.b&&(this.b=new we(pr,this,12,3)),kt(this.b),!this.b&&(this.b=new we(pr,this,12,3)),nr(this.b,u(t,18));return}fbe(this,n,t)},s.fi=function(){return Gu(),P8e},s.hi=function(n){switch(n){case 9:!this.c&&(this.c=new we($s,this,9,9)),kt(this.c);return;case 10:!this.a&&(this.a=new we(Ft,this,10,11)),kt(this.a);return;case 11:Lz(this,null);return;case 12:!this.b&&(this.b=new we(pr,this,12,3)),kt(this.b);return}Ade(this,n)},s.Ib=function(){return Jbe(this)},v(wg,"ElkNodeImpl",206),m(193,729,{109:1,343:1,84:1,174:1,125:1,276:1,193:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},voe),s.xh=function(n){return Gde(this,n)},s.Ih=function(n,t,i){return n==9?_a(this):Nde(this,n,t,i)},s.Ph=function(n,t,i){var r;return t===9?(this.Cb&&(i=(r=this.Db>>16,r>=0?Gde(this,i):this.Cb.Qh(this,-1-r,null,i))),Ole(this,u(n,26),i)):Yde(this,n,t,i)},s.Rh=function(n,t,i){return t==9?Ole(this,null,i):Qde(this,n,t,i)},s.Th=function(n){return n==9?!!_a(this):v1e(this,n)},s.$h=function(n,t){if(n===9){kbe(this,u(t,26));return}fbe(this,n,t)},s.fi=function(){return Gu(),$8e},s.hi=function(n){if(n===9){kbe(this,null);return}Ade(this,n)},s.Ib=function(){return LXe(this)},v(wg,"ElkPortImpl",193);var Oan=Gi(yc,"BasicEMap/Entry");m(1091,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,117:1,118:1},F6),s.Fb=function(n){return this===n},s.jd=function(){return this.b},s.Hb=function(){return jw(this)},s.Ai=function(n){zhe(this,u(n,147))},s.Ih=function(n,t,i){switch(n){case 0:return this.b;case 1:return this.c}return sz(this,n,t,i)},s.Th=function(n){switch(n){case 0:return!!this.b;case 1:return this.c!=null}return LQ(this,n)},s.$h=function(n,t){switch(n){case 0:zhe(this,u(t,147));return;case 1:Fhe(this,t);return}yW(this,n,t)},s.fi=function(){return Gu(),h1},s.hi=function(n){switch(n){case 0:zhe(this,null);return;case 1:Fhe(this,null);return}pW(this,n)},s.yi=function(){var n;return this.a==-1&&(n=this.b,this.a=n?Ni(n):0),this.a},s.kd=function(){return this.c},s.zi=function(n){this.a=n},s.ld=function(n){var t;return t=this.c,Fhe(this,n),t},s.Ib=function(){var n;return(this.Db&64)!=0?Ff(this):(n=new y0,Kt(Kt(Kt(n,this.b?this.b.Og():Vo),nee),Wj(this.c)),n.a)},s.a=-1,s.c=null;var Zd=v(wg,"ElkPropertyToValueMapEntryImpl",1091);m(980,1,{},Yp),v(Wr,"JsonAdapter",980),m(215,63,H1,lh),v(Wr,"JsonImportException",215),m(850,1,{},Qqe),v(Wr,"JsonImporter",850),m(884,1,{},_Ce),s.Bi=function(n){qHe(this.a,this.b,u(n,139))},v(Wr,"JsonImporter/lambda$0$Type",884),m(885,1,{},LCe),s.Bi=function(n){Cqe(this.a,this.b,u(n,139))},v(Wr,"JsonImporter/lambda$1$Type",885),m(893,1,{},uSe),s.Bi=function(n){zDe(this.a,u(n,149))},v(Wr,"JsonImporter/lambda$10$Type",893),m(895,1,{},PCe),s.Bi=function(n){gqe(this.a,this.b,u(n,139))},v(Wr,"JsonImporter/lambda$11$Type",895),m(896,1,{},$Ce),s.Bi=function(n){wqe(this.a,this.b,u(n,139))},v(Wr,"JsonImporter/lambda$12$Type",896),m(902,1,{},YDe),s.Bi=function(n){BGe(this.a,this.b,this.c,this.d,u(n,139))},v(Wr,"JsonImporter/lambda$13$Type",902),m(901,1,{},QDe),s.Bi=function(n){tKe(this.a,this.b,this.c,this.d,u(n,149))},v(Wr,"JsonImporter/lambda$14$Type",901),m(897,1,{},RCe),s.Bi=function(n){hNe(this.a,this.b,Pt(n))},v(Wr,"JsonImporter/lambda$15$Type",897),m(898,1,{},BCe),s.Bi=function(n){dNe(this.a,this.b,Pt(n))},v(Wr,"JsonImporter/lambda$16$Type",898),m(899,1,{},zCe),s.Bi=function(n){AHe(this.b,this.a,u(n,139))},v(Wr,"JsonImporter/lambda$17$Type",899),m(900,1,{},FCe),s.Bi=function(n){MHe(this.b,this.a,u(n,139))},v(Wr,"JsonImporter/lambda$18$Type",900),m(905,1,{},oSe),s.Bi=function(n){OGe(this.a,u(n,149))},v(Wr,"JsonImporter/lambda$19$Type",905),m(886,1,{},sSe),s.Bi=function(n){RHe(this.a,u(n,139))},v(Wr,"JsonImporter/lambda$2$Type",886),m(903,1,{},lSe),s.Bi=function(n){e3(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$20$Type",903),m(904,1,{},fSe),s.Bi=function(n){n3(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$21$Type",904),m(908,1,{},aSe),s.Bi=function(n){TGe(this.a,u(n,149))},v(Wr,"JsonImporter/lambda$22$Type",908),m(906,1,{},hSe),s.Bi=function(n){Wv(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$23$Type",906),m(907,1,{},dSe),s.Bi=function(n){Zv(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$24$Type",907),m(910,1,{},bSe),s.Bi=function(n){tGe(this.a,u(n,139))},v(Wr,"JsonImporter/lambda$25$Type",910),m(909,1,{},gSe),s.Bi=function(n){FDe(this.a,u(n,149))},v(Wr,"JsonImporter/lambda$26$Type",909),m(911,1,ct,JCe),s.Ad=function(n){R9n(this.b,this.a,Pt(n))},v(Wr,"JsonImporter/lambda$27$Type",911),m(912,1,ct,HCe),s.Ad=function(n){B9n(this.b,this.a,Pt(n))},v(Wr,"JsonImporter/lambda$28$Type",912),m(913,1,{},GCe),s.Bi=function(n){aUe(this.a,this.b,u(n,139))},v(Wr,"JsonImporter/lambda$29$Type",913),m(889,1,{},wSe),s.Bi=function(n){YFe(this.a,u(n,149))},v(Wr,"JsonImporter/lambda$3$Type",889),m(914,1,{},qCe),s.Bi=function(n){DUe(this.a,this.b,u(n,139))},v(Wr,"JsonImporter/lambda$30$Type",914),m(915,1,{},pSe),s.Bi=function(n){mRe(this.a,re(n))},v(Wr,"JsonImporter/lambda$31$Type",915),m(916,1,{},mSe),s.Bi=function(n){vRe(this.a,re(n))},v(Wr,"JsonImporter/lambda$32$Type",916),m(917,1,{},vSe),s.Bi=function(n){yRe(this.a,re(n))},v(Wr,"JsonImporter/lambda$33$Type",917),m(918,1,{},ySe),s.Bi=function(n){kRe(this.a,re(n))},v(Wr,"JsonImporter/lambda$34$Type",918),m(919,1,{},kSe),s.Bi=function(n){LMn(this.a,u(n,57))},v(Wr,"JsonImporter/lambda$35$Type",919),m(920,1,{},jSe),s.Bi=function(n){PMn(this.a,u(n,57))},v(Wr,"JsonImporter/lambda$36$Type",920),m(924,1,{},VDe),v(Wr,"JsonImporter/lambda$37$Type",924),m(921,1,ct,qNe),s.Ad=function(n){a7n(this.a,this.c,this.b,u(n,372))},v(Wr,"JsonImporter/lambda$38$Type",921),m(922,1,ct,UCe),s.Ad=function(n){Ygn(this.a,this.b,u(n,170))},v(Wr,"JsonImporter/lambda$39$Type",922),m(887,1,{},ESe),s.Bi=function(n){e3(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$4$Type",887),m(923,1,ct,XCe),s.Ad=function(n){Qgn(this.a,this.b,u(n,170))},v(Wr,"JsonImporter/lambda$40$Type",923),m(925,1,ct,UNe),s.Ad=function(n){h7n(this.a,this.b,this.c,u(n,8))},v(Wr,"JsonImporter/lambda$41$Type",925),m(888,1,{},SSe),s.Bi=function(n){n3(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$5$Type",888),m(892,1,{},xSe),s.Bi=function(n){QFe(this.a,u(n,149))},v(Wr,"JsonImporter/lambda$6$Type",892),m(890,1,{},ASe),s.Bi=function(n){Wv(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$7$Type",890),m(891,1,{},MSe),s.Bi=function(n){Zv(this.a,ne(re(n)))},v(Wr,"JsonImporter/lambda$8$Type",891),m(894,1,{},CSe),s.Bi=function(n){iGe(this.a,u(n,139))},v(Wr,"JsonImporter/lambda$9$Type",894),m(944,1,ct,TSe),s.Ad=function(n){D4(this.a,new M2(Pt(n)))},v(Wr,"JsonMetaDataConverter/lambda$0$Type",944),m(945,1,ct,OSe),s.Ad=function(n){H3n(this.a,u(n,244))},v(Wr,"JsonMetaDataConverter/lambda$1$Type",945),m(946,1,ct,NSe),s.Ad=function(n){_4n(this.a,u(n,144))},v(Wr,"JsonMetaDataConverter/lambda$2$Type",946),m(947,1,ct,ISe),s.Ad=function(n){G3n(this.a,u(n,160))},v(Wr,"JsonMetaDataConverter/lambda$3$Type",947),m(244,23,{3:1,35:1,23:1,244:1},m4);var pG,mG,Lce,vG,yG,kG,Pce,$ce,jG=yt(EN,"GraphFeature",244,Tt,p8n,xvn),Nan;m(11,1,{35:1,147:1},ki,Pi,fn,Yr),s.Dd=function(n){return Kwn(this,u(n,147))},s.Fb=function(n){return k_e(this,n)},s.Rg=function(){return Le(this)},s.Og=function(){return this.b},s.Hb=function(){return Id(this.b)},s.Ib=function(){return this.b},v(EN,"Property",11),m(657,1,Yt,hX),s.Le=function(n,t){return Tjn(this,u(n,105),u(t,105))},s.Fb=function(n){return this===n},s.Me=function(){return new At(this)},v(EN,"PropertyHolderComparator",657),m(698,1,Fr,roe),s.Nb=function(n){Zr(this,n)},s.Pb=function(){return H9n(this)},s.Qb=function(){AAe()},s.Ob=function(){return!!this.a},v(qF,"ElkGraphUtil/AncestorIterator",698);var B8e=Gi(yc,"EList");m(71,56,{20:1,31:1,56:1,18:1,16:1,71:1,61:1}),s._c=function(n,t){RE(this,n,t)},s.Ec=function(n){return Et(this,n)},s.ad=function(n,t){return h1e(this,n,t)},s.Fc=function(n){return nr(this,n)},s.Gi=function(){return new E4(this)},s.Hi=function(){return new ET(this)},s.Ii=function(n){return bO(this,n)},s.Ji=function(){return!0},s.Ki=function(n,t){},s.Li=function(){},s.Mi=function(n,t){gY(this,n,t)},s.Ni=function(n,t,i){},s.Oi=function(n,t){},s.Pi=function(n,t,i){},s.Fb=function(n){return mXe(this,n)},s.Hb=function(){return s1e(this)},s.Qi=function(){return!1},s.Jc=function(){return new st(this)},s.cd=function(){return new j4(this)},s.dd=function(n){var t;if(t=this.gc(),n<0||n>t)throw R(new k2(n,t));return new yV(this,n)},s.Si=function(n,t){this.Ri(n,this.bd(t))},s.Kc=function(n){return fB(this,n)},s.Ui=function(n,t){return t},s.fd=function(n,t){return o3(this,n,t)},s.Ib=function(){return rde(this)},s.Wi=function(){return!0},s.Xi=function(n,t){return r8(this,t)},v(yc,"AbstractEList",71),m(67,71,Th,J6,_w,t1e),s.Ci=function(n,t){return fW(this,n,t)},s.Di=function(n){return oHe(this,n)},s.Ei=function(n,t){MO(this,n,t)},s.Fi=function(n){WT(this,n)},s.Yi=function(n){return phe(this,n)},s.$b=function(){yE(this)},s.Gc=function(n){return y8(this,n)},s.Xb=function(n){return K(this,n)},s.Zi=function(n){var t,i,r;++this.j,i=this.g==null?0:this.g.length,n>i&&(r=this.g,t=i+(i/2|0)+4,t=0?(this.ed(t),!0):!1},s.Vi=function(n,t){return this.Bj(n,this.Xi(n,t))},s.gc=function(){return this.Cj()},s.Nc=function(){return this.Dj()},s.Oc=function(n){return this.Ej(n)},s.Ib=function(){return this.Fj()},v(yc,"DelegatingEList",2055),m(2056,2055,RZe),s.Ci=function(n,t){return tge(this,n,t)},s.Di=function(n){return this.Ci(this.Cj(),n)},s.Ei=function(n,t){iUe(this,n,t)},s.Fi=function(n){Uqe(this,n)},s.Ji=function(){return!this.Kj()},s.$b=function(){dS(this)},s.Gj=function(n,t,i,r,c){return new v_e(this,n,t,i,r,c)},s.Hj=function(n){hi(this.hj(),n)},s.Ij=function(){return null},s.Jj=function(){return-1},s.hj=function(){return null},s.Kj=function(){return!1},s.Lj=function(n,t){return t},s.Mj=function(n,t){return t},s.Nj=function(){return!1},s.Oj=function(){return!this.yj()},s.Ri=function(n,t){var i,r;return this.Nj()?(r=this.Oj(),i=E0e(this,n,t),this.Hj(this.Gj(7,ke(t),i,n,r)),i):E0e(this,n,t)},s.ed=function(n){var t,i,r,c;return this.Nj()?(i=null,r=this.Oj(),t=this.Gj(4,c=cR(this,n),null,n,r),this.Kj()&&c?(i=this.Mj(c,i),i?(i.lj(t),i.mj()):this.Hj(t)):i?(i.lj(t),i.mj()):this.Hj(t),c):(c=cR(this,n),this.Kj()&&c&&(i=this.Mj(c,null),i&&i.mj()),c)},s.Vi=function(n,t){return bKe(this,n,t)},v(ky,"DelegatingNotifyingListImpl",2056),m(151,1,zN),s.lj=function(n){return s0e(this,n)},s.mj=function(){EY(this)},s.ej=function(){return this.d},s.Ij=function(){return null},s.Pj=function(){return null},s.fj=function(n){return-1},s.gj=function(){return ZUe(this)},s.hj=function(){return null},s.ij=function(){return Nbe(this)},s.jj=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},s.Qj=function(){return!1},s.kj=function(n){var t,i,r,c,o,l,f,h,b,p,y;switch(this.d){case 1:case 2:switch(c=n.ej(),c){case 1:case 2:if(o=n.hj(),ue(o)===ue(this.hj())&&this.fj(null)==n.fj(null))return this.g=n.gj(),n.ej()==1&&(this.d=1),!0}case 4:{switch(c=n.ej(),c){case 4:{if(o=n.hj(),ue(o)===ue(this.hj())&&this.fj(null)==n.fj(null))return b=yge(this),h=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,l=n.jj(),this.d=6,y=new _w(2),h<=l?(Et(y,this.n),Et(y,n.ij()),this.g=F(z($t,1),ni,30,15,[this.o=h,l+1])):(Et(y,n.ij()),Et(y,this.n),this.g=F(z($t,1),ni,30,15,[this.o=l,h])),this.n=y,b||(this.o=-2-this.o-1),!0;break}}break}case 6:{switch(c=n.ej(),c){case 4:{if(o=n.hj(),ue(o)===ue(this.hj())&&this.fj(null)==n.fj(null)){for(b=yge(this),l=n.jj(),p=u(this.g,54),r=se($t,ni,30,p.length+1,15,1),t=0;t>>0,t.toString(16))),r.a+=" (eventType: ",this.d){case 1:{r.a+="SET";break}case 2:{r.a+="UNSET";break}case 3:{r.a+="ADD";break}case 5:{r.a+="ADD_MANY";break}case 4:{r.a+="REMOVE";break}case 6:{r.a+="REMOVE_MANY";break}case 7:{r.a+="MOVE";break}case 8:{r.a+="REMOVING_ADAPTER";break}case 9:{r.a+="RESOLVE";break}default:{_X(r,this.d);break}}if(FXe(this)&&(r.a+=", touch: true"),r.a+=", position: ",_X(r,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),r.a+=", notifier: ",Uj(r,this.hj()),r.a+=", feature: ",Uj(r,this.Ij()),r.a+=", oldValue: ",Uj(r,Nbe(this)),r.a+=", newValue: ",this.d==6&&X(this.g,54)){for(i=u(this.g,54),r.a+="[",n=0;n10?((!this.b||this.c.j!=this.a)&&(this.b=new E2(this),this.a=this.j),rf(this.b,n)):y8(this,n)},s.Wi=function(){return!0},s.a=0,v(yc,"AbstractEList/1",949),m(305,99,cF,k2),v(yc,"AbstractEList/BasicIndexOutOfBoundsException",305),m(42,1,Fr,st),s.Nb=function(n){Zr(this,n)},s.Vj=function(){if(this.i.j!=this.f)throw R(new Nl)},s.Wj=function(){return ft(this)},s.Ob=function(){return this.e!=this.i.gc()},s.Pb=function(){return this.Wj()},s.Qb=function(){VE(this)},s.e=0,s.f=0,s.g=-1,v(yc,"AbstractEList/EIterator",42),m(286,42,Wh,j4,yV),s.Qb=function(){VE(this)},s.Rb=function(n){sJe(this,n)},s.Xj=function(){var n;try{return n=this.d.Xb(--this.e),this.Vj(),this.g=this.e,n}catch(t){throw t=sr(t),X(t,99)?(this.Vj(),R(new hu)):R(t)}},s.Yj=function(n){sHe(this,n)},s.Sb=function(){return this.e!=0},s.Tb=function(){return this.e},s.Ub=function(){return this.Xj()},s.Vb=function(){return this.e-1},s.Wb=function(n){this.Yj(n)},v(yc,"AbstractEList/EListIterator",286),m(355,42,Fr,E4),s.Wj=function(){return PQ(this)},s.Qb=function(){throw R(new _t)},v(yc,"AbstractEList/NonResolvingEIterator",355),m(391,286,Wh,ET,Xle),s.Rb=function(n){throw R(new _t)},s.Wj=function(){var n;try{return n=this.c.Ti(this.e),this.Vj(),this.g=this.e++,n}catch(t){throw t=sr(t),X(t,99)?(this.Vj(),R(new hu)):R(t)}},s.Xj=function(){var n;try{return n=this.c.Ti(--this.e),this.Vj(),this.g=this.e,n}catch(t){throw t=sr(t),X(t,99)?(this.Vj(),R(new hu)):R(t)}},s.Qb=function(){throw R(new _t)},s.Wb=function(n){throw R(new _t)},v(yc,"AbstractEList/NonResolvingEListIterator",391),m(2042,71,BZe),s.Ci=function(n,t){var i,r,c,o,l,f,h,b,p,y,S;if(c=t.gc(),c!=0){for(b=u(Xn(this.a,4),129),p=b==null?0:b.length,S=p+c,r=oQ(this,S),y=p-n,y>0&&Wu(b,n,r,n+c,y),h=t.Jc(),l=0;li)throw R(new k2(n,i));return new _De(this,n)},s.$b=function(){var n,t;++this.j,n=u(Xn(this.a,4),129),t=n==null?0:n.length,p8(this,null),gY(this,t,n)},s.Gc=function(n){var t,i,r,c,o;if(t=u(Xn(this.a,4),129),t!=null){if(n!=null){for(r=t,c=0,o=r.length;c=i)throw R(new k2(n,i));return t[n]},s.bd=function(n){var t,i,r;if(t=u(Xn(this.a,4),129),t!=null){if(n!=null){for(i=0,r=t.length;ii)throw R(new k2(n,i));return new DDe(this,n)},s.Ri=function(n,t){var i,r,c;if(i=pJe(this),c=i==null?0:i.length,n>=c)throw R(new jo(Cne+n+pg+c));if(t>=c)throw R(new jo(Tne+t+pg+c));return r=i[t],n!=t&&(n0&&Wu(n,0,t,0,i),t},s.Oc=function(n){var t,i,r;return t=u(Xn(this.a,4),129),r=t==null?0:t.length,r>0&&(n.lengthr&&ir(n,r,null),n};var Ian;v(yc,"ArrayDelegatingEList",2042),m(1032,42,Fr,FPe),s.Vj=function(){if(this.b.j!=this.f||ue(u(Xn(this.b.a,4),129))!==ue(this.a))throw R(new Nl)},s.Qb=function(){VE(this),this.a=u(Xn(this.b.a,4),129)},v(yc,"ArrayDelegatingEList/EIterator",1032),m(712,286,Wh,eDe,DDe),s.Vj=function(){if(this.b.j!=this.f||ue(u(Xn(this.b.a,4),129))!==ue(this.a))throw R(new Nl)},s.Yj=function(n){sHe(this,n),this.a=u(Xn(this.b.a,4),129)},s.Qb=function(){VE(this),this.a=u(Xn(this.b.a,4),129)},v(yc,"ArrayDelegatingEList/EListIterator",712),m(1033,355,Fr,JPe),s.Vj=function(){if(this.b.j!=this.f||ue(u(Xn(this.b.a,4),129))!==ue(this.a))throw R(new Nl)},v(yc,"ArrayDelegatingEList/NonResolvingEIterator",1033),m(713,391,Wh,nDe,_De),s.Vj=function(){if(this.b.j!=this.f||ue(u(Xn(this.b.a,4),129))!==ue(this.a))throw R(new Nl)},v(yc,"ArrayDelegatingEList/NonResolvingEListIterator",713),m(605,305,cF,EK),v(yc,"BasicEList/BasicIndexOutOfBoundsException",605),m(699,67,Th,Nse),s._c=function(n,t){throw R(new _t)},s.Ec=function(n){throw R(new _t)},s.ad=function(n,t){throw R(new _t)},s.Fc=function(n){throw R(new _t)},s.$b=function(){throw R(new _t)},s.Zi=function(n){throw R(new _t)},s.Jc=function(){return this.Gi()},s.cd=function(){return this.Hi()},s.dd=function(n){return this.Ii(n)},s.Ri=function(n,t){throw R(new _t)},s.Si=function(n,t){throw R(new _t)},s.ed=function(n){throw R(new _t)},s.Kc=function(n){throw R(new _t)},s.fd=function(n,t){throw R(new _t)},v(yc,"BasicEList/UnmodifiableEList",699),m(711,1,{3:1,20:1,18:1,16:1,61:1,586:1}),s._c=function(n,t){$wn(this,n,u(t,45))},s.Ec=function(n){return Npn(this,u(n,45))},s.Ic=function(n){cc(this,n)},s.Xb=function(n){return u(K(this.c,n),136)},s.Ri=function(n,t){return u(this.c.Ri(n,t),45)},s.Si=function(n,t){Rwn(this,n,u(t,45))},s.ed=function(n){return u(this.c.ed(n),45)},s.fd=function(n,t){return U3n(this,n,u(t,45))},s.gd=function(n){Zb(this,n)},s.Lc=function(){return new vn(this,16)},s.Mc=function(){return new mn(null,new vn(this,16))},s.ad=function(n,t){return this.c.ad(n,t)},s.Fc=function(n){return this.c.Fc(n)},s.$b=function(){this.c.$b()},s.Gc=function(n){return this.c.Gc(n)},s.Hc=function(n){return jO(this.c,n)},s.Zj=function(){var n,t,i;if(this.d==null){for(this.d=se(z8e,nme,67,2*this.f+1,0,1),i=this.e,this.f=0,t=this.c.Jc();t.e!=t.i.gc();)n=u(t.Wj(),136),az(this,n);this.e=i}},s.Fb=function(n){return xNe(this,n)},s.Hb=function(){return s1e(this.c)},s.bd=function(n){return this.c.bd(n)},s.$j=function(){this.c=new DSe(this)},s.dc=function(){return this.f==0},s.Jc=function(){return this.c.Jc()},s.cd=function(){return this.c.cd()},s.dd=function(n){return this.c.dd(n)},s._j=function(){return nO(this)},s.ak=function(n,t,i){return new XNe(n,t,i)},s.bk=function(){return new yL},s.Kc=function(n){return pBe(this,n)},s.gc=function(){return this.f},s.hd=function(n,t){return new N0(this.c,n,t)},s.Nc=function(){return this.c.Nc()},s.Oc=function(n){return this.c.Oc(n)},s.Ib=function(){return rde(this.c)},s.e=0,s.f=0,v(yc,"BasicEMap",711),m(1027,67,Th,DSe),s.Ki=function(n,t){vbn(this,u(t,136))},s.Ni=function(n,t,i){var r;++(r=this,u(t,136),r).a.e},s.Oi=function(n,t){ybn(this,u(t,136))},s.Pi=function(n,t,i){ppn(this,u(t,136),u(i,136))},s.Mi=function(n,t){aze(this.a)},v(yc,"BasicEMap/1",1027),m(1028,67,Th,yL),s.$i=function(n){return se(ZBn,zZe,611,n,0,1)},v(yc,"BasicEMap/2",1028),m(1029,Ga,fs,_Se),s.$b=function(){this.a.c.$b()},s.Gc=function(n){return xQ(this.a,n)},s.Jc=function(){return this.a.f==0?(A9(),tD.a):new mAe(this.a)},s.Kc=function(n){var t;return t=this.a.f,nz(this.a,n),this.a.f!=t},s.gc=function(){return this.a.f},v(yc,"BasicEMap/3",1029),m(1030,31,im,LSe),s.$b=function(){this.a.c.$b()},s.Gc=function(n){return vXe(this.a,n)},s.Jc=function(){return this.a.f==0?(A9(),tD.a):new vAe(this.a)},s.gc=function(){return this.a.f},v(yc,"BasicEMap/4",1030),m(1031,Ga,fs,PSe),s.$b=function(){this.a.c.$b()},s.Gc=function(n){var t,i,r,c,o,l,f,h,b;if(this.a.f>0&&X(n,45)&&(this.a.Zj(),h=u(n,45),f=h.jd(),c=f==null?0:Ni(f),o=Nle(this.a,c),t=this.a.d[o],t)){for(i=u(t.g,374),b=t.i,l=0;l"+this.c},s.a=0;var ZBn=v(yc,"BasicEMap/EntryImpl",611);m(534,1,{},G6),v(yc,"BasicEMap/View",534);var tD;m(769,1,{}),s.Fb=function(n){return abe((En(),Sc),n)},s.Hb=function(){return y1e((En(),Sc))},s.Ib=function(){return Ja((En(),Sc))},v(yc,"ECollections/BasicEmptyUnmodifiableEList",769),m(1302,1,Wh,eC),s.Nb=function(n){Zr(this,n)},s.Rb=function(n){throw R(new _t)},s.Ob=function(){return!1},s.Sb=function(){return!1},s.Pb=function(){throw R(new hu)},s.Tb=function(){return 0},s.Ub=function(){throw R(new hu)},s.Vb=function(){return-1},s.Qb=function(){throw R(new _t)},s.Wb=function(n){throw R(new _t)},v(yc,"ECollections/BasicEmptyUnmodifiableEList/1",1302),m(1300,769,{20:1,18:1,16:1,61:1},xxe),s._c=function(n,t){FAe()},s.Ec=function(n){return zAe()},s.ad=function(n,t){return JAe()},s.Fc=function(n){return HAe()},s.$b=function(){GAe()},s.Gc=function(n){return!1},s.Hc=function(n){return!1},s.Ic=function(n){cc(this,n)},s.Xb=function(n){return Pse((En(),n)),null},s.bd=function(n){return-1},s.dc=function(){return!0},s.Jc=function(){return this.a},s.cd=function(){return this.a},s.dd=function(n){return this.a},s.Ri=function(n,t){return qAe()},s.Si=function(n,t){UAe()},s.ed=function(n){return XAe()},s.Kc=function(n){return KAe()},s.fd=function(n,t){return VAe()},s.gc=function(){return 0},s.gd=function(n){Zb(this,n)},s.Lc=function(){return new vn(this,16)},s.Mc=function(){return new mn(null,new vn(this,16))},s.hd=function(n,t){return En(),new N0(Sc,n,t)},s.Nc=function(){return Ofe((En(),Sc))},s.Oc=function(n){return En(),qE(Sc,n)},v(yc,"ECollections/EmptyUnmodifiableEList",1300),m(1301,769,{20:1,18:1,16:1,61:1,586:1},Axe),s._c=function(n,t){FAe()},s.Ec=function(n){return zAe()},s.ad=function(n,t){return JAe()},s.Fc=function(n){return HAe()},s.$b=function(){GAe()},s.Gc=function(n){return!1},s.Hc=function(n){return!1},s.Ic=function(n){cc(this,n)},s.Xb=function(n){return Pse((En(),n)),null},s.bd=function(n){return-1},s.dc=function(){return!0},s.Jc=function(){return this.a},s.cd=function(){return this.a},s.dd=function(n){return this.a},s.Ri=function(n,t){return qAe()},s.Si=function(n,t){UAe()},s.ed=function(n){return XAe()},s.Kc=function(n){return KAe()},s.fd=function(n,t){return VAe()},s.gc=function(){return 0},s.gd=function(n){Zb(this,n)},s.Lc=function(){return new vn(this,16)},s.Mc=function(){return new mn(null,new vn(this,16))},s.hd=function(n,t){return En(),new N0(Sc,n,t)},s.Nc=function(){return Ofe((En(),Sc))},s.Oc=function(n){return En(),qE(Sc,n)},s._j=function(){return En(),En(),r1},v(yc,"ECollections/EmptyUnmodifiableEMap",1301);var J8e=Gi(yc,"Enumerator"),EG;m(290,1,{290:1},DW),s.Fb=function(n){var t;return this===n?!0:X(n,290)?(t=u(n,290),this.f==t.f&&l3n(this.i,t.i)&&uV(this.a,(this.f&256)!=0?(t.f&256)!=0?t.a:null:(t.f&256)!=0?null:t.a)&&uV(this.d,t.d)&&uV(this.g,t.g)&&uV(this.e,t.e)&&hSn(this,t)):!1},s.Hb=function(){return this.f},s.Ib=function(){return ZXe(this)},s.f=0;var Dan=0,_an=0,Lan=0,Pan=0,H8e=0,G8e=0,q8e=0,U8e=0,X8e=0,$an,oA=0,sA=0,Ran=0,Ban=0,SG,K8e;v(yc,"URI",290),m(1090,44,v3,Mxe),s.yc=function(n,t){return u(Kc(this,Pt(n),u(t,290)),290)},v(yc,"URI/URICache",1090),m(492,67,Th,nC,aR),s.Qi=function(){return!0},v(yc,"UniqueEList",492),m(578,63,H1,sB),v(yc,"WrappedException",578);var Zt=Gi(ql,HZe),Gm=Gi(ql,GZe),ns=Gi(ql,qZe),qm=Gi(ql,UZe),Ma=Gi(ql,XZe),vf=Gi(ql,"EClass"),zce=Gi(ql,"EDataType"),zan;m(1198,44,v3,Cxe),s.xc=function(n){return $r(n)?lo(this,n):bu(Xc(this.f,n))},v(ql,"EDataType/Internal/ConversionDelegate/Factory/Registry/Impl",1198);var xG=Gi(ql,"EEnum"),ed=Gi(ql,KZe),Rc=Gi(ql,VZe),yf=Gi(ql,YZe),kf,jp=Gi(ql,QZe),Um=Gi(ql,WZe);m(1023,1,{},tC),s.Ib=function(){return"NIL"},v(ql,"EStructuralFeature/Internal/DynamicValueHolder/1",1023);var Fan;m(1022,44,v3,Txe),s.xc=function(n){return $r(n)?lo(this,n):bu(Xc(this.f,n))},v(ql,"EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl",1022);var Fo=Gi(ql,ZZe),Qy=Gi(ql,"EValidator/PatternMatcher"),V8e,Y8e,Bn,e0,Xm,yb,Jan,Han,Gan,kb,n0,jb,Ep,rh,qan,Uan,jf,t0,Xan,i0,Km,i5,Ac,Kan,Van,Sp,AG=Gi(Ri,"FeatureMap/Entry");m(533,1,{75:1},C$),s.Jk=function(){return this.a},s.kd=function(){return this.b},v(Jn,"BasicEObjectImpl/1",533),m(1021,1,Lne,VCe),s.Dk=function(n){return aY(this.a,this.b,n)},s.Oj=function(){return P_e(this.a,this.b)},s.Wb=function(n){pae(this.a,this.b,n)},s.Ek=function(){h5n(this.a,this.b)},v(Jn,"BasicEObjectImpl/4",1021),m(2043,1,{114:1}),s.Kk=function(n){this.e=n==0?Yan:se(Mr,On,1,n,5,1)},s.ii=function(n){return this.e[n]},s.ji=function(n,t){this.e[n]=t},s.ki=function(n){this.e[n]=null},s.Lk=function(){return this.c},s.Mk=function(){throw R(new _t)},s.Nk=function(){throw R(new _t)},s.Ok=function(){return this.d},s.Pk=function(){return this.e!=null},s.Qk=function(n){this.c=n},s.Rk=function(n){throw R(new _t)},s.Sk=function(n){throw R(new _t)},s.Tk=function(n){this.d=n};var Yan;v(Jn,"BasicEObjectImpl/EPropertiesHolderBaseImpl",2043),m(192,2043,{114:1},nl),s.Mk=function(){return this.a},s.Nk=function(){return this.b},s.Rk=function(n){this.a=n},s.Sk=function(n){this.b=n},v(Jn,"BasicEObjectImpl/EPropertiesHolderImpl",192),m(501,100,ZWe,jv),s.rh=function(){return this.f},s.wh=function(){return this.k},s.yh=function(n,t){this.g=n,this.i=t},s.Ah=function(){return(this.j&2)==0?this.fi():this.Xh().Lk()},s.Ch=function(){return this.i},s.th=function(){return(this.j&1)!=0},s.Mh=function(){return this.g},s.Sh=function(){return(this.j&4)!=0},s.Xh=function(){return!this.k&&(this.k=new nl),this.k},s._h=function(n){this.Xh().Qk(n),n?this.j|=2:this.j&=-3},s.bi=function(n){this.Xh().Sk(n),n?this.j|=4:this.j&=-5},s.fi=function(){return(C0(),Bn).S},s.i=0,s.j=1,v(Jn,"EObjectImpl",501),m(785,501,{109:1,94:1,93:1,57:1,114:1,52:1,100:1},bfe),s.ii=function(n){return this.e[n]},s.ji=function(n,t){this.e[n]=t},s.ki=function(n){this.e[n]=null},s.Ah=function(){return this.d},s.Fh=function(n){return Ji(this.d,n)},s.Hh=function(){return this.d},s.Lh=function(){return this.e!=null},s.Xh=function(){return!this.k&&(this.k=new kL),this.k},s._h=function(n){this.d=n},s.ei=function(){var n;return this.e==null&&(n=dt(this.d),this.e=n==0?Qan:se(Mr,On,1,n,5,1)),this},s.gi=function(){return 0};var Qan;v(Jn,"DynamicEObjectImpl",785),m(1483,785,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1},gIe),s.Fb=function(n){return this===n},s.Hb=function(){return jw(this)},s._h=function(n){this.d=n,this.b=ZO(n,"key"),this.c=ZO(n,$S)},s.yi=function(){var n;return this.a==-1&&(n=SY(this,this.b),this.a=n==null?0:Ni(n)),this.a},s.jd=function(){return SY(this,this.b)},s.kd=function(){return SY(this,this.c)},s.zi=function(n){this.a=n},s.Ai=function(n){pae(this,this.b,n)},s.ld=function(n){var t;return t=SY(this,this.c),pae(this,this.c,n),t},s.a=0,v(Jn,"DynamicEObjectImpl/BasicEMapEntry",1483),m(1484,1,{114:1},kL),s.Kk=function(n){throw R(new _t)},s.ii=function(n){throw R(new _t)},s.ji=function(n,t){throw R(new _t)},s.ki=function(n){throw R(new _t)},s.Lk=function(){throw R(new _t)},s.Mk=function(){return this.a},s.Nk=function(){return this.b},s.Ok=function(){return this.c},s.Pk=function(){throw R(new _t)},s.Qk=function(n){throw R(new _t)},s.Rk=function(n){this.a=n},s.Sk=function(n){this.b=n},s.Tk=function(n){this.c=n},v(Jn,"DynamicEObjectImpl/DynamicEPropertiesHolderImpl",1484),m(504,161,{109:1,94:1,93:1,587:1,158:1,57:1,114:1,52:1,100:1,504:1,161:1,117:1,118:1},Nb),s.xh=function(n){return qde(this,n)},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.d;case 2:return i?(!this.b&&(this.b=new Hs((jn(),Ac),Du,this)),this.b):(!this.b&&(this.b=new Hs((jn(),Ac),Du,this)),nO(this.b));case 3:return H_e(this);case 4:return!this.a&&(this.a=new mr(vb,this,4)),this.a;case 5:return!this.c&&(this.c=new Jv(vb,this,5)),this.c}return Pl(this,n-dt((jn(),e0)),Mn((r=u(Xn(this,16),29),r||e0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 3:return this.Cb&&(i=(c=this.Db>>16,c>=0?qde(this,i):this.Cb.Qh(this,-1-c,null,i))),Cfe(this,u(n,158),i)}return o=u(Mn((r=u(Xn(this,16),29),r||(jn(),e0)),t),69),o.uk().xk(this,Lo(this),t-dt((jn(),e0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 2:return!this.b&&(this.b=new Hs((jn(),Ac),Du,this)),K$(this.b,n,i);case 3:return Cfe(this,null,i);case 4:return!this.a&&(this.a=new mr(vb,this,4)),vc(this.a,n,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),e0)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),e0)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.d!=null;case 2:return!!this.b&&this.b.f!=0;case 3:return!!H_e(this);case 4:return!!this.a&&this.a.i!=0;case 5:return!!this.c&&this.c.i!=0}return Ll(this,n-dt((jn(),e0)),Mn((t=u(Xn(this,16),29),t||e0),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:Yvn(this,Pt(t));return;case 2:!this.b&&(this.b=new Hs((jn(),Ac),Du,this)),NB(this.b,t);return;case 3:FUe(this,u(t,158));return;case 4:!this.a&&(this.a=new mr(vb,this,4)),kt(this.a),!this.a&&(this.a=new mr(vb,this,4)),nr(this.a,u(t,18));return;case 5:!this.c&&(this.c=new Jv(vb,this,5)),kt(this.c),!this.c&&(this.c=new Jv(vb,this,5)),nr(this.c,u(t,18));return}Jl(this,n-dt((jn(),e0)),Mn((i=u(Xn(this,16),29),i||e0),n),t)},s.fi=function(){return jn(),e0},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:Hhe(this,null);return;case 2:!this.b&&(this.b=new Hs((jn(),Ac),Du,this)),this.b.c.$b();return;case 3:FUe(this,null);return;case 4:!this.a&&(this.a=new mr(vb,this,4)),kt(this.a);return;case 5:!this.c&&(this.c=new Jv(vb,this,5)),kt(this.c);return}Fl(this,n-dt((jn(),e0)),Mn((t=u(Xn(this,16),29),t||e0),n))},s.Ib=function(){return IFe(this)},s.d=null,v(Jn,"EAnnotationImpl",504),m(142,711,tme,os),s.Ei=function(n,t){kwn(this,n,u(t,45))},s.Uk=function(n,t){return k2n(this,u(n,45),t)},s.Yi=function(n){return u(u(this.c,72).Yi(n),136)},s.Gi=function(){return u(this.c,72).Gi()},s.Hi=function(){return u(this.c,72).Hi()},s.Ii=function(n){return u(this.c,72).Ii(n)},s.Vk=function(n,t){return K$(this,n,t)},s.Dk=function(n){return u(this.c,77).Dk(n)},s.$j=function(){},s.Oj=function(){return u(this.c,77).Oj()},s.ak=function(n,t,i){var r;return r=u(ol(this.b).ti().pi(this.b),136),r.zi(n),r.Ai(t),r.ld(i),r},s.bk=function(){return new uoe(this)},s.Wb=function(n){NB(this,n)},s.Ek=function(){u(this.c,77).Ek()},v(Ri,"EcoreEMap",142),m(169,142,tme,Hs),s.Zj=function(){var n,t,i,r,c,o;if(this.d==null){for(o=se(z8e,nme,67,2*this.f+1,0,1),i=this.c.Jc();i.e!=i.i.gc();)t=u(i.Wj(),136),r=t.yi(),c=(r&oi)%o.length,n=o[c],!n&&(n=o[c]=new uoe(this)),n.Ec(t);this.d=o}},v(Jn,"EAnnotationImpl/1",169),m(293,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,470:1,52:1,100:1,161:1,293:1,117:1,118:1}),s.Ih=function(n,t,i){var r,c;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return $n(),(this.Bb&256)!=0;case 3:return $n(),(this.Bb&512)!=0;case 4:return ke(this.s);case 5:return ke(this.t);case 6:return $n(),!!this.Hk();case 7:return $n(),c=this.s,c>=1;case 8:return t?ff(this):this.r;case 9:return this.q}return Pl(this,n-dt(this.fi()),Mn((r=u(Xn(this,16),29),r||this.fi()),n),t,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 9:return SV(this,i)}return c=u(Mn((r=u(Xn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i)},s.Th=function(n){var t,i;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Mw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mw(this.q).i==0)}return Ll(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:this.ri(Pt(t));return;case 2:Ld(this,Fe(ze(t)));return;case 3:Pd(this,Fe(ze(t)));return;case 4:Nd(this,u(t,15).a);return;case 5:this.Xk(u(t,15).a);return;case 8:cg(this,u(t,143));return;case 9:r=Fa(this,u(t,87),null),r&&r.mj();return}Jl(this,n-dt(this.fi()),Mn((i=u(Xn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return jn(),Van},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:this.ri(null);return;case 2:Ld(this,!0);return;case 3:Pd(this,!0);return;case 4:Nd(this,0);return;case 5:this.Xk(1);return;case 8:cg(this,null);return;case 9:i=Fa(this,null,null),i&&i.mj();return}Fl(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.mi=function(){ff(this),this.Bb|=1},s.Fk=function(){return ff(this)},s.Gk=function(){return this.t},s.Hk=function(){var n;return n=this.t,n>1||n==-1},s.Qi=function(){return(this.Bb&512)!=0},s.Wk=function(n,t){return z1e(this,n,t)},s.Xk=function(n){$2(this,n)},s.Ib=function(){return tbe(this)},s.s=0,s.t=1,v(Jn,"ETypedElementImpl",293),m(451,293,{109:1,94:1,93:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,451:1,293:1,117:1,118:1,682:1}),s.xh=function(n){return EHe(this,n)},s.Ih=function(n,t,i){var r,c;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return $n(),(this.Bb&256)!=0;case 3:return $n(),(this.Bb&512)!=0;case 4:return ke(this.s);case 5:return ke(this.t);case 6:return $n(),!!this.Hk();case 7:return $n(),c=this.s,c>=1;case 8:return t?ff(this):this.r;case 9:return this.q;case 10:return $n(),(this.Bb&Gf)!=0;case 11:return $n(),(this.Bb&V0)!=0;case 12:return $n(),(this.Bb&cm)!=0;case 13:return this.j;case 14:return A8(this);case 15:return $n(),(this.Bb&as)!=0;case 16:return $n(),(this.Bb&jh)!=0;case 17:return O2(this)}return Pl(this,n-dt(this.fi()),Mn((r=u(Xn(this,16),29),r||this.fi()),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 17:return this.Cb&&(i=(c=this.Db>>16,c>=0?EHe(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,17,i)}return o=u(Mn((r=u(Xn(this,16),29),r||this.fi()),t),69),o.uk().xk(this,Lo(this),t-dt(this.fi()),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 9:return SV(this,i);case 17:return hl(this,null,17,i)}return c=u(Mn((r=u(Xn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i)},s.Th=function(n){var t,i;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Mw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mw(this.q).i==0);case 10:return(this.Bb&Gf)==0;case 11:return(this.Bb&V0)!=0;case 12:return(this.Bb&cm)!=0;case 13:return this.j!=null;case 14:return A8(this)!=null;case 15:return(this.Bb&as)!=0;case 16:return(this.Bb&jh)!=0;case 17:return!!O2(this)}return Ll(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:XV(this,Pt(t));return;case 2:Ld(this,Fe(ze(t)));return;case 3:Pd(this,Fe(ze(t)));return;case 4:Nd(this,u(t,15).a);return;case 5:this.Xk(u(t,15).a);return;case 8:cg(this,u(t,143));return;case 9:r=Fa(this,u(t,87),null),r&&r.mj();return;case 10:l8(this,Fe(ze(t)));return;case 11:h8(this,Fe(ze(t)));return;case 12:a8(this,Fe(ze(t)));return;case 13:Dse(this,Pt(t));return;case 15:f8(this,Fe(ze(t)));return;case 16:d8(this,Fe(ze(t)));return}Jl(this,n-dt(this.fi()),Mn((i=u(Xn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return jn(),Kan},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:X(this.Cb,88)&&Y2(Ms(u(this.Cb,88)),4),Mo(this,null);return;case 2:Ld(this,!0);return;case 3:Pd(this,!0);return;case 4:Nd(this,0);return;case 5:this.Xk(1);return;case 8:cg(this,null);return;case 9:i=Fa(this,null,null),i&&i.mj();return;case 10:l8(this,!0);return;case 11:h8(this,!1);return;case 12:a8(this,!1);return;case 13:this.i=null,xB(this,null);return;case 15:f8(this,!1);return;case 16:d8(this,!1);return}Fl(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.mi=function(){$9(Vc((ls(),nc),this)),ff(this),this.Bb|=1},s.nk=function(){return this.f},s.gk=function(){return A8(this)},s.ok=function(){return O2(this)},s.sk=function(){return null},s.Yk=function(){return this.k},s.Jj=function(){return this.n},s.tk=function(){return mz(this)},s.uk=function(){var n,t,i,r,c,o,l,f,h;return this.p||(i=O2(this),(i.i==null&&kh(i),i.i).length,r=this.sk(),r&&dt(O2(r)),c=ff(this),l=c.ik(),n=l?(l.i&1)!=0?l==ts?Qi:l==$t?jr:l==Ym?b7:l==Jr?gr:l==Ap?sp:l==o5?lp:l==ds?jy:KS:l:null,t=A8(this),f=c.gk(),Ljn(this),(this.Bb&jh)!=0&&((o=Wde((ls(),nc),i))&&o!=this||(o=$4(Vc(nc,this))))?this.p=new QCe(this,o):this.Hk()?this.$k()?r?(this.Bb&as)!=0?n?this._k()?this.p=new Ub(47,n,this,r):this.p=new Ub(5,n,this,r):this._k()?this.p=new Wb(46,this,r):this.p=new Wb(4,this,r):n?this._k()?this.p=new Ub(49,n,this,r):this.p=new Ub(7,n,this,r):this._k()?this.p=new Wb(48,this,r):this.p=new Wb(6,this,r):(this.Bb&as)!=0?n?n==yg?this.p=new xd(50,Oan,this):this._k()?this.p=new xd(43,n,this):this.p=new xd(1,n,this):this._k()?this.p=new Md(42,this):this.p=new Md(0,this):n?n==yg?this.p=new xd(41,Oan,this):this._k()?this.p=new xd(45,n,this):this.p=new xd(3,n,this):this._k()?this.p=new Md(44,this):this.p=new Md(2,this):X(c,159)?n==AG?this.p=new Md(40,this):(this.Bb&512)!=0?(this.Bb&as)!=0?n?this.p=new xd(9,n,this):this.p=new Md(8,this):n?this.p=new xd(11,n,this):this.p=new Md(10,this):(this.Bb&as)!=0?n?this.p=new xd(13,n,this):this.p=new Md(12,this):n?this.p=new xd(15,n,this):this.p=new Md(14,this):r?(h=r.t,h>1||h==-1?this._k()?(this.Bb&as)!=0?n?this.p=new Ub(25,n,this,r):this.p=new Wb(24,this,r):n?this.p=new Ub(27,n,this,r):this.p=new Wb(26,this,r):(this.Bb&as)!=0?n?this.p=new Ub(29,n,this,r):this.p=new Wb(28,this,r):n?this.p=new Ub(31,n,this,r):this.p=new Wb(30,this,r):this._k()?(this.Bb&as)!=0?n?this.p=new Ub(33,n,this,r):this.p=new Wb(32,this,r):n?this.p=new Ub(35,n,this,r):this.p=new Wb(34,this,r):(this.Bb&as)!=0?n?this.p=new Ub(37,n,this,r):this.p=new Wb(36,this,r):n?this.p=new Ub(39,n,this,r):this.p=new Wb(38,this,r)):this._k()?(this.Bb&as)!=0?n?this.p=new xd(17,n,this):this.p=new Md(16,this):n?this.p=new xd(19,n,this):this.p=new Md(18,this):(this.Bb&as)!=0?n?this.p=new xd(21,n,this):this.p=new Md(20,this):n?this.p=new xd(23,n,this):this.p=new Md(22,this):this.Zk()?this._k()?this.p=new zNe(u(c,29),this,r):this.p=new bae(u(c,29),this,r):X(c,159)?n==AG?this.p=new Md(40,this):(this.Bb&as)!=0?n?this.p=new $Ie(t,f,this,(MQ(),l==$t?i7e:l==ts?W8e:l==Ap?r7e:l==Ym?t7e:l==Jr?n7e:l==o5?c7e:l==ds?Z8e:l==Wl?e7e:Hce)):this.p=new ZDe(u(c,159),t,f,this):n?this.p=new PIe(t,f,this,(MQ(),l==$t?i7e:l==ts?W8e:l==Ap?r7e:l==Ym?t7e:l==Jr?n7e:l==o5?c7e:l==ds?Z8e:l==Wl?e7e:Hce)):this.p=new WDe(u(c,159),t,f,this):this.$k()?r?(this.Bb&as)!=0?this._k()?this.p=new JNe(u(c,29),this,r):this.p=new Zle(u(c,29),this,r):this._k()?this.p=new FNe(u(c,29),this,r):this.p=new ZK(u(c,29),this,r):(this.Bb&as)!=0?this._k()?this.p=new ROe(u(c,29),this):this.p=new mle(u(c,29),this):this._k()?this.p=new $Oe(u(c,29),this):this.p=new BK(u(c,29),this):this._k()?r?(this.Bb&as)!=0?this.p=new HNe(u(c,29),this,r):this.p=new efe(u(c,29),this,r):(this.Bb&as)!=0?this.p=new BOe(u(c,29),this):this.p=new vle(u(c,29),this):r?(this.Bb&as)!=0?this.p=new GNe(u(c,29),this,r):this.p=new nfe(u(c,29),this,r):(this.Bb&as)!=0?this.p=new zOe(u(c,29),this):this.p=new fR(u(c,29),this)),this.p},s.pk=function(){return(this.Bb&Gf)!=0},s.Zk=function(){return!1},s.$k=function(){return!1},s.qk=function(){return(this.Bb&jh)!=0},s.vk=function(){return AY(this)},s._k=function(){return!1},s.rk=function(){return(this.Bb&as)!=0},s.al=function(n){this.k=n},s.ri=function(n){XV(this,n)},s.Ib=function(){return Jz(this)},s.e=!1,s.n=0,v(Jn,"EStructuralFeatureImpl",451),m(335,451,{109:1,94:1,93:1,38:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,335:1,161:1,451:1,293:1,117:1,118:1,682:1},vX),s.Ih=function(n,t,i){var r,c;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return $n(),(this.Bb&256)!=0;case 3:return $n(),(this.Bb&512)!=0;case 4:return ke(this.s);case 5:return ke(this.t);case 6:return $n(),!!Y0e(this);case 7:return $n(),c=this.s,c>=1;case 8:return t?ff(this):this.r;case 9:return this.q;case 10:return $n(),(this.Bb&Gf)!=0;case 11:return $n(),(this.Bb&V0)!=0;case 12:return $n(),(this.Bb&cm)!=0;case 13:return this.j;case 14:return A8(this);case 15:return $n(),(this.Bb&as)!=0;case 16:return $n(),(this.Bb&jh)!=0;case 17:return O2(this);case 18:return $n(),(this.Bb&Ru)!=0;case 19:return t?XY(this):n$e(this)}return Pl(this,n-dt((jn(),Xm)),Mn((r=u(Xn(this,16),29),r||Xm),n),t,i)},s.Th=function(n){var t,i;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return Y0e(this);case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Mw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mw(this.q).i==0);case 10:return(this.Bb&Gf)==0;case 11:return(this.Bb&V0)!=0;case 12:return(this.Bb&cm)!=0;case 13:return this.j!=null;case 14:return A8(this)!=null;case 15:return(this.Bb&as)!=0;case 16:return(this.Bb&jh)!=0;case 17:return!!O2(this);case 18:return(this.Bb&Ru)!=0;case 19:return!!n$e(this)}return Ll(this,n-dt((jn(),Xm)),Mn((t=u(Xn(this,16),29),t||Xm),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:XV(this,Pt(t));return;case 2:Ld(this,Fe(ze(t)));return;case 3:Pd(this,Fe(ze(t)));return;case 4:Nd(this,u(t,15).a);return;case 5:xAe(this,u(t,15).a);return;case 8:cg(this,u(t,143));return;case 9:r=Fa(this,u(t,87),null),r&&r.mj();return;case 10:l8(this,Fe(ze(t)));return;case 11:h8(this,Fe(ze(t)));return;case 12:a8(this,Fe(ze(t)));return;case 13:Dse(this,Pt(t));return;case 15:f8(this,Fe(ze(t)));return;case 16:d8(this,Fe(ze(t)));return;case 18:mQ(this,Fe(ze(t)));return}Jl(this,n-dt((jn(),Xm)),Mn((i=u(Xn(this,16),29),i||Xm),n),t)},s.fi=function(){return jn(),Xm},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:X(this.Cb,88)&&Y2(Ms(u(this.Cb,88)),4),Mo(this,null);return;case 2:Ld(this,!0);return;case 3:Pd(this,!0);return;case 4:Nd(this,0);return;case 5:this.b=0,$2(this,1);return;case 8:cg(this,null);return;case 9:i=Fa(this,null,null),i&&i.mj();return;case 10:l8(this,!0);return;case 11:h8(this,!1);return;case 12:a8(this,!1);return;case 13:this.i=null,xB(this,null);return;case 15:f8(this,!1);return;case 16:d8(this,!1);return;case 18:mQ(this,!1);return}Fl(this,n-dt((jn(),Xm)),Mn((t=u(Xn(this,16),29),t||Xm),n))},s.mi=function(){XY(this),$9(Vc((ls(),nc),this)),ff(this),this.Bb|=1},s.Hk=function(){return Y0e(this)},s.Wk=function(n,t){return this.b=0,this.a=null,z1e(this,n,t)},s.Xk=function(n){xAe(this,n)},s.Ib=function(){var n;return(this.Db&64)!=0?Jz(this):(n=new cf(Jz(this)),n.a+=" (iD: ",yd(n,(this.Bb&Ru)!=0),n.a+=")",n.a)},s.b=0,v(Jn,"EAttributeImpl",335),m(360,439,{109:1,94:1,93:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,161:1,117:1,118:1,681:1}),s.bl=function(n){return n.Ah()==this},s.xh=function(n){return WQ(this,n)},s.yh=function(n,t){this.w=null,this.Db=t<<16|this.Db&255,this.Cb=n},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return Gw(this);case 4:return this.gk();case 5:return this.F;case 6:return t?ol(this):z9(this);case 7:return!this.A&&(this.A=new rs(Fo,this,7)),this.A}return Pl(this,n-dt(this.fi()),Mn((r=u(Xn(this,16),29),r||this.fi()),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 6:return this.Cb&&(i=(c=this.Db>>16,c>=0?WQ(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,6,i)}return o=u(Mn((r=u(Xn(this,16),29),r||this.fi()),t),69),o.uk().xk(this,Lo(this),t-dt(this.fi()),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 6:return hl(this,null,6,i);case 7:return!this.A&&(this.A=new rs(Fo,this,7)),vc(this.A,n,i)}return c=u(Mn((r=u(Xn(this,16),29),r||this.fi()),t),69),c.uk().yk(this,Lo(this),t-dt(this.fi()),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!Gw(this);case 4:return this.gk()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!z9(this);case 7:return!!this.A&&this.A.i!=0}return Ll(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:zR(this,Pt(t));return;case 2:AK(this,Pt(t));return;case 5:D8(this,Pt(t));return;case 7:!this.A&&(this.A=new rs(Fo,this,7)),kt(this.A),!this.A&&(this.A=new rs(Fo,this,7)),nr(this.A,u(t,18));return}Jl(this,n-dt(this.fi()),Mn((i=u(Xn(this,16),29),i||this.fi()),n),t)},s.fi=function(){return jn(),Jan},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:X(this.Cb,184)&&(u(this.Cb,184).tb=null),Mo(this,null);return;case 2:c8(this,null),K9(this,this.D);return;case 5:D8(this,null);return;case 7:!this.A&&(this.A=new rs(Fo,this,7)),kt(this.A);return}Fl(this,n-dt(this.fi()),Mn((t=u(Xn(this,16),29),t||this.fi()),n))},s.fk=function(){var n;return this.G==-1&&(this.G=(n=ol(this),n?$d(n.si(),this):-1)),this.G},s.gk=function(){return null},s.hk=function(){return ol(this)},s.cl=function(){return this.v},s.ik=function(){return Gw(this)},s.jk=function(){return this.D!=null?this.D:this.B},s.kk=function(){return this.F},s.dk=function(n){return JW(this,n)},s.dl=function(n){this.v=n},s.el=function(n){GBe(this,n)},s.fl=function(n){this.C=n},s.ri=function(n){zR(this,n)},s.Ib=function(){return QB(this)},s.C=null,s.D=null,s.G=-1,v(Jn,"EClassifierImpl",360),m(88,360,{109:1,94:1,93:1,29:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,88:1,360:1,161:1,471:1,117:1,118:1,681:1},rj),s.bl=function(n){return o2n(this,n.Ah())},s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return Gw(this);case 4:return null;case 5:return this.F;case 6:return t?ol(this):z9(this);case 7:return!this.A&&(this.A=new rs(Fo,this,7)),this.A;case 8:return $n(),(this.Bb&256)!=0;case 9:return $n(),(this.Bb&512)!=0;case 10:return tu(this);case 11:return!this.q&&(this.q=new we(yf,this,11,10)),this.q;case 12:return g3(this);case 13:return fS(this);case 14:return fS(this),this.r;case 15:return g3(this),this.k;case 16:return B0e(this);case 17:return UW(this);case 18:return kh(this);case 19:return Dz(this);case 20:return g3(this),this.o;case 21:return!this.s&&(this.s=new we(ns,this,21,17)),this.s;case 22:return Vu(this);case 23:return IW(this)}return Pl(this,n-dt((jn(),yb)),Mn((r=u(Xn(this,16),29),r||yb),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 6:return this.Cb&&(i=(c=this.Db>>16,c>=0?WQ(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,6,i);case 11:return!this.q&&(this.q=new we(yf,this,11,10)),Co(this.q,n,i);case 21:return!this.s&&(this.s=new we(ns,this,21,17)),Co(this.s,n,i)}return o=u(Mn((r=u(Xn(this,16),29),r||(jn(),yb)),t),69),o.uk().xk(this,Lo(this),t-dt((jn(),yb)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 6:return hl(this,null,6,i);case 7:return!this.A&&(this.A=new rs(Fo,this,7)),vc(this.A,n,i);case 11:return!this.q&&(this.q=new we(yf,this,11,10)),vc(this.q,n,i);case 21:return!this.s&&(this.s=new we(ns,this,21,17)),vc(this.s,n,i);case 22:return vc(Vu(this),n,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),yb)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),yb)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!Gw(this);case 4:return!1;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!z9(this);case 7:return!!this.A&&this.A.i!=0;case 8:return(this.Bb&256)!=0;case 9:return(this.Bb&512)!=0;case 10:return!!this.u&&Vu(this.u.a).i!=0&&!(this.n&&FQ(this.n));case 11:return!!this.q&&this.q.i!=0;case 12:return g3(this).i!=0;case 13:return fS(this).i!=0;case 14:return fS(this),this.r.i!=0;case 15:return g3(this),this.k.i!=0;case 16:return B0e(this).i!=0;case 17:return UW(this).i!=0;case 18:return kh(this).i!=0;case 19:return Dz(this).i!=0;case 20:return g3(this),!!this.o;case 21:return!!this.s&&this.s.i!=0;case 22:return!!this.n&&FQ(this.n);case 23:return IW(this).i!=0}return Ll(this,n-dt((jn(),yb)),Mn((t=u(Xn(this,16),29),t||yb),n))},s.Wh=function(n){var t;return t=this.i==null||this.q&&this.q.i!=0?null:ZO(this,n),t||Cge(this,n)},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:zR(this,Pt(t));return;case 2:AK(this,Pt(t));return;case 5:D8(this,Pt(t));return;case 7:!this.A&&(this.A=new rs(Fo,this,7)),kt(this.A),!this.A&&(this.A=new rs(Fo,this,7)),nr(this.A,u(t,18));return;case 8:H1e(this,Fe(ze(t)));return;case 9:G1e(this,Fe(ze(t)));return;case 10:dS(tu(this)),nr(tu(this),u(t,18));return;case 11:!this.q&&(this.q=new we(yf,this,11,10)),kt(this.q),!this.q&&(this.q=new we(yf,this,11,10)),nr(this.q,u(t,18));return;case 21:!this.s&&(this.s=new we(ns,this,21,17)),kt(this.s),!this.s&&(this.s=new we(ns,this,21,17)),nr(this.s,u(t,18));return;case 22:kt(Vu(this)),nr(Vu(this),u(t,18));return}Jl(this,n-dt((jn(),yb)),Mn((i=u(Xn(this,16),29),i||yb),n),t)},s.fi=function(){return jn(),yb},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:X(this.Cb,184)&&(u(this.Cb,184).tb=null),Mo(this,null);return;case 2:c8(this,null),K9(this,this.D);return;case 5:D8(this,null);return;case 7:!this.A&&(this.A=new rs(Fo,this,7)),kt(this.A);return;case 8:H1e(this,!1);return;case 9:G1e(this,!1);return;case 10:this.u&&dS(this.u);return;case 11:!this.q&&(this.q=new we(yf,this,11,10)),kt(this.q);return;case 21:!this.s&&(this.s=new we(ns,this,21,17)),kt(this.s);return;case 22:this.n&&kt(this.n);return}Fl(this,n-dt((jn(),yb)),Mn((t=u(Xn(this,16),29),t||yb),n))},s.mi=function(){var n,t;if(g3(this),fS(this),B0e(this),UW(this),kh(this),Dz(this),IW(this),yE(Tvn(Ms(this))),this.s)for(n=0,t=this.s.i;n=0;--t)K(this,t);return hde(this,n)},s.Ek=function(){kt(this)},s.Xi=function(n,t){return wBe(this,n,t)},v(Ri,"EcoreEList",623),m(491,623,au,PT),s.Ji=function(){return!1},s.Jj=function(){return this.c},s.Kj=function(){return!1},s.ml=function(){return!0},s.Qi=function(){return!0},s.Ui=function(n,t){return t},s.Wi=function(){return!1},s.c=0,v(Ri,"EObjectEList",491),m(81,491,au,mr),s.Kj=function(){return!0},s.kl=function(){return!1},s.$k=function(){return!0},v(Ri,"EObjectContainmentEList",81),m(543,81,au,B$),s.Li=function(){this.b=!0},s.Oj=function(){return this.b},s.Ek=function(){var n;kt(this),Fs(this.e)?(n=this.b,this.b=!1,hi(this.e,new Lf(this.e,2,this.c,n,!1))):this.b=!1},s.b=!1,v(Ri,"EObjectContainmentEList/Unsettable",543),m(1130,543,au,RIe),s.Ri=function(n,t){var i,r;return i=u(BE(this,n,t),87),Fs(this.e)&&f9(this,new rO(this.a,7,(jn(),Han),ke(t),(r=i.c,X(r,88)?u(r,29):jf),n)),i},s.Sj=function(n,t){return dEn(this,u(n,87),t)},s.Tj=function(n,t){return bEn(this,u(n,87),t)},s.Uj=function(n,t,i){return gAn(this,u(n,87),u(t,87),i)},s.Gj=function(n,t,i,r,c){switch(n){case 3:return bE(this,n,t,i,r,this.i>1);case 5:return bE(this,n,t,i,r,this.i-u(i,16).gc()>0);default:return new L1(this.e,n,this.c,t,i,r,!0)}},s.Rj=function(){return!0},s.Oj=function(){return FQ(this)},s.Ek=function(){kt(this)},v(Jn,"EClassImpl/1",1130),m(1144,1143,eme),s.bj=function(n){var t,i,r,c,o,l,f;if(i=n.ej(),i!=8){if(r=QEn(n),r==0)switch(i){case 1:case 9:{f=n.ij(),f!=null&&(t=Ms(u(f,471)),!t.c&&(t.c=new Ol),fB(t.c,n.hj())),l=n.gj(),l!=null&&(c=u(l,471),(c.Bb&1)==0&&(t=Ms(c),!t.c&&(t.c=new Ol),Et(t.c,u(n.hj(),29))));break}case 3:{l=n.gj(),l!=null&&(c=u(l,471),(c.Bb&1)==0&&(t=Ms(c),!t.c&&(t.c=new Ol),Et(t.c,u(n.hj(),29))));break}case 5:{if(l=n.gj(),l!=null)for(o=u(l,18).Jc();o.Ob();)c=u(o.Pb(),471),(c.Bb&1)==0&&(t=Ms(c),!t.c&&(t.c=new Ol),Et(t.c,u(n.hj(),29)));break}case 4:{f=n.ij(),f!=null&&(c=u(f,471),(c.Bb&1)==0&&(t=Ms(c),!t.c&&(t.c=new Ol),fB(t.c,n.hj())));break}case 6:{if(f=n.ij(),f!=null)for(o=u(f,18).Jc();o.Ob();)c=u(o.Pb(),471),(c.Bb&1)==0&&(t=Ms(c),!t.c&&(t.c=new Ol),fB(t.c,n.hj()));break}}this.ol(r)}},s.ol=function(n){MXe(this,n)},s.b=63,v(Jn,"ESuperAdapter",1144),m(1145,1144,eme,RSe),s.ol=function(n){Y2(this,n)},v(Jn,"EClassImpl/10",1145),m(1134,699,au),s.Ci=function(n,t){return fW(this,n,t)},s.Di=function(n){return oHe(this,n)},s.Ei=function(n,t){MO(this,n,t)},s.Fi=function(n){WT(this,n)},s.Yi=function(n){return phe(this,n)},s.Vi=function(n,t){return xY(this,n,t)},s.Uk=function(n,t){throw R(new _t)},s.Gi=function(){return new E4(this)},s.Hi=function(){return new ET(this)},s.Ii=function(n){return bO(this,n)},s.Vk=function(n,t){throw R(new _t)},s.Dk=function(n){return this},s.Oj=function(){return this.i!=0},s.Wb=function(n){throw R(new _t)},s.Ek=function(){throw R(new _t)},v(Ri,"EcoreEList/UnmodifiableEList",1134),m(333,1134,au,Pv),s.Wi=function(){return!1},v(Ri,"EcoreEList/UnmodifiableEList/FastCompare",333),m(1137,333,au,Pze),s.bd=function(n){var t,i,r;if(X(n,179)&&(t=u(n,179),i=t.Jj(),i!=-1)){for(r=this.i;i4)if(this.dk(n)){if(this.$k()){if(r=u(n,52),i=r.Bh(),f=i==this.b&&(this.kl()?r.vh(r.Ch(),u(Mn(Go(this.b),this.Jj()).Fk(),29).ik())==Oc(u(Mn(Go(this.b),this.Jj()),19)).n:-1-r.Ch()==this.Jj()),this.ll()&&!f&&!i&&r.Gh()){for(c=0;c1||r==-1)):!1},s.kl=function(){var n,t,i;return t=Mn(Go(this.b),this.Jj()),X(t,103)?(n=u(t,19),i=Oc(n),!!i):!1},s.ll=function(){var n,t;return t=Mn(Go(this.b),this.Jj()),X(t,103)?(n=u(t,19),(n.Bb&Ec)!=0):!1},s.bd=function(n){var t,i,r,c;if(r=this.xj(n),r>=0)return r;if(this.ml()){for(i=0,c=this.Cj();i=0;--n)oN(this,n,this.vj(n));return this.Dj()},s.Oc=function(n){var t;if(this.ll())for(t=this.Cj()-1;t>=0;--t)oN(this,t,this.vj(t));return this.Ej(n)},s.Ek=function(){dS(this)},s.Xi=function(n,t){return z$e(this,n,t)},v(Ri,"DelegatingEcoreEList",744),m(1140,744,rme,YOe),s.oj=function(n,t){Ppn(this,n,u(t,29))},s.pj=function(n){Ewn(this,u(n,29))},s.vj=function(n){var t,i;return t=u(K(Vu(this.a),n),87),i=t.c,X(i,88)?u(i,29):(jn(),jf)},s.Aj=function(n){var t,i;return t=u(Z2(Vu(this.a),n),87),i=t.c,X(i,88)?u(i,29):(jn(),jf)},s.Bj=function(n,t){return HSn(this,n,u(t,29))},s.Ji=function(){return!1},s.Gj=function(n,t,i,r,c){return null},s.qj=function(){return new FSe(this)},s.rj=function(){kt(Vu(this.a))},s.sj=function(n){return DFe(this,n)},s.tj=function(n){var t,i;for(i=n.Jc();i.Ob();)if(t=i.Pb(),!DFe(this,t))return!1;return!0},s.uj=function(n){var t,i,r;if(X(n,16)&&(r=u(n,16),r.gc()==Vu(this.a).i)){for(t=r.Jc(),i=new st(this);t.Ob();)if(ue(t.Pb())!==ue(ft(i)))return!1;return!0}return!1},s.wj=function(){var n,t,i,r,c;for(i=1,t=new st(Vu(this.a));t.e!=t.i.gc();)n=u(ft(t),87),r=(c=n.c,X(c,88)?u(c,29):(jn(),jf)),i=31*i+(r?jw(r):0);return i},s.xj=function(n){var t,i,r,c;for(r=0,i=new st(Vu(this.a));i.e!=i.i.gc();){if(t=u(ft(i),87),ue(n)===ue((c=t.c,X(c,88)?u(c,29):(jn(),jf))))return r;++r}return-1},s.yj=function(){return Vu(this.a).i==0},s.zj=function(){return null},s.Cj=function(){return Vu(this.a).i},s.Dj=function(){var n,t,i,r,c,o;for(o=Vu(this.a).i,c=se(Mr,On,1,o,5,1),i=0,t=new st(Vu(this.a));t.e!=t.i.gc();)n=u(ft(t),87),c[i++]=(r=n.c,X(r,88)?u(r,29):(jn(),jf));return c},s.Ej=function(n){var t,i,r,c,o,l,f;for(f=Vu(this.a).i,n.lengthf&&ir(n,f,null),r=0,i=new st(Vu(this.a));i.e!=i.i.gc();)t=u(ft(i),87),o=(l=t.c,X(l,88)?u(l,29):(jn(),jf)),ir(n,r++,o);return n},s.Fj=function(){var n,t,i,r,c;for(c=new vd,c.a+="[",n=Vu(this.a),t=0,r=Vu(this.a).i;t>16,c>=0?WQ(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,6,i);case 9:return!this.a&&(this.a=new we(ed,this,9,5)),Co(this.a,n,i)}return o=u(Mn((r=u(Xn(this,16),29),r||(jn(),kb)),t),69),o.uk().xk(this,Lo(this),t-dt((jn(),kb)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 6:return hl(this,null,6,i);case 7:return!this.A&&(this.A=new rs(Fo,this,7)),vc(this.A,n,i);case 9:return!this.a&&(this.a=new we(ed,this,9,5)),vc(this.a,n,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),kb)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),kb)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!Gw(this);case 4:return!!O1e(this);case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!z9(this);case 7:return!!this.A&&this.A.i!=0;case 8:return(this.Bb&256)==0;case 9:return!!this.a&&this.a.i!=0}return Ll(this,n-dt((jn(),kb)),Mn((t=u(Xn(this,16),29),t||kb),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:zR(this,Pt(t));return;case 2:AK(this,Pt(t));return;case 5:D8(this,Pt(t));return;case 7:!this.A&&(this.A=new rs(Fo,this,7)),kt(this.A),!this.A&&(this.A=new rs(Fo,this,7)),nr(this.A,u(t,18));return;case 8:HB(this,Fe(ze(t)));return;case 9:!this.a&&(this.a=new we(ed,this,9,5)),kt(this.a),!this.a&&(this.a=new we(ed,this,9,5)),nr(this.a,u(t,18));return}Jl(this,n-dt((jn(),kb)),Mn((i=u(Xn(this,16),29),i||kb),n),t)},s.fi=function(){return jn(),kb},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:X(this.Cb,184)&&(u(this.Cb,184).tb=null),Mo(this,null);return;case 2:c8(this,null),K9(this,this.D);return;case 5:D8(this,null);return;case 7:!this.A&&(this.A=new rs(Fo,this,7)),kt(this.A);return;case 8:HB(this,!0);return;case 9:!this.a&&(this.a=new we(ed,this,9,5)),kt(this.a);return}Fl(this,n-dt((jn(),kb)),Mn((t=u(Xn(this,16),29),t||kb),n))},s.mi=function(){var n,t;if(this.a)for(n=0,t=this.a.i;n>16==5?u(this.Cb,675):null}return Pl(this,n-dt((jn(),n0)),Mn((r=u(Xn(this,16),29),r||n0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 5:return this.Cb&&(i=(c=this.Db>>16,c>=0?_He(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,5,i)}return o=u(Mn((r=u(Xn(this,16),29),r||(jn(),n0)),t),69),o.uk().xk(this,Lo(this),t-dt((jn(),n0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 5:return hl(this,null,5,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),n0)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),n0)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.d!=0;case 3:return!!this.b;case 4:return this.c!=null;case 5:return!!(this.Db>>16==5&&u(this.Cb,675))}return Ll(this,n-dt((jn(),n0)),Mn((t=u(Xn(this,16),29),t||n0),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:Mo(this,Pt(t));return;case 2:IY(this,u(t,15).a);return;case 3:$qe(this,u(t,2001));return;case 4:_Y(this,Pt(t));return}Jl(this,n-dt((jn(),n0)),Mn((i=u(Xn(this,16),29),i||n0),n),t)},s.fi=function(){return jn(),n0},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:Mo(this,null);return;case 2:IY(this,0);return;case 3:$qe(this,null);return;case 4:_Y(this,null);return}Fl(this,n-dt((jn(),n0)),Mn((t=u(Xn(this,16),29),t||n0),n))},s.Ib=function(){var n;return n=this.c,n??this.zb},s.b=null,s.c=null,s.d=0,v(Jn,"EEnumLiteralImpl",568);var ezn=Gi(Jn,"EFactoryImpl/InternalEDateTimeFormat");m(485,1,{2076:1},KC),v(Jn,"EFactoryImpl/1ClientInternalEDateTimeFormat",485),m(248,118,{109:1,94:1,93:1,87:1,57:1,114:1,52:1,100:1,248:1,117:1,118:1},gw),s.zh=function(n,t,i){var r;return i=hl(this,n,t,i),this.e&&X(n,179)&&(r=Iz(this,this.e),r!=this.c&&(i=_8(this,r,i))),i},s.Ih=function(n,t,i){var r;switch(n){case 0:return this.f;case 1:return!this.d&&(this.d=new mr(Rc,this,1)),this.d;case 2:return t?Gz(this):this.c;case 3:return this.b;case 4:return this.e;case 5:return t?GQ(this):this.a}return Pl(this,n-dt((jn(),Ep)),Mn((r=u(Xn(this,16),29),r||Ep),n),t,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return vFe(this,null,i);case 1:return!this.d&&(this.d=new mr(Rc,this,1)),vc(this.d,n,i);case 3:return mFe(this,null,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),Ep)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),Ep)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.f;case 1:return!!this.d&&this.d.i!=0;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return Ll(this,n-dt((jn(),Ep)),Mn((t=u(Xn(this,16),29),t||Ep),n))},s.$h=function(n,t){var i;switch(n){case 0:ZHe(this,u(t,87));return;case 1:!this.d&&(this.d=new mr(Rc,this,1)),kt(this.d),!this.d&&(this.d=new mr(Rc,this,1)),nr(this.d,u(t,18));return;case 3:u0e(this,u(t,87));return;case 4:x0e(this,u(t,834));return;case 5:X9(this,u(t,143));return}Jl(this,n-dt((jn(),Ep)),Mn((i=u(Xn(this,16),29),i||Ep),n),t)},s.fi=function(){return jn(),Ep},s.hi=function(n){var t;switch(n){case 0:ZHe(this,null);return;case 1:!this.d&&(this.d=new mr(Rc,this,1)),kt(this.d);return;case 3:u0e(this,null);return;case 4:x0e(this,null);return;case 5:X9(this,null);return}Fl(this,n-dt((jn(),Ep)),Mn((t=u(Xn(this,16),29),t||Ep),n))},s.Ib=function(){var n;return n=new tl(Ff(this)),n.a+=" (expression: ",QW(this,n),n.a+=")",n.a};var Q8e;v(Jn,"EGenericTypeImpl",248),m(2029,2024,YF),s.Ei=function(n,t){WOe(this,n,t)},s.Uk=function(n,t){return WOe(this,this.gc(),n),t},s.Yi=function(n){return Yu(this.nj(),n)},s.Gi=function(){return this.Hi()},s.nj=function(){return new qSe(this)},s.Hi=function(){return this.Ii(0)},s.Ii=function(n){return this.nj().dd(n)},s.Vk=function(n,t){return H2(this,n,!0),t},s.Ri=function(n,t){var i,r;return r=nW(this,t),i=this.dd(n),i.Rb(r),r},s.Si=function(n,t){var i;H2(this,t,!0),i=this.dd(n),i.Rb(t)},v(Ri,"AbstractSequentialInternalEList",2029),m(482,2029,YF,ST),s.Yi=function(n){return Yu(this.nj(),n)},s.Gi=function(){return this.b==null?(Ed(),Ed(),iD):this.ql()},s.nj=function(){return new pTe(this.a,this.b)},s.Hi=function(){return this.b==null?(Ed(),Ed(),iD):this.ql()},s.Ii=function(n){var t,i;if(this.b==null){if(n<0||n>1)throw R(new jo(RS+n+", size=0"));return Ed(),Ed(),iD}for(i=this.ql(),t=0;t0;)if(t=this.c[--this.d],(!this.e||t.nk()!=K7||t.Jj()!=0)&&(!this.tl()||this.b.Uh(t))){if(o=this.b.Kh(t,this.sl()),this.f=(Tc(),u(t,69).vk()),this.f||t.Hk()){if(this.sl()?(r=u(o,16),this.k=r):(r=u(o,72),this.k=this.j=r),X(this.k,59)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j.Ii(this.k.gc()):this.k.dd(this.k.gc()),this.p?QGe(this,this.p):oqe(this))return c=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(n=u(c,75),n.Jk(),i=n.kd(),this.i=i):(i=c,this.i=i),this.g=-3,!0}else if(o!=null)return this.k=null,this.p=null,i=o,this.i=i,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}else return c=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(n=u(c,75),n.Jk(),i=n.kd(),this.i=i):(i=c,this.i=i),this.g=-3,!0}},s.Pb=function(){return IB(this)},s.Tb=function(){return this.a},s.Ub=function(){var n;if(this.g<-1||this.Sb())return--this.a,this.g=0,n=this.i,this.Sb(),n;throw R(new hu)},s.Vb=function(){return this.a-1},s.Qb=function(){throw R(new _t)},s.sl=function(){return!1},s.Wb=function(n){throw R(new _t)},s.tl=function(){return!0},s.a=0,s.d=0,s.f=!1,s.g=0,s.n=0,s.o=0;var iD;v(Ri,"EContentsEList/FeatureIteratorImpl",287),m(700,287,QF,ple),s.sl=function(){return!0},v(Ri,"EContentsEList/ResolvingFeatureIteratorImpl",700),m(1147,700,QF,_Oe),s.tl=function(){return!1},v(Jn,"ENamedElementImpl/1/1",1147),m(1148,287,QF,LOe),s.tl=function(){return!1},v(Jn,"ENamedElementImpl/1/2",1148),m(39,151,zN,_2,rY,Dr,mY,L1,Lf,The,yLe,Ohe,kLe,Gae,jLe,Dhe,ELe,qae,SLe,Nhe,xLe,oE,rO,RV,Ihe,ALe,Uae,MLe),s.Ij=function(){return ahe(this)},s.Pj=function(){var n;return n=ahe(this),n?n.gk():null},s.fj=function(n){return this.b==-1&&this.a&&(this.b=this.c.Eh(this.a.Jj(),this.a.nk())),this.c.vh(this.b,n)},s.hj=function(){return this.c},s.Qj=function(){var n;return n=ahe(this),n?n.rk():!1},s.b=-1,v(Jn,"ENotificationImpl",39),m(403,293,{109:1,94:1,93:1,158:1,197:1,57:1,62:1,114:1,470:1,52:1,100:1,161:1,403:1,293:1,117:1,118:1},yX),s.xh=function(n){return PHe(this,n)},s.Ih=function(n,t,i){var r,c,o;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return $n(),(this.Bb&256)!=0;case 3:return $n(),(this.Bb&512)!=0;case 4:return ke(this.s);case 5:return ke(this.t);case 6:return $n(),o=this.t,o>1||o==-1;case 7:return $n(),c=this.s,c>=1;case 8:return t?ff(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?u(this.Cb,29):null;case 11:return!this.d&&(this.d=new rs(Fo,this,11)),this.d;case 12:return!this.c&&(this.c=new we(jp,this,12,10)),this.c;case 13:return!this.a&&(this.a=new CT(this,this)),this.a;case 14:return Ts(this)}return Pl(this,n-dt((jn(),t0)),Mn((r=u(Xn(this,16),29),r||t0),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 10:return this.Cb&&(i=(c=this.Db>>16,c>=0?PHe(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,10,i);case 12:return!this.c&&(this.c=new we(jp,this,12,10)),Co(this.c,n,i)}return o=u(Mn((r=u(Xn(this,16),29),r||(jn(),t0)),t),69),o.uk().xk(this,Lo(this),t-dt((jn(),t0)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 9:return SV(this,i);case 10:return hl(this,null,10,i);case 11:return!this.d&&(this.d=new rs(Fo,this,11)),vc(this.d,n,i);case 12:return!this.c&&(this.c=new we(jp,this,12,10)),vc(this.c,n,i);case 14:return vc(Ts(this),n,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),t0)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),t0)),n,i)},s.Th=function(n){var t,i,r;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Mw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mw(this.q).i==0);case 10:return!!(this.Db>>16==10&&u(this.Cb,29));case 11:return!!this.d&&this.d.i!=0;case 12:return!!this.c&&this.c.i!=0;case 13:return!!this.a&&Ts(this.a.a).i!=0&&!(this.b&&JQ(this.b));case 14:return!!this.b&&JQ(this.b)}return Ll(this,n-dt((jn(),t0)),Mn((t=u(Xn(this,16),29),t||t0),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:Mo(this,Pt(t));return;case 2:Ld(this,Fe(ze(t)));return;case 3:Pd(this,Fe(ze(t)));return;case 4:Nd(this,u(t,15).a);return;case 5:$2(this,u(t,15).a);return;case 8:cg(this,u(t,143));return;case 9:r=Fa(this,u(t,87),null),r&&r.mj();return;case 11:!this.d&&(this.d=new rs(Fo,this,11)),kt(this.d),!this.d&&(this.d=new rs(Fo,this,11)),nr(this.d,u(t,18));return;case 12:!this.c&&(this.c=new we(jp,this,12,10)),kt(this.c),!this.c&&(this.c=new we(jp,this,12,10)),nr(this.c,u(t,18));return;case 13:!this.a&&(this.a=new CT(this,this)),dS(this.a),!this.a&&(this.a=new CT(this,this)),nr(this.a,u(t,18));return;case 14:kt(Ts(this)),nr(Ts(this),u(t,18));return}Jl(this,n-dt((jn(),t0)),Mn((i=u(Xn(this,16),29),i||t0),n),t)},s.fi=function(){return jn(),t0},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:Mo(this,null);return;case 2:Ld(this,!0);return;case 3:Pd(this,!0);return;case 4:Nd(this,0);return;case 5:$2(this,1);return;case 8:cg(this,null);return;case 9:i=Fa(this,null,null),i&&i.mj();return;case 11:!this.d&&(this.d=new rs(Fo,this,11)),kt(this.d);return;case 12:!this.c&&(this.c=new we(jp,this,12,10)),kt(this.c);return;case 13:this.a&&dS(this.a);return;case 14:this.b&&kt(this.b);return}Fl(this,n-dt((jn(),t0)),Mn((t=u(Xn(this,16),29),t||t0),n))},s.mi=function(){var n,t;if(this.c)for(n=0,t=this.c.i;nf&&ir(n,f,null),r=0,i=new st(Ts(this.a));i.e!=i.i.gc();)t=u(ft(i),87),o=(l=t.c,l||(jn(),rh)),ir(n,r++,o);return n},s.Fj=function(){var n,t,i,r,c;for(c=new vd,c.a+="[",n=Ts(this.a),t=0,r=Ts(this.a).i;t1);case 5:return bE(this,n,t,i,r,this.i-u(i,16).gc()>0);default:return new L1(this.e,n,this.c,t,i,r,!0)}},s.Rj=function(){return!0},s.Oj=function(){return JQ(this)},s.Ek=function(){kt(this)},v(Jn,"EOperationImpl/2",1331),m(493,1,{1999:1,493:1},YCe),v(Jn,"EPackageImpl/1",493),m(14,81,au,we),s.gl=function(){return this.d},s.hl=function(){return this.b},s.kl=function(){return!0},s.b=0,v(Ri,"EObjectContainmentWithInverseEList",14),m(361,14,au,x4),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectContainmentWithInverseEList/Resolving",361),m(312,361,au,x2),s.Li=function(){this.a.tb=null},v(Jn,"EPackageImpl/2",312),m(1243,1,{},Ss),v(Jn,"EPackageImpl/3",1243),m(721,44,v3,yoe),s._b=function(n){return $r(n)?BV(this,n):!!Xc(this.f,n)},v(Jn,"EPackageRegistryImpl",721),m(503,293,{109:1,94:1,93:1,158:1,197:1,57:1,2078:1,114:1,470:1,52:1,100:1,161:1,503:1,293:1,117:1,118:1},kX),s.xh=function(n){return $He(this,n)},s.Ih=function(n,t,i){var r,c,o;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return $n(),(this.Bb&256)!=0;case 3:return $n(),(this.Bb&512)!=0;case 4:return ke(this.s);case 5:return ke(this.t);case 6:return $n(),o=this.t,o>1||o==-1;case 7:return $n(),c=this.s,c>=1;case 8:return t?ff(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?u(this.Cb,62):null}return Pl(this,n-dt((jn(),Km)),Mn((r=u(Xn(this,16),29),r||Km),n),t,i)},s.Ph=function(n,t,i){var r,c,o;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),Co(this.Ab,n,i);case 10:return this.Cb&&(i=(c=this.Db>>16,c>=0?$He(this,i):this.Cb.Qh(this,-1-c,null,i))),hl(this,n,10,i)}return o=u(Mn((r=u(Xn(this,16),29),r||(jn(),Km)),t),69),o.uk().xk(this,Lo(this),t-dt((jn(),Km)),n,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 9:return SV(this,i);case 10:return hl(this,null,10,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),Km)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),Km)),n,i)},s.Th=function(n){var t,i,r;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Mw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mw(this.q).i==0);case 10:return!!(this.Db>>16==10&&u(this.Cb,62))}return Ll(this,n-dt((jn(),Km)),Mn((t=u(Xn(this,16),29),t||Km),n))},s.fi=function(){return jn(),Km},v(Jn,"EParameterImpl",503),m(103,451,{109:1,94:1,93:1,158:1,197:1,57:1,19:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,103:1,451:1,293:1,117:1,118:1,682:1},kle),s.Ih=function(n,t,i){var r,c,o,l;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return $n(),(this.Bb&256)!=0;case 3:return $n(),(this.Bb&512)!=0;case 4:return ke(this.s);case 5:return ke(this.t);case 6:return $n(),l=this.t,l>1||l==-1;case 7:return $n(),c=this.s,c>=1;case 8:return t?ff(this):this.r;case 9:return this.q;case 10:return $n(),(this.Bb&Gf)!=0;case 11:return $n(),(this.Bb&V0)!=0;case 12:return $n(),(this.Bb&cm)!=0;case 13:return this.j;case 14:return A8(this);case 15:return $n(),(this.Bb&as)!=0;case 16:return $n(),(this.Bb&jh)!=0;case 17:return O2(this);case 18:return $n(),(this.Bb&Ru)!=0;case 19:return $n(),o=Oc(this),!!(o&&(o.Bb&Ru)!=0);case 20:return $n(),(this.Bb&Ec)!=0;case 21:return t?Oc(this):this.b;case 22:return t?d1e(this):GPe(this);case 23:return!this.a&&(this.a=new Jv(qm,this,23)),this.a}return Pl(this,n-dt((jn(),i5)),Mn((r=u(Xn(this,16),29),r||i5),n),t,i)},s.Th=function(n){var t,i,r,c;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return c=this.t,c>1||c==-1;case 7:return i=this.s,i>=1;case 8:return!!this.r&&!this.q.e&&Mw(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mw(this.q).i==0);case 10:return(this.Bb&Gf)==0;case 11:return(this.Bb&V0)!=0;case 12:return(this.Bb&cm)!=0;case 13:return this.j!=null;case 14:return A8(this)!=null;case 15:return(this.Bb&as)!=0;case 16:return(this.Bb&jh)!=0;case 17:return!!O2(this);case 18:return(this.Bb&Ru)!=0;case 19:return r=Oc(this),!!r&&(r.Bb&Ru)!=0;case 20:return(this.Bb&Ec)==0;case 21:return!!this.b;case 22:return!!GPe(this);case 23:return!!this.a&&this.a.i!=0}return Ll(this,n-dt((jn(),i5)),Mn((t=u(Xn(this,16),29),t||i5),n))},s.$h=function(n,t){var i,r;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:XV(this,Pt(t));return;case 2:Ld(this,Fe(ze(t)));return;case 3:Pd(this,Fe(ze(t)));return;case 4:Nd(this,u(t,15).a);return;case 5:$2(this,u(t,15).a);return;case 8:cg(this,u(t,143));return;case 9:r=Fa(this,u(t,87),null),r&&r.mj();return;case 10:l8(this,Fe(ze(t)));return;case 11:h8(this,Fe(ze(t)));return;case 12:a8(this,Fe(ze(t)));return;case 13:Dse(this,Pt(t));return;case 15:f8(this,Fe(ze(t)));return;case 16:d8(this,Fe(ze(t)));return;case 18:L4n(this,Fe(ze(t)));return;case 20:Y1e(this,Fe(ze(t)));return;case 21:Khe(this,u(t,19));return;case 23:!this.a&&(this.a=new Jv(qm,this,23)),kt(this.a),!this.a&&(this.a=new Jv(qm,this,23)),nr(this.a,u(t,18));return}Jl(this,n-dt((jn(),i5)),Mn((i=u(Xn(this,16),29),i||i5),n),t)},s.fi=function(){return jn(),i5},s.hi=function(n){var t,i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:X(this.Cb,88)&&Y2(Ms(u(this.Cb,88)),4),Mo(this,null);return;case 2:Ld(this,!0);return;case 3:Pd(this,!0);return;case 4:Nd(this,0);return;case 5:$2(this,1);return;case 8:cg(this,null);return;case 9:i=Fa(this,null,null),i&&i.mj();return;case 10:l8(this,!0);return;case 11:h8(this,!1);return;case 12:a8(this,!1);return;case 13:this.i=null,xB(this,null);return;case 15:f8(this,!1);return;case 16:d8(this,!1);return;case 18:Q1e(this,!1),X(this.Cb,88)&&Y2(Ms(u(this.Cb,88)),2);return;case 20:Y1e(this,!0);return;case 21:Khe(this,null);return;case 23:!this.a&&(this.a=new Jv(qm,this,23)),kt(this.a);return}Fl(this,n-dt((jn(),i5)),Mn((t=u(Xn(this,16),29),t||i5),n))},s.mi=function(){d1e(this),$9(Vc((ls(),nc),this)),ff(this),this.Bb|=1},s.sk=function(){return Oc(this)},s.Zk=function(){var n;return n=Oc(this),!!n&&(n.Bb&Ru)!=0},s.$k=function(){return(this.Bb&Ru)!=0},s._k=function(){return(this.Bb&Ec)!=0},s.Wk=function(n,t){return this.c=null,z1e(this,n,t)},s.Ib=function(){var n;return(this.Db&64)!=0?Jz(this):(n=new cf(Jz(this)),n.a+=" (containment: ",yd(n,(this.Bb&Ru)!=0),n.a+=", resolveProxies: ",yd(n,(this.Bb&Ec)!=0),n.a+=")",n.a)},v(Jn,"EReferenceImpl",103),m(549,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,549:1,117:1,118:1},$h),s.Fb=function(n){return this===n},s.jd=function(){return this.b},s.kd=function(){return this.c},s.Hb=function(){return jw(this)},s.Ai=function(n){Qvn(this,Pt(n))},s.ld=function(n){return zvn(this,Pt(n))},s.Ih=function(n,t,i){var r;switch(n){case 0:return this.b;case 1:return this.c}return Pl(this,n-dt((jn(),Ac)),Mn((r=u(Xn(this,16),29),r||Ac),n),t,i)},s.Th=function(n){var t;switch(n){case 0:return this.b!=null;case 1:return this.c!=null}return Ll(this,n-dt((jn(),Ac)),Mn((t=u(Xn(this,16),29),t||Ac),n))},s.$h=function(n,t){var i;switch(n){case 0:Wvn(this,Pt(t));return;case 1:Jhe(this,Pt(t));return}Jl(this,n-dt((jn(),Ac)),Mn((i=u(Xn(this,16),29),i||Ac),n),t)},s.fi=function(){return jn(),Ac},s.hi=function(n){var t;switch(n){case 0:qhe(this,null);return;case 1:Jhe(this,null);return}Fl(this,n-dt((jn(),Ac)),Mn((t=u(Xn(this,16),29),t||Ac),n))},s.yi=function(){var n;return this.a==-1&&(n=this.b,this.a=n==null?0:Id(n)),this.a},s.zi=function(n){this.a=n},s.Ib=function(){var n;return(this.Db&64)!=0?Ff(this):(n=new cf(Ff(this)),n.a+=" (key: ",Bc(n,this.b),n.a+=", value: ",Bc(n,this.c),n.a+=")",n.a)},s.a=-1,s.b=null,s.c=null;var Du=v(Jn,"EStringToStringMapEntryImpl",549),Zan=Gi(Ri,"FeatureMap/Entry/Internal");m(562,1,WF),s.vl=function(n){return this.wl(u(n,52))},s.wl=function(n){return this.vl(n)},s.Fb=function(n){var t,i;return this===n?!0:X(n,75)?(t=u(n,75),t.Jk()==this.c?(i=this.kd(),i==null?t.kd()==null:gi(i,t.kd())):!1):!1},s.Jk=function(){return this.c},s.Hb=function(){var n;return n=this.kd(),Ni(this.c)^(n==null?0:Ni(n))},s.Ib=function(){var n,t;return n=this.c,t=ol(n.ok()).vi(),n.ve(),(t!=null&&t.length!=0?t+":"+n.ve():n.ve())+"="+this.kd()},v(Jn,"EStructuralFeatureImpl/BasicFeatureMapEntry",562),m(777,562,WF,Mle),s.wl=function(n){return new Mle(this.c,n)},s.kd=function(){return this.a},s.xl=function(n,t,i){return E7n(this,n,this.a,t,i)},s.yl=function(n,t,i){return S7n(this,n,this.a,t,i)},v(Jn,"EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry",777),m(1304,1,{},QCe),s.wk=function(n,t,i,r,c){var o;return o=u(H9(n,this.b),219),o.Wl(this.a).Dk(r)},s.xk=function(n,t,i,r,c){var o;return o=u(H9(n,this.b),219),o.Nl(this.a,r,c)},s.yk=function(n,t,i,r,c){var o;return o=u(H9(n,this.b),219),o.Ol(this.a,r,c)},s.zk=function(n,t,i){var r;return r=u(H9(n,this.b),219),r.Wl(this.a).Oj()},s.Ak=function(n,t,i,r){var c;c=u(H9(n,this.b),219),c.Wl(this.a).Wb(r)},s.Bk=function(n,t,i){return u(H9(n,this.b),219).Wl(this.a)},s.Ck=function(n,t,i){var r;r=u(H9(n,this.b),219),r.Wl(this.a).Ek()},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator",1304),m(89,1,{},xd,Ub,Md,Wb),s.wk=function(n,t,i,r,c){var o;if(o=t.ii(i),o==null&&t.ji(i,o=eF(this,n)),!c)switch(this.e){case 50:case 41:return u(o,586)._j();case 40:return u(o,219).Tl()}return o},s.xk=function(n,t,i,r,c){var o,l;return l=t.ii(i),l==null&&t.ji(i,l=eF(this,n)),o=u(l,72).Uk(r,c),o},s.yk=function(n,t,i,r,c){var o;return o=t.ii(i),o!=null&&(c=u(o,72).Vk(r,c)),c},s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null&&u(r,77).Oj()},s.Ak=function(n,t,i,r){var c;c=u(t.ii(i),77),!c&&t.ji(i,c=eF(this,n)),c.Wb(r)},s.Bk=function(n,t,i){var r,c;return c=t.ii(i),c==null&&t.ji(i,c=eF(this,n)),X(c,77)?u(c,77):(r=u(t.ii(i),16),new HSe(r))},s.Ck=function(n,t,i){var r;r=u(t.ii(i),77),!r&&t.ji(i,r=eF(this,n)),r.Ek()},s.b=0,s.e=0,v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateMany",89),m(498,1,{}),s.xk=function(n,t,i,r,c){throw R(new _t)},s.yk=function(n,t,i,r,c){throw R(new _t)},s.Bk=function(n,t,i){return new KDe(this,n,t,i)};var d1;v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingle",498),m(1321,1,Lne,KDe),s.Dk=function(n){return this.a.wk(this.c,this.d,this.b,n,!0)},s.Oj=function(){return this.a.zk(this.c,this.d,this.b)},s.Wb=function(n){this.a.Ak(this.c,this.d,this.b,n)},s.Ek=function(){this.a.Ck(this.c,this.d,this.b)},s.b=0,v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingle/1",1321),m(770,498,{},bae),s.wk=function(n,t,i,r,c){return RW(n,n.Mh(),n.Ch())==this.b?this._k()&&r?xW(n):n.Mh():null},s.xk=function(n,t,i,r,c){var o,l;return n.Mh()&&(c=(o=n.Ch(),o>=0?n.xh(c):n.Mh().Qh(n,-1-o,null,c))),l=Ji(n.Ah(),this.e),n.zh(r,l,c)},s.yk=function(n,t,i,r,c){var o;return o=Ji(n.Ah(),this.e),n.zh(null,o,c)},s.zk=function(n,t,i){var r;return r=Ji(n.Ah(),this.e),!!n.Mh()&&n.Ch()==r},s.Ak=function(n,t,i,r){var c,o,l,f,h;if(r!=null&&!JW(this.a,r))throw R(new a9(ZF+(X(r,57)?c0e(u(r,57).Ah()):xhe(Us(r)))+eJ+this.a+"'"));if(c=n.Mh(),l=Ji(n.Ah(),this.e),ue(r)!==ue(c)||n.Ch()!=l&&r!=null){if(m8(n,u(r,57)))throw R(new qn(PS+n.Ib()));h=null,c&&(h=(o=n.Ch(),o>=0?n.xh(h):n.Mh().Qh(n,-1-o,null,h))),f=u(r,52),f&&(h=f.Oh(n,Ji(f.Ah(),this.b),null,h)),h=n.zh(f,l,h),h&&h.mj()}else n.sh()&&n.th()&&hi(n,new Dr(n,1,l,r,r))},s.Ck=function(n,t,i){var r,c,o,l;r=n.Mh(),r?(l=(c=n.Ch(),c>=0?n.xh(null):n.Mh().Qh(n,-1-c,null,null)),o=Ji(n.Ah(),this.e),l=n.zh(null,o,l),l&&l.mj()):n.sh()&&n.th()&&hi(n,new oE(n,1,this.e,null,null))},s._k=function(){return!1},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainer",770),m(1305,770,{},zNe),s._k=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving",1305),m(560,498,{}),s.wk=function(n,t,i,r,c){var o;return o=t.ii(i),o==null?this.b:ue(o)===ue(d1)?null:o},s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null&&(ue(r)===ue(d1)||!gi(r,this.b))},s.Ak=function(n,t,i,r){var c,o;n.sh()&&n.th()?(c=(o=t.ii(i),o==null?this.b:ue(o)===ue(d1)?null:o),r==null?this.c!=null?(t.ji(i,null),r=this.b):this.b!=null?t.ji(i,d1):t.ji(i,null):(this.zl(r),t.ji(i,r)),hi(n,this.d.Al(n,1,this.e,c,r))):r==null?this.c!=null?t.ji(i,null):this.b!=null?t.ji(i,d1):t.ji(i,null):(this.zl(r),t.ji(i,r))},s.Ck=function(n,t,i){var r,c;n.sh()&&n.th()?(r=(c=t.ii(i),c==null?this.b:ue(c)===ue(d1)?null:c),t.ki(i),hi(n,this.d.Al(n,1,this.e,r,this.b))):t.ki(i)},s.zl=function(n){throw R(new ZSe)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData",560),m(C3,1,{},sw),s.Al=function(n,t,i,r,c){return new oE(n,t,i,r,c)},s.Bl=function(n,t,i,r,c,o){return new RV(n,t,i,r,c,o)};var W8e,Z8e,e7e,n7e,t7e,i7e,r7e,Hce,c7e;v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator",C3),m(1322,C3,{},SL),s.Al=function(n,t,i,r,c){return new Uae(n,t,i,Fe(ze(r)),Fe(ze(c)))},s.Bl=function(n,t,i,r,c,o){return new MLe(n,t,i,Fe(ze(r)),Fe(ze(c)),o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1",1322),m(1323,C3,{},xL),s.Al=function(n,t,i,r,c){return new The(n,t,i,u(r,221).a,u(c,221).a)},s.Bl=function(n,t,i,r,c,o){return new yLe(n,t,i,u(r,221).a,u(c,221).a,o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2",1323),m(1324,C3,{},AL),s.Al=function(n,t,i,r,c){return new Ohe(n,t,i,u(r,180).a,u(c,180).a)},s.Bl=function(n,t,i,r,c,o){return new kLe(n,t,i,u(r,180).a,u(c,180).a,o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3",1324),m(1325,C3,{},bU),s.Al=function(n,t,i,r,c){return new Gae(n,t,i,ne(re(r)),ne(re(c)))},s.Bl=function(n,t,i,r,c,o){return new jLe(n,t,i,ne(re(r)),ne(re(c)),o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4",1325),m(1326,C3,{},Hk),s.Al=function(n,t,i,r,c){return new Dhe(n,t,i,u(r,164).a,u(c,164).a)},s.Bl=function(n,t,i,r,c,o){return new ELe(n,t,i,u(r,164).a,u(c,164).a,o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5",1326),m(1327,C3,{},Rh),s.Al=function(n,t,i,r,c){return new qae(n,t,i,u(r,15).a,u(c,15).a)},s.Bl=function(n,t,i,r,c,o){return new SLe(n,t,i,u(r,15).a,u(c,15).a,o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6",1327),m(1328,C3,{},g0),s.Al=function(n,t,i,r,c){return new Nhe(n,t,i,u(r,190).a,u(c,190).a)},s.Bl=function(n,t,i,r,c,o){return new xLe(n,t,i,u(r,190).a,u(c,190).a,o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7",1328),m(1329,C3,{},ML),s.Al=function(n,t,i,r,c){return new Ihe(n,t,i,u(r,191).a,u(c,191).a)},s.Bl=function(n,t,i,r,c,o){return new ALe(n,t,i,u(r,191).a,u(c,191).a,o)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8",1329),m(1307,560,{},WDe),s.zl=function(n){if(!this.a.dk(n))throw R(new a9(ZF+Us(n)+eJ+this.a+"'"))},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic",1307),m(1308,560,{},PIe),s.zl=function(n){},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic",1308),m(771,560,{}),s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null},s.Ak=function(n,t,i,r){var c,o;n.sh()&&n.th()?(c=!0,o=t.ii(i),o==null?(c=!1,o=this.b):ue(o)===ue(d1)&&(o=null),r==null?this.c!=null?(t.ji(i,null),r=this.b):t.ji(i,d1):(this.zl(r),t.ji(i,r)),hi(n,this.d.Bl(n,1,this.e,o,r,!c))):r==null?this.c!=null?t.ji(i,null):t.ji(i,d1):(this.zl(r),t.ji(i,r))},s.Ck=function(n,t,i){var r,c;n.sh()&&n.th()?(r=!0,c=t.ii(i),c==null?(r=!1,c=this.b):ue(c)===ue(d1)&&(c=null),t.ki(i),hi(n,this.d.Bl(n,2,this.e,c,this.b,r))):t.ki(i)},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable",771),m(1309,771,{},ZDe),s.zl=function(n){if(!this.a.dk(n))throw R(new a9(ZF+Us(n)+eJ+this.a+"'"))},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic",1309),m(1310,771,{},$Ie),s.zl=function(n){},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic",1310),m(402,498,{},fR),s.wk=function(n,t,i,r,c){var o,l,f,h,b;if(b=t.ii(i),this.rk()&&ue(b)===ue(d1))return null;if(this._k()&&r&&b!=null){if(f=u(b,52),f.Sh()&&(h=z0(n,f),f!=h)){if(!JW(this.a,h))throw R(new a9(ZF+Us(h)+eJ+this.a+"'"));t.ji(i,b=h),this.$k()&&(o=u(h,52),l=f.Qh(n,this.b?Ji(f.Ah(),this.b):-1-Ji(n.Ah(),this.e),null,null),!o.Mh()&&(l=o.Oh(n,this.b?Ji(o.Ah(),this.b):-1-Ji(n.Ah(),this.e),null,l)),l&&l.mj()),n.sh()&&n.th()&&hi(n,new oE(n,9,this.e,f,h))}return b}else return b},s.xk=function(n,t,i,r,c){var o,l;return l=t.ii(i),ue(l)===ue(d1)&&(l=null),t.ji(i,r),this.Kj()?ue(l)!==ue(r)&&l!=null&&(o=u(l,52),c=o.Qh(n,Ji(o.Ah(),this.b),null,c)):this.$k()&&l!=null&&(c=u(l,52).Qh(n,-1-Ji(n.Ah(),this.e),null,c)),n.sh()&&n.th()&&(!c&&(c=new k0(4)),c.lj(new oE(n,1,this.e,l,r))),c},s.yk=function(n,t,i,r,c){var o;return o=t.ii(i),ue(o)===ue(d1)&&(o=null),t.ki(i),n.sh()&&n.th()&&(!c&&(c=new k0(4)),this.rk()?c.lj(new oE(n,2,this.e,o,null)):c.lj(new oE(n,1,this.e,o,null))),c},s.zk=function(n,t,i){var r;return r=t.ii(i),r!=null},s.Ak=function(n,t,i,r){var c,o,l,f,h;if(r!=null&&!JW(this.a,r))throw R(new a9(ZF+(X(r,57)?c0e(u(r,57).Ah()):xhe(Us(r)))+eJ+this.a+"'"));h=t.ii(i),f=h!=null,this.rk()&&ue(h)===ue(d1)&&(h=null),l=null,this.Kj()?ue(h)!==ue(r)&&(h!=null&&(c=u(h,52),l=c.Qh(n,Ji(c.Ah(),this.b),null,l)),r!=null&&(c=u(r,52),l=c.Oh(n,Ji(c.Ah(),this.b),null,l))):this.$k()&&ue(h)!==ue(r)&&(h!=null&&(l=u(h,52).Qh(n,-1-Ji(n.Ah(),this.e),null,l)),r!=null&&(l=u(r,52).Oh(n,-1-Ji(n.Ah(),this.e),null,l))),r==null&&this.rk()?t.ji(i,d1):t.ji(i,r),n.sh()&&n.th()?(o=new RV(n,1,this.e,h,r,this.rk()&&!f),l?(l.lj(o),l.mj()):hi(n,o)):l&&l.mj()},s.Ck=function(n,t,i){var r,c,o,l,f;f=t.ii(i),l=f!=null,this.rk()&&ue(f)===ue(d1)&&(f=null),o=null,f!=null&&(this.Kj()?(r=u(f,52),o=r.Qh(n,Ji(r.Ah(),this.b),null,o)):this.$k()&&(o=u(f,52).Qh(n,-1-Ji(n.Ah(),this.e),null,o))),t.ki(i),n.sh()&&n.th()?(c=new RV(n,this.rk()?2:1,this.e,f,null,l),o?(o.lj(c),o.mj()):hi(n,c)):o&&o.mj()},s.Kj=function(){return!1},s.$k=function(){return!1},s._k=function(){return!1},s.rk=function(){return!1},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObject",402),m(561,402,{},BK),s.$k=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment",561),m(1313,561,{},$Oe),s._k=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving",1313),m(773,561,{},mle),s.rk=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable",773),m(1315,773,{},ROe),s._k=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving",1315),m(638,561,{},ZK),s.Kj=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse",638),m(1314,638,{},FNe),s._k=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving",1314),m(774,638,{},Zle),s.rk=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable",774),m(1316,774,{},JNe),s._k=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving",1316),m(639,402,{},vle),s._k=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving",639),m(1317,639,{},BOe),s.rk=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable",1317),m(775,639,{},efe),s.Kj=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse",775),m(1318,775,{},HNe),s.rk=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable",1318),m(1311,402,{},zOe),s.rk=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable",1311),m(772,402,{},nfe),s.Kj=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse",772),m(1312,772,{},GNe),s.rk=function(){return!0},v(Jn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable",1312),m(776,562,WF,Qfe),s.wl=function(n){return new Qfe(this.a,this.c,n)},s.kd=function(){return this.b},s.xl=function(n,t,i){return y9n(this,n,this.b,i)},s.yl=function(n,t,i){return k9n(this,n,this.b,i)},v(Jn,"EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry",776),m(1319,1,Lne,HSe),s.Dk=function(n){return this.a},s.Oj=function(){return X(this.a,98)?u(this.a,98).Oj():!this.a.dc()},s.Wb=function(n){this.a.$b(),this.a.Fc(u(n,16))},s.Ek=function(){X(this.a,98)?u(this.a,98).Ek():this.a.$b()},v(Jn,"EStructuralFeatureImpl/SettingMany",1319),m(1320,562,WF,wPe),s.vl=function(n){return new JK((Si(),hA),this.b.oi(this.a,n))},s.kd=function(){return null},s.xl=function(n,t,i){return i},s.yl=function(n,t,i){return i},v(Jn,"EStructuralFeatureImpl/SimpleContentFeatureMapEntry",1320),m(640,562,WF,JK),s.vl=function(n){return new JK(this.c,n)},s.kd=function(){return this.a},s.xl=function(n,t,i){return i},s.yl=function(n,t,i){return i},v(Jn,"EStructuralFeatureImpl/SimpleFeatureMapEntry",640),m(396,492,Th,Ol),s.$i=function(n){return se(vf,On,29,n,0,1)},s.Wi=function(){return!1},v(Jn,"ESuperAdapter/1",396),m(446,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,834:1,52:1,100:1,161:1,446:1,117:1,118:1},Gk),s.Ih=function(n,t,i){var r;switch(n){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),this.Ab;case 1:return this.zb;case 2:return!this.a&&(this.a=new iE(this,Rc,this)),this.a}return Pl(this,n-dt((jn(),Sp)),Mn((r=u(Xn(this,16),29),r||Sp),n),t,i)},s.Rh=function(n,t,i){var r,c;switch(t){case 0:return!this.Ab&&(this.Ab=new we(Zt,this,0,3)),vc(this.Ab,n,i);case 2:return!this.a&&(this.a=new iE(this,Rc,this)),vc(this.a,n,i)}return c=u(Mn((r=u(Xn(this,16),29),r||(jn(),Sp)),t),69),c.uk().yk(this,Lo(this),t-dt((jn(),Sp)),n,i)},s.Th=function(n){var t;switch(n){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!!this.a&&this.a.i!=0}return Ll(this,n-dt((jn(),Sp)),Mn((t=u(Xn(this,16),29),t||Sp),n))},s.$h=function(n,t){var i;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab),!this.Ab&&(this.Ab=new we(Zt,this,0,3)),nr(this.Ab,u(t,18));return;case 1:Mo(this,Pt(t));return;case 2:!this.a&&(this.a=new iE(this,Rc,this)),kt(this.a),!this.a&&(this.a=new iE(this,Rc,this)),nr(this.a,u(t,18));return}Jl(this,n-dt((jn(),Sp)),Mn((i=u(Xn(this,16),29),i||Sp),n),t)},s.fi=function(){return jn(),Sp},s.hi=function(n){var t;switch(n){case 0:!this.Ab&&(this.Ab=new we(Zt,this,0,3)),kt(this.Ab);return;case 1:Mo(this,null);return;case 2:!this.a&&(this.a=new iE(this,Rc,this)),kt(this.a);return}Fl(this,n-dt((jn(),Sp)),Mn((t=u(Xn(this,16),29),t||Sp),n))},v(Jn,"ETypeParameterImpl",446),m(447,81,au,iE),s.Lj=function(n,t){return hMn(this,u(n,87),t)},s.Mj=function(n,t){return dMn(this,u(n,87),t)},v(Jn,"ETypeParameterImpl/1",447),m(637,44,v3,jX),s.ec=function(){return new IP(this)},v(Jn,"ETypeParameterImpl/2",637),m(557,Ga,fs,IP),s.Ec=function(n){return vNe(this,u(n,87))},s.Fc=function(n){var t,i,r;for(r=!1,i=n.Jc();i.Ob();)t=u(i.Pb(),87),ei(this.a,t,"")==null&&(r=!0);return r},s.$b=function(){Hu(this.a)},s.Gc=function(n){return so(this.a,n)},s.Jc=function(){var n;return n=new B2(new sn(this.a).a),new DP(n)},s.Kc=function(n){return t$e(this,n)},s.gc=function(){return Aj(this.a)},v(Jn,"ETypeParameterImpl/2/1",557),m(558,1,Fr,DP),s.Nb=function(n){Zr(this,n)},s.Pb=function(){return u(t3(this.a).jd(),87)},s.Ob=function(){return this.a.b},s.Qb=function(){wRe(this.a)},v(Jn,"ETypeParameterImpl/2/1/1",558),m(1281,44,v3,Ixe),s._b=function(n){return $r(n)?BV(this,n):!!Xc(this.f,n)},s.xc=function(n){var t,i;return t=$r(n)?lo(this,n):bu(Xc(this.f,n)),X(t,835)?(i=u(t,835),t=i.Ik(),ei(this,u(n,241),t),t):t??(n==null?(zX(),nhn):null)},v(Jn,"EValidatorRegistryImpl",1281),m(1303,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,2002:1,52:1,100:1,161:1,117:1,118:1},lw),s.oi=function(n,t){switch(n.fk()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return t==null?null:fu(t);case 25:return I8n(t);case 27:return X9n(t);case 28:return K9n(t);case 29:return t==null?null:JTe(uA[0],u(t,205));case 41:return t==null?"":Pb(u(t,298));case 42:return fu(t);case 50:return Pt(t);default:throw R(new qn(u7+n.ve()+up))}},s.pi=function(n){var t,i,r,c,o,l,f,h,b,p,y,S,A,O,D,B;switch(n.G==-1&&(n.G=(S=ol(n),S?$d(S.si(),n):-1)),n.G){case 0:return i=new vX,i;case 1:return t=new Nb,t;case 2:return r=new rj,r;case 4:return c=new PP,c;case 5:return o=new Nxe,o;case 6:return l=new KSe,l;case 7:return f=new IC,f;case 10:return b=new jv,b;case 11:return p=new yX,p;case 12:return y=new u_e,y;case 13:return A=new kX,A;case 14:return O=new kle,O;case 17:return D=new $h,D;case 18:return h=new gw,h;case 19:return B=new Gk,B;default:throw R(new qn(vne+n.zb+up))}},s.qi=function(n,t){switch(n.fk()){case 20:return t==null?null:new Joe(t);case 21:return t==null?null:new A0(t);case 23:case 22:return t==null?null:OEn(t);case 26:case 24:return t==null?null:fO(al(t,-128,127)<<24>>24);case 25:return AOn(t);case 27:return hxn(t);case 28:return dxn(t);case 29:return IMn(t);case 32:case 31:return t==null?null:K2(t);case 38:case 37:return t==null?null:new aoe(t);case 40:case 39:return t==null?null:ke(al(t,Xr,oi));case 41:return null;case 42:return t==null,null;case 44:case 43:return t==null?null:q2(Zz(t));case 49:case 48:return t==null?null:o8(al(t,nJ,32767)<<16>>16);case 50:return t;default:throw R(new qn(u7+n.ve()+up))}},v(Jn,"EcoreFactoryImpl",1303),m(548,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,2e3:1,52:1,100:1,161:1,184:1,548:1,117:1,118:1,680:1},NDe),s.gb=!1,s.hb=!1;var u7e,ehn=!1;v(Jn,"EcorePackageImpl",548),m(1199,1,{835:1},Ev),s.Ik=function(){return aOe(),thn},v(Jn,"EcorePackageImpl/1",1199),m(1208,1,ii,fw),s.dk=function(n){return X(n,158)},s.ek=function(n){return se(ZI,On,158,n,0,1)},v(Jn,"EcorePackageImpl/10",1208),m(1209,1,ii,rC),s.dk=function(n){return X(n,197)},s.ek=function(n){return se(_ce,On,197,n,0,1)},v(Jn,"EcorePackageImpl/11",1209),m(1210,1,ii,cC),s.dk=function(n){return X(n,57)},s.ek=function(n){return se(vb,On,57,n,0,1)},v(Jn,"EcorePackageImpl/12",1210),m(1211,1,ii,w0),s.dk=function(n){return X(n,403)},s.ek=function(n){return se(yf,ime,62,n,0,1)},v(Jn,"EcorePackageImpl/13",1211),m(1212,1,ii,CL),s.dk=function(n){return X(n,241)},s.ek=function(n){return se(Aa,On,241,n,0,1)},v(Jn,"EcorePackageImpl/14",1212),m(1213,1,ii,G5),s.dk=function(n){return X(n,503)},s.ek=function(n){return se(jp,On,2078,n,0,1)},v(Jn,"EcorePackageImpl/15",1213),m(1214,1,ii,U6),s.dk=function(n){return X(n,103)},s.ek=function(n){return se(Um,M3,19,n,0,1)},v(Jn,"EcorePackageImpl/16",1214),m(1215,1,ii,X6),s.dk=function(n){return X(n,179)},s.ek=function(n){return se(ns,M3,179,n,0,1)},v(Jn,"EcorePackageImpl/17",1215),m(1216,1,ii,q5),s.dk=function(n){return X(n,470)},s.ek=function(n){return se(Gm,On,470,n,0,1)},v(Jn,"EcorePackageImpl/18",1216),m(1217,1,ii,TL),s.dk=function(n){return X(n,549)},s.ek=function(n){return se(Du,zZe,549,n,0,1)},v(Jn,"EcorePackageImpl/19",1217),m(1200,1,ii,OL),s.dk=function(n){return X(n,335)},s.ek=function(n){return se(qm,M3,38,n,0,1)},v(Jn,"EcorePackageImpl/2",1200),m(1218,1,ii,K6),s.dk=function(n){return X(n,248)},s.ek=function(n){return se(Rc,ien,87,n,0,1)},v(Jn,"EcorePackageImpl/20",1218),m(1219,1,ii,NL),s.dk=function(n){return X(n,446)},s.ek=function(n){return se(Fo,On,834,n,0,1)},v(Jn,"EcorePackageImpl/21",1219),m(1220,1,ii,qk),s.dk=function(n){return b2(n)},s.ek=function(n){return se(Qi,Me,473,n,8,1)},v(Jn,"EcorePackageImpl/22",1220),m(1221,1,ii,IL),s.dk=function(n){return X(n,195)},s.ek=function(n){return se(ds,Me,195,n,0,2)},v(Jn,"EcorePackageImpl/23",1221),m(1222,1,ii,gU),s.dk=function(n){return X(n,221)},s.ek=function(n){return se(jy,Me,221,n,0,1)},v(Jn,"EcorePackageImpl/24",1222),m(1223,1,ii,wU),s.dk=function(n){return X(n,180)},s.ek=function(n){return se(KS,Me,180,n,0,1)},v(Jn,"EcorePackageImpl/25",1223),m(1224,1,ii,Ju),s.dk=function(n){return X(n,205)},s.ek=function(n){return se(aJ,Me,205,n,0,1)},v(Jn,"EcorePackageImpl/26",1224),m(1225,1,ii,Do),s.dk=function(n){return!1},s.ek=function(n){return se(S7e,On,2174,n,0,1)},v(Jn,"EcorePackageImpl/27",1225),m(1226,1,ii,Hc),s.dk=function(n){return g2(n)},s.ek=function(n){return se(gr,Me,346,n,7,1)},v(Jn,"EcorePackageImpl/28",1226),m(1227,1,ii,nu),s.dk=function(n){return X(n,61)},s.ek=function(n){return se(B8e,um,61,n,0,1)},v(Jn,"EcorePackageImpl/29",1227),m(1201,1,ii,io),s.dk=function(n){return X(n,504)},s.ek=function(n){return se(Zt,{3:1,4:1,5:1,1995:1},587,n,0,1)},v(Jn,"EcorePackageImpl/3",1201),m(1228,1,ii,v1),s.dk=function(n){return X(n,568)},s.ek=function(n){return se(J8e,On,2001,n,0,1)},v(Jn,"EcorePackageImpl/30",1228),m(1229,1,ii,Qp),s.dk=function(n){return X(n,163)},s.ek=function(n){return se(a7e,um,163,n,0,1)},v(Jn,"EcorePackageImpl/31",1229),m(1230,1,ii,U5),s.dk=function(n){return X(n,75)},s.ek=function(n){return se(AG,hen,75,n,0,1)},v(Jn,"EcorePackageImpl/32",1230),m(1231,1,ii,uC),s.dk=function(n){return X(n,164)},s.ek=function(n){return se(b7,Me,164,n,0,1)},v(Jn,"EcorePackageImpl/33",1231),m(1232,1,ii,aw),s.dk=function(n){return X(n,15)},s.ek=function(n){return se(jr,Me,15,n,0,1)},v(Jn,"EcorePackageImpl/34",1232),m(1233,1,ii,zs),s.dk=function(n){return X(n,298)},s.ek=function(n){return se(wme,On,298,n,0,1)},v(Jn,"EcorePackageImpl/35",1233),m(1234,1,ii,Wp),s.dk=function(n){return X(n,190)},s.ek=function(n){return se(sp,Me,190,n,0,1)},v(Jn,"EcorePackageImpl/36",1234),m(1235,1,ii,Sv),s.dk=function(n){return X(n,92)},s.ek=function(n){return se(pme,On,92,n,0,1)},v(Jn,"EcorePackageImpl/37",1235),m(1236,1,ii,oC),s.dk=function(n){return X(n,588)},s.ek=function(n){return se(o7e,On,588,n,0,1)},v(Jn,"EcorePackageImpl/38",1236),m(1237,1,ii,y1),s.dk=function(n){return!1},s.ek=function(n){return se(x7e,On,2175,n,0,1)},v(Jn,"EcorePackageImpl/39",1237),m(1202,1,ii,X5),s.dk=function(n){return X(n,88)},s.ek=function(n){return se(vf,On,29,n,0,1)},v(Jn,"EcorePackageImpl/4",1202),m(1238,1,ii,V6),s.dk=function(n){return X(n,191)},s.ek=function(n){return se(lp,Me,191,n,0,1)},v(Jn,"EcorePackageImpl/40",1238),m(1239,1,ii,Bh),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(Jn,"EcorePackageImpl/41",1239),m(1240,1,ii,sC),s.dk=function(n){return X(n,585)},s.ek=function(n){return se(F8e,On,585,n,0,1)},v(Jn,"EcorePackageImpl/42",1240),m(1241,1,ii,Uk),s.dk=function(n){return!1},s.ek=function(n){return se(A7e,Me,2176,n,0,1)},v(Jn,"EcorePackageImpl/43",1241),m(1242,1,ii,DL),s.dk=function(n){return X(n,45)},s.ek=function(n){return se(yg,tF,45,n,0,1)},v(Jn,"EcorePackageImpl/44",1242),m(1203,1,ii,Xk),s.dk=function(n){return X(n,143)},s.ek=function(n){return se(Ma,On,143,n,0,1)},v(Jn,"EcorePackageImpl/5",1203),m(1204,1,ii,Kk),s.dk=function(n){return X(n,159)},s.ek=function(n){return se(zce,On,159,n,0,1)},v(Jn,"EcorePackageImpl/6",1204),m(1205,1,ii,Zp),s.dk=function(n){return X(n,459)},s.ek=function(n){return se(xG,On,675,n,0,1)},v(Jn,"EcorePackageImpl/7",1205),m(1206,1,ii,nf),s.dk=function(n){return X(n,568)},s.ek=function(n){return se(ed,On,684,n,0,1)},v(Jn,"EcorePackageImpl/8",1206),m(1207,1,ii,e2),s.dk=function(n){return X(n,469)},s.ek=function(n){return se(cA,On,469,n,0,1)},v(Jn,"EcorePackageImpl/9",1207),m(1019,2042,BZe,tAe),s.Ki=function(n,t){ljn(this,u(t,415))},s.Oi=function(n,t){cqe(this,n,u(t,415))},v(Jn,"MinimalEObjectImpl/1ArrayDelegatingAdapterList",1019),m(1020,151,zN,kDe),s.hj=function(){return this.a.a},v(Jn,"MinimalEObjectImpl/1ArrayDelegatingAdapterList/1",1020),m(1047,1046,{},ITe),v("org.eclipse.emf.ecore.plugin","EcorePlugin",1047);var o7e=Gi(den,"Resource");m(786,1485,ben),s.Fl=function(n){},s.Gl=function(n){},s.Cl=function(){return!this.a&&(this.a=new dX(this)),this.a},s.Dl=function(n){var t,i,r,c,o;if(r=n.length,r>0)if(Qn(0,n.length),n.charCodeAt(0)==47){for(o=new xo(4),c=1,t=1;t0&&(n=(Qr(0,i,n.length),n.substr(0,i))));return vTn(this,n)},s.El=function(){return this.c},s.Ib=function(){var n;return Pb(this.Pm)+"@"+(n=Ni(this)>>>0,n.toString(16))+" uri='"+this.d+"'"},s.b=!1,v(Pne,"ResourceImpl",786),m(1486,786,ben,GSe),v(Pne,"BinaryResourceImpl",1486),m(1159,697,One),s._i=function(n){return X(n,57)?Y5n(this,u(n,57)):X(n,588)?new st(u(n,588).Cl()):ue(n)===ue(this.f)?u(n,18).Jc():(A9(),tD.a)},s.Ob=function(){return Z0e(this)},s.a=!1,v(Ri,"EcoreUtil/ContentTreeIterator",1159),m(1487,1159,One,QIe),s._i=function(n){return ue(n)===ue(this.f)?u(n,16).Jc():new WLe(u(n,57))},v(Pne,"ResourceImpl/5",1487),m(647,2054,ten,dX),s.Gc=function(n){return this.i<=4?y8(this,n):X(n,52)&&u(n,52).Gh()==this.a},s.Ki=function(n,t){n==this.i-1&&(this.a.b||(this.a.b=!0))},s.Mi=function(n,t){n==0?this.a.b||(this.a.b=!0):gY(this,n,t)},s.Oi=function(n,t){},s.Pi=function(n,t,i){},s.Jj=function(){return 2},s.hj=function(){return this.a},s.Kj=function(){return!0},s.Lj=function(n,t){var i;return i=u(n,52),t=i.ci(this.a,t),t},s.Mj=function(n,t){var i;return i=u(n,52),i.ci(null,t)},s.Nj=function(){return!1},s.Qi=function(){return!0},s.$i=function(n){return se(vb,On,57,n,0,1)},s.Wi=function(){return!1},v(Pne,"ResourceImpl/ContentsEList",647),m(953,2024,B8,qSe),s.dd=function(n){return this.a.Ii(n)},s.gc=function(){return this.a.gc()},v(Ri,"AbstractSequentialInternalEList/1",953);var s7e,l7e,nc,f7e;m(625,1,{},eIe);var MG,CG;v(Ri,"BasicExtendedMetaData",625),m(1150,1,{},WCe),s.Hl=function(){return null},s.Il=function(){return this.a==-2&&qC(this,xMn(this.d,this.b)),this.a},s.Jl=function(){return null},s.Kl=function(){return En(),En(),Sc},s.ve=function(){return this.c==f7&&oX(this,MJe(this.d,this.b)),this.c},s.Ll=function(){return 0},s.a=-2,s.c=f7,v(Ri,"BasicExtendedMetaData/EClassExtendedMetaDataImpl",1150),m(1151,1,{},TLe),s.Hl=function(){return this.a==(J9(),MG)&&TP(this,lDn(this.f,this.b)),this.a},s.Il=function(){return 0},s.Jl=function(){return this.c==(J9(),MG)&&u9(this,fDn(this.f,this.b)),this.c},s.Kl=function(){return!this.d&&lX(this,X_n(this.f,this.b)),this.d},s.ve=function(){return this.e==f7&&XC(this,MJe(this.f,this.b)),this.e},s.Ll=function(){return this.g==-2&&d(this,UAn(this.f,this.b)),this.g},s.e=f7,s.g=-2,v(Ri,"BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl",1151),m(1149,1,{},ZCe),s.b=!1,s.c=!1,v(Ri,"BasicExtendedMetaData/EPackageExtendedMetaDataImpl",1149),m(1152,1,{},OLe),s.c=-2,s.e=f7,s.f=f7,v(Ri,"BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl",1152),m(581,623,au,nR),s.Jj=function(){return this.c},s.ml=function(){return!1},s.Ui=function(n,t){return t},s.c=0,v(Ri,"EDataTypeEList",581);var a7e=Gi(Ri,"FeatureMap");m(76,581,{3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,77:1,163:1,219:1,1998:1,72:1,98:1},tr),s._c=function(n,t){ONn(this,n,u(t,75))},s.Ec=function(n){return XOn(this,u(n,75))},s.Fi=function(n){q3n(this,u(n,75))},s.Lj=function(n,t){return j2n(this,u(n,75),t)},s.Mj=function(n,t){return qle(this,u(n,75),t)},s.Ri=function(n,t){return e_n(this,n,t)},s.Ui=function(n,t){return JPn(this,n,u(t,75))},s.fd=function(n,t){return gIn(this,n,u(t,75))},s.Sj=function(n,t){return E2n(this,u(n,75),t)},s.Tj=function(n,t){return MNe(this,u(n,75),t)},s.Uj=function(n,t,i){return LAn(this,u(n,75),u(t,75),i)},s.Xi=function(n,t){return oW(this,n,u(t,75))},s.Ml=function(n,t){return Xbe(this,n,t)},s.ad=function(n,t){var i,r,c,o,l,f,h,b,p;for(b=new _w(t.gc()),c=t.Jc();c.Ob();)if(r=u(c.Pb(),75),o=r.Jk(),J1(this.e,o))(!o.Qi()||!qR(this,o,r.kd())&&!y8(b,r))&&Et(b,r);else{for(p=Po(this.e.Ah(),o),i=u(this.g,122),l=!0,f=0;f=0;)if(t=n[this.c],this.k.$l(t.Jk()))return this.j=this.f?t:t.kd(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},v(Ri,"BasicFeatureMap/FeatureEIterator",412),m(666,412,Wh,SK),s.sl=function(){return!0},v(Ri,"BasicFeatureMap/ResolvingFeatureEIterator",666),m(951,482,YF,UTe),s.nj=function(){return this},v(Ri,"EContentsEList/1",951),m(952,482,YF,pTe),s.sl=function(){return!1},v(Ri,"EContentsEList/2",952),m(950,287,QF,XTe),s.ul=function(n){},s.Ob=function(){return!1},s.Sb=function(){return!1},v(Ri,"EContentsEList/FeatureIteratorImpl/1",950),m(824,581,au,Zse),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;kt(this),Fs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Lf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EDataTypeEList/Unsettable",824),m(1920,581,au,ZTe),s.Qi=function(){return!0},v(Ri,"EDataTypeUniqueEList",1920),m(1921,824,au,eOe),s.Qi=function(){return!0},v(Ri,"EDataTypeUniqueEList/Unsettable",1921),m(145,81,au,rs),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectContainmentEList/Resolving",145),m(1153,543,au,WTe),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectContainmentEList/Unsettable/Resolving",1153),m(753,14,au,Rle),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;kt(this),Fs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Lf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EObjectContainmentWithInverseEList/Unsettable",753),m(1187,753,au,bNe),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectContainmentWithInverseEList/Unsettable/Resolving",1187),m(745,491,au,Wse),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;kt(this),Fs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Lf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EObjectEList/Unsettable",745),m(339,491,au,Jv),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectResolvingEList",339),m(1825,745,au,nOe),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectResolvingEList/Unsettable",1825),m(1488,1,{},K5);var nhn;v(Ri,"EObjectValidator",1488),m(547,491,au,yR),s.gl=function(){return this.d},s.hl=function(){return this.b},s.Kj=function(){return!0},s.kl=function(){return!0},s.b=0,v(Ri,"EObjectWithInverseEList",547),m(1190,547,au,gNe),s.jl=function(){return!0},v(Ri,"EObjectWithInverseEList/ManyInverse",1190),m(626,547,au,qK),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;kt(this),Fs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Lf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EObjectWithInverseEList/Unsettable",626),m(1189,626,au,wNe),s.jl=function(){return!0},v(Ri,"EObjectWithInverseEList/Unsettable/ManyInverse",1189),m(754,547,au,Ble),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectWithInverseResolvingEList",754),m(33,754,au,Nn),s.jl=function(){return!0},v(Ri,"EObjectWithInverseResolvingEList/ManyInverse",33),m(755,626,au,zle),s.ll=function(){return!0},s.Ui=function(n,t){return oy(this,n,u(t,57))},v(Ri,"EObjectWithInverseResolvingEList/Unsettable",755),m(1188,755,au,pNe),s.jl=function(){return!0},v(Ri,"EObjectWithInverseResolvingEList/Unsettable/ManyInverse",1188),m(1154,623,au),s.Ji=function(){return(this.b&1792)==0},s.Li=function(){this.b|=1},s.il=function(){return(this.b&4)!=0},s.Kj=function(){return(this.b&40)!=0},s.jl=function(){return(this.b&16)!=0},s.kl=function(){return(this.b&8)!=0},s.ll=function(){return(this.b&V0)!=0},s.$k=function(){return(this.b&32)!=0},s.ml=function(){return(this.b&Gf)!=0},s.dk=function(n){return this.d?cPe(this.d,n):this.Jk().Fk().dk(n)},s.Oj=function(){return(this.b&2)!=0?(this.b&1)!=0:this.i!=0},s.Qi=function(){return(this.b&128)!=0},s.Ek=function(){var n;kt(this),(this.b&2)!=0&&(Fs(this.e)?(n=(this.b&1)!=0,this.b&=-2,f9(this,new Lf(this.e,2,Ji(this.e.Ah(),this.Jk()),n,!1))):this.b&=-2)},s.Wi=function(){return(this.b&1536)==0},s.b=0,v(Ri,"EcoreEList/Generic",1154),m(1155,1154,au,f_e),s.Jk=function(){return this.a},v(Ri,"EcoreEList/Dynamic",1155),m(752,67,Th,uoe),s.$i=function(n){return dO(this.a.a,n)},v(Ri,"EcoreEMap/1",752),m(751,81,au,Lfe),s.Ki=function(n,t){az(this.b,u(t,136))},s.Mi=function(n,t){aze(this.b)},s.Ni=function(n,t,i){var r;++(r=this.b,u(t,136),r).e},s.Oi=function(n,t){wQ(this.b,u(t,136))},s.Pi=function(n,t,i){wQ(this.b,u(i,136)),ue(i)===ue(t)&&u(i,136).zi(ywn(u(t,136).jd())),az(this.b,u(t,136))},v(Ri,"EcoreEMap/DelegateEObjectContainmentEList",751),m(1185,142,tme,jBe),v(Ri,"EcoreEMap/Unsettable",1185),m(1186,751,au,mNe),s.Li=function(){this.a=!0},s.Oj=function(){return this.a},s.Ek=function(){var n;kt(this),Fs(this.e)?(n=this.a,this.a=!1,hi(this.e,new Lf(this.e,2,this.c,n,!1))):this.a=!1},s.a=!1,v(Ri,"EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList",1186),m(1158,223,v3,dDe),s.a=!1,s.b=!1,v(Ri,"EcoreUtil/Copier",1158),m(747,1,Fr,WLe),s.Nb=function(n){Zr(this,n)},s.Ob=function(){return hJe(this)},s.Pb=function(){var n;return hJe(this),n=this.b,this.b=null,n},s.Qb=function(){this.a.Qb()},v(Ri,"EcoreUtil/ProperContentIterator",747),m(1489,1488,{},FU);var thn;v(Ri,"EcoreValidator",1489);var ihn;Gi(Ri,"FeatureMapUtil/Validator"),m(1258,1,{2003:1},hw),s.$l=function(n){return!0},v(Ri,"FeatureMapUtil/1",1258),m(760,1,{2003:1},Age),s.$l=function(n){var t;return this.c==n?!0:(t=ze(zn(this.a,n)),t==null?gDn(this,n)?(XPe(this.a,n,($n(),d7)),!0):(XPe(this.a,n,($n(),ib)),!1):t==($n(),d7))},s.e=!1;var Gce;v(Ri,"FeatureMapUtil/BasicValidator",760),m(761,44,v3,Vse),v(Ri,"FeatureMapUtil/BasicValidator/Cache",761),m(495,56,{20:1,31:1,56:1,18:1,16:1,61:1,77:1,72:1,98:1},vT),s._c=function(n,t){eXe(this.c,this.b,n,t)},s.Ec=function(n){return Xbe(this.c,this.b,n)},s.ad=function(n,t){return _Ln(this.c,this.b,n,t)},s.Fc=function(n){return Yj(this,n)},s.Ei=function(n,t){y8n(this.c,this.b,n,t)},s.Uk=function(n,t){return Bbe(this.c,this.b,n,t)},s.Yi=function(n){return Kz(this.c,this.b,n,!1)},s.Gi=function(){return ATe(this.c,this.b)},s.Hi=function(){return hwn(this.c,this.b)},s.Ii=function(n){return j9n(this.c,this.b,n)},s.Vk=function(n,t){return QOe(this,n,t)},s.$b=function(){u4(this)},s.Gc=function(n){return qR(this.c,this.b,n)},s.Hc=function(n){return k7n(this.c,this.b,n)},s.Xb=function(n){return Kz(this.c,this.b,n,!0)},s.Dk=function(n){return this},s.bd=function(n){return I6n(this.c,this.b,n)},s.dc=function(){return T$(this)},s.Oj=function(){return!IO(this.c,this.b)},s.Jc=function(){return r8n(this.c,this.b)},s.cd=function(){return c8n(this.c,this.b)},s.dd=function(n){return Ajn(this.c,this.b,n)},s.Ri=function(n,t){return pKe(this.c,this.b,n,t)},s.Si=function(n,t){A9n(this.c,this.b,n,t)},s.ed=function(n){return GGe(this.c,this.b,n)},s.Kc=function(n){return BDn(this.c,this.b,n)},s.fd=function(n,t){return AKe(this.c,this.b,n,t)},s.Wb=function(n){Tz(this.c,this.b),Yj(this,u(n,16))},s.gc=function(){return Mjn(this.c,this.b)},s.Nc=function(){return Dyn(this.c,this.b)},s.Oc=function(n){return D6n(this.c,this.b,n)},s.Ib=function(){var n,t;for(t=new vd,t.a+="[",n=ATe(this.c,this.b);uQ(n);)Bc(t,Wj(lz(n))),uQ(n)&&(t.a+=To);return t.a+="]",t.a},s.Ek=function(){Tz(this.c,this.b)},v(Ri,"FeatureMapUtil/FeatureEList",495),m(634,39,zN,cY),s.fj=function(n){return $E(this,n)},s.kj=function(n){var t,i,r,c,o,l,f;switch(this.d){case 1:case 2:{if(o=n.hj(),ue(o)===ue(this.c)&&$E(this,null)==n.fj(null))return this.g=n.gj(),n.ej()==1&&(this.d=1),!0;break}case 3:{switch(c=n.ej(),c){case 3:{if(o=n.hj(),ue(o)===ue(this.c)&&$E(this,null)==n.fj(null))return this.d=5,t=new _w(2),Et(t,this.g),Et(t,n.gj()),this.g=t,!0;break}}break}case 5:{switch(c=n.ej(),c){case 3:{if(o=n.hj(),ue(o)===ue(this.c)&&$E(this,null)==n.fj(null))return i=u(this.g,18),i.Ec(n.gj()),!0;break}}break}case 4:{switch(c=n.ej(),c){case 3:{if(o=n.hj(),ue(o)===ue(this.c)&&$E(this,null)==n.fj(null))return this.d=1,this.g=n.gj(),!0;break}case 4:{if(o=n.hj(),ue(o)===ue(this.c)&&$E(this,null)==n.fj(null))return this.d=6,f=new _w(2),Et(f,this.n),Et(f,n.ij()),this.n=f,l=F(z($t,1),ni,30,15,[this.o,n.jj()]),this.g=l,!0;break}}break}case 6:{switch(c=n.ej(),c){case 4:{if(o=n.hj(),ue(o)===ue(this.c)&&$E(this,null)==n.fj(null))return i=u(this.n,18),i.Ec(n.ij()),l=u(this.g,54),r=se($t,ni,30,l.length+1,15,1),Wu(l,0,r,0,l.length),r[l.length]=n.jj(),this.g=r,!0;break}}break}}return!1},v(Ri,"FeatureMapUtil/FeatureENotificationImpl",634),m(553,495,{20:1,31:1,56:1,18:1,16:1,61:1,77:1,163:1,219:1,1998:1,72:1,98:1},uR),s.Ml=function(n,t){return Xbe(this.c,n,t)},s.Nl=function(n,t,i){return Bbe(this.c,n,t,i)},s.Ol=function(n,t,i){return bge(this.c,n,t,i)},s.Pl=function(){return this},s.Ql=function(n,t){return cN(this.c,n,t)},s.Rl=function(n){return u(Kz(this.c,this.b,n,!1),75).Jk()},s.Sl=function(n){return u(Kz(this.c,this.b,n,!1),75).kd()},s.Tl=function(){return this.a},s.Ul=function(n){return!IO(this.c,n)},s.Vl=function(n,t){Vz(this.c,n,t)},s.Wl=function(n){return OBe(this.c,n)},s.Xl=function(n){aHe(this.c,n)},v(Ri,"FeatureMapUtil/FeatureFeatureMap",553),m(1257,1,Lne,tTe),s.Dk=function(n){return Kz(this.b,this.a,-1,n)},s.Oj=function(){return!IO(this.b,this.a)},s.Wb=function(n){Vz(this.b,this.a,n)},s.Ek=function(){Tz(this.b,this.a)},v(Ri,"FeatureMapUtil/FeatureValue",1257);var Wy,qce,Uce,Zy,rhn,rD=Gi(cJ,"AnyType");m(670,63,H1,TX),v(cJ,"InvalidDatatypeValueException",670);var TG=Gi(cJ,wen),cD=Gi(cJ,pen),h7e=Gi(cJ,men),chn,Bu,d7e,Pg,uhn,ohn,shn,lhn,fhn,ahn,hhn,dhn,bhn,ghn,whn,r5,phn,c5,fA,mhn,xp,uD,oD,vhn,aA,hA;m(828,501,{109:1,94:1,93:1,57:1,52:1,100:1,841:1},koe),s.Ih=function(n,t,i){switch(n){case 0:return i?(!this.c&&(this.c=new tr(this,0)),this.c):(!this.c&&(this.c=new tr(this,0)),this.c.b);case 1:return i?(!this.c&&(this.c=new tr(this,0)),u(fo(this.c,(Si(),Pg)),163)):(!this.c&&(this.c=new tr(this,0)),u(u(fo(this.c,(Si(),Pg)),163),219)).Tl();case 2:return i?(!this.b&&(this.b=new tr(this,2)),this.b):(!this.b&&(this.b=new tr(this,2)),this.b.b)}return Pl(this,n-dt(this.fi()),Mn((this.j&2)==0?this.fi():(!this.k&&(this.k=new nl),this.k).Lk(),n),t,i)},s.Rh=function(n,t,i){var r;switch(t){case 0:return!this.c&&(this.c=new tr(this,0)),tN(this.c,n,i);case 1:return(!this.c&&(this.c=new tr(this,0)),u(u(fo(this.c,(Si(),Pg)),163),72)).Vk(n,i);case 2:return!this.b&&(this.b=new tr(this,2)),tN(this.b,n,i)}return r=u(Mn((this.j&2)==0?this.fi():(!this.k&&(this.k=new nl),this.k).Lk(),t),69),r.uk().yk(this,khe(this),t-dt(this.fi()),n,i)},s.Th=function(n){switch(n){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new tr(this,0)),u(fo(this.c,(Si(),Pg)),163)).dc();case 2:return!!this.b&&this.b.i!=0}return Ll(this,n-dt(this.fi()),Mn((this.j&2)==0?this.fi():(!this.k&&(this.k=new nl),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:!this.c&&(this.c=new tr(this,0)),BT(this.c,t);return;case 1:(!this.c&&(this.c=new tr(this,0)),u(u(fo(this.c,(Si(),Pg)),163),219)).Wb(t);return;case 2:!this.b&&(this.b=new tr(this,2)),BT(this.b,t);return}Jl(this,n-dt(this.fi()),Mn((this.j&2)==0?this.fi():(!this.k&&(this.k=new nl),this.k).Lk(),n),t)},s.fi=function(){return Si(),d7e},s.hi=function(n){switch(n){case 0:!this.c&&(this.c=new tr(this,0)),kt(this.c);return;case 1:(!this.c&&(this.c=new tr(this,0)),u(fo(this.c,(Si(),Pg)),163)).$b();return;case 2:!this.b&&(this.b=new tr(this,2)),kt(this.b);return}Fl(this,n-dt(this.fi()),Mn((this.j&2)==0?this.fi():(!this.k&&(this.k=new nl),this.k).Lk(),n))},s.Ib=function(){var n;return(this.j&4)!=0?Ff(this):(n=new cf(Ff(this)),n.a+=" (mixed: ",Uj(n,this.c),n.a+=", anyAttribute: ",Uj(n,this.b),n.a+=")",n.a)},v(kr,"AnyTypeImpl",828),m(671,501,{109:1,94:1,93:1,57:1,52:1,100:1,2081:1,671:1},pU),s.Ih=function(n,t,i){switch(n){case 0:return this.a;case 1:return this.b}return Pl(this,n-dt((Si(),r5)),Mn((this.j&2)==0?r5:(!this.k&&(this.k=new nl),this.k).Lk(),n),t,i)},s.Th=function(n){switch(n){case 0:return this.a!=null;case 1:return this.b!=null}return Ll(this,n-dt((Si(),r5)),Mn((this.j&2)==0?r5:(!this.k&&(this.k=new nl),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:T(this,Pt(t));return;case 1:Q(this,Pt(t));return}Jl(this,n-dt((Si(),r5)),Mn((this.j&2)==0?r5:(!this.k&&(this.k=new nl),this.k).Lk(),n),t)},s.fi=function(){return Si(),r5},s.hi=function(n){switch(n){case 0:this.a=null;return;case 1:this.b=null;return}Fl(this,n-dt((Si(),r5)),Mn((this.j&2)==0?r5:(!this.k&&(this.k=new nl),this.k).Lk(),n))},s.Ib=function(){var n;return(this.j&4)!=0?Ff(this):(n=new cf(Ff(this)),n.a+=" (data: ",Bc(n,this.a),n.a+=", target: ",Bc(n,this.b),n.a+=")",n.a)},s.a=null,s.b=null,v(kr,"ProcessingInstructionImpl",671),m(672,828,{109:1,94:1,93:1,57:1,52:1,100:1,841:1,2082:1,672:1},Dxe),s.Ih=function(n,t,i){switch(n){case 0:return i?(!this.c&&(this.c=new tr(this,0)),this.c):(!this.c&&(this.c=new tr(this,0)),this.c.b);case 1:return i?(!this.c&&(this.c=new tr(this,0)),u(fo(this.c,(Si(),Pg)),163)):(!this.c&&(this.c=new tr(this,0)),u(u(fo(this.c,(Si(),Pg)),163),219)).Tl();case 2:return i?(!this.b&&(this.b=new tr(this,2)),this.b):(!this.b&&(this.b=new tr(this,2)),this.b.b);case 3:return!this.c&&(this.c=new tr(this,0)),Pt(cN(this.c,(Si(),fA),!0));case 4:return Jle(this.a,(!this.c&&(this.c=new tr(this,0)),Pt(cN(this.c,(Si(),fA),!0))));case 5:return this.a}return Pl(this,n-dt((Si(),c5)),Mn((this.j&2)==0?c5:(!this.k&&(this.k=new nl),this.k).Lk(),n),t,i)},s.Th=function(n){switch(n){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new tr(this,0)),u(fo(this.c,(Si(),Pg)),163)).dc();case 2:return!!this.b&&this.b.i!=0;case 3:return!this.c&&(this.c=new tr(this,0)),Pt(cN(this.c,(Si(),fA),!0))!=null;case 4:return Jle(this.a,(!this.c&&(this.c=new tr(this,0)),Pt(cN(this.c,(Si(),fA),!0))))!=null;case 5:return!!this.a}return Ll(this,n-dt((Si(),c5)),Mn((this.j&2)==0?c5:(!this.k&&(this.k=new nl),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:!this.c&&(this.c=new tr(this,0)),BT(this.c,t);return;case 1:(!this.c&&(this.c=new tr(this,0)),u(u(fo(this.c,(Si(),Pg)),163),219)).Wb(t);return;case 2:!this.b&&(this.b=new tr(this,2)),BT(this.b,t);return;case 3:Tae(this,Pt(t));return;case 4:Tae(this,Fle(this.a,t));return;case 5:I(this,u(t,159));return}Jl(this,n-dt((Si(),c5)),Mn((this.j&2)==0?c5:(!this.k&&(this.k=new nl),this.k).Lk(),n),t)},s.fi=function(){return Si(),c5},s.hi=function(n){switch(n){case 0:!this.c&&(this.c=new tr(this,0)),kt(this.c);return;case 1:(!this.c&&(this.c=new tr(this,0)),u(fo(this.c,(Si(),Pg)),163)).$b();return;case 2:!this.b&&(this.b=new tr(this,2)),kt(this.b);return;case 3:!this.c&&(this.c=new tr(this,0)),Vz(this.c,(Si(),fA),null);return;case 4:Tae(this,Fle(this.a,null));return;case 5:this.a=null;return}Fl(this,n-dt((Si(),c5)),Mn((this.j&2)==0?c5:(!this.k&&(this.k=new nl),this.k).Lk(),n))},v(kr,"SimpleAnyTypeImpl",672),m(673,501,{109:1,94:1,93:1,57:1,52:1,100:1,2083:1,673:1},_xe),s.Ih=function(n,t,i){switch(n){case 0:return i?(!this.a&&(this.a=new tr(this,0)),this.a):(!this.a&&(this.a=new tr(this,0)),this.a.b);case 1:return i?(!this.b&&(this.b=new os((jn(),Ac),Du,this,1)),this.b):(!this.b&&(this.b=new os((jn(),Ac),Du,this,1)),nO(this.b));case 2:return i?(!this.c&&(this.c=new os((jn(),Ac),Du,this,2)),this.c):(!this.c&&(this.c=new os((jn(),Ac),Du,this,2)),nO(this.c));case 3:return!this.a&&(this.a=new tr(this,0)),fo(this.a,(Si(),uD));case 4:return!this.a&&(this.a=new tr(this,0)),fo(this.a,(Si(),oD));case 5:return!this.a&&(this.a=new tr(this,0)),fo(this.a,(Si(),aA));case 6:return!this.a&&(this.a=new tr(this,0)),fo(this.a,(Si(),hA))}return Pl(this,n-dt((Si(),xp)),Mn((this.j&2)==0?xp:(!this.k&&(this.k=new nl),this.k).Lk(),n),t,i)},s.Rh=function(n,t,i){var r;switch(t){case 0:return!this.a&&(this.a=new tr(this,0)),tN(this.a,n,i);case 1:return!this.b&&(this.b=new os((jn(),Ac),Du,this,1)),K$(this.b,n,i);case 2:return!this.c&&(this.c=new os((jn(),Ac),Du,this,2)),K$(this.c,n,i);case 5:return!this.a&&(this.a=new tr(this,0)),QOe(fo(this.a,(Si(),aA)),n,i)}return r=u(Mn((this.j&2)==0?(Si(),xp):(!this.k&&(this.k=new nl),this.k).Lk(),t),69),r.uk().yk(this,khe(this),t-dt((Si(),xp)),n,i)},s.Th=function(n){switch(n){case 0:return!!this.a&&this.a.i!=0;case 1:return!!this.b&&this.b.f!=0;case 2:return!!this.c&&this.c.f!=0;case 3:return!this.a&&(this.a=new tr(this,0)),!T$(fo(this.a,(Si(),uD)));case 4:return!this.a&&(this.a=new tr(this,0)),!T$(fo(this.a,(Si(),oD)));case 5:return!this.a&&(this.a=new tr(this,0)),!T$(fo(this.a,(Si(),aA)));case 6:return!this.a&&(this.a=new tr(this,0)),!T$(fo(this.a,(Si(),hA)))}return Ll(this,n-dt((Si(),xp)),Mn((this.j&2)==0?xp:(!this.k&&(this.k=new nl),this.k).Lk(),n))},s.$h=function(n,t){switch(n){case 0:!this.a&&(this.a=new tr(this,0)),BT(this.a,t);return;case 1:!this.b&&(this.b=new os((jn(),Ac),Du,this,1)),NB(this.b,t);return;case 2:!this.c&&(this.c=new os((jn(),Ac),Du,this,2)),NB(this.c,t);return;case 3:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),uD))),!this.a&&(this.a=new tr(this,0)),Yj(fo(this.a,uD),u(t,18));return;case 4:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),oD))),!this.a&&(this.a=new tr(this,0)),Yj(fo(this.a,oD),u(t,18));return;case 5:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),aA))),!this.a&&(this.a=new tr(this,0)),Yj(fo(this.a,aA),u(t,18));return;case 6:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),hA))),!this.a&&(this.a=new tr(this,0)),Yj(fo(this.a,hA),u(t,18));return}Jl(this,n-dt((Si(),xp)),Mn((this.j&2)==0?xp:(!this.k&&(this.k=new nl),this.k).Lk(),n),t)},s.fi=function(){return Si(),xp},s.hi=function(n){switch(n){case 0:!this.a&&(this.a=new tr(this,0)),kt(this.a);return;case 1:!this.b&&(this.b=new os((jn(),Ac),Du,this,1)),this.b.c.$b();return;case 2:!this.c&&(this.c=new os((jn(),Ac),Du,this,2)),this.c.c.$b();return;case 3:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),uD)));return;case 4:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),oD)));return;case 5:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),aA)));return;case 6:!this.a&&(this.a=new tr(this,0)),u4(fo(this.a,(Si(),hA)));return}Fl(this,n-dt((Si(),xp)),Mn((this.j&2)==0?xp:(!this.k&&(this.k=new nl),this.k).Lk(),n))},s.Ib=function(){var n;return(this.j&4)!=0?Ff(this):(n=new cf(Ff(this)),n.a+=" (mixed: ",Uj(n,this.a),n.a+=")",n.a)},v(kr,"XMLTypeDocumentRootImpl",673),m(1990,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1,2084:1},lC),s.oi=function(n,t){switch(n.fk()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return t==null?null:fu(t);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return Pt(t);case 6:return Fpn(u(t,195));case 12:case 47:case 49:case 11:return fVe(this,n,t);case 13:return t==null?null:zLn(u(t,247));case 15:case 14:return t==null?null:L3n(ne(re(t)));case 17:return eGe((Si(),t));case 18:return eGe(t);case 21:case 20:return t==null?null:P3n(u(t,164).a);case 27:return zpn(u(t,195));case 30:return hHe((Si(),u(t,16)));case 31:return hHe(u(t,16));case 40:return Bpn((Si(),t));case 42:return nGe((Si(),t));case 43:return nGe(t);case 59:case 48:return Rpn((Si(),t));default:throw R(new qn(u7+n.ve()+up))}},s.pi=function(n){var t,i,r,c,o;switch(n.G==-1&&(n.G=(i=ol(n),i?$d(i.si(),n):-1)),n.G){case 0:return t=new koe,t;case 1:return r=new pU,r;case 2:return c=new Dxe,c;case 3:return o=new _xe,o;default:throw R(new qn(vne+n.zb+up))}},s.qi=function(n,t){var i,r,c,o,l,f,h,b,p,y,S,A,O,D,B,q;switch(n.fk()){case 5:case 52:case 4:return t;case 6:return rSn(t);case 8:case 7:return t==null?null:JAn(t);case 9:return t==null?null:fO(al((r=bo(t,!0),r.length>0&&(Qn(0,r.length),r.charCodeAt(0)==43)?(Qn(1,r.length+1),r.substr(1)):r),-128,127)<<24>>24);case 10:return t==null?null:fO(al((c=bo(t,!0),c.length>0&&(Qn(0,c.length),c.charCodeAt(0)==43)?(Qn(1,c.length+1),c.substr(1)):c),-128,127)<<24>>24);case 11:return Pt(Qw(this,(Si(),shn),t));case 12:return Pt(Qw(this,(Si(),lhn),t));case 13:return t==null?null:new Joe(bo(t,!0));case 15:case 14:return YOn(t);case 16:return Pt(Qw(this,(Si(),fhn),t));case 17:return bJe((Si(),t));case 18:return bJe(t);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return bo(t,!0);case 21:case 20:return uNn(t);case 22:return Pt(Qw(this,(Si(),ahn),t));case 23:return Pt(Qw(this,(Si(),hhn),t));case 24:return Pt(Qw(this,(Si(),dhn),t));case 25:return Pt(Qw(this,(Si(),bhn),t));case 26:return Pt(Qw(this,(Si(),ghn),t));case 27:return VEn(t);case 30:return gJe((Si(),t));case 31:return gJe(t);case 32:return t==null?null:ke(al((p=bo(t,!0),p.length>0&&(Qn(0,p.length),p.charCodeAt(0)==43)?(Qn(1,p.length+1),p.substr(1)):p),Xr,oi));case 33:return t==null?null:new A0((y=bo(t,!0),y.length>0&&(Qn(0,y.length),y.charCodeAt(0)==43)?(Qn(1,y.length+1),y.substr(1)):y));case 34:return t==null?null:ke(al((S=bo(t,!0),S.length>0&&(Qn(0,S.length),S.charCodeAt(0)==43)?(Qn(1,S.length+1),S.substr(1)):S),Xr,oi));case 36:return t==null?null:q2(Zz((A=bo(t,!0),A.length>0&&(Qn(0,A.length),A.charCodeAt(0)==43)?(Qn(1,A.length+1),A.substr(1)):A)));case 37:return t==null?null:q2(Zz((O=bo(t,!0),O.length>0&&(Qn(0,O.length),O.charCodeAt(0)==43)?(Qn(1,O.length+1),O.substr(1)):O)));case 40:return qSn((Si(),t));case 42:return wJe((Si(),t));case 43:return wJe(t);case 44:return t==null?null:new A0((D=bo(t,!0),D.length>0&&(Qn(0,D.length),D.charCodeAt(0)==43)?(Qn(1,D.length+1),D.substr(1)):D));case 45:return t==null?null:new A0((B=bo(t,!0),B.length>0&&(Qn(0,B.length),B.charCodeAt(0)==43)?(Qn(1,B.length+1),B.substr(1)):B));case 46:return bo(t,!1);case 47:return Pt(Qw(this,(Si(),whn),t));case 59:case 48:return GSn((Si(),t));case 49:return Pt(Qw(this,(Si(),phn),t));case 50:return t==null?null:o8(al((q=bo(t,!0),q.length>0&&(Qn(0,q.length),q.charCodeAt(0)==43)?(Qn(1,q.length+1),q.substr(1)):q),nJ,32767)<<16>>16);case 51:return t==null?null:o8(al((o=bo(t,!0),o.length>0&&(Qn(0,o.length),o.charCodeAt(0)==43)?(Qn(1,o.length+1),o.substr(1)):o),nJ,32767)<<16>>16);case 53:return Pt(Qw(this,(Si(),mhn),t));case 55:return t==null?null:o8(al((l=bo(t,!0),l.length>0&&(Qn(0,l.length),l.charCodeAt(0)==43)?(Qn(1,l.length+1),l.substr(1)):l),nJ,32767)<<16>>16);case 56:return t==null?null:o8(al((f=bo(t,!0),f.length>0&&(Qn(0,f.length),f.charCodeAt(0)==43)?(Qn(1,f.length+1),f.substr(1)):f),nJ,32767)<<16>>16);case 57:return t==null?null:q2(Zz((h=bo(t,!0),h.length>0&&(Qn(0,h.length),h.charCodeAt(0)==43)?(Qn(1,h.length+1),h.substr(1)):h)));case 58:return t==null?null:q2(Zz((b=bo(t,!0),b.length>0&&(Qn(0,b.length),b.charCodeAt(0)==43)?(Qn(1,b.length+1),b.substr(1)):b)));case 60:return t==null?null:ke(al((i=bo(t,!0),i.length>0&&(Qn(0,i.length),i.charCodeAt(0)==43)?(Qn(1,i.length+1),i.substr(1)):i),Xr,oi));case 61:return t==null?null:ke(al(bo(t,!0),Xr,oi));default:throw R(new qn(u7+n.ve()+up))}};var yhn,b7e,khn,g7e;v(kr,"XMLTypeFactoryImpl",1990),m(582,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1,2006:1,582:1},ODe),s.N=!1,s.O=!1;var jhn=!1;v(kr,"XMLTypePackageImpl",582),m(1923,1,{835:1},fC),s.Ik=function(){return rge(),Nhn},v(kr,"XMLTypePackageImpl/1",1923),m(1932,1,ii,_L),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/10",1932),m(1933,1,ii,Y6),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/11",1933),m(1934,1,ii,aC),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/12",1934),m(1935,1,ii,k1),s.dk=function(n){return g2(n)},s.ek=function(n){return se(gr,Me,346,n,7,1)},v(kr,"XMLTypePackageImpl/13",1935),m(1936,1,ii,LL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/14",1936),m(1937,1,ii,zh),s.dk=function(n){return X(n,16)},s.ek=function(n){return se(gl,um,16,n,0,1)},v(kr,"XMLTypePackageImpl/15",1937),m(1938,1,ii,PL),s.dk=function(n){return X(n,16)},s.ek=function(n){return se(gl,um,16,n,0,1)},v(kr,"XMLTypePackageImpl/16",1938),m(1939,1,ii,$L),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/17",1939),m(1940,1,ii,n2),s.dk=function(n){return X(n,164)},s.ek=function(n){return se(b7,Me,164,n,0,1)},v(kr,"XMLTypePackageImpl/18",1940),m(1941,1,ii,Vk),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/19",1941),m(1924,1,ii,hC),s.dk=function(n){return X(n,841)},s.ek=function(n){return se(rD,On,841,n,0,1)},v(kr,"XMLTypePackageImpl/2",1924),m(1942,1,ii,V5),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/20",1942),m(1943,1,ii,RL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/21",1943),m(1944,1,ii,BL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/22",1944),m(1945,1,ii,zL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/23",1945),m(1946,1,ii,FL),s.dk=function(n){return X(n,195)},s.ek=function(n){return se(ds,Me,195,n,0,2)},v(kr,"XMLTypePackageImpl/24",1946),m(1947,1,ii,Yk),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/25",1947),m(1948,1,ii,dC),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/26",1948),m(1949,1,ii,mU),s.dk=function(n){return X(n,16)},s.ek=function(n){return se(gl,um,16,n,0,1)},v(kr,"XMLTypePackageImpl/27",1949),m(1950,1,ii,vU),s.dk=function(n){return X(n,16)},s.ek=function(n){return se(gl,um,16,n,0,1)},v(kr,"XMLTypePackageImpl/28",1950),m(1951,1,ii,yU),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/29",1951),m(1925,1,ii,JL),s.dk=function(n){return X(n,671)},s.ek=function(n){return se(TG,On,2081,n,0,1)},v(kr,"XMLTypePackageImpl/3",1925),m(1952,1,ii,HL),s.dk=function(n){return X(n,15)},s.ek=function(n){return se(jr,Me,15,n,0,1)},v(kr,"XMLTypePackageImpl/30",1952),m(1953,1,ii,Y5),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/31",1953),m(1954,1,ii,Qk),s.dk=function(n){return X(n,190)},s.ek=function(n){return se(sp,Me,190,n,0,1)},v(kr,"XMLTypePackageImpl/32",1954),m(1955,1,ii,GL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/33",1955),m(1956,1,ii,qL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/34",1956),m(1957,1,ii,UL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/35",1957),m(1958,1,ii,XL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/36",1958),m(1959,1,ii,KL),s.dk=function(n){return X(n,16)},s.ek=function(n){return se(gl,um,16,n,0,1)},v(kr,"XMLTypePackageImpl/37",1959),m(1960,1,ii,VL),s.dk=function(n){return X(n,16)},s.ek=function(n){return se(gl,um,16,n,0,1)},v(kr,"XMLTypePackageImpl/38",1960),m(1961,1,ii,Wk),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/39",1961),m(1926,1,ii,YL),s.dk=function(n){return X(n,672)},s.ek=function(n){return se(cD,On,2082,n,0,1)},v(kr,"XMLTypePackageImpl/4",1926),m(1962,1,ii,QL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/40",1962),m(1963,1,ii,ro),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/41",1963),m(1964,1,ii,bC),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/42",1964),m(1965,1,ii,kU),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/43",1965),m(1966,1,ii,WL),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/44",1966),m(1967,1,ii,jU),s.dk=function(n){return X(n,191)},s.ek=function(n){return se(lp,Me,191,n,0,1)},v(kr,"XMLTypePackageImpl/45",1967),m(1968,1,ii,EU),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/46",1968),m(1969,1,ii,SU),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/47",1969),m(1970,1,ii,Zk),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/48",1970),m(1971,1,ii,Q5),s.dk=function(n){return X(n,191)},s.ek=function(n){return se(lp,Me,191,n,0,1)},v(kr,"XMLTypePackageImpl/49",1971),m(1927,1,ii,gC),s.dk=function(n){return X(n,673)},s.ek=function(n){return se(h7e,On,2083,n,0,1)},v(kr,"XMLTypePackageImpl/5",1927),m(1972,1,ii,ej),s.dk=function(n){return X(n,190)},s.ek=function(n){return se(sp,Me,190,n,0,1)},v(kr,"XMLTypePackageImpl/50",1972),m(1973,1,ii,wC),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/51",1973),m(1974,1,ii,t2),s.dk=function(n){return X(n,15)},s.ek=function(n){return se(jr,Me,15,n,0,1)},v(kr,"XMLTypePackageImpl/52",1974),m(1928,1,ii,Ib),s.dk=function(n){return $r(n)},s.ek=function(n){return se(He,Me,2,n,6,1)},v(kr,"XMLTypePackageImpl/6",1928),m(1929,1,ii,Q6),s.dk=function(n){return X(n,195)},s.ek=function(n){return se(ds,Me,195,n,0,2)},v(kr,"XMLTypePackageImpl/7",1929),m(1930,1,ii,xU),s.dk=function(n){return b2(n)},s.ek=function(n){return se(Qi,Me,473,n,8,1)},v(kr,"XMLTypePackageImpl/8",1930),m(1931,1,ii,ZL),s.dk=function(n){return X(n,221)},s.ek=function(n){return se(jy,Me,221,n,0,1)},v(kr,"XMLTypePackageImpl/9",1931);var ch,r0,dA,OG,J;m(53,63,H1,Bt),v(Gd,"RegEx/ParseException",53),m(820,1,{},pC),s._l=function(n){return ni*16)throw R(new Bt(Ht((Lt(),TZe))));i=i*16+c}while(!0);if(this.a!=125)throw R(new Bt(Ht((Lt(),OZe))));if(i>a7)throw R(new Bt(Ht((Lt(),NZe))));n=i}else{if(c=0,this.c!=0||(c=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(i=c,fi(this),this.c!=0||(c=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));i=i*16+c,n=i}break;case 117:if(r=0,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=t*16+r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=t*16+r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));t=t*16+r,n=t;break;case 118:if(fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=t*16+r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=t*16+r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=t*16+r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=t*16+r,fi(this),this.c!=0||(r=og(this.a))<0)throw R(new Bt(Ht((Lt(),Hd))));if(t=t*16+r,t>a7)throw R(new Bt(Ht((Lt(),"parser.descappe.4"))));n=t;break;case 65:case 90:case 122:throw R(new Bt(Ht((Lt(),IZe))))}return n},s.bm=function(n){var t,i;switch(n){case 100:i=(this.e&32)==32?K0("Nd",!0):(ai(),NG);break;case 68:i=(this.e&32)==32?K0("Nd",!1):(ai(),k7e);break;case 119:i=(this.e&32)==32?K0("IsWord",!0):(ai(),Q7);break;case 87:i=(this.e&32)==32?K0("IsWord",!1):(ai(),E7e);break;case 115:i=(this.e&32)==32?K0("IsSpace",!0):(ai(),e6);break;case 83:i=(this.e&32)==32?K0("IsSpace",!1):(ai(),j7e);break;default:throw R(new du((t=n,Ien+t.toString(16))))}return i},s.cm=function(n){var t,i,r,c,o,l,f,h,b,p,y,S;for(this.b=1,fi(this),t=null,this.c==0&&this.a==94?(fi(this),n?p=(ai(),ai(),new cl(5)):(t=(ai(),ai(),new cl(4)),ho(t,0,a7),p=new cl(4))):p=(ai(),ai(),new cl(4)),c=!0;(S=this.c)!=1&&!(S==0&&this.a==93&&!c);){if(c=!1,i=this.a,r=!1,S==10)switch(i){case 100:case 68:case 119:case 87:case 115:case 83:tm(p,this.bm(i)),r=!0;break;case 105:case 73:case 99:case 67:i=this.sm(p,i),i<0&&(r=!0);break;case 112:case 80:if(y=Q0e(this,i),!y)throw R(new Bt(Ht((Lt(),Ine))));tm(p,y),r=!0;break;default:i=this.am()}else if(S==20){if(l=E9(this.i,58,this.d),l<0)throw R(new Bt(Ht((Lt(),Y2e))));if(f=!0,rc(this.i,this.d)==94&&(++this.d,f=!1),o=of(this.i,this.d,l),h=$$e(o,f,(this.e&512)==512),!h)throw R(new Bt(Ht((Lt(),SZe))));if(tm(p,h),r=!0,l+1>=this.j||rc(this.i,l+1)!=93)throw R(new Bt(Ht((Lt(),Y2e))));this.d=l+2}if(fi(this),!r)if(this.c!=0||this.a!=45)ho(p,i,i);else{if(fi(this),(S=this.c)==1)throw R(new Bt(Ht((Lt(),KF))));S==0&&this.a==93?(ho(p,i,i),ho(p,45,45)):(b=this.a,S==10&&(b=this.am()),fi(this),ho(p,i,b))}(this.e&Gf)==Gf&&this.c==0&&this.a==44&&fi(this)}if(this.c==1)throw R(new Bt(Ht((Lt(),KF))));return t&&(bS(t,p),p=t),h3(p),hS(p),this.b=0,fi(this),p},s.dm=function(){var n,t,i,r;for(i=this.cm(!1);(r=this.c)!=7;)if(n=this.a,r==0&&(n==45||n==38)||r==4){if(fi(this),this.c!=9)throw R(new Bt(Ht((Lt(),AZe))));if(t=this.cm(!1),r==4)tm(i,t);else if(n==45)bS(i,t);else if(n==38)uVe(i,t);else throw R(new du("ASSERT"))}else throw R(new Bt(Ht((Lt(),MZe))));return fi(this),i},s.em=function(){var n,t;return n=this.a-48,t=(ai(),ai(),new JV(12,null,n)),!this.g&&(this.g=new RP),$P(this.g,new ooe(n)),fi(this),t},s.fm=function(){return fi(this),ai(),xhn},s.gm=function(){return fi(this),ai(),Shn},s.hm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.im=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.jm=function(){return fi(this),vkn()},s.km=function(){return fi(this),ai(),Mhn},s.lm=function(){return fi(this),ai(),Thn},s.mm=function(){var n;if(this.d>=this.j||((n=rc(this.i,this.d++))&65504)!=64)throw R(new Bt(Ht((Lt(),kZe))));return fi(this),ai(),ai(),new Gh(0,n-64)},s.nm=function(){return fi(this),J_n()},s.om=function(){return fi(this),ai(),Ohn},s.pm=function(){var n;return n=(ai(),ai(),new Gh(0,105)),fi(this),n},s.qm=function(){return fi(this),ai(),Chn},s.rm=function(){return fi(this),ai(),Ahn},s.sm=function(n,t){return this.am()},s.tm=function(){return fi(this),ai(),v7e},s.um=function(){var n,t,i,r,c;if(this.d+1>=this.j)throw R(new Bt(Ht((Lt(),mZe))));if(r=-1,t=null,n=rc(this.i,this.d),49<=n&&n<=57){if(r=n-48,!this.g&&(this.g=new RP),$P(this.g,new ooe(r)),++this.d,rc(this.i,this.d)!=41)throw R(new Bt(Ht((Lt(),mg))));++this.d}else switch(n==63&&--this.d,fi(this),t=Oge(this),t.e){case 20:case 21:case 22:case 23:break;case 8:if(this.c!=7)throw R(new Bt(Ht((Lt(),mg))));break;default:throw R(new Bt(Ht((Lt(),vZe))))}if(fi(this),c=Jw(this),i=null,c.e==2){if(c.Nm()!=2)throw R(new Bt(Ht((Lt(),yZe))));i=c.Jm(1),c=c.Jm(0)}if(this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),ai(),ai(),new CRe(r,t,c,i)},s.vm=function(){return fi(this),ai(),y7e},s.wm=function(){var n;if(fi(this),n=kR(24,Jw(this)),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),n},s.xm=function(){var n;if(fi(this),n=kR(20,Jw(this)),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),n},s.ym=function(){var n;if(fi(this),n=kR(22,Jw(this)),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),n},s.zm=function(){var n,t,i,r,c;for(n=0,i=0,t=-1;this.d=this.j)throw R(new Bt(Ht((Lt(),K2e))));if(t==45){for(++this.d;this.d=this.j)throw R(new Bt(Ht((Lt(),K2e))))}if(t==58){if(++this.d,fi(this),r=gDe(Jw(this),n,i),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));fi(this)}else if(t==41)++this.d,fi(this),r=gDe(Jw(this),n,i);else throw R(new Bt(Ht((Lt(),pZe))));return r},s.Am=function(){var n;if(fi(this),n=kR(21,Jw(this)),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),n},s.Bm=function(){var n;if(fi(this),n=kR(23,Jw(this)),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),n},s.Cm=function(){var n,t;if(fi(this),n=this.f++,t=pV(Jw(this),n),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),t},s.Dm=function(){var n;if(fi(this),n=pV(Jw(this),0),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),n},s.Em=function(n){return fi(this),this.c==5?(fi(this),dR(n,(ai(),ai(),new D2(9,n)))):dR(n,(ai(),ai(),new D2(3,n)))},s.Fm=function(n){var t;return fi(this),t=(ai(),ai(),new Vj(2)),this.c==5?(fi(this),fg(t,gA),fg(t,n)):(fg(t,n),fg(t,gA)),t},s.Gm=function(n){return fi(this),this.c==5?(fi(this),ai(),ai(),new D2(9,n)):(ai(),ai(),new D2(3,n))},s.a=0,s.b=0,s.c=0,s.d=0,s.e=0,s.f=1,s.g=null,s.j=0,v(Gd,"RegEx/RegexParser",820),m(1910,820,{},Lxe),s._l=function(n){return!1},s.am=function(){return Lbe(this)},s.bm=function(n){return O8(n)},s.cm=function(n){return ZVe(this)},s.dm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.em=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.fm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.gm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.hm=function(){return fi(this),O8(67)},s.im=function(){return fi(this),O8(73)},s.jm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.km=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.lm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.mm=function(){return fi(this),O8(99)},s.nm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.om=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.pm=function(){return fi(this),O8(105)},s.qm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.rm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.sm=function(n,t){return tm(n,O8(t)),-1},s.tm=function(){return fi(this),ai(),ai(),new Gh(0,94)},s.um=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.vm=function(){return fi(this),ai(),ai(),new Gh(0,36)},s.wm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.xm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.ym=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.zm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.Am=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.Bm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.Cm=function(){var n;if(fi(this),n=pV(Jw(this),0),this.c!=7)throw R(new Bt(Ht((Lt(),mg))));return fi(this),n},s.Dm=function(){throw R(new Bt(Ht((Lt(),Ul))))},s.Em=function(n){return fi(this),dR(n,(ai(),ai(),new D2(3,n)))},s.Fm=function(n){var t;return fi(this),t=(ai(),ai(),new Vj(2)),fg(t,n),fg(t,gA),t},s.Gm=function(n){return fi(this),ai(),ai(),new D2(3,n)};var u5=null,V7=null;v(Gd,"RegEx/ParserForXMLSchema",1910),m(121,1,h7,bw),s.Hm=function(n){throw R(new du("Not supported."))},s.Im=function(){return-1},s.Jm=function(n){return null},s.Km=function(){return null},s.Lm=function(n){},s.Mm=function(n){},s.Nm=function(){return 0},s.Ib=function(){return this.Om(0)},s.Om=function(n){return this.e==11?".":""},s.e=0;var w7e,Y7,bA,Ehn,p7e,Vm=null,NG,Xce=null,m7e,gA,Kce=null,v7e,y7e,k7e,j7e,E7e,Shn,e6,xhn,Ahn,Mhn,Chn,Q7,Thn,Ohn,nzn=v(Gd,"RegEx/Token",121);m(137,121,{3:1,137:1,121:1},cl),s.Om=function(n){var t,i,r;if(this.e==4)if(this==m7e)i=".";else if(this==NG)i="\\d";else if(this==Q7)i="\\w";else if(this==e6)i="\\s";else{for(r=new vd,r.a+="[",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?Bc(r,rN(this.b[t])):(Bc(r,rN(this.b[t])),r.a+="-",Bc(r,rN(this.b[t+1])));r.a+="]",i=r.a}else if(this==k7e)i="\\D";else if(this==E7e)i="\\W";else if(this==j7e)i="\\S";else{for(r=new vd,r.a+="[^",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?Bc(r,rN(this.b[t])):(Bc(r,rN(this.b[t])),r.a+="-",Bc(r,rN(this.b[t+1])));r.a+="]",i=r.a}return i},s.a=!1,s.c=!1,v(Gd,"RegEx/RangeToken",137),m(580,1,{580:1},ooe),s.a=0,v(Gd,"RegEx/RegexParser/ReferencePosition",580),m(579,1,{3:1,579:1},pMe),s.Fb=function(n){var t;return n==null||!X(n,579)?!1:(t=u(n,579),gn(this.b,t.b)&&this.a==t.a)},s.Hb=function(){return Id(this.b+"/"+Cbe(this.a))},s.Ib=function(){return this.c.Om(this.a)},s.a=0,v(Gd,"RegEx/RegularExpression",579),m(228,121,h7,Gh),s.Im=function(){return this.a},s.Om=function(n){var t,i,r;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:r="\\"+HK(this.a&yr);break;case 12:r="\\f";break;case 10:r="\\n";break;case 13:r="\\r";break;case 9:r="\\t";break;case 27:r="\\e";break;default:this.a>=Ec?(i=(t=this.a>>>0,"0"+t.toString(16)),r="\\v"+of(i,i.length-6,i.length)):r=""+HK(this.a&yr)}break;case 8:this==v7e||this==y7e?r=""+HK(this.a&yr):r="\\"+HK(this.a&yr);break;default:r=null}return r},s.a=0,v(Gd,"RegEx/Token/CharToken",228),m(322,121,h7,D2),s.Jm=function(n){return this.a},s.Lm=function(n){this.b=n},s.Mm=function(n){this.c=n},s.Nm=function(){return 1},s.Om=function(n){var t;if(this.e==3)if(this.c<0&&this.b<0)t=this.a.Om(n)+"*";else if(this.c==this.b)t=this.a.Om(n)+"{"+this.c+"}";else if(this.c>=0&&this.b>=0)t=this.a.Om(n)+"{"+this.c+","+this.b+"}";else if(this.c>=0&&this.b<0)t=this.a.Om(n)+"{"+this.c+",}";else throw R(new du("Token#toString(): CLOSURE "+this.c+To+this.b));else if(this.c<0&&this.b<0)t=this.a.Om(n)+"*?";else if(this.c==this.b)t=this.a.Om(n)+"{"+this.c+"}?";else if(this.c>=0&&this.b>=0)t=this.a.Om(n)+"{"+this.c+","+this.b+"}?";else if(this.c>=0&&this.b<0)t=this.a.Om(n)+"{"+this.c+",}?";else throw R(new du("Token#toString(): NONGREEDYCLOSURE "+this.c+To+this.b));return t},s.b=0,s.c=0,v(Gd,"RegEx/Token/ClosureToken",322),m(821,121,h7,zfe),s.Jm=function(n){return n==0?this.a:this.b},s.Nm=function(){return 2},s.Om=function(n){var t;return this.b.e==3&&this.b.Jm(0)==this.a?t=this.a.Om(n)+"+":this.b.e==9&&this.b.Jm(0)==this.a?t=this.a.Om(n)+"+?":t=this.a.Om(n)+(""+this.b.Om(n)),t},v(Gd,"RegEx/Token/ConcatToken",821),m(1908,121,h7,CRe),s.Jm=function(n){if(n==0)return this.d;if(n==1)return this.b;throw R(new du("Internal Error: "+n))},s.Nm=function(){return this.b?2:1},s.Om=function(n){var t;return this.c>0?t="(?("+this.c+")":this.a.e==8?t="(?("+this.a+")":t="(?"+this.a,this.b?t+=this.d+"|"+this.b+")":t+=this.d+")",t},s.c=0,v(Gd,"RegEx/Token/ConditionToken",1908),m(1909,121,h7,hLe),s.Jm=function(n){return this.b},s.Nm=function(){return 1},s.Om=function(n){return"(?"+(this.a==0?"":Cbe(this.a))+(this.c==0?"":Cbe(this.c))+":"+this.b.Om(n)+")"},s.a=0,s.c=0,v(Gd,"RegEx/Token/ModifierToken",1909),m(822,121,h7,Yfe),s.Jm=function(n){return this.a},s.Nm=function(){return 1},s.Om=function(n){var t;switch(t=null,this.e){case 6:this.b==0?t="(?:"+this.a.Om(n)+")":t="("+this.a.Om(n)+")";break;case 20:t="(?="+this.a.Om(n)+")";break;case 21:t="(?!"+this.a.Om(n)+")";break;case 22:t="(?<="+this.a.Om(n)+")";break;case 23:t="(?"+this.a.Om(n)+")"}return t},s.b=0,v(Gd,"RegEx/Token/ParenToken",822),m(517,121,{3:1,121:1,517:1},JV),s.Km=function(){return this.b},s.Om=function(n){return this.e==12?"\\"+this.a:POn(this.b)},s.a=0,v(Gd,"RegEx/Token/StringToken",517),m(466,121,h7,Vj),s.Hm=function(n){fg(this,n)},s.Jm=function(n){return u(Aw(this.a,n),121)},s.Nm=function(){return this.a?this.a.a.c.length:0},s.Om=function(n){var t,i,r,c,o;if(this.e==1){if(this.a.a.c.length==2)t=u(Aw(this.a,0),121),i=u(Aw(this.a,1),121),i.e==3&&i.Jm(0)==t?c=t.Om(n)+"+":i.e==9&&i.Jm(0)==t?c=t.Om(n)+"+?":c=t.Om(n)+(""+i.Om(n));else{for(o=new vd,r=0;r=this.c.b:this.a<=this.c.b},s.Sb=function(){return this.b>0},s.Tb=function(){return this.b},s.Vb=function(){return this.b-1},s.Qb=function(){throw R(new pd(Ben))},s.a=0,s.b=0,v(gme,"ExclusiveRange/RangeIterator",259);var Wl=L9(VF,"C"),$t=L9(JS,"I"),ts=L9(ly,"Z"),Ap=L9(HS,"J"),ds=L9(BS,"B"),Jr=L9(zS,"D"),Ym=L9(FS,"F"),o5=L9(GS,"S"),tzn=Gi("org.eclipse.elk.core.labels","ILabelManager"),S7e=Gi(yc,"DiagnosticChain"),x7e=Gi(den,"ResourceSet"),A7e=v(yc,"InvocationTargetException",null),Ihn=(GP(),X6n),Dhn=Dhn=AAn;G8n(wbn),u7n("permProps",[[["locale","default"],[zen,"gecko1_8"]],[["locale","default"],[zen,"safari"]]]),Dhn(null,"elk",null)}).call(this)}).call(this,typeof Lhn<"u"?Lhn:typeof self<"u"?self:typeof window<"u"?window:{})},{}],3:[function(x,M,N){function $(pe){"@babel/helpers - typeof";return $=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($e){return typeof $e}:function($e){return $e&&typeof Symbol=="function"&&$e.constructor===Symbol&&$e!==Symbol.prototype?"symbol":typeof $e},$(pe)}function k(pe,$e,ae){return Object.defineProperty(pe,"prototype",{writable:!1}),pe}function H(pe,$e){if(!(pe instanceof $e))throw new TypeError("Cannot call a class as a function")}function U(pe,$e,ae){return $e=Z($e),G(pe,W()?Reflect.construct($e,ae||[],Z(pe).constructor):$e.apply(pe,ae))}function G(pe,$e){if($e&&($($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ie(pe)}function ie(pe){if(pe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return pe}function W(){try{var pe=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W=function(){return!!pe})()}function Z(pe){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function($e){return $e.__proto__||Object.getPrototypeOf($e)},Z(pe)}function le(pe,$e){if(typeof $e!="function"&&$e!==null)throw new TypeError("Super expression must either be null or a function");pe.prototype=Object.create($e&&$e.prototype,{constructor:{value:pe,writable:!0,configurable:!0}}),Object.defineProperty(pe,"prototype",{writable:!1}),$e&&oe(pe,$e)}function oe(pe,$e){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ae,Ne){return ae.__proto__=Ne,ae},oe(pe,$e)}var ee=x("./elk-api.js").default,Ce=(function(pe){function $e(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};H(this,$e);var Ne=Object.assign({},ae),Ue=!1;try{x.resolve("web-worker"),Ue=!0}catch{}if(ae.workerUrl)if(Ue){var ln=x("web-worker");Ne.workerFactory=function(xn){return new ln(xn)}}else console.warn(`Web worker requested but 'web-worker' package not installed. +Consider installing the package or pass your own 'workerFactory' to ELK's constructor. +... Falling back to non-web worker version.`);if(!Ne.workerFactory){var un=x("./elk-worker.min.js"),An=un.Worker;Ne.workerFactory=function(xn){return new An(xn)}}return U(this,$e,[Ne])}return le($e,pe),k($e)})(ee);Object.defineProperty(M.exports,"__esModule",{value:!0}),M.exports=Ce,Ce.default=Ce},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(x,M,N){var $=typeof Worker<"u"?Worker:void 0;M.exports=$},{}]},{},[3])(3)})})(K7e)),K7e.exports}var cKn=rKn();const uKn=bke(cKn);function ebn(g){if(g.detailMode==="overview")return 190;const E=Math.max(g.applicationId.length,g.modelName.length,...g.inputs.map(x=>x.name.length),...g.outputs.map(x=>x.name.length));return Math.max(310,Math.min(540,235+E*7))}const oKn=new uKn;async function sKn(g,E,x){const M={id:"root",layoutOptions:lKn(x),children:g.map(k=>({id:k.id,width:fKn(k.data),height:aKn(k.data),ports:k.data.nodeKind==="application"?[...nbn(k.data).map((H,U)=>lue(H.id,"WEST",U)),...tbn(k.data).map((H,U)=>lue(H.id,"EAST",U))]:[...(k.data.inputPortIds??[]).map((H,U)=>lue(H,"WEST",U)),...(k.data.outputPortIds??[]).map((H,U)=>lue(H,"EAST",U))],layoutOptions:{"org.eclipse.elk.portConstraints":"FIXED_ORDER"}})),edges:E.map(k=>({id:k.id,sources:[k.sourceHandle??k.source],targets:[k.targetHandle??k.target]}))},N=await oKn.layout(M),$=new Map((N.children??[]).map(k=>[k.id,{x:k.x??0,y:k.y??0}]));return g.map(k=>({...k,position:$.get(k.id)??k.position}))}function lKn(g){return{"elk.algorithm":g==="topology"?"mrtree":"layered","elk.direction":g==="topology"?"DOWN":"RIGHT","elk.spacing.nodeNode":g==="overview"?"24":g==="compact"?"32":"56","elk.layered.spacing.nodeNodeBetweenLayers":g==="overview"?"48":g==="compact"?"60":"110","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.crossingMinimization.semiInteractive":"true","elk.edgeRouting":"ORTHOGONAL"}}function lue(g,E,x){return{id:g,width:9,height:9,layoutOptions:{"org.eclipse.elk.port.side":E,"org.eclipse.elk.port.index":String(x)}}}function fKn(g){return g.nodeKind==="application"?ebn(g):240}function aKn(g){if(g.nodeKind!=="application")return 112;if(g.detailMode==="overview")return 108;const E=Math.max(g.inputs.length,g.outputs.length),x=Math.max(g.environmentInputs.length,g.environmentOutputs.length);return Math.max(178,142+E*27+(x>0?32+x*27:0))}function nbn(g){return[...g.inputs,...g.environmentInputs]}function tbn(g){return[...g.outputs,...g.environmentOutputs]}function hKn({data:g,selected:E}){const x=g.detailMode==="overview",M=new Set(g.requiredInputPortIds),N=new Set(g.candidatePortIds),$=new Set(g.previousTimeStepPortIds),k=new Set(g.cycleBreakInputPortIds),H=gKn(g);return L.jsxs("section",{className:`model-node application-node ${x?"overview-node":""} ${g.cyclic?"cyclic":""} ${E?"selected":""}`,"data-testid":`application-node-${g.applicationId}`,style:{width:ebn(g)},children:[x&&L.jsx(bKn,{inputs:nbn(g),outputs:tbn(g)}),L.jsxs("header",{className:"node-header",children:[L.jsxs("div",{children:[L.jsx("div",{className:"process",children:g.name||g.applicationId}),L.jsx("div",{className:"model-type",children:g.modelName})]}),L.jsx(Y0n,{size:18})]}),x?L.jsxs("div",{className:"overview-node-summary",children:[L.jsxs("span",{children:[g.targetCount," targets"]}),L.jsxs("span",{children:[g.inputs.length," in"]}),L.jsxs("span",{children:[g.outputs.length," out"]})]}):L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"node-meta",children:[L.jsxs("span",{className:"meta-chip",title:g.selector.julia,children:[L.jsx(xXn,{size:13})," ",H]}),L.jsxs("span",{className:"meta-chip",title:g.cadence.julia,children:[L.jsx(CXn,{size:13})," ",wKn(g)]})]}),L.jsxs("div",{className:"target-summary",children:[L.jsx("strong",{children:g.targetCount})," concrete target",g.targetCount===1?"":"s"]}),L.jsxs("div",{className:"ports-grid",children:[L.jsx(fue,{title:"Inputs",side:"input",ports:g.inputs,required:M,candidates:N,previous:$,cycleBreaks:k,cycleBreakMode:g.cycleBreakMode,application:g,onCandidateClick:g.onCandidateClick,onPortClick:g.onPortClick,onCycleBreak:g.onCycleBreak}),L.jsx(fue,{title:"Outputs",side:"output",ports:g.outputs,required:M,candidates:N,previous:$,cycleBreaks:k,cycleBreakMode:g.cycleBreakMode,application:g,onCandidateClick:g.onCandidateClick,onPortClick:g.onPortClick,onCycleBreak:g.onCycleBreak})]}),(g.environmentInputs.length>0||g.environmentOutputs.length>0)&&L.jsxs("div",{className:"ports-grid environment-ports",children:[L.jsx(fue,{title:"Environment inputs",side:"input",ports:g.environmentInputs,required:M,candidates:new Set,previous:new Set,cycleBreaks:new Set,cycleBreakMode:!1,application:g,onPortClick:g.onPortClick}),L.jsx(fue,{title:"Environment outputs",side:"output",ports:g.environmentOutputs,required:M,candidates:new Set,previous:new Set,cycleBreaks:new Set,cycleBreakMode:!1,application:g,onPortClick:g.onPortClick})]})]})]})}function dKn({data:g,selected:E}){return L.jsxs("section",{className:`entity-node ${g.nodeKind} ${E?"selected":""}`,"data-testid":`${g.nodeKind}-node`,children:[(g.inputPortIds?.length?g.inputPortIds:[void 0]).map((x,M)=>L.jsx(h5,{id:x,type:"target",position:ur.Left,style:{top:`${Tue(M,g.inputPortIds?.length??1)}%`}},x??"target")),L.jsxs("header",{children:[L.jsx("strong",{children:g.title}),L.jsx("span",{children:g.subtitle})]}),L.jsx("div",{className:"badges",children:g.badges.map(x=>L.jsx("span",{className:"meta-chip",children:x},x))}),(g.outputPortIds?.length?g.outputPortIds:[void 0]).map((x,M)=>L.jsx(h5,{id:x,type:"source",position:ur.Right,style:{top:`${Tue(M,g.outputPortIds?.length??1)}%`}},x??"source"))]})}function fue({title:g,side:E,ports:x,required:M,candidates:N,previous:$,cycleBreaks:k,cycleBreakMode:H,application:U,onCandidateClick:G,onPortClick:ie,onCycleBreak:W}){return L.jsxs("div",{className:`port-column ${E}`,children:[L.jsx("div",{className:"port-title",children:g}),x.map(Z=>L.jsxs("div",{className:`port ${M.has(Z.id)?"required-input":""} ${$.has(Z.id)?"previous":""}`,"data-testid":`port-${E}-${Z.name}`,title:`${Z.name}: ${Z.defaultJulia}`,onClick:le=>{le.stopPropagation(),ie?.(Z)},children:[E==="input"&&L.jsx(h5,{id:Z.id,type:"target",position:ur.Left}),L.jsx("span",{children:Z.name}),N.has(Z.id)&&L.jsx("button",{className:"port-candidate-button nodrag nopan",type:"button",title:E==="input"?"Models that compute this variable":"Models that consume this variable","aria-label":E==="input"?`Models that compute ${Z.name}`:`Models that consume ${Z.name}`,onClick:le=>{le.stopPropagation();const oe=le.currentTarget.getBoundingClientRect();G?.(Z,{x:oe.right,y:oe.top+oe.height/2})},children:L.jsx(SA,{size:11})}),E==="input"&&H&&k.has(Z.id)&&L.jsx("button",{className:"cycle-port-break nodrag nopan",type:"button",title:`Read ${Z.name} from the previous accepted timestep`,"aria-label":`Break cycle at ${U.applicationId}.${Z.name}`,"data-testid":`cycle-break-${U.applicationId}-${Z.name}`,onClick:le=>{le.stopPropagation(),W?.(U,Z)},children:L.jsx(Q0n,{size:12})}),$.has(Z.id)&&L.jsx("small",{className:"previous-label",children:"t-1"}),E==="output"&&L.jsx(h5,{id:Z.id,type:"source",position:ur.Right})]},Z.id))]})}function bKn({inputs:g,outputs:E}){return L.jsxs(L.Fragment,{children:[g.map((x,M)=>L.jsx(h5,{id:x.id,type:"target",position:ur.Left,style:{top:`${Tue(M,g.length)}%`}},x.id)),E.map((x,M)=>L.jsx(h5,{id:x.id,type:"source",position:ur.Right,style:{top:`${Tue(M,E.length)}%`}},x.id))]})}function Tue(g,E){return E<=1?52:28+g/(E-1)*48}function gKn(g){const E=[...g.targetInstances,...g.targetScales,...g.targetKinds];return E.length>0?E.slice(0,2).join(" / "):g.selector.type}function wKn(g){return g.cadence.mode==="default"?"default rate":g.cadence.mode==="period"?`${g.cadence.value} ${g.cadence.unit}`:g.cadence.julia}function pKn({id:g,sourceX:E,sourceY:x,targetX:M,targetY:N,sourcePosition:$=ur.Right,targetPosition:k=ur.Left,markerEnd:H,style:U,data:G}){const[ie,W,Z]=Aue({sourceX:E,sourceY:x,targetX:M,targetY:N,sourcePosition:$,targetPosition:k,borderRadius:14,offset:24}),le=mKn(G);return L.jsxs(L.Fragment,{children:[L.jsx(uq,{id:g,path:ie,markerEnd:H,style:U,interactionWidth:18}),le&&L.jsx(qUn,{children:L.jsx("div",{className:`edge-chip ${G?.kind??""} ${G?.cycle?"cycle":""}`,style:{transform:`translate(-50%, -50%) translate(${W}px, ${Z-12}px)`},children:le})})]})}function mKn(g){return g?g.kind==="manual_call"?g.call||"call":g.kind==="object_topology"||g.kind==="application_target"?"":g.sourceVariable&&g.targetVariable?g.sourceVariable===g.targetVariable?g.sourceVariable:`${g.sourceVariable} → ${g.targetVariable}`:g.kind.replaceAll("_"," "):""}const V7e=_ke("source","degree_days","ToyDegreeDaysCumulModel",[],["TT_cu"]),aue=_ke("lai","lai_dynamic","ToyLAIModel",["TT_cu"],["LAI"]),Y7e=_ke("light","light_interception","Beer",["LAI"],["aPPFD"]),ndn={schemaVersion:2,level:"applications",metadata:{title:"PlantSimEngine Model Graph",modelRevision:0,objectCount:1,instanceCount:0,applicationCount:3,executionCount:3,bindingCount:2,callCount:0,unresolvedInitializationCount:1,cyclic:!1,strictlyCompiled:!0,sceneEnvironmentId:null},objects:[{id:"object:plant",objectId:"plant",scale:"Plant",kind:"plant",species:null,name:"plant",instance:null,parent:null,children:[],hasGeometry:!1,hasStatus:!0}],templates:[],instances:[],applications:[V7e,aue,Y7e],executions:[V7e,aue,Y7e].map(g=>({id:`execution:${g.applicationId}:plant`,applicationId:g.applicationId,applicationNodeId:g.id,objectId:"plant",objectNodeId:"object:plant",modelType:g.modelType,modelParameters:{},overridden:!1})),edges:[idn(V7e,"TT_cu",aue,"TT_cu"),idn(aue,"LAI",Y7e,"LAI")],modelLibrary:[],environments:[],initialization:[{applicationId:"source",objectId:"plant",variable:"TT",role:"input",disposition:"unresolved",value:"-Inf",valueJulia:"-Inf",expectedType:"Float64",sourceApplicationIds:[],sourceObjectIds:[],sourceVariable:null,origin:"missing",previousTimeStep:!1}],diagnostics:[],cycles:[],availableActions:["inspect"]};function _ke(g,E,x,M,N){return{id:`application:${g}`,applicationId:g,owner:{scope:"global",applicationId:g,instance:null,templateId:null},name:g,process:E,modelType:x,modelName:x,module:"PlantSimEngine.Examples",package:"PlantSimEngine",modelParameters:{},selector:{type:"One",multiplicity:"one",criteria:{scale:"Plant"},julia:"One(scale=:Plant)"},targetIds:["plant"],targetCount:1,targetScales:["Plant"],targetKinds:["plant"],targetSpecies:[],targetInstances:[],cadence:{mode:"default",value:null,unit:null,julia:"nothing"},clock:null,inputs:M.map($=>tdn(g,"input",$)),outputs:N.map($=>tdn(g,"output",$)),environmentInputs:[],environmentOutputs:[],inputBindings:{},callBindings:{},environment:null,environmentBindings:{},environmentWindow:{mode:"default",value:null,unit:null,julia:"nothing"},outputRouting:{},updates:[],modelStorage:"shared_application",objectOverrides:[]}}function tdn(g,E,x){return{id:`application:${g}:${E}:${x}`,name:x,role:E,default:"-Inf",defaultJulia:"-Inf",expectedType:"Float64"}}function idn(g,E,x,M){return{id:`binding:${g.applicationId}:${E}:${x.applicationId}:${M}`,source:g.id,target:x.id,sourcePort:`application:${g.applicationId}:output:${E}`,targetPort:`application:${x.applicationId}:input:${M}`,sourceVariable:E,targetVariable:M,sourceApplicationId:g.applicationId,targetApplicationId:x.applicationId,kind:"inferred_same_object",cycle:!1,projection:"applications"}}const vKn={application:hKn,entity:dKn},yKn={modelEdge:pKn};function kKn(){const[g,E]=Be.useState(W7e),[x,M]=Be.useState(()=>W7e().level),[N,$]=Be.useState(()=>W7e().metadata.applicationCount>24?"overview":"detail"),[k,H]=Be.useState(""),[U,G]=Be.useState(null),[ie,W]=Be.useState(null),[Z,le]=Be.useState(null),[oe,ee]=Be.useState(null),[Ce,pe]=Be.useState(!1),[$e,ae]=Be.useState(!1),[Ne,Ue]=Be.useState(!1),[ln,un]=Be.useState(!1),[An,xn]=Be.useState(!1),[nt,dn]=Be.useState(""),[bn,Y]=Be.useState(null),[Je,pn]=Be.useState(null),[Ae,ve]=Be.useState([]),[nn,yn]=Be.useState(null),[Pn,ye]=Be.useState(!1),[Re,tt]=Be.useState(!1),[ut,Jt]=Be.useState(!1),[di,Gt]=Be.useState(null),[xt,si]=Be.useState(null),[Kr,Er]=Be.useState(null),[Mt,bi]=Be.useState(!1),[zi,cu]=Be.useState(null),[Fu,Rs]=Be.useState(!1),[ia,ef]=Be.useState(null),[Oa,Cc]=Be.useState(null),[o0,xb]=Be.useState(null),[Sl,cd]=Be.useState(null),[s0,uh]=Be.useState(null),[ud,b5]=Be.useState(!1),[l0,Cp]=Be.useState(null),[l6,Ab,ra]=UUn([]),[od,Sf,f6]=XUn([]),oh=Be.useMemo(FKn,[]),Tp=Be.useMemo(()=>new Map(g.applications.map(vt=>[vt.applicationId,vt])),[g.applications]),Gg=Be.useMemo(()=>new Set(g.initialization.filter(vt=>vt.role==="input"&&vt.disposition==="unresolved").map(vt=>Q7e(vt.applicationId,"input",vt.variable))),[g.initialization]),qg=Be.useMemo(()=>new Set(g.initialization.filter(vt=>vt.role==="input"&&vt.previousTimeStep).map(vt=>Q7e(vt.applicationId,"input",vt.variable))),[g.initialization]),Ug=Be.useMemo(()=>new Set(g.cycles.flatMap(vt=>vt.applicationIds)),[g.cycles]),sd=Be.useMemo(()=>new Set(g.cycles.flatMap(vt=>vt.breakCandidates.map(kc=>Q7e(kc.applicationId,"input",kc.input)))),[g.cycles]),Xg=Be.useMemo(()=>MKn(g),[g]),Mb=Be.useMemo(()=>oe?CKn(g.modelLibrary,oe.port):[],[oe,g.modelLibrary]),g5=Be.useMemo(()=>oe?OKn(g.applications,oe):[],[oe,g.applications]),Op=Be.useMemo(()=>{const vt=new Map;for(const kc of g.applications)for(const tc of[...kc.inputs,...kc.outputs])vt.set(tc.id,{application:kc,port:tc});return vt},[g.applications]),Np=Be.useMemo(()=>ie?new Set(ie.objectIds.map(u6)):null,[ie]);Be.useEffect(()=>{if(!oh?.websocketUrl)return;const vt=new WebSocket(oh.websocketUrl);return yn(vt),vt.addEventListener("open",()=>{ye(!0),Gt(null)}),vt.addEventListener("close",()=>{ye(!1),Gt("Editor connection closed.")}),vt.addEventListener("message",kc=>{const tc=JSON.parse(kc.data);tc.graph&&E(tc.graph),typeof tc.modelCode=="string"&&dn(tc.modelCode),Y(tc.autosavePath??null),pn(tc.savePath??null),ve(tc.recentPaths??[]),tc.selectorPreview&&uh(tc.selectorPreview),tc.targetPreview&&Er(tc.targetPreview),tc.instancePreview&&cu(tc.instancePreview),tc.ok===!1&&(uh(null),Er(null),cu(null)),tt(!!tc.canUndo),Jt(!!tc.canRedo),Gt(tc.ok===!1?tc.diagnostics?.[0]||"The edit failed.":null)}),()=>vt.close()},[oh?.websocketUrl]),Be.useEffect(()=>{g.metadata.cyclic||(b5(!1),Cp(null))},[g.metadata.cyclic]);const uu=Be.useCallback(vt=>{if(!nn||nn.readyState!==WebSocket.OPEN){Gt("This action requires an interactive Julia editor session.");return}nn.send(JSON.stringify(vt))},[nn]),w5=Be.useCallback((vt,kc,tc)=>{G(vt),le(kc),ee({application:vt,port:kc,x:tc.x,y:tc.y})},[]);Be.useEffect(()=>{const vt=jKn({graph:g,view:x,detailMode:N,query:k,scopedObjectIds:Np,unresolvedPortIds:Gg,previousPortIds:qg,candidatePortIds:Xg,cyclicApplications:Ug,cycleBreakPortIds:sd,cycleBreakMode:ud,openCandidates:w5,onPortClick:le,onCycleBreak:(f0,Yg)=>Cp({application:f0,port:Yg})}),kc=new Set(vt.map(f0=>f0.id)),tc=EKn(g,x).filter(f0=>kc.has(f0.source)&&kc.has(f0.target));sKn(vt,tc,x==="topology"?"topology":N==="overview"?"overview":"data_flow").then(Ab),Sf(tc)},[Xg,ud,sd,Ug,N,g,w5,qg,k,Np,Sf,Ab,Gg,x]);const Kg=Be.useCallback((vt,kc)=>{if(kc.data.nodeKind==="application")G(Tp.get(kc.data.applicationId)??null);else if(G(kc.data.detail),kc.data.nodeKind==="object"){const tc=kc.data.detail;W({label:`subtree ${tc.name||String(tc.objectId)}`,objectIds:xKn(g.objects,tc.objectId)})}else if(kc.data.nodeKind==="instance"){const tc=kc.data.detail;W({label:`instance ${tc.name}`,objectIds:tc.objectIds})}else kc.data.nodeKind==="model"&&W(null);le(null)},[Tp,g.objects]),rv=Be.useCallback(vt=>{oe&&(Er(null),si({mode:"add",initialModelType:vt.type,suggestedSelector:zKn(oe.application)}),Pn||Gt(`${vt.name} matches ${oe.port.name}. Start an interactive Julia editor session to add it to the composite model.`),ee(null))},[oe,Pn]),p5=Be.useCallback(vt=>{if(!Pn){Gt("Adding or updating an application requires an interactive Julia editor session."),si(null);return}uu({action:"edit",kind:vt.applicationRef?"update_application":"add_application",...vt}),si(null)},[Pn,uu]),Vg=Be.useCallback(vt=>{if(!Pn){Gt("Adding a template instance requires an interactive Julia editor session.");return}uu({action:"edit",kind:"add_instance",...vt}),bi(!1),cu(null)},[Pn,uu]),cv=Be.useCallback(vt=>{if(!Pn){Gt("Creating a binding requires an interactive Julia editor session."),cd(null);return}uu({action:"edit",kind:"set_input_binding",...vt}),cd(null)},[Pn,uu]),m5=Be.useCallback(vt=>{if(!Pn){Gt("Adding or updating an object requires an interactive Julia editor session."),ef(null);return}uu({action:"edit",kind:ia?.mode==="update"?"update_object":"add_object",objectId:vt.objectId,configuration:vt.configuration}),ef(null)},[Pn,ia?.mode,uu]),v5=Be.useCallback(vt=>{if(!Pn){Gt("Creating an override requires an interactive Julia editor session."),Cc(null);return}uu({action:"edit",kind:vt.scope==="instance"?"set_instance_override":"set_object_override",...vt}),Cc(null)},[Pn,uu]),b1=Be.useCallback(vt=>{if(!Pn){Gt("Removing an override requires an interactive Julia editor session.");return}uu({action:"edit",kind:vt.scope==="instance"?"remove_instance_override":"remove_object_override",...vt}),Cc(null)},[Pn,uu]),Ws=Be.useCallback(vt=>{if(!vt.sourceHandle||!vt.targetHandle)return;const kc=Op.get(vt.sourceHandle),tc=Op.get(vt.targetHandle);if(!kc||!tc||kc.port.role!=="output"||tc.port.role!=="input"){Gt("Connect an application output to an application input.");return}cd({sourceApplication:kc.application,sourcePort:kc.port,targetApplication:tc.application,targetPort:tc.port}),uh(null)},[Op]),xf=Be.useMemo(()=>{if(!U)return g.initialization;if("applicationId"in U)return g.initialization.filter(vt=>vt.applicationId===U.applicationId);if("objectId"in U)return g.initialization.filter(vt=>String(vt.objectId)===String(U.objectId));if("objectIds"in U){const vt=new Set(U.objectIds.map(u6));return g.initialization.filter(kc=>vt.has(u6(kc.objectId)))}return g.initialization},[g.initialization,U]);return L.jsxs("main",{className:"model-editor-shell","data-testid":"model-graph-viewer",children:[L.jsxs("header",{className:"model-toolbar",children:[L.jsxs("div",{className:"model-brand",children:[L.jsx("span",{className:"brand-mark"}),L.jsxs("div",{children:[L.jsx("small",{children:"PLANTSIMENGINE"}),L.jsx("strong",{children:"Model Graph"})]})]}),L.jsxs("div",{className:"model-search",children:[L.jsx(PXn,{size:17}),L.jsx("input",{value:k,onChange:vt=>H(vt.target.value),placeholder:"Search application, object, or variable"}),k&&L.jsx("button",{"aria-label":"Clear search",onClick:()=>H(""),children:L.jsx(Jg,{size:15})})]}),L.jsxs("div",{className:"model-counts",children:[L.jsxs("span",{children:[g.metadata.applicationCount," applications"]}),L.jsxs("span",{children:[g.metadata.objectCount," objects"]}),g.metadata.unresolvedInitializationCount>0&&L.jsxs("button",{className:"count-warning",onClick:()=>ae(!0),children:[L.jsx(MXn,{size:14})," ",g.metadata.unresolvedInitializationCount," init"]}),g.diagnostics.length>0&&L.jsxs("button",{className:"count-error",onClick:()=>pe(!0),children:[L.jsx(dke,{size:14})," ",g.diagnostics.length]})]}),L.jsxs("nav",{className:"view-tabs","aria-label":"Graph projection",children:[L.jsxs("button",{className:x==="applications"?"active":"",onClick:()=>M("applications"),children:[L.jsx(Y0n,{size:15})," Applications"]}),L.jsxs("button",{className:x==="topology"?"active":"",onClick:()=>M("topology"),children:[L.jsx(NXn,{size:15})," Objects"]}),L.jsxs("button",{className:x==="resolved"?"active":"",onClick:()=>M("resolved"),children:[L.jsx(IXn,{size:15})," Executions"]})]}),L.jsxs("div",{className:"model-actions",children:[oh&&L.jsxs("button",{"data-testid":"open-model",onClick:()=>un(!0),children:[L.jsx(OXn,{size:15})," Open"]}),oh&&L.jsxs("button",{"data-testid":"save-model",onClick:()=>xn(!0),children:[L.jsx(LXn,{size:15})," ",Je?"Saved":"Save"]}),x!=="topology"&&L.jsx("button",{className:N==="overview"?"overview-cta":"",onClick:()=>$(vt=>vt==="overview"?"detail":"overview"),children:N==="overview"?"Overview Mode - Show Detailed View":"Show Overview"}),oh&&L.jsxs("button",{"data-testid":"add-application",onClick:()=>{Er(null),si({mode:"add"})},children:[L.jsx(SA,{size:15})," Add application"]}),oh&&L.jsxs("button",{"data-testid":"add-object",onClick:()=>ef({mode:"add"}),children:[L.jsx(SA,{size:15})," Add object"]}),oh&&g.templates.length>0&&L.jsxs("button",{"data-testid":"add-instance",onClick:()=>{cu(null),bi(!0)},children:[L.jsx(SA,{size:15})," Add instance"]}),oh&&L.jsx("button",{"data-testid":"configure-environment",onClick:()=>Rs(!0),children:"Environment"}),oh&&L.jsx("button",{disabled:!Re,onClick:()=>uu({action:"undo"}),"aria-label":"Undo",children:L.jsx($Xn,{size:15})}),oh&&L.jsx("button",{disabled:!ut,onClick:()=>uu({action:"redo"}),"aria-label":"Redo",children:L.jsx(DXn,{size:15})}),L.jsxs("button",{onClick:()=>Ue(!0),children:[L.jsx(TXn,{size:15})," Model code"]})]})]}),g.metadata.cyclic&&L.jsxs("section",{className:"cycle-callout","data-testid":"cycle-callout",children:[L.jsx(dke,{size:19}),L.jsxs("div",{children:[L.jsx("strong",{children:"Current-step dependency cycle"}),L.jsx("span",{children:"Select a cycle input to read its previous accepted timestep value."})]}),L.jsx("button",{className:ud?"active":"",onClick:()=>{M("applications"),$("detail"),b5(vt=>!vt)},"data-testid":"choose-cycle-break",children:ud?"Cancel break selection":"Choose a break point in graph"})]}),di&&L.jsxs("div",{className:"editor-feedback",children:[di,L.jsx("button",{onClick:()=>Gt(null),children:L.jsx(Jg,{size:14})})]}),ie&&L.jsxs("section",{className:"graph-scope-filter","data-testid":"graph-scope-filter",children:[L.jsxs("span",{children:["Showing ",x==="resolved"?"executions":x==="applications"?"applications":"topology"," for ",L.jsx("strong",{children:ie.label})," (",ie.objectIds.length," objects)"]}),x==="topology"&&L.jsx("button",{onClick:()=>M("applications"),children:"Show related applications"}),L.jsxs("button",{"aria-label":"Clear graph scope",onClick:()=>W(null),children:[L.jsx(Jg,{size:14})," Clear"]})]}),L.jsxs("section",{className:"model-workspace",children:[L.jsx("div",{className:"flow-wrap",children:L.jsxs(HUn,{nodes:l6,edges:od,nodeTypes:vKn,edgeTypes:yKn,onNodesChange:ra,onEdgesChange:f6,onConnect:Ws,onNodeClick:Kg,onEdgeClick:(vt,kc)=>G(kc.data??null),fitView:!0,minZoom:.05,maxZoom:2,children:[L.jsx(WUn,{color:"#d8cdbc",gap:22,size:1}),L.jsx(cXn,{}),L.jsx(mXn,{pannable:!0,zoomable:!0})]})}),L.jsx(IKn,{selection:U,port:Z,initialization:xf,interactive:Pn,onEditApplication:vt=>{Er(null),si({mode:"update",application:vt})},onRemoveApplication:vt=>uu({action:"edit",kind:"remove_application",applicationRef:vt.owner}),onConfigureApplication:vt=>xb(vt.applicationId),onOverrideApplication:Cc,onRemoveInstance:vt=>uu({action:"edit",kind:"remove_instance",name:vt.name}),onEditObject:vt=>ef({mode:"update",object:vt}),onRemoveObject:vt=>uu({action:"edit",kind:"remove_object",objectId:vt.objectId,recursive:!0})})]}),oe&&(Mb.length>0||g5.length>0)&&L.jsx(TKn,{candidate:oe,models:Mb,applications:g5,onSelectModel:rv,onSelectApplication:vt=>{cd(NKn(oe,vt)),uh(null),ee(null)},onClose:()=>ee(null)}),Ce&&L.jsx(DKn,{graph:g,onClose:()=>pe(!1),sendCommand:uu,interactive:Pn}),$e&&L.jsx(_Kn,{graph:g,onClose:()=>ae(!1),sendCommand:uu,interactive:Pn}),Ne&&L.jsx(PKn,{code:nt,onClose:()=>Ue(!1)}),ln&&L.jsx(odn,{mode:"open",recentPaths:Ae,currentPath:Je,autosavePath:bn,onSubmit:vt=>{uu({action:"open_model_code",path:vt}),un(!1)},onClose:()=>un(!1)}),An&&L.jsx(odn,{mode:"save",recentPaths:Ae,currentPath:Je,autosavePath:bn,onSubmit:vt=>{uu({action:"save_model_code",path:vt}),xn(!1)},onClose:()=>xn(!1)}),xt&&L.jsx(RXn,{mode:xt.mode,models:g.modelLibrary,objects:g.objects,application:xt.application,initialModelType:xt.initialModelType,suggestedSelector:xt.suggestedSelector,nameReadOnly:xt.application?.owner.scope==="template",preview:Kr,onPreview:vt=>{Er(null),uu({action:"preview_application_targets",selector:vt,applicationRef:xt.application?.owner})},onSubmit:p5,onClose:()=>{si(null),Er(null)}}),Sl&&L.jsx(UXn,{endpoints:Sl,objects:g.objects,preview:s0,onPreview:vt=>{uh(null),uu({action:"preview_input_binding",...vt})},onSubmit:cv,onClose:()=>{cd(null),uh(null)}}),ia&&L.jsx(nKn,{mode:ia.mode,objects:g.objects,object:ia.object,onSubmit:m5,onClose:()=>ef(null)}),Mt&&L.jsx(ZXn,{templates:g.templates,instances:g.instances,objects:g.objects,preview:zi,onPreview:vt=>{cu(null),uu({action:"preview_instance",...vt})},onSubmit:Vg,onClose:()=>{bi(!1),cu(null)}}),Fu&&L.jsx(WXn,{environments:g.environments,activeId:g.metadata.sceneEnvironmentId,onSubmit:vt=>{uu({action:"edit",kind:"set_model_environment",environmentId:vt}),Rs(!1)},onClose:()=>Rs(!1)}),Oa&&L.jsx(iKn,{application:Oa,models:g.modelLibrary,instances:g.instances,onSubmit:v5,onRemove:b1,onClose:()=>Cc(null)}),o0&&Tp.get(o0)&&L.jsx(HXn,{application:Tp.get(o0),applications:g.applications,environments:g.environments,models:g.modelLibrary,onCommand:uu,onClose:()=>xb(null)}),l0&&L.jsx($Kn,{selection:l0,initialization:g.initialization,onSubmit:(vt,kc)=>{uu({action:"edit",kind:"break_cycle",applicationRef:l0.application.owner,input:l0.port.name,initializeMissing:vt,initialValue:kc}),Cp(null)},onClose:()=>Cp(null)})]})}function jKn({graph:g,view:E,detailMode:x,query:M,scopedObjectIds:N,unresolvedPortIds:$,previousPortIds:k,candidatePortIds:H,cyclicApplications:U,cycleBreakPortIds:G,cycleBreakMode:ie,openCandidates:W,onPortClick:Z,onCycleBreak:le}){const oe=Ce=>!M||JSON.stringify(Ce).toLowerCase().includes(M.toLowerCase());if(E==="topology"){const Ce={entity:"model",objectCount:g.metadata.objectCount,instanceCount:g.metadata.instanceCount,applicationCount:g.metadata.applicationCount},pe={id:"model:root",type:"entity",position:{x:0,y:0},data:{nodeKind:"model",title:g.metadata.title||"Composite model",subtitle:"model root",badges:[`${g.metadata.instanceCount} instances`,`${g.metadata.objectCount} objects`],detail:Ce}},$e=g.templates.filter(oe).map(Ue=>({id:`template:${Ue.id}`,type:"entity",position:{x:0,y:0},data:{nodeKind:"template",title:Ue.name,subtitle:Ue.source==="catalog"?"template preset":"model-local template",badges:[`${Ue.applications.length} applications`,`${Ue.mountedInstances.length} mounts`],detail:Ue}})),ae=g.instances.filter(oe).map(Ue=>({id:Ue.id,type:"entity",position:{x:0,y:0},data:{nodeKind:"instance",title:Ue.name,subtitle:[Ue.kind,Ue.species].filter(Boolean).join(" · ")||"object instance",badges:[`${Ue.objectIds.length} objects`,`${Ue.applicationIds.length} applications`,`${Ue.instanceOverrides.length+Ue.objectOverrides.length} overrides`],detail:Ue}})),Ne=g.objects.filter(oe).map(Ue=>({id:Ue.id,type:"entity",position:{x:0,y:0},data:{nodeKind:"object",title:Ue.name||String(Ue.objectId),subtitle:[Ue.kind,Ue.scale,Ue.instance].filter(Boolean).join(" · "),badges:[Ue.species,Ue.hasStatus?"status":null,Ue.hasGeometry?"geometry":null].filter(Boolean),detail:Ue}}));return[pe,...$e,...ae,...Ne]}if(E==="resolved"){const Ce=new Map(g.applications.map($e=>[$e.applicationId,$e]));return[...g.executions.filter($e=>!N||N.has(u6($e.objectId))).filter(oe).map($e=>{const ae=Ce.get($e.applicationId);return{id:$e.id,type:"entity",position:{x:0,y:0},data:{nodeKind:"execution",title:$e.applicationId,subtitle:`object ${String($e.objectId)}`,badges:[BKn($e.modelType),$e.overridden?"override":"shared"],inputPortIds:[...ae?.inputs??[],...ae?.environmentInputs??[]].map(Ne=>Ne.id),outputPortIds:[...ae?.outputs??[],...ae?.environmentOutputs??[]].map(Ne=>Ne.id),detail:$e}}}),...rdn(g,"resolved")]}return[...g.applications.filter(Ce=>!N||Ce.targetIds.some(pe=>N.has(u6(pe)))).filter(oe).map(Ce=>({id:Ce.id,type:"application",position:{x:0,y:0},data:{...Ce,nodeKind:"application",detailMode:x,cyclic:U.has(Ce.applicationId),requiredInputPortIds:Ce.inputs.filter(pe=>$.has(pe.id)).map(pe=>pe.id),candidatePortIds:[...Ce.inputs,...Ce.outputs].filter(pe=>H.has(pe.id)).map(pe=>pe.id),previousTimeStepPortIds:Ce.inputs.filter(pe=>k.has(pe.id)).map(pe=>pe.id),cycleBreakInputPortIds:Ce.inputs.filter(pe=>G.has(pe.id)).map(pe=>pe.id),cycleBreakMode:ie,onCandidateClick:(pe,$e)=>W(Ce,pe,$e),onPortClick:Z,onCycleBreak:le}})),...rdn(g,"applications")]}function rdn(g,E){const x=g.edges.filter(N=>N.kind==="environment_binding"&&N.projection===E);return[...new Set(x.flatMap(N=>[N.source,N.target]).filter(N=>N.startsWith("environment:")))].map(N=>{const $=N.slice(12),k=g.environments.find(G=>G.id===N),H=cdn(x.filter(G=>G.target===N).map(G=>G.targetPort).filter(Boolean)),U=cdn(x.filter(G=>G.source===N).map(G=>G.sourcePort).filter(Boolean));return{id:N,type:"entity",position:{x:0,y:0},data:{nodeKind:"environment",title:k?.name||$,subtitle:k?.active?"active scene environment":"environment backend",badges:[`${U.length} inputs`,`${H.length} outputs`],inputPortIds:H,outputPortIds:U,detail:k||{provider:$}}}})}function cdn(g){return[...new Set(g)]}function EKn(g,E){return(E==="topology"?[...g.edges,...SKn(g)]:g.edges).filter(M=>AKn(M,E)).map(M=>({id:M.id,source:M.source,target:M.target,sourceHandle:M.sourcePort||void 0,targetHandle:M.targetPort||void 0,type:"modelEdge",data:M,markerEnd:{type:VG.ArrowClosed,color:udn(M),width:16,height:16},style:{stroke:udn(M),strokeWidth:M.cycle?4:M.kind==="manual_call"?2.5:1.8,strokeDasharray:M.kind==="previous_timestep"?"7 5":M.kind==="manual_call"?"3 4":void 0}}))}function SKn(g){const E=[],x=new Set(g.instances.flatMap(M=>M.objectIds.map(u6)));for(const M of g.templates)E.push({id:`topology:model:template:${M.id}`,source:"model:root",target:`template:${M.id}`,kind:"object_topology",projection:"topology",cycle:!1});for(const M of g.instances)E.push({id:`topology:${M.id}:object:${String(M.rootId)}`,source:M.id,target:`object:${String(M.rootId)}`,kind:"object_topology",projection:"topology",cycle:!1});for(const M of g.objects)M.parent===null&&!x.has(u6(M.objectId))&&E.push({id:`topology:model:${M.id}`,source:"model:root",target:M.id,kind:"object_topology",projection:"topology",cycle:!1});return E}function xKn(g,E){const x=new Map;for(const k of g){if(k.parent===null)continue;const H=u6(k.parent);x.set(H,[...x.get(H)??[],k.objectId])}const M=[],N=[E],$=new Set;for(;N.length>0;){const k=N.pop(),H=u6(k);$.has(H)||($.add(H),M.push(k),N.push(...x.get(H)??[]))}return M}function u6(g){const E=String(g);return E.startsWith("object:")?E.slice(7):E}function AKn(g,E){const x=g.projection;return E==="topology"?g.kind==="object_topology"||g.kind==="template_mount":E==="resolved"?x==="resolved":x==="applications"||!x&&!["object_topology","application_target"].includes(g.kind)}function udn(g){return g.cycle?"#cf4937":g.kind==="previous_timestep"?"#317b62":g.kind==="manual_call"?"#be6a54":g.kind==="object_topology"?"#7b7167":g.kind==="environment_binding"?"#367b8b":"#a59687"}function MKn(g){const E=new Set;for(const x of g.applications){for(const M of x.inputs)(g.applications.some($=>$.applicationId!==x.applicationId&&$.outputs.some(k=>k.name===M.name))||g.modelLibrary.some($=>Object.prototype.hasOwnProperty.call($.outputs,M.name)))&&E.add(M.id);for(const M of x.outputs)(g.applications.some($=>$.applicationId!==x.applicationId&&$.inputs.some(k=>k.name===M.name))||g.modelLibrary.some($=>Object.prototype.hasOwnProperty.call($.inputs,M.name)))&&E.add(M.id)}return E}function CKn(g,E){const x=E.role==="input"?"outputs":"inputs";return g.filter(M=>Object.prototype.hasOwnProperty.call(M[x],E.name)).sort((M,N)=>`${M.package}.${M.name}`.localeCompare(`${N.package}.${N.name}`))}function TKn({candidate:g,models:E,applications:x,onSelectModel:M,onSelectApplication:N,onClose:$}){const k=g.port.role==="input"?`Models that compute ${g.port.name}`:`Models that consume ${g.port.name}`;return L.jsxs("section",{className:"candidate-popover",style:{left:Math.min(g.x+8,window.innerWidth-390),top:Math.min(g.y-20,window.innerHeight-480)},children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:k}),L.jsx("span",{children:"Exact declared variable-name matches"})]}),L.jsx("button",{onClick:$,children:L.jsx(Jg,{size:15})})]}),L.jsxs("div",{className:"candidate-list",children:[x.length>0&&L.jsx("div",{className:"candidate-section-label",children:"Existing applications"}),x.map(H=>L.jsxs("button",{className:"candidate-card existing",onClick:()=>N(H),children:[L.jsx("strong",{children:H.name||H.applicationId}),L.jsx("span",{children:H.modelName}),L.jsxs("small",{children:[H.targetCount," target",H.targetCount===1?"":"s"]}),L.jsx("div",{children:"Connect without adding another application"})]},H.applicationId)),E.length>0&&L.jsx("div",{className:"candidate-section-label",children:"Available models"}),E.map(H=>L.jsxs("button",{className:"candidate-card",onClick:()=>M(H),children:[L.jsx("strong",{children:H.name}),L.jsx("span",{children:H.process}),L.jsx("small",{children:H.package||H.module}),L.jsxs("div",{children:[Object.keys(H.inputs).length," inputs · ",Object.keys(H.outputs).length," outputs"]})]},H.type))]})]})}function OKn(g,E){return g.filter(x=>x.applicationId!==E.application.applicationId).filter(x=>(E.port.role==="input"?x.outputs:x.inputs).some(N=>N.name===E.port.name)).sort((x,M)=>x.applicationId.localeCompare(M.applicationId))}function NKn(g,E){if(g.port.role==="input"){const M=E.outputs.find(N=>N.name===g.port.name);if(!M)throw new Error(`Application ${E.applicationId} does not output ${g.port.name}.`);return{sourceApplication:E,sourcePort:M,targetApplication:g.application,targetPort:g.port}}const x=E.inputs.find(M=>M.name===g.port.name);if(!x)throw new Error(`Application ${E.applicationId} does not input ${g.port.name}.`);return{sourceApplication:g.application,sourcePort:g.port,targetApplication:E,targetPort:x}}function IKn({selection:g,port:E,initialization:x,interactive:M,onEditApplication:N,onConfigureApplication:$,onRemoveApplication:k,onOverrideApplication:H,onRemoveInstance:U,onEditObject:G,onRemoveObject:ie}){const W=g&&"applicationId"in g&&"selector"in g?g:null,Z=g&&"objectId"in g&&!("applicationId"in g)?g:null,le=g&&"templateId"in g&&"objectIds"in g?g:null;return L.jsxs("aside",{className:"model-inspector",children:[L.jsxs("header",{children:[L.jsx("strong",{children:"Inspector"}),g&&L.jsx("span",{children:RKn(g)})]}),!g&&L.jsxs("div",{className:"empty-inspector",children:[L.jsx(AXn,{size:28}),L.jsx("p",{children:"Select an application, object, execution, or relationship."})]}),g&&L.jsx("pre",{children:JSON.stringify(g,null,2)}),W&&M&&L.jsxs("div",{className:"inspector-actions",children:[L.jsx("button",{onClick:()=>N(W),children:W.owner.scope==="template"?"Edit shared template":"Edit application"}),L.jsx("button",{"data-testid":"configure-application",onClick:()=>$(W),children:"Configure coupling"}),W.owner.scope==="template"&&L.jsx("button",{onClick:()=>H(W),children:"Create override"}),L.jsx("button",{className:"danger",onClick:()=>k(W),children:W.owner.scope==="template"?"Remove from shared template":"Remove application"})]}),le&&M&&L.jsxs("div",{className:"inspector-actions",children:[L.jsx("button",{className:"danger",onClick:()=>U(le),children:"Unmount instance"}),L.jsx("small",{children:"The object subtree is retained."})]}),Z&&M&&L.jsxs("div",{className:"inspector-actions",children:[L.jsx("button",{onClick:()=>G(Z),children:"Edit object"}),L.jsx("button",{className:"danger",onClick:()=>ie(Z),children:"Remove object and descendants"})]}),E&&L.jsxs("section",{children:[L.jsx("h4",{children:"Selected variable"}),L.jsx("code",{children:E.name}),L.jsx("p",{children:E.expectedType})]}),g&&x.length>0&&L.jsxs("section",{className:"inspector-initialization",children:[L.jsx("h4",{children:"Initialization"}),x.slice(0,8).map(oe=>L.jsxs("div",{children:[L.jsx("code",{children:oe.variable}),L.jsx("span",{className:oe.disposition==="unresolved"?"unresolved":"",children:oe.disposition})]},`${oe.applicationId}:${oe.objectId}:${oe.variable}`))]})]})}function DKn({graph:g,onClose:E,sendCommand:x,interactive:M}){return L.jsxs(Fue,{title:"Diagnostics and cycles",onClose:E,children:[g.diagnostics.map(N=>L.jsxs("article",{className:"diagnostic-card",children:[L.jsx("strong",{children:N.code}),L.jsx("p",{children:N.message}),N.suggestions.map($=>L.jsx("small",{children:$},$))]},`${N.code}:${N.message}`)),g.cycles.map(N=>L.jsxs("article",{className:"cycle-card",children:[L.jsx("strong",{children:N.applicationIds.join(" → ")}),L.jsx("p",{children:"Choose an input to read from the previous timestep."}),N.breakCandidates.map($=>{const k=g.applications.find(H=>H.applicationId===$.applicationId)?.owner;return L.jsxs("button",{disabled:!M||!k,onClick:()=>k&&x({action:"edit",kind:"mark_previous_timestep",applicationRef:k,input:$.input}),children:[$.applicationId,".",$.input]},`${$.applicationId}:${$.objectId}:${$.input}`)})]},N.id)),g.diagnostics.length===0&&g.cycles.length===0&&L.jsx("p",{children:"No diagnostics."})]})}function _Kn({graph:g,onClose:E,sendCommand:x,interactive:M}){const N=g.initialization.filter(k=>k.disposition==="unresolved"),$=new Map;for(const k of N){const H=`${k.applicationId}:${k.variable}`;$.set(H,[...$.get(H)||[],k])}return L.jsxs(Fue,{title:"Initialization",onClose:E,children:[[...$.entries()].map(([k,H])=>L.jsx(LKn,{rows:H,interactive:M,sendCommand:x},k)),N.length===0&&L.jsx("p",{children:"No unresolved initial values."})]})}function LKn({rows:g,interactive:E,sendCommand:x}){const[M,N]=Be.useState("float"),[$,k]=Be.useState(""),H=g[0],U={type:M,value:$};return L.jsxs("article",{className:"initialization-group",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:H.variable}),L.jsx("span",{children:H.applicationId})]}),L.jsxs("small",{children:[g.length," object",g.length===1?"":"s"," · expected ",H.expectedType]})]}),L.jsx("p",{children:"Required because the input has no producer, environment source, status value, or usable temporal initialization."}),E&&L.jsxs("div",{className:"initialization-value",children:[L.jsxs("label",{children:["Type",L.jsxs("select",{value:M,onChange:G=>N(G.target.value),children:[L.jsx("option",{value:"float",children:"Float"}),L.jsx("option",{value:"integer",children:"Integer"}),L.jsx("option",{value:"boolean",children:"Boolean"}),L.jsx("option",{value:"symbol",children:"Symbol"}),L.jsx("option",{value:"string",children:"String"}),L.jsx("option",{value:"julia",children:"Julia expression"})]})]}),L.jsxs("label",{children:["Value",L.jsx("input",{value:$,onChange:G=>k(G.target.value)})]}),L.jsx("button",{disabled:!$.trim(),onClick:()=>x({action:"edit",kind:"set_object_statuses",objectIds:g.map(G=>G.objectId),variable:H.variable,value:U}),children:"Set all targets"})]}),L.jsx("div",{className:"initialization-object-list",children:g.map(G=>L.jsxs("div",{children:[L.jsxs("span",{children:["Object ",String(G.objectId)]}),L.jsx("code",{children:G.origin}),E&&L.jsx("button",{disabled:!$.trim(),onClick:()=>x({action:"edit",kind:"set_object_status",objectId:G.objectId,variable:G.variable,value:U}),children:"Set this object"})]},String(G.objectId)))})]})}function PKn({code:g,onClose:E}){return L.jsx(Fue,{title:"Model code",onClose:E,children:L.jsx("pre",{className:"model-code",children:g||"Model code is available from an interactive editor session."})})}function odn({mode:g,recentPaths:E,currentPath:x,autosavePath:M,onSubmit:N,onClose:$}){const[k,H]=Be.useState(x||"");return L.jsx(Fue,{title:g==="open"?"Open Model":"Save Model",onClose:$,children:L.jsxs("div",{className:"model-file-dialog",children:[L.jsx("p",{children:g==="open"?"Open a Julia script whose final binding is `model = CompositeModel(...)`. Future edits will be saved back to that file.":"After the first save, every successful graph edit automatically rewrites this Julia script."}),L.jsxs("label",{children:["Julia file path",L.jsxs("div",{className:"model-path-input",children:[L.jsx("input",{value:k,onChange:U=>H(U.target.value),placeholder:"/absolute/path/to/model.jl",autoFocus:!0}),L.jsx("button",{className:"primary",disabled:!k.trim(),onClick:()=>N(k.trim()),children:g==="open"?"Open":"Save"})]})]}),g==="open"&&E.length>0&&L.jsxs("section",{children:[L.jsx("strong",{children:"Recent models"}),L.jsx("div",{className:"recent-model-list",children:E.map(U=>L.jsxs("button",{onClick:()=>N(U),children:[L.jsx("span",{children:U.split("/").at(-1)}),L.jsx("small",{children:U})]},U))})]}),g==="open"&&M&&L.jsxs("section",{children:[L.jsx("strong",{children:"Recovery autosave"}),L.jsx("button",{className:"recovery-path",onClick:()=>N(M),children:M})]}),L.jsx("small",{children:"Use Git to version saved composite-model scripts and review scientific configuration changes."})]})})}function $Kn({selection:g,initialization:E,onSubmit:x,onClose:M}){const N=E.filter(G=>G.applicationId===g.application.applicationId&&G.variable===g.port.name&&G.disposition!=="supplied"),[$,k]=Be.useState("float"),[H,U]=Be.useState("");return L.jsx("div",{className:"overlay-backdrop",onMouseDown:M,children:L.jsxs("section",{className:"overlay-panel cycle-break-dialog",onMouseDown:G=>G.stopPropagation(),"data-testid":"cycle-break-dialog",children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("strong",{children:"Break the current-step cycle"}),L.jsxs("span",{children:[g.application.applicationId,".",g.port.name]})]}),L.jsx("button",{onClick:M,children:L.jsx(Jg,{size:17})})]}),L.jsxs("div",{className:"overlay-content",children:[L.jsx("p",{children:"This changes the application input to read its value from the previous accepted timestep. The model is disconnected from the current value during each run step."}),L.jsxs("div",{className:"cycle-impact",children:[L.jsx("strong",{children:"Application-wide change"}),L.jsxs("span",{children:["It affects all ",g.application.targetCount," targets selected by this application."]})]}),N.length>0&&L.jsxs("fieldset",{children:[L.jsx("legend",{children:"Required initial value"}),L.jsxs("p",{children:[N.length," target",N.length===1?"":"s"," need a value before the first timestep."]}),L.jsxs("div",{className:"form-grid",children:[L.jsxs("label",{children:["Value type",L.jsxs("select",{value:$,onChange:G=>k(G.target.value),children:[L.jsx("option",{value:"float",children:"Float"}),L.jsx("option",{value:"integer",children:"Integer"}),L.jsx("option",{value:"boolean",children:"Boolean"}),L.jsx("option",{value:"symbol",children:"Symbol"}),L.jsx("option",{value:"string",children:"String"}),L.jsx("option",{value:"julia",children:"Julia expression"})]})]}),L.jsxs("label",{children:["Initial value",L.jsx("input",{value:H,onChange:G=>U(G.target.value),autoFocus:!0})]})]})]})]}),L.jsxs("footer",{children:[L.jsx("button",{onClick:M,children:"Cancel"}),L.jsxs("button",{className:"primary",disabled:N.length>0&&!H.trim(),onClick:()=>x(N.length>0,N.length>0?{type:$,value:H}:null),"data-testid":"confirm-cycle-break",children:[L.jsx(Q0n,{size:15})," Use previous timestep"]})]})]})})}function Fue({title:g,onClose:E,children:x}){return L.jsx("div",{className:"overlay-backdrop",onMouseDown:E,children:L.jsxs("section",{className:"overlay-panel",onMouseDown:M=>M.stopPropagation(),children:[L.jsxs("header",{children:[L.jsx("strong",{children:g}),L.jsx("button",{onClick:E,children:L.jsx(Jg,{size:17})})]}),L.jsx("div",{className:"overlay-content",children:x})]})})}function RKn(g){return"applicationId"in g?g.applicationId:"objectId"in g?String(g.objectId):"objectIds"in g?g.name:"entity"in g?"Composite model":"provider"in g?g.provider:"name"in g?g.name:g.kind.replaceAll("_"," ")}function BKn(g){return g.split(".").at(-1)||g}function zKn(g){const E={selectors:[]};return g.targetInstances.length===0&&g.targetScales.length===1&&(E.scale=g.targetScales[0]),g.targetKinds.length===1&&(E.kind=g.targetKinds[0]),g.targetSpecies.length===1&&(E.species=g.targetSpecies[0]),{type:g.targetCount===1?"One":"Many",multiplicity:g.targetCount===1?"one":"many",criteria:E,julia:""}}function Q7e(g,E,x){return`application:${g}:${E}:${x}`}function W7e(){const g=document.getElementById("pse-model-graph-data");if(!g?.textContent)return ndn;try{return JSON.parse(g.textContent)}catch{return ndn}}function FKn(){const g=document.getElementById("pse-editor-config");if(!g?.textContent)return null;try{return JSON.parse(g.textContent)}catch{return null}}class JKn extends Be.Component{state={error:null};static getDerivedStateFromError(E){return{error:E}}componentDidCatch(E,x){console.error("PlantSimEngine model graph frontend failed",E,x)}render(){return this.state.error?L.jsxs("main",{className:"frontend-error","data-testid":"frontend-error",children:[L.jsx(dke,{size:28}),L.jsx("h1",{children:"The graph view could not be rendered"}),L.jsx("p",{children:this.state.error.message}),L.jsxs("button",{onClick:()=>window.location.reload(),children:[L.jsx(_Xn,{size:15})," Reload graph"]})]}):this.props.children}}hzn.createRoot(document.getElementById("root")).render(L.jsx(Be.StrictMode,{children:L.jsx(JKn,{children:L.jsx(kKn,{})})})); diff --git a/frontend/dist/assets/index-DH4q_-2-.css b/frontend/dist/assets/index-DH4q_-2-.css new file mode 100644 index 000000000..02b2ea4de --- /dev/null +++ b/frontend/dist/assets/index-DH4q_-2-.css @@ -0,0 +1 @@ +.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{--bg: #f3eee6;--paper: #fffaf2;--paper-strong: #fbf2e6;--ink: #312721;--muted: #80756c;--line: #ded2c3;--line-strong: #b7a696;--accent: #1f7a53;--accent-soft: rgba(31, 122, 83, .12);--sage: #7f8f73;--sage-dark: #596851;--ochre: #c99035;--clay: #bf6a54;--shadow: rgba(56, 43, 35, .12)}.model-editor-shell{height:100vh;min-height:560px;display:grid;grid-template-rows:auto auto auto minmax(0,1fr);color:#302923;background:#f3eee5}.frontend-error{min-height:100vh;display:grid;place-content:center;justify-items:center;gap:10px;padding:24px;color:#743128;background:#fff5ef;text-align:center}.frontend-error h1,.frontend-error p{margin:0}.frontend-error p{max-width:620px;color:#655850}.frontend-error button{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:8px 11px;border:1px solid #b95040;border-radius:5px;color:#fff;background:#b94435}.model-toolbar{z-index:20;display:grid;grid-template-columns:auto minmax(260px,1fr) auto;gap:12px 18px;align-items:center;padding:14px 18px;background:#fffaf2;border-bottom:1px solid #d9cdbd;box-shadow:0 8px 24px #3c302514}.model-brand{display:flex;align-items:center;gap:11px}.model-brand .brand-mark{width:5px;height:42px;border-radius:3px;background:#1f7a58}.model-brand div{display:grid}.model-brand small{color:#81766c;font:10px/1.2 ui-monospace,monospace;letter-spacing:0}.model-brand strong{font-size:20px;letter-spacing:0}.model-search{display:flex;align-items:center;gap:8px;min-width:0;padding:8px 11px;border:1px solid #d9cdbd;border-radius:6px;background:#fffdf8}.model-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;font:inherit}.model-search button,.model-toolbar button,.overlay-panel button,.candidate-popover button,.editor-feedback button{border:0;background:transparent;color:inherit;cursor:pointer}.model-counts{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.model-counts>span,.model-counts>button{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:1px solid #d9cdbd;border-radius:5px;background:#fffaf2;font:12px ui-monospace,monospace}.model-counts .count-warning{color:#a96a13;border-color:#dfbd83}.model-counts .count-error{color:#b44e3c;border-color:#dfa496}.view-tabs,.model-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.view-tabs{grid-column:1 / 3}.model-actions{justify-content:flex-end}.view-tabs button,.model-actions button,.cycle-callout button{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:6px 10px;border:1px solid #d4c7b6;border-radius:5px;background:#fffaf2;color:#4c433b}.view-tabs button.active{color:#176047;border-color:#83b59e;background:#e9f4ed}.model-actions button:disabled{opacity:.4;cursor:default}.model-actions .overview-cta{color:#176047;border-color:#86bba4;background:#e9f4ed;font-weight:700}.cycle-callout{display:flex;align-items:center;gap:12px;padding:10px 18px;color:#8f2f24;background:#fff0eb;border-bottom:1px solid #df9a8e}.cycle-callout div{display:grid;margin-right:auto}.cycle-callout span{font-size:12px}.cycle-callout button{border-color:#cf7668;color:#8f2f24}.cycle-callout button.active{color:#fff;border-color:#9d3428;background:#b94435}.editor-feedback{display:flex;align-items:center;justify-content:center;gap:12px;padding:7px 16px;background:#fff5d9;border-bottom:1px solid #dfc278;color:#6e5315;font-size:12px}.graph-scope-filter{align-items:center;background:#edf5ef;border-bottom:1px solid #b9d4c0;color:#365849;display:flex;font-size:12px;gap:10px;justify-content:center;min-height:38px;padding:6px 14px}.graph-scope-filter button{align-items:center;background:#fff;border:1px solid #b9d4c0;border-radius:5px;color:#365849;cursor:pointer;display:inline-flex;gap:5px;padding:5px 8px}.model-workspace{min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 310px}.flow-wrap{min-width:0;min-height:0;position:relative}.model-inspector{overflow:auto;padding:16px;background:#fffaf2;border-left:1px solid #d9cdbd}.model-inspector>header{display:grid;gap:2px;margin-bottom:14px}.model-inspector>header span{color:#776c63;font:11px ui-monospace,monospace}.model-inspector pre{overflow-wrap:anywhere;white-space:pre-wrap;font-size:10px;line-height:1.45}.empty-inspector{display:grid;place-items:center;padding:48px 20px;color:#8a7e74;text-align:center}.inspector-initialization>div{display:flex;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid #eee4d6;font-size:11px}.inspector-initialization .unresolved{color:#b74635;font-weight:700}.application-node .target-summary{margin:-2px 0 10px;color:#766c63;font-size:11px}.application-node .target-summary strong{color:#2d6652}.application-node .previous-label{margin-left:auto;color:#1f7a58;font:10px ui-monospace,monospace}.cycle-port-break{display:inline-grid;place-items:center;width:24px;height:24px;margin-left:auto;border:1px solid #c94e3e!important;border-radius:50%;color:#a63428!important;background:#fff0eb!important;box-shadow:0 3px 9px #8c2d232e}.cycle-port-break:hover{color:#fff!important;background:#bd4435!important}.entity-node{position:relative;width:240px;min-height:105px;padding:13px;border:1px solid #d8cbbb;border-radius:6px;background:#fffaf2;box-shadow:0 7px 18px #392e241f}.entity-node.selected{border-color:#1f7a58;box-shadow:0 0 0 2px #1f7a5829}.entity-node header{display:grid;gap:3px}.entity-node header span{color:#766c63;font-size:11px}.entity-node .badges{display:flex;gap:5px;flex-wrap:wrap;margin-top:12px}.candidate-popover{position:fixed;z-index:80;width:370px;max-height:460px;display:grid;grid-template-rows:auto minmax(0,1fr);border:1px solid #cfbfaa;border-radius:7px;background:#fffaf2;box-shadow:0 20px 54px #342a203d}.candidate-popover>header{display:flex;gap:10px;padding:12px;border-bottom:1px solid #e1d5c5}.candidate-popover>header div{display:grid;margin-right:auto}.candidate-popover>header span{color:#7a7067;font-size:10px}.candidate-list{overflow:auto;display:grid;gap:7px;padding:9px}.candidate-card{display:grid;grid-template-columns:1fr auto;gap:2px 8px;padding:10px;border:1px solid #ded2c2!important;border-radius:5px;background:#fffdf8!important;text-align:left}.candidate-card:hover{border-color:#76a990!important;background:#edf6f0!important}.candidate-card span{color:#1f7053;font:11px ui-monospace,monospace}.candidate-card small{color:#7a7067}.candidate-card div{grid-column:1 / -1;color:#7a7067;font-size:10px}.candidate-card.existing{border-left:3px solid #1f7a58!important}.candidate-section-label{padding:5px 3px 2px;color:#71675e;font:700 10px ui-monospace,monospace;text-transform:uppercase}.overlay-backdrop{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:24px;background:#2d251e61}.overlay-panel{width:min(720px,100%);max-height:min(760px,92vh);display:grid;grid-template-rows:auto minmax(0,1fr);border:1px solid #cdbda8;border-radius:7px;background:#fffaf2;box-shadow:0 24px 70px #271f194d}.overlay-panel>header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid #ded2c2}.overlay-content{overflow:auto;padding:15px}.diagnostic-card,.cycle-card,.initialization-card{display:grid;gap:5px;margin-bottom:10px;padding:11px;border:1px solid #ded2c2;border-radius:5px}.diagnostic-card{border-left:3px solid #c85240}.diagnostic-card p,.cycle-card p{margin:0}.diagnostic-card small{color:#766c63}.cycle-card button{width:fit-content;padding:6px 8px;border:1px solid #ce7768;border-radius:4px;color:#963529}.model-code{min-height:320px;margin:0;padding:14px;overflow:auto;border-radius:5px;background:#292622;color:#f5eee5}.model-file-dialog{display:grid;gap:14px}.model-file-dialog>p{margin:0;line-height:1.5}.model-file-dialog>label{display:grid;gap:5px;color:#5f554d;font-size:11px;font-weight:700}.model-path-input{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.model-path-input input{width:100%;min-width:0;padding:8px 9px;border:1px solid #d3c5b4;border-radius:4px;background:#fffdf8;font:12px ui-monospace,monospace}.model-path-input button{padding:8px 13px;border:1px solid #1d7052!important;border-radius:4px;color:#fff!important;background:#1f7a58!important}.model-path-input button:disabled{opacity:.4;cursor:default}.model-file-dialog section{display:grid;gap:7px}.recent-model-list{display:grid;gap:6px}.recent-model-list button{display:grid;gap:2px;padding:9px;border:1px solid #d8cbbb!important;border-radius:5px;background:#fffdf8!important;text-align:left}.recent-model-list button:hover{border-color:#73a88e!important;background:#edf6f0!important}.recent-model-list small,.model-file-dialog>small{color:#776d64;overflow-wrap:anywhere}.recovery-path{padding:9px;border:1px dashed #c99035!important;border-radius:5px;color:#6d511d!important;background:#fff6e6!important;text-align:left;overflow-wrap:anywhere}.initialization-group{display:grid;gap:10px;margin-bottom:12px;padding:12px;border:1px solid #d8cbbb;border-radius:6px;background:#fffdf8}.initialization-group>header{display:flex;align-items:end;justify-content:space-between;gap:12px}.initialization-group>header div{display:grid}.initialization-group>header span,.initialization-group>header small{color:#786d64;font:10px ui-monospace,monospace}.initialization-group>p{margin:0;color:#6c625a;font-size:11px;line-height:1.45}.initialization-value{display:grid;grid-template-columns:120px minmax(0,1fr) auto;gap:8px;align-items:end}.initialization-value label{display:grid;gap:4px;color:#5f554d;font-size:10px;font-weight:700}.initialization-value input,.initialization-value select{width:100%;min-width:0;padding:7px 8px;border:1px solid #d3c5b4;border-radius:4px;background:#fff}.initialization-value button,.initialization-object-list button{padding:7px 9px;border:1px solid #85ad99!important;border-radius:4px;color:#176047!important;background:#edf6f0!important}.initialization-value button:disabled,.initialization-object-list button:disabled{opacity:.4;cursor:default}.initialization-object-list{display:grid;gap:5px}.initialization-object-list>div{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;padding-top:5px;border-top:1px solid #ece1d2;font-size:11px}.initialization-object-list code{color:#a33d31}@media(max-width:980px){.model-toolbar{grid-template-columns:1fr}.view-tabs{grid-column:auto}.model-counts,.model-actions{justify-content:flex-start}.model-workspace{grid-template-columns:1fr}.model-inspector{display:none}}.application-form{width:min(780px,100%)}.object-form{width:min(640px,100%)}.override-form{width:min(760px,100%)}.application-form>header div{display:grid;gap:2px}.object-form>header div{display:grid;gap:2px}.override-form>header div{display:grid;gap:2px}.application-form>header span{color:#786d64;font-size:11px}.object-form>header span{color:#786d64;font-size:11px}.override-form>header span{color:#786d64;font-size:11px}.application-form-content,.object-form-content,.override-form-content{display:grid;gap:14px}.application-form-content>label,.application-form fieldset label,.object-form-content label{display:grid;gap:5px;color:#5f554d;font-size:11px;font-weight:700}.override-form-content label{display:grid;gap:5px;color:#5f554d;font-size:11px;font-weight:700}.application-form input,.application-form select,.object-form input,.object-form select,.override-form input,.override-form select{width:100%;min-width:0;padding:8px 9px;border:1px solid #d3c5b4;border-radius:4px;background:#fffdf8;color:#332c26;font:12px ui-monospace,monospace}.override-form fieldset{margin:0;padding:12px;border:1px solid #ded2c2;border-radius:5px}.override-form legend{padding:0 6px;color:#2d6652;font-weight:800}.override-form fieldset label{display:grid;gap:5px;color:#5f554d;font-size:11px;font-weight:700}.override-scope-choice{display:grid;grid-template-columns:1fr 1fr;gap:9px}.override-scope-choice button{display:grid;gap:3px;padding:11px;border:1px solid #d4c7b6!important;border-radius:5px;background:#fffdf8!important;text-align:left}.override-scope-choice button.active{border-color:#72a88d!important;background:#edf6f0!important}.override-scope-choice span{color:#756a61;font-size:10px;line-height:1.4}.override-warning{display:grid;gap:3px;padding:10px;border-left:3px solid #c99035;background:#fff6e6}.override-warning span{color:#74685e;font-size:11px}.application-form fieldset{margin:0;padding:12px;border:1px solid #ded2c2;border-radius:5px}.application-form legend{padding:0 6px;color:#2d6652;font-weight:800}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.parameter-list{display:grid;gap:9px}.parameter-row{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:9px;align-items:end}.parameter-row>label>span{color:#3c342e}.parameter-row small{color:#8a7e74;font-weight:400}.selector-summary{margin:10px 0 0;color:#796e64;font-size:11px}.application-form>footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 15px;border-top:1px solid #ded2c2}.object-form>footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 15px;border-top:1px solid #ded2c2}.override-form>footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 15px;border-top:1px solid #ded2c2}.application-form>footer button,.object-form>footer button,.override-form>footer button,.inspector-actions button{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #d2c4b3;border-radius:4px;background:#fffdf8}.application-form>footer .primary,.object-form>footer .primary{color:#fff;border-color:#1d7052;background:#1f7a58}.override-form>footer .primary{color:#fff;border-color:#1d7052;background:#1f7a58}.application-form>footer button:disabled{opacity:.45}.object-form>footer button:disabled{opacity:.45}.override-form>footer button:disabled{opacity:.45}.inspector-actions{display:flex;gap:7px;margin:10px 0 16px}.inspector-actions .danger{color:#a33d31;border-color:#d8a296}.binding-form{width:min(680px,100%)}.binding-form>header div{display:grid;gap:2px}.binding-form>header span{color:#786d64;font-size:11px}.binding-form .overlay-content{display:grid;gap:14px}.binding-route{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:14px;padding:12px;border:1px solid #d8cbbb;border-radius:5px;background:#fffdf8}.binding-route>div{display:grid;gap:3px;min-width:0}.binding-route>div:last-child{text-align:right}.binding-route small{color:#7c7168;text-transform:uppercase;font-size:9px}.binding-route strong,.binding-route code{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.binding-route code{color:#1f7053}.binding-form fieldset{margin:0;padding:12px;border:1px solid #ded2c2;border-radius:5px}.binding-form legend{padding:0 6px;color:#2d6652;font-weight:800}.binding-form fieldset label{display:grid;gap:5px;color:#5f554d;font-size:11px;font-weight:700}.binding-form select{width:100%;min-width:0;padding:8px 9px;border:1px solid #d3c5b4;border-radius:4px;background:#fffdf8;color:#332c26;font:12px ui-monospace,monospace}.binding-form>footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 15px;border-top:1px solid #ded2c2}.binding-form>footer button{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #d2c4b3;border-radius:4px;background:#fffdf8}.binding-form>footer .primary{color:#fff;border-color:#1d7052;background:#1f7a58}.cycle-break-dialog{width:min(620px,100%)}.cycle-break-dialog>header div{display:grid;gap:2px}.cycle-break-dialog>header span{color:#a33d31;font:11px ui-monospace,monospace}.cycle-break-dialog .overlay-content{display:grid;gap:13px}.cycle-break-dialog p{margin:0;line-height:1.5}.cycle-impact{display:grid;gap:3px;padding:10px;border-left:3px solid #c54c3c;background:#fff0eb}.cycle-impact span{color:#705f57;font-size:11px}.cycle-break-dialog fieldset{margin:0;padding:12px;border:1px solid #d8cbbb;border-radius:5px}.cycle-break-dialog legend{padding:0 6px;color:#9a392e;font-weight:800}.cycle-break-dialog label{display:grid;gap:5px;color:#5f554d;font-size:11px;font-weight:700}.cycle-break-dialog input,.cycle-break-dialog select{width:100%;min-width:0;padding:8px 9px;border:1px solid #d3c5b4;border-radius:4px;background:#fffdf8}.cycle-break-dialog>footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 15px;border-top:1px solid #ded2c2}.cycle-break-dialog>footer button{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #d2c4b3;border-radius:4px;background:#fffdf8}.cycle-break-dialog>footer .primary{color:#fff;border-color:#a8392d;background:#b94435}.cycle-break-dialog>footer button:disabled{opacity:.45;cursor:default}@media(max-width:700px){.form-grid,.parameter-row,.override-scope-choice,.binding-route{grid-template-columns:1fr}.binding-route>div:last-child{text-align:left}.initialization-value{grid-template-columns:1fr}}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:radial-gradient(circle at 20% 24%,rgba(31,122,83,.045),transparent 30%),radial-gradient(circle at 78% 68%,rgba(201,144,53,.055),transparent 34%),linear-gradient(180deg,rgba(255,250,242,.26),transparent 42%),var(--bg);font-family:Avenir Next,Trebuchet MS,Segoe UI,sans-serif}.app-shell{display:grid;grid-template-columns:minmax(0,1fr);height:100vh;position:relative}.app-shell.has-side-panel{grid-template-columns:minmax(0,1fr) 340px}.graph-panel{position:relative;min-width:0}.graph-panel:after{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;opacity:.2;background-image:radial-gradient(rgba(49,39,33,.11) .55px,transparent .55px);background-size:16px 16px;-webkit-mask-image:linear-gradient(to bottom,transparent 0%,black 22%,black 82%,transparent 100%);mask-image:linear-gradient(to bottom,transparent 0%,black 22%,black 82%,transparent 100%)}.topbar{position:absolute;z-index:10;top:18px;left:18px;right:18px;display:flex;align-items:center;gap:12px;padding:11px 14px;background:#fffaf2eb;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.topbar:before{content:"";align-self:stretch;width:5px;border-radius:999px;background:var(--accent)}.editor-feedback{position:absolute;z-index:12;top:96px;left:18px;right:18px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:#fffaf2f2;box-shadow:0 12px 30px var(--shadow);max-height:132px;overflow:auto;font-size:12px;line-height:1.45;white-space:normal;overflow-wrap:anywhere}.editor-feedback.error{color:var(--clay);border-color:#bf6a5466;background:#fff4eef7}.editor-feedback.info{color:var(--accent);border-color:#1f7a5359;background:#f5fcf8f7}.cycle-break-prompt{position:absolute;z-index:14;top:98px;left:18px;right:18px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid rgba(211,66,47,.32);border-radius:12px;background:linear-gradient(135deg,rgba(211,66,47,.12),transparent 62%),#fffaf2f5;box-shadow:0 16px 36px #382b2329}.cycle-break-prompt div{display:grid;gap:3px;min-width:0}.cycle-break-prompt strong{color:#7a2018;font-size:13px}.cycle-break-prompt span{color:var(--muted);font-size:12px;line-height:1.35}.cycle-break-prompt code{color:#7a2018;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.cycle-break-prompt.active{border-color:#d3422f85;box-shadow:0 16px 36px #382b2329,0 0 0 4px #d3422f14}.cycle-break-cta{flex:0 0 auto;justify-content:center;font-weight:780}.graph-workbench{flex-wrap:wrap;align-items:flex-start;max-height:min(36vh,250px);overflow:auto;scrollbar-width:thin}.brand-block{min-width:150px}.brand-block h1{font-size:clamp(16px,2.2vw,20px)}.search-box{position:relative;display:flex;align-items:center;gap:8px;flex:1 1 280px;max-width:460px;min-width:220px;padding:7px 9px;border:1px solid var(--line);border-radius:11px;background:#fffdf7db}.search-box input{width:100%;min-width:0;border:0;outline:0;color:var(--ink);background:transparent;font:inherit;font-size:13px}.clear-search{display:grid;place-items:center;width:20px;height:20px;border:0;border-radius:999px;background:#b7a6962e;color:var(--muted);cursor:pointer}.search-results{position:absolute;z-index:80;top:calc(100% + 8px);left:0;right:0;display:grid;gap:6px;max-height:360px;overflow:auto;padding:8px;border:1px solid var(--line);border-radius:12px;background:#fffaf2fa;box-shadow:0 18px 45px var(--shadow)}.search-result{display:grid;gap:2px;padding:8px 9px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--ink);text-align:left;cursor:pointer}.search-result:hover,.search-result:focus-visible{border-color:#1f7a533d;background:var(--accent-soft);outline:none}.search-result strong{overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.search-result span{color:var(--muted);font-size:11px}.eyebrow{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}h1,h2,h3{margin:0;letter-spacing:0}h1{font-size:20px;font-weight:800}.metrics{display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}.metrics span,.metric-button,.node-meta span{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:1px solid var(--line);border-radius:9px;background:#fffaf2e6;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.metric-button{color:var(--ink);cursor:pointer}.metric-button.active,.metric-button:hover,.metric-button:focus-visible{outline:none;background:#fff6f0}.view-mode-button.overview-cta{border-color:#1f7a5361;color:var(--accent);background:#1f7a531a;box-shadow:0 8px 18px #1f7a531a;font-weight:800}.meta-chip{position:relative}.meta-chip:after{content:attr(data-tooltip);position:absolute;z-index:20;left:0;bottom:calc(100% + 10px);width:max-content;max-width:280px;padding:8px 10px;color:var(--paper);background:var(--ink);border-radius:10px;box-shadow:0 12px 28px #382b232e;font-family:Avenir Next,Trebuchet MS,Segoe UI,sans-serif;font-size:12px;line-height:1.3;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);transition:opacity .12s ease,transform .12s ease}.meta-chip:before{content:"";position:absolute;z-index:21;left:16px;bottom:calc(100% + 4px);width:10px;height:10px;background:var(--ink);opacity:0;pointer-events:none;transform:rotate(45deg) translateY(4px);transition:opacity .12s ease,transform .12s ease}.meta-chip:hover:after,.meta-chip:hover:before,.meta-chip:focus-visible:after,.meta-chip:focus-visible:before{opacity:1;transform:translateY(0)}.meta-chip:hover:before,.meta-chip:focus-visible:before{transform:rotate(45deg) translateY(0)}.metrics .warn{color:var(--clay);border-color:#c9614a73}.metrics .caution{color:var(--ochre);border-color:#c9903573}.metrics .warn svg{flex:0 0 auto}.icon-button{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);cursor:pointer;box-shadow:0 8px 18px #382b2314}.icon-button.compact{width:28px;height:28px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px}.toolbar-group{display:flex;align-items:center;gap:8px}.open-button{flex:0 0 auto}.panel-switch{flex-wrap:wrap}.select-control{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid var(--line);border-radius:10px;background:#fffaf2e6;color:var(--muted)}.select-control select{max-width:132px;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:12px}.relationship-legend{position:absolute;z-index:35;top:116px;left:18px;display:grid;gap:7px;width:190px;padding:10px;border:1px solid var(--line);border-radius:13px;background:#fffaf2eb;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);max-height:min(480px,calc(100vh - 142px));overflow:auto}.legend-title,.legend-note{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.relationship-legend button{display:flex;align-items:center;gap:8px;padding:6px 7px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);font:inherit;font-size:12px;cursor:pointer}.relationship-legend button.active{color:var(--ink);border-color:#1f7a5338;background:var(--accent-soft)}.legend-line{width:28px;height:0;border-top:2px solid var(--line-strong)}.legend-line.mapped{border-color:var(--accent);border-style:dashed}.legend-line.call{border-color:var(--clay);border-style:dashed}.scale-controls{position:absolute;z-index:35;top:116px;left:220px;display:grid;gap:8px;width:190px;padding:10px;border:1px solid var(--line);border-radius:13px;background:#fffaf2eb;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);max-height:min(560px,calc(100vh - 142px));overflow:auto}.scale-list{display:grid;gap:6px}.scale-list button,.scale-reset{display:grid;gap:2px;width:100%;padding:7px 8px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);font:inherit;text-align:left;cursor:pointer}.scale-list button.active{color:var(--ink);border-color:#1f7a5338;background:var(--accent-soft)}.scale-list button.collapsed{border-color:#b7a69657;border-style:dashed;background:#b7a69614}.scale-list span{overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:700}.scale-list small{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}.scale-reset{color:var(--accent);border-color:#1f7a5333;background:#1f7a5314;text-align:center}.floating-panel{position:absolute;z-index:40;top:116px;right:18px;width:min(360px,calc(100vw - 36px));max-height:min(560px,calc(100vh - 142px));overflow:auto;padding:14px;background:#fffaf2f5;border:1px solid rgba(191,106,84,.32);border-radius:14px;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.warnings-panel{border-color:#c9903559}.open-panel{left:18px;right:auto;border-color:#1f7a5352}.floating-panel-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.floating-panel h2{font-size:18px}.react-flow{background:transparent;z-index:1}.react-flow__background{display:none}.react-flow__edges{z-index:8}.react-flow__edges:has(.react-flow__edge.highlighted){z-index:120}.react-flow__edgelabel-renderer{z-index:28}.react-flow__edgelabel-renderer:has(.edge-chip.highlighted){z-index:121}.react-flow__nodes{z-index:20}.model-node{position:relative;overflow:visible;background:#fffaf2f5;border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 42px var(--shadow)}.model-remove-button{position:absolute;z-index:45;top:-11px;right:-11px;display:grid;place-items:center;width:30px;height:30px;border:1px solid rgba(191,106,84,.4);border-radius:999px;color:#fff;background:var(--clay);box-shadow:0 10px 24px #bf6a543d;cursor:pointer}.model-remove-button:hover,.model-remove-button:focus-visible{outline:none;background:#9b3f2e;transform:translateY(-1px)}.node-header{border-radius:16px 16px 0 0}.model-node.selected{border-color:#1f7a53b8;box-shadow:0 20px 48px #1f7a5324}.model-node.focused{border-color:#1f7a539e;box-shadow:0 20px 48px #1f7a5324,0 0 0 4px #1f7a5314}.model-node.dimmed{opacity:.2;filter:grayscale(.2)}.model-node.cyclic{border-color:#bf6a549e;box-shadow:0 18px 42px var(--shadow),0 0 0 3px #bf6a5414}.model-node.cyclic .node-header>svg{color:var(--clay)}.model-node.hard_dependency{border-color:#bf6a548c;border-style:dashed;background:#fff6f0f0;box-shadow:0 14px 30px #bf6a541f}.model-node.hard_dependency .node-header{background:linear-gradient(90deg,rgba(191,106,84,.08),transparent 60%),var(--paper-strong)}.model-node.hard_dependency .node-header>svg{color:var(--clay)}.model-node.hard_dependency .process:before{content:"↳ ";color:var(--clay)}.model-node.overview-node{border-radius:12px;box-shadow:0 10px 24px #382b231a}.model-node.overview-node .node-header{min-height:64px;padding:9px 10px;border-radius:12px 12px 0 0}.model-node.overview-node .process{font-size:12px;line-height:1.18;overflow-wrap:anywhere}.model-node.overview-node .model-type{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-node-summary{display:flex;flex-wrap:wrap;gap:5px;padding:8px 10px 10px}.overview-node-summary span{min-width:0;max-width:100%;padding:3px 6px;border:1px solid rgba(183,166,150,.35);border-radius:999px;color:var(--muted);background:#fffdf7c2;font-size:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-port-handles .react-flow__handle{width:7px;height:7px;border-color:#fffaf2e6;background:var(--line-strong)}.overview-port-handles .react-flow__handle-right{background:var(--accent)}.hard-chip{color:var(--clay);border-color:#bf6a5447!important;background:#fff6f0e6!important}.node-header{display:grid;grid-template-columns:1fr auto;align-items:flex-start;gap:11px;padding:11px 12px 12px;color:var(--ink);background:var(--paper-strong);border-bottom:1px solid var(--line)}.node-header>svg{color:var(--accent)}.process{font-weight:820;font-size:15px;letter-spacing:0}.model-type{margin-top:2px;font-size:12px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.node-meta{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px 0}.ports-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px}.port-title{margin-bottom:6px;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.port{position:relative;display:flex;align-items:center;gap:5px;min-height:24px;margin:4px 0;padding:4px 7px;border:1px solid var(--line);border-radius:8px;background:#fffdf7e6;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.port:after{content:attr(data-default);position:absolute;z-index:60;left:50%;bottom:calc(100% + 8px);width:max-content;max-width:240px;padding:7px 9px;color:var(--paper);background:var(--ink);border-radius:9px;box-shadow:0 12px 28px #382b232e;font-family:Avenir Next,Trebuchet MS,Segoe UI,sans-serif;font-size:11px;line-height:1.3;white-space:normal;opacity:0;pointer-events:none;transform:translate(-50%,4px);transition:opacity .12s ease,transform .12s ease}.port:hover:after,.port.active:after{opacity:1;transform:translate(-50%)}.app-shell.has-candidate-popover .port.active:after{opacity:0}.port.output{justify-content:flex-end}.port.previous{color:var(--clay)}.port.mapped{border-color:#1f7a5361}.port-candidate-button{position:relative;z-index:8;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:16px;height:16px;padding:0;color:var(--accent);background:#fffdf7f0;border:1px solid rgba(31,122,83,.34);border-radius:999px;cursor:pointer}.port-candidate-button:hover,.port-candidate-button:focus-visible{color:#fffdfa;background:var(--accent);outline:none}.port-cycle-break-button{position:relative;z-index:9;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px;padding:0;color:#9b2d22;background:#fff1ecf5;border:1px solid rgba(211,66,47,.45);border-radius:999px;cursor:pointer;box-shadow:0 5px 12px #d3422f29}.port-cycle-break-button:hover,.port-cycle-break-button:focus-visible{color:#fffdfa;background:#d3422f;outline:none}.port.active .port-candidate-button{color:var(--accent);background:#fffdfa}@keyframes cycleTargetPulse{0%,to{box-shadow:inset 3px 0 #d3422fc7,0 0 0 3px #d3422f14}50%{box-shadow:inset 3px 0 #d3422feb,0 0 0 6px #d3422f26}}.candidate-popover{position:fixed;z-index:1200;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;color:var(--ink);border:1px solid rgba(31,122,83,.28);border-radius:8px;background:linear-gradient(135deg,rgba(31,122,83,.08),transparent 42%),#fffdf7fa;box-shadow:0 18px 42px #382b232e}.candidate-popover-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:12px 12px 9px;border-bottom:1px solid rgba(183,166,150,.32)}.candidate-popover-header h3{margin:3px 0 0;overflow-wrap:anywhere;font-size:15px}.candidate-popover-list{display:grid;gap:8px;overflow:auto;padding:10px}.candidate-model-card{display:grid;gap:5px;width:100%;padding:9px 10px;color:var(--ink);border:1px solid rgba(183,166,150,.38);border-left:4px solid var(--accent);border-radius:8px;background:#ffffffb3;font:inherit;text-align:left;cursor:pointer}.candidate-model-card:hover,.candidate-model-card:focus-visible{background:#fffdf7f5;border-color:#1f7a536b;outline:none}.candidate-model-card strong{overflow-wrap:anywhere;font-size:12px}.candidate-model-card span{color:var(--muted);font-size:11px}.candidate-model-card small{overflow-wrap:anywhere;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}.port.required-input{border-color:#bf6a54b8;background:linear-gradient(90deg,#bf6a5429,#fffdf7eb 62%),#fffdf7e6;box-shadow:inset 3px 0 #bf6a54bd}.port.required-input .react-flow__handle{border-color:var(--clay);background:#fff6f0;box-shadow:0 0 0 3px #fffaf2eb,0 0 0 6px #bf6a5421}.port.cycle-break-target{border-color:#d3422fb8;background:linear-gradient(90deg,#d3422f2e,#fffdf7eb 62%),#fffdf7e6;box-shadow:inset 3px 0 #d3422fc7,0 0 0 3px #d3422f14}.cycle-break-mode .port.cycle-break-target{animation:cycleTargetPulse 1.35s ease-in-out infinite}.port.cycle-break-target .react-flow__handle{border-color:#d3422f;background:#fff1ec;box-shadow:0 0 0 3px #fffaf2eb,0 0 0 7px #d3422f26}.port.highlighted{border-color:var(--line);background:#fffdfa}.port.focused{border-color:#1f7a5394;background:var(--accent-soft)}.port.active{color:#fffdfa;border-color:var(--accent);background:var(--accent)}.port.cycle-break-target.active,.port.cycle-break-target.focused,.port.cycle-break-target.highlighted{color:#7a2018;border-color:#d3422fc7;background:linear-gradient(90deg,#d3422f33,#fffdf7f0 64%),#fffdf7f0;box-shadow:inset 3px 0 #d3422fdb,0 0 0 4px #d3422f1f}.port.cycle-break-target.active:after{background:#7a2018}.port.cycle-break-target.active .port-cycle-break-button,.port.cycle-break-target.focused .port-cycle-break-button,.port.cycle-break-target.highlighted .port-cycle-break-button{color:#9b2d22;background:#fff1ecfa}.react-flow__handle{width:9px;height:9px;border:1px solid var(--line-strong);background:var(--paper);z-index:25;box-shadow:0 0 0 3px #fffaf2eb}.react-flow__handle.call-handle{width:12px;height:36px;opacity:0;pointer-events:none}.react-flow__edge.multiscale path{stroke-dasharray:7 5}.react-flow__edge.mapped_variable path{stroke:var(--accent)}.react-flow__edge.hard_dependency path{stroke:var(--clay)}.react-flow__edge.cycle_dependency path,.react-flow__edge.cycle_edge path{stroke:#d3422f;filter:drop-shadow(0 0 5px rgba(211,66,47,.26))}.react-flow__edge.call_edge path{stroke-width:1.7;stroke-dasharray:3 6;opacity:.7}.react-flow__edge.highlighted path{stroke-width:3;stroke:var(--accent)}.react-flow__edge.focused path{stroke-width:2.8}.react-flow__edge.highlighted{z-index:80!important}.react-flow__edge.focused{z-index:70!important}.react-flow__edge.dimmed{opacity:.04}.overview-mode .react-flow__edge.variable_edge path{stroke-width:1.45!important;opacity:.74}.overview-mode .react-flow__edge.call_edge path{stroke-width:1.15!important;opacity:.4}.overview-mode .react-flow__edge.highlighted path,.overview-mode .react-flow__edge.focused path{stroke-width:2.8!important;opacity:1}.edge-chip{position:absolute;z-index:-1;display:inline-flex;align-items:center;gap:6px;padding:3px 7px;color:var(--ink);background:#fffaf2f0;border:1px solid var(--line);border-radius:999px;box-shadow:0 8px 20px #382b231a;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1;pointer-events:none;white-space:nowrap}.edge-chip.mapped_variable,.edge-chip.multiscale{border-color:#1f7a534d;background:#f8faf1f5}.edge-chip.hard_dependency{border-color:#bf6a5452;background:#fff6f0f5}.edge-chip.cycle_dependency,.edge-chip.cycle_edge{color:#7a2018;border-color:#d3422f70;background:#ffeee9fa}.edge-chip small{color:var(--muted);font-size:9px;letter-spacing:.02em;text-transform:uppercase}.edge-chip.highlighted{z-index:80;color:#fffdfa;border-color:var(--accent);background:var(--accent);box-shadow:0 12px 24px #1f7a5338}.edge-chip.highlighted small{color:#fffdf7b8}.edge-chip.dimmed{opacity:.04}.overview-mode .edge-chip:not(.highlighted):not(.focused),.overview-mode .edge-terminal:not(.highlighted):not(.focused){display:none}.edge-chip.focused{z-index:70;border-color:#1f7a535c;box-shadow:0 10px 22px #1f7a5324}.edge-terminal{position:absolute;z-index:32;--terminal-color: var(--line-strong);width:18px;height:10px;pointer-events:none;opacity:.95}.edge-terminal:before{content:"";position:absolute;top:4px;left:2px;right:2px;height:2px;border-radius:999px;background:var(--terminal-color)}.edge-terminal.target:after{content:"";position:absolute;top:1px;width:0;height:0;border-top:4px solid transparent;border-bottom:4px solid transparent}.edge-terminal[data-side=left]:before{left:7px}.edge-terminal[data-side=right]:before{right:7px}.edge-terminal.target[data-side=left]:after{right:0;border-left:7px solid var(--terminal-color)}.edge-terminal.target[data-side=right]:after{left:0;border-right:7px solid var(--terminal-color)}.edge-terminal.highlighted:before{height:3px}.edge-terminal.dimmed{opacity:.12}.cycle-edge-card{border-color:#d3422f57;background:linear-gradient(135deg,rgba(211,66,47,.1),transparent 58%),#fffaf2e0}.cycle-break-button{justify-content:center;margin:8px 0 4px}.inspector{border-left:1px solid var(--line);background:#fffaf2d1;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);padding:18px;overflow:auto}.inspector:focus{outline:none}.inspector.guided-focus{animation:guided-panel-focus 1.8s ease-out}@keyframes guided-panel-focus{0%{box-shadow:inset 0 0 0 3px #1f7a537a,-18px 0 44px #1f7a5329;background:#fafff7f0}60%{box-shadow:inset 0 0 0 3px #1f7a535c,-12px 0 34px #1f7a531f}to{box-shadow:none;background:#fffaf2d1}}.inspector header{display:flex;align-items:center;gap:8px;margin-bottom:14px}.mapping-code-panel{display:grid;gap:10px}.row-with-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.mapping-code{width:100%;min-height:260px;resize:vertical;border:1px solid var(--line);border-radius:10px;background:#fffdf7e6;color:var(--ink);padding:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.45}.storage-grid{display:grid;gap:8px}.path-status{display:grid;gap:3px;border:1px solid var(--line);border-radius:10px;background:#fffaf2b8;padding:9px}.path-status span{color:var(--muted);font-size:11px;font-weight:720}.path-status strong{color:var(--ink);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;overflow-wrap:anywhere}.recent-mappings{display:grid;gap:8px;margin-top:4px}.open-mapping-panel{display:grid;gap:12px}.recent-mapping-list{display:grid;gap:7px}.recent-mapping-item{display:grid;gap:3px;text-align:left;border:1px solid var(--line);border-radius:10px;background:#fffdf7d1;color:var(--ink);padding:9px;cursor:pointer}.recent-mapping-item:hover,.recent-mapping-item:focus-visible{border-color:#1f7a5352;background:#1f7a5314}.recent-mapping-item span{font-weight:720}.recent-mapping-item small{color:var(--muted);overflow-wrap:anywhere}.inline-field{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.inspector h2{font-size:17px}.inspector h3{margin-top:22px;margin-bottom:8px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em}.row{display:grid;grid-template-columns:84px minmax(0,1fr);gap:8px;padding:8px 0;border-top:1px solid rgba(183,166,150,.35)}.row span{color:var(--muted)}.row strong{overflow-wrap:anywhere;font-weight:620}.variable-card{border:1px solid var(--line);border-radius:12px;background:#fffaf2bf;padding:10px}.edge-detail-card{display:grid;gap:4px;margin-bottom:14px;padding:10px;border:1px solid rgba(31,122,83,.24);border-radius:12px;background:linear-gradient(135deg,rgba(31,122,83,.08),transparent 58%),#fffaf2d1}.edge-detail-card .diagnostic,.edge-detail-card .empty-state{margin-top:6px}.variable-card .row:first-of-type{margin-top:8px}.variable-card-title{display:flex;align-items:center;justify-content:space-between;gap:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.variable-card-title span{overflow-wrap:anywhere;font-weight:720}.variable-card-title small{color:var(--muted);text-transform:uppercase;letter-spacing:.08em}.diagnostic,.edit-suggestion,.initialization-note,.empty-state{border:1px solid var(--line);border-radius:12px;background:#fffaf2bf;padding:10px;color:var(--muted)}.diagnostic,.edit-suggestion,.initialization-note{display:flex;align-items:center;gap:7px}.diagnostic,.edit-suggestion{color:var(--clay);border-color:#c9614a47;background:#c9614a17}.initialization-note{color:#87533b;border-color:#bf6a5452;background:#bf6a541a}.initialization-list{display:grid;gap:8px}.initialization-list.compact{gap:6px}.initialization-group{display:grid;gap:7px}.initialization-group h4,.provenance-block h4{margin:6px 0 0;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700}.initialization-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;padding:9px 10px;color:var(--ink);background:#fffaf2c7;border:1px solid rgba(191,106,84,.28);border-left:4px solid var(--clay);border-radius:10px;font:inherit;text-align:left;cursor:pointer}.initialization-item:hover,.initialization-item:focus-visible{background:#fff6f0f5;outline:none}.initialization-item span{overflow:hidden;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.initialization-item strong{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.initialization-item small{grid-column:1 / -1;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}.initialization-item.previous_time_step{border-left-color:var(--ochre)}.initialization-item.mapped_unresolved{border-left-color:var(--accent)}.warning-list,.provenance-block{display:grid;gap:8px}.warning-group{display:grid;gap:7px}.warning-group h4{margin:6px 0 0;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700}.warning-item,.provenance-edge{display:grid;gap:3px;width:100%;padding:9px 10px;border:1px solid rgba(201,144,53,.28);border-left:4px solid var(--ochre);border-radius:10px;background:#fffaf2c7;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.warning-item.error{border-color:#bf6a5457;border-left-color:var(--clay);background:#bf6a5414}.warning-item.info{border-color:#7f8f7342;border-left-color:var(--sage);background:#7f8f7314}.provenance-edge{border-color:#b7a6966b;border-left-color:var(--line-strong)}.provenance-edge.mapped_variable{border-left-color:var(--accent)}.provenance-edge.hard_dependency{border-left-color:var(--clay)}.warning-item:hover,.warning-item:focus-visible,.provenance-edge:hover,.provenance-edge:focus-visible{background:#fff6f0f5;outline:none}.warning-item strong,.provenance-edge strong{overflow-wrap:anywhere;font-size:12px}.warning-item span,.provenance-edge span,.provenance-edge small{color:var(--muted);font-size:11px;line-height:1.25}.provenance-block{margin-top:10px}.empty-state.compact{padding:7px 8px;font-size:11px}.live-session{border-left:1px solid rgba(183,166,150,.36);padding-left:10px}.live-pill{display:inline-flex;align-items:center;height:28px;padding:0 9px;border:1px solid rgba(191,106,84,.38);border-radius:999px;color:var(--clay);background:#bf6a5414;font-size:11px;font-weight:800;text-transform:uppercase}.live-pill.connected{border-color:#1f7a5357;color:var(--accent);background:#1f7a5317}.metric-button:disabled{cursor:not-allowed;opacity:.42}.model-browser{display:grid;gap:7px}.model-browser-control{display:grid;gap:4px}.model-browser-control span,.parameter-row label{color:var(--muted);font-size:11px;font-weight:700}.model-browser-control select,.model-browser-control input,.parameter-row input,.parameter-row select{min-width:0;border:1px solid rgba(183,166,150,.44);border-radius:8px;background:#ffffffc7;color:var(--ink);font:inherit}.model-browser-control select,.model-browser-control input{height:32px;padding:0 8px}.model-browser-item{display:grid;gap:7px;padding:8px 9px;border:1px solid rgba(183,166,150,.34);border-radius:10px;background:#ffffff9e}.model-browser-item.add-model-config{gap:10px;padding-bottom:0}.model-browser-title{display:grid;gap:2px}.model-browser-item strong{overflow-wrap:anywhere;font-size:12px}.model-browser-item span{color:var(--muted);font-size:11px}.existing-model-editor{display:grid;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid rgba(183,166,150,.32)}.variable-mapping-editor{display:grid;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid rgba(183,166,150,.32)}.variable-mapping-editor h4{margin:0;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700}.initialization-editor{display:grid;gap:12px}.initialization-editor-group{display:grid;gap:8px}.initialization-editor-group h3{margin:0}.initialization-editor-row{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1fr) minmax(82px,.72fr) auto;gap:7px;align-items:center;padding:9px;border:1px solid rgba(191,106,84,.26);border-left:4px solid var(--clay);border-radius:8px;background:#fffaf2c7}.initialization-editor-row.provided{border-color:#1f7a533d;border-left-color:var(--accent)}.initialization-editor-row label{overflow-wrap:anywhere;font-weight:700}.initialization-editor-row input,.initialization-editor-row select{min-width:0;height:30px;border:1px solid rgba(183,166,150,.44);border-radius:8px;background:#ffffffc7;color:var(--ink);font:inherit}.initialization-editor-row input{padding:0 8px}.initialization-editor-row small{grid-column:1 / -1;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em}.parameter-row{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1fr) minmax(78px,.8fr);gap:6px;align-items:center}.parameter-row input,.parameter-row select{height:28px;padding:0 7px;font-size:12px}.rate-editor{display:grid;gap:6px;padding:7px;border:1px solid rgba(183,166,150,.28);border-radius:8px;background:#fcf9f4b8}.add-model-footer{position:sticky;bottom:-18px;display:flex;justify-content:flex-end;margin:2px -9px 0;padding:10px 9px;border-top:1px solid rgba(183,166,150,.34);border-radius:0 0 10px 10px;background:#fffaf2f0;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.rate-summary{color:var(--muted);font-size:11px;line-height:1.35}.rate-clock-row{display:grid;grid-template-columns:1fr 1fr;gap:6px}.rate-clock-row label{display:grid;gap:4px;color:var(--muted);font-size:11px;font-weight:700}.rate-clock-row input{min-width:0;height:28px;border:1px solid rgba(183,166,150,.44);border-radius:8px;background:#ffffffc7;color:var(--ink);font:inherit;padding:0 7px}.metric-button.danger{border-color:#bf6a546b;color:#9b3f2e;background:#fff2ecdb}@media(max-width:900px){.app-shell{grid-template-columns:1fr}.inspector{position:absolute;z-index:28;top:150px;right:16px;bottom:16px;width:min(360px,calc(100% - 32px));border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 45px var(--shadow)}.relationship-legend,.scale-controls,.floating-panel{top:150px}.scale-controls{left:220px}}@media(max-width:720px){.topbar{top:10px;left:10px;right:10px;gap:8px;padding:9px 10px}.topbar:before{display:none}.brand-block{min-width:128px}.search-box{flex-basis:100%;max-width:none;min-width:0}.metrics{margin-left:0}.relationship-legend,.scale-controls,.floating-panel{top:132px;left:10px;right:10px;width:auto}.scale-controls{top:326px}.react-flow__minimap{display:none}}.mapping-dialog-overlay{position:fixed;inset:0;z-index:1000;background:#31272161;display:flex;align-items:center;justify-content:center}.mapping-dialog{background:var(--paper);border:1px solid var(--line-strong);border-radius:10px;box-shadow:0 8px 32px var(--shadow);width:360px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:0;overflow:hidden}.mapping-dialog-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;border-bottom:1px solid var(--line)}.mapping-dialog-header .eyebrow{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}.mapping-dialog-body{padding:14px 16px;display:flex;flex-direction:column;gap:14px}.mapping-port-summary{display:flex;align-items:center;gap:8px;background:var(--paper-strong);border:1px solid var(--line);border-radius:6px;padding:10px 12px}.mapping-port{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}.mapping-port small{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.mapping-port strong{font-size:12px;font-weight:700;color:var(--accent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mapping-port span{font-size:11px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mapping-port.target strong{color:var(--clay)}.mapping-arrow{font-size:18px;color:var(--muted);flex-shrink:0}.mapping-mode-section{display:flex;flex-direction:column;gap:6px}.mapping-mode-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-bottom:2px}.mapping-radio{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer;padding:4px 0}.mapping-radio input[type=radio]{accent-color:var(--accent);width:14px;height:14px;flex-shrink:0}.mapping-scale-picker{display:flex;flex-direction:column;gap:4px}.mapping-checkbox{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer;padding:2px 0}.mapping-checkbox input[type=checkbox]{accent-color:var(--accent);width:14px;height:14px;flex-shrink:0}.mapping-dialog-footer{display:flex;justify-content:flex-end;gap:8px;padding:10px 16px 14px;border-top:1px solid var(--line)}.accent-button{background:var(--accent);color:#fff;border-color:transparent}.accent-button:hover:not(:disabled){background:var(--sage-dark);border-color:transparent}.selector-preview{display:grid;gap:6px;padding:12px;border:1px solid #b9d3c4;background:#f2f8f4;border-radius:6px}.selector-preview span,.selector-preview p{margin:0;color:#615c55;font-size:.86rem}.selector-preview p{color:#a44b39}.selector-preview-button{display:inline-flex;align-items:center;gap:6px;width:max-content}.environment-ports{border-top:1px solid #ded5c8;margin-top:8px;padding-top:8px}.entity-node.environment{border-color:#8fb9c2;background:#f3fafb}.entity-node.template{border-color:#9a8bc0;background:#f8f5fd}.instance-form{width:min(780px,100%)}.instance-form-content{display:grid;gap:14px}.environment-form{width:min(560px,100%)}.environment-summary,.effective-environment{display:grid;gap:6px;padding:10px;border:1px solid #d4dfdb;border-radius:5px;background:#f4f9f6}.environment-summary span,.environment-hint{color:#655f58;font-size:12px}.environment-sources input,.configuration-list>div>input,.configuration-list>div>select{width:100%;min-height:32px;border:1px solid #cdbda8;border-radius:5px;background:#fffdf8;color:#302923}.compact-actions{display:flex;justify-content:flex-end;gap:8px}.compact-actions button{display:inline-flex;align-items:center;gap:5px}.application-configuration-form{width:min(820px,100%)}.application-configuration-content{display:grid;gap:14px}.application-configuration-content fieldset{margin:0;padding:12px;border:1px solid #ded2c2;border-radius:5px}.application-configuration-content legend{padding:0 6px;color:#2d6652;font-weight:800}.application-configuration-content p{margin:0;color:#786d64}.configuration-list{display:grid;gap:7px;margin-bottom:10px}.configuration-list>div,.configuration-list>label{min-height:36px;display:grid;grid-template-columns:minmax(100px,.6fr) minmax(0,1fr) auto;align-items:center;gap:10px;padding:7px 9px;border:1px solid #e4d9ca;border-radius:5px;background:#fffdf8}.configuration-list span{overflow:hidden;color:#786d64;text-overflow:ellipsis;white-space:nowrap}.configuration-list select,.compact-configuration-row input,.compact-configuration-row select{width:100%;min-height:34px;border:1px solid #cdbda8;border-radius:5px;background:#fffdf8;color:#302923}.compact-configuration-row{align-items:end}.compact-configuration-row label{display:grid;gap:5px;color:#655b52;font-size:12px;font-weight:700}.compact-configuration-row button{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:5px}.icon-button{width:32px;height:32px;display:inline-grid;place-items:center;padding:0}.application-configuration-form>footer{display:flex;justify-content:flex-end;padding:12px 15px;border-top:1px solid #ded2c2} diff --git a/frontend/dist/assets/index-DwZ0xeih.css b/frontend/dist/assets/index-DwZ0xeih.css deleted file mode 100644 index a12e873e9..000000000 --- a/frontend/dist/assets/index-DwZ0xeih.css +++ /dev/null @@ -1 +0,0 @@ -.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{--bg: #f3eee6;--paper: #fffaf2;--paper-strong: #fbf2e6;--ink: #312721;--muted: #80756c;--line: #ded2c3;--line-strong: #b7a696;--accent: #1f7a53;--accent-soft: rgba(31, 122, 83, .12);--sage: #7f8f73;--sage-dark: #596851;--ochre: #c99035;--clay: #bf6a54;--shadow: rgba(56, 43, 35, .12)}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:radial-gradient(circle at 20% 24%,rgba(31,122,83,.045),transparent 30%),radial-gradient(circle at 78% 68%,rgba(201,144,53,.055),transparent 34%),linear-gradient(180deg,rgba(255,250,242,.26),transparent 42%),var(--bg);font-family:Avenir Next,Trebuchet MS,Segoe UI,sans-serif}.app-shell{display:grid;grid-template-columns:minmax(0,1fr);height:100vh;position:relative}.app-shell.has-side-panel{grid-template-columns:minmax(0,1fr) 340px}.graph-panel{position:relative;min-width:0}.graph-panel:after{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;opacity:.2;background-image:radial-gradient(rgba(49,39,33,.11) .55px,transparent .55px);background-size:16px 16px;-webkit-mask-image:linear-gradient(to bottom,transparent 0%,black 22%,black 82%,transparent 100%);mask-image:linear-gradient(to bottom,transparent 0%,black 22%,black 82%,transparent 100%)}.topbar{position:absolute;z-index:10;top:18px;left:18px;right:18px;display:flex;align-items:center;gap:12px;padding:11px 14px;background:#fffaf2eb;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.topbar:before{content:"";align-self:stretch;width:5px;border-radius:999px;background:var(--accent)}.editor-feedback{position:absolute;z-index:12;top:96px;left:18px;right:18px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:#fffaf2f2;box-shadow:0 12px 30px var(--shadow);max-height:132px;overflow:auto;font-size:12px;line-height:1.45;white-space:normal;overflow-wrap:anywhere}.editor-feedback.error{color:var(--clay);border-color:#bf6a5466;background:#fff4eef7}.editor-feedback.info{color:var(--accent);border-color:#1f7a5359;background:#f5fcf8f7}.cycle-break-prompt{position:absolute;z-index:14;top:98px;left:18px;right:18px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid rgba(211,66,47,.32);border-radius:12px;background:linear-gradient(135deg,rgba(211,66,47,.12),transparent 62%),#fffaf2f5;box-shadow:0 16px 36px #382b2329}.cycle-break-prompt div{display:grid;gap:3px;min-width:0}.cycle-break-prompt strong{color:#7a2018;font-size:13px}.cycle-break-prompt span{color:var(--muted);font-size:12px;line-height:1.35}.cycle-break-prompt code{color:#7a2018;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.cycle-break-prompt.active{border-color:#d3422f85;box-shadow:0 16px 36px #382b2329,0 0 0 4px #d3422f14}.cycle-break-cta{flex:0 0 auto;justify-content:center;font-weight:780}.graph-workbench{flex-wrap:wrap;align-items:flex-start;max-height:min(36vh,250px);overflow:auto;scrollbar-width:thin}.brand-block{min-width:150px}.brand-block h1{font-size:clamp(16px,2.2vw,20px)}.search-box{position:relative;display:flex;align-items:center;gap:8px;flex:1 1 280px;max-width:460px;min-width:220px;padding:7px 9px;border:1px solid var(--line);border-radius:11px;background:#fffdf7db}.search-box input{width:100%;min-width:0;border:0;outline:0;color:var(--ink);background:transparent;font:inherit;font-size:13px}.clear-search{display:grid;place-items:center;width:20px;height:20px;border:0;border-radius:999px;background:#b7a6962e;color:var(--muted);cursor:pointer}.search-results{position:absolute;z-index:80;top:calc(100% + 8px);left:0;right:0;display:grid;gap:6px;max-height:360px;overflow:auto;padding:8px;border:1px solid var(--line);border-radius:12px;background:#fffaf2fa;box-shadow:0 18px 45px var(--shadow)}.search-result{display:grid;gap:2px;padding:8px 9px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--ink);text-align:left;cursor:pointer}.search-result:hover,.search-result:focus-visible{border-color:#1f7a533d;background:var(--accent-soft);outline:none}.search-result strong{overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.search-result span{color:var(--muted);font-size:11px}.eyebrow{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}h1,h2,h3{margin:0;letter-spacing:0}h1{font-size:20px;font-weight:800}.metrics{display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}.metrics span,.metric-button,.node-meta span{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:1px solid var(--line);border-radius:9px;background:#fffaf2e6;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.metric-button{color:var(--ink);cursor:pointer}.metric-button.active,.metric-button:hover,.metric-button:focus-visible{outline:none;background:#fff6f0}.view-mode-button.overview-cta{border-color:#1f7a5361;color:var(--accent);background:#1f7a531a;box-shadow:0 8px 18px #1f7a531a;font-weight:800}.meta-chip{position:relative}.meta-chip:after{content:attr(data-tooltip);position:absolute;z-index:20;left:0;bottom:calc(100% + 10px);width:max-content;max-width:280px;padding:8px 10px;color:var(--paper);background:var(--ink);border-radius:10px;box-shadow:0 12px 28px #382b232e;font-family:Avenir Next,Trebuchet MS,Segoe UI,sans-serif;font-size:12px;line-height:1.3;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);transition:opacity .12s ease,transform .12s ease}.meta-chip:before{content:"";position:absolute;z-index:21;left:16px;bottom:calc(100% + 4px);width:10px;height:10px;background:var(--ink);opacity:0;pointer-events:none;transform:rotate(45deg) translateY(4px);transition:opacity .12s ease,transform .12s ease}.meta-chip:hover:after,.meta-chip:hover:before,.meta-chip:focus-visible:after,.meta-chip:focus-visible:before{opacity:1;transform:translateY(0)}.meta-chip:hover:before,.meta-chip:focus-visible:before{transform:rotate(45deg) translateY(0)}.metrics .warn{color:var(--clay);border-color:#c9614a73}.metrics .caution{color:var(--ochre);border-color:#c9903573}.metrics .warn svg{flex:0 0 auto}.icon-button{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);cursor:pointer;box-shadow:0 8px 18px #382b2314}.icon-button.compact{width:28px;height:28px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px}.toolbar-group{display:flex;align-items:center;gap:8px}.open-button{flex:0 0 auto}.panel-switch{flex-wrap:wrap}.select-control{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid var(--line);border-radius:10px;background:#fffaf2e6;color:var(--muted)}.select-control select{max-width:132px;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:12px}.relationship-legend{position:absolute;z-index:35;top:116px;left:18px;display:grid;gap:7px;width:190px;padding:10px;border:1px solid var(--line);border-radius:13px;background:#fffaf2eb;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);max-height:min(480px,calc(100vh - 142px));overflow:auto}.legend-title,.legend-note{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.relationship-legend button{display:flex;align-items:center;gap:8px;padding:6px 7px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);font:inherit;font-size:12px;cursor:pointer}.relationship-legend button.active{color:var(--ink);border-color:#1f7a5338;background:var(--accent-soft)}.legend-line{width:28px;height:0;border-top:2px solid var(--line-strong)}.legend-line.mapped{border-color:var(--accent);border-style:dashed}.legend-line.call{border-color:var(--clay);border-style:dashed}.scale-controls{position:absolute;z-index:35;top:116px;left:220px;display:grid;gap:8px;width:190px;padding:10px;border:1px solid var(--line);border-radius:13px;background:#fffaf2eb;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);max-height:min(560px,calc(100vh - 142px));overflow:auto}.scale-list{display:grid;gap:6px}.scale-list button,.scale-reset{display:grid;gap:2px;width:100%;padding:7px 8px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);font:inherit;text-align:left;cursor:pointer}.scale-list button.active{color:var(--ink);border-color:#1f7a5338;background:var(--accent-soft)}.scale-list button.collapsed{border-color:#b7a69657;border-style:dashed;background:#b7a69614}.scale-list span{overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:700}.scale-list small{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}.scale-reset{color:var(--accent);border-color:#1f7a5333;background:#1f7a5314;text-align:center}.floating-panel{position:absolute;z-index:40;top:116px;right:18px;width:min(360px,calc(100vw - 36px));max-height:min(560px,calc(100vh - 142px));overflow:auto;padding:14px;background:#fffaf2f5;border:1px solid rgba(191,106,84,.32);border-radius:14px;box-shadow:0 18px 45px var(--shadow);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.warnings-panel{border-color:#c9903559}.open-panel{left:18px;right:auto;border-color:#1f7a5352}.floating-panel-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.floating-panel h2{font-size:18px}.react-flow{background:transparent;z-index:1}.react-flow__background{display:none}.react-flow__edges{z-index:8}.react-flow__edges:has(.react-flow__edge.highlighted){z-index:120}.react-flow__edgelabel-renderer{z-index:28}.react-flow__edgelabel-renderer:has(.edge-chip.highlighted){z-index:121}.react-flow__nodes{z-index:20}.model-node{position:relative;overflow:visible;background:#fffaf2f5;border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 42px var(--shadow)}.model-remove-button{position:absolute;z-index:45;top:-11px;right:-11px;display:grid;place-items:center;width:30px;height:30px;border:1px solid rgba(191,106,84,.4);border-radius:999px;color:#fff;background:var(--clay);box-shadow:0 10px 24px #bf6a543d;cursor:pointer}.model-remove-button:hover,.model-remove-button:focus-visible{outline:none;background:#9b3f2e;transform:translateY(-1px)}.node-header{border-radius:16px 16px 0 0}.model-node.selected{border-color:#1f7a53b8;box-shadow:0 20px 48px #1f7a5324}.model-node.focused{border-color:#1f7a539e;box-shadow:0 20px 48px #1f7a5324,0 0 0 4px #1f7a5314}.model-node.dimmed{opacity:.2;filter:grayscale(.2)}.model-node.cyclic{border-color:#bf6a549e;box-shadow:0 18px 42px var(--shadow),0 0 0 3px #bf6a5414}.model-node.cyclic .node-header>svg{color:var(--clay)}.model-node.hard_dependency{border-color:#bf6a548c;border-style:dashed;background:#fff6f0f0;box-shadow:0 14px 30px #bf6a541f}.model-node.hard_dependency .node-header{background:linear-gradient(90deg,rgba(191,106,84,.08),transparent 60%),var(--paper-strong)}.model-node.hard_dependency .node-header>svg{color:var(--clay)}.model-node.hard_dependency .process:before{content:"↳ ";color:var(--clay)}.model-node.overview-node{border-radius:12px;box-shadow:0 10px 24px #382b231a}.model-node.overview-node .node-header{min-height:64px;padding:9px 10px;border-radius:12px 12px 0 0}.model-node.overview-node .process{font-size:12px;line-height:1.18;overflow-wrap:anywhere}.model-node.overview-node .model-type{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-node-summary{display:flex;flex-wrap:wrap;gap:5px;padding:8px 10px 10px}.overview-node-summary span{min-width:0;max-width:100%;padding:3px 6px;border:1px solid rgba(183,166,150,.35);border-radius:999px;color:var(--muted);background:#fffdf7c2;font-size:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-port-handles .react-flow__handle{width:7px;height:7px;border-color:#fffaf2e6;background:var(--line-strong)}.overview-port-handles .react-flow__handle-right{background:var(--accent)}.hard-chip{color:var(--clay);border-color:#bf6a5447!important;background:#fff6f0e6!important}.node-header{display:grid;grid-template-columns:1fr auto;align-items:flex-start;gap:11px;padding:11px 12px 12px;color:var(--ink);background:var(--paper-strong);border-bottom:1px solid var(--line)}.node-header>svg{color:var(--accent)}.process{font-weight:820;font-size:15px;letter-spacing:0}.model-type{margin-top:2px;font-size:12px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.node-meta{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px 0}.ports-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px}.port-title{margin-bottom:6px;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.port{position:relative;display:flex;align-items:center;gap:5px;min-height:24px;margin:4px 0;padding:4px 7px;border:1px solid var(--line);border-radius:8px;background:#fffdf7e6;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.port:after{content:attr(data-default);position:absolute;z-index:60;left:50%;bottom:calc(100% + 8px);width:max-content;max-width:240px;padding:7px 9px;color:var(--paper);background:var(--ink);border-radius:9px;box-shadow:0 12px 28px #382b232e;font-family:Avenir Next,Trebuchet MS,Segoe UI,sans-serif;font-size:11px;line-height:1.3;white-space:normal;opacity:0;pointer-events:none;transform:translate(-50%,4px);transition:opacity .12s ease,transform .12s ease}.port:hover:after,.port.active:after{opacity:1;transform:translate(-50%)}.app-shell.has-candidate-popover .port.active:after{opacity:0}.port.output{justify-content:flex-end}.port.previous{color:var(--clay)}.port.mapped{border-color:#1f7a5361}.port-candidate-button{position:relative;z-index:8;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:16px;height:16px;padding:0;color:var(--accent);background:#fffdf7f0;border:1px solid rgba(31,122,83,.34);border-radius:999px;cursor:pointer}.port-candidate-button:hover,.port-candidate-button:focus-visible{color:#fffdfa;background:var(--accent);outline:none}.port-cycle-break-button{position:relative;z-index:9;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px;padding:0;color:#9b2d22;background:#fff1ecf5;border:1px solid rgba(211,66,47,.45);border-radius:999px;cursor:pointer;box-shadow:0 5px 12px #d3422f29}.port-cycle-break-button:hover,.port-cycle-break-button:focus-visible{color:#fffdfa;background:#d3422f;outline:none}.port.active .port-candidate-button{color:var(--accent);background:#fffdfa}@keyframes cycleTargetPulse{0%,to{box-shadow:inset 3px 0 #d3422fc7,0 0 0 3px #d3422f14}50%{box-shadow:inset 3px 0 #d3422feb,0 0 0 6px #d3422f26}}.candidate-popover{position:fixed;z-index:1200;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;color:var(--ink);border:1px solid rgba(31,122,83,.28);border-radius:8px;background:linear-gradient(135deg,rgba(31,122,83,.08),transparent 42%),#fffdf7fa;box-shadow:0 18px 42px #382b232e}.candidate-popover-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:12px 12px 9px;border-bottom:1px solid rgba(183,166,150,.32)}.candidate-popover-header h3{margin:3px 0 0;overflow-wrap:anywhere;font-size:15px}.candidate-popover-list{display:grid;gap:8px;overflow:auto;padding:10px}.candidate-model-card{display:grid;gap:5px;width:100%;padding:9px 10px;color:var(--ink);border:1px solid rgba(183,166,150,.38);border-left:4px solid var(--accent);border-radius:8px;background:#ffffffb3;font:inherit;text-align:left;cursor:pointer}.candidate-model-card:hover,.candidate-model-card:focus-visible{background:#fffdf7f5;border-color:#1f7a536b;outline:none}.candidate-model-card strong{overflow-wrap:anywhere;font-size:12px}.candidate-model-card span{color:var(--muted);font-size:11px}.candidate-model-card small{overflow-wrap:anywhere;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}.port.required-input{border-color:#bf6a54b8;background:linear-gradient(90deg,#bf6a5429,#fffdf7eb 62%),#fffdf7e6;box-shadow:inset 3px 0 #bf6a54bd}.port.required-input .react-flow__handle{border-color:var(--clay);background:#fff6f0;box-shadow:0 0 0 3px #fffaf2eb,0 0 0 6px #bf6a5421}.port.cycle-break-target{border-color:#d3422fb8;background:linear-gradient(90deg,#d3422f2e,#fffdf7eb 62%),#fffdf7e6;box-shadow:inset 3px 0 #d3422fc7,0 0 0 3px #d3422f14}.cycle-break-mode .port.cycle-break-target{animation:cycleTargetPulse 1.35s ease-in-out infinite}.port.cycle-break-target .react-flow__handle{border-color:#d3422f;background:#fff1ec;box-shadow:0 0 0 3px #fffaf2eb,0 0 0 7px #d3422f26}.port.highlighted{border-color:var(--line);background:#fffdfa}.port.focused{border-color:#1f7a5394;background:var(--accent-soft)}.port.active{color:#fffdfa;border-color:var(--accent);background:var(--accent)}.port.cycle-break-target.active,.port.cycle-break-target.focused,.port.cycle-break-target.highlighted{color:#7a2018;border-color:#d3422fc7;background:linear-gradient(90deg,#d3422f33,#fffdf7f0 64%),#fffdf7f0;box-shadow:inset 3px 0 #d3422fdb,0 0 0 4px #d3422f1f}.port.cycle-break-target.active:after{background:#7a2018}.port.cycle-break-target.active .port-cycle-break-button,.port.cycle-break-target.focused .port-cycle-break-button,.port.cycle-break-target.highlighted .port-cycle-break-button{color:#9b2d22;background:#fff1ecfa}.react-flow__handle{width:9px;height:9px;border:1px solid var(--line-strong);background:var(--paper);z-index:25;box-shadow:0 0 0 3px #fffaf2eb}.react-flow__handle.call-handle{width:12px;height:36px;opacity:0;pointer-events:none}.react-flow__edge.multiscale path{stroke-dasharray:7 5}.react-flow__edge.mapped_variable path{stroke:var(--accent)}.react-flow__edge.hard_dependency path{stroke:var(--clay)}.react-flow__edge.cycle_dependency path,.react-flow__edge.cycle_edge path{stroke:#d3422f;filter:drop-shadow(0 0 5px rgba(211,66,47,.26))}.react-flow__edge.call_edge path{stroke-width:1.7;stroke-dasharray:3 6;opacity:.7}.react-flow__edge.highlighted path{stroke-width:3;stroke:var(--accent)}.react-flow__edge.focused path{stroke-width:2.8}.react-flow__edge.highlighted{z-index:80!important}.react-flow__edge.focused{z-index:70!important}.react-flow__edge.dimmed{opacity:.04}.overview-mode .react-flow__edge.variable_edge path{stroke-width:1.45!important;opacity:.74}.overview-mode .react-flow__edge.call_edge path{stroke-width:1.15!important;opacity:.4}.overview-mode .react-flow__edge.highlighted path,.overview-mode .react-flow__edge.focused path{stroke-width:2.8!important;opacity:1}.edge-chip{position:absolute;z-index:-1;display:inline-flex;align-items:center;gap:6px;padding:3px 7px;color:var(--ink);background:#fffaf2f0;border:1px solid var(--line);border-radius:999px;box-shadow:0 8px 20px #382b231a;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1;pointer-events:none;white-space:nowrap}.edge-chip.mapped_variable,.edge-chip.multiscale{border-color:#1f7a534d;background:#f8faf1f5}.edge-chip.hard_dependency{border-color:#bf6a5452;background:#fff6f0f5}.edge-chip.cycle_dependency,.edge-chip.cycle_edge{color:#7a2018;border-color:#d3422f70;background:#ffeee9fa}.edge-chip small{color:var(--muted);font-size:9px;letter-spacing:.02em;text-transform:uppercase}.edge-chip.highlighted{z-index:80;color:#fffdfa;border-color:var(--accent);background:var(--accent);box-shadow:0 12px 24px #1f7a5338}.edge-chip.highlighted small{color:#fffdf7b8}.edge-chip.dimmed{opacity:.04}.overview-mode .edge-chip:not(.highlighted):not(.focused),.overview-mode .edge-terminal:not(.highlighted):not(.focused){display:none}.edge-chip.focused{z-index:70;border-color:#1f7a535c;box-shadow:0 10px 22px #1f7a5324}.edge-terminal{position:absolute;z-index:32;--terminal-color: var(--line-strong);width:18px;height:10px;pointer-events:none;opacity:.95}.edge-terminal:before{content:"";position:absolute;top:4px;left:2px;right:2px;height:2px;border-radius:999px;background:var(--terminal-color)}.edge-terminal.target:after{content:"";position:absolute;top:1px;width:0;height:0;border-top:4px solid transparent;border-bottom:4px solid transparent}.edge-terminal[data-side=left]:before{left:7px}.edge-terminal[data-side=right]:before{right:7px}.edge-terminal.target[data-side=left]:after{right:0;border-left:7px solid var(--terminal-color)}.edge-terminal.target[data-side=right]:after{left:0;border-right:7px solid var(--terminal-color)}.edge-terminal.highlighted:before{height:3px}.edge-terminal.dimmed{opacity:.12}.cycle-edge-card{border-color:#d3422f57;background:linear-gradient(135deg,rgba(211,66,47,.1),transparent 58%),#fffaf2e0}.cycle-break-button{justify-content:center;margin:8px 0 4px}.inspector{border-left:1px solid var(--line);background:#fffaf2d1;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);padding:18px;overflow:auto}.inspector:focus{outline:none}.inspector.guided-focus{animation:guided-panel-focus 1.8s ease-out}@keyframes guided-panel-focus{0%{box-shadow:inset 0 0 0 3px #1f7a537a,-18px 0 44px #1f7a5329;background:#fafff7f0}60%{box-shadow:inset 0 0 0 3px #1f7a535c,-12px 0 34px #1f7a531f}to{box-shadow:none;background:#fffaf2d1}}.inspector header{display:flex;align-items:center;gap:8px;margin-bottom:14px}.mapping-code-panel{display:grid;gap:10px}.row-with-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.mapping-code{width:100%;min-height:260px;resize:vertical;border:1px solid var(--line);border-radius:10px;background:#fffdf7e6;color:var(--ink);padding:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.45}.storage-grid{display:grid;gap:8px}.path-status{display:grid;gap:3px;border:1px solid var(--line);border-radius:10px;background:#fffaf2b8;padding:9px}.path-status span{color:var(--muted);font-size:11px;font-weight:720}.path-status strong{color:var(--ink);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;overflow-wrap:anywhere}.recent-mappings{display:grid;gap:8px;margin-top:4px}.open-mapping-panel{display:grid;gap:12px}.recent-mapping-list{display:grid;gap:7px}.recent-mapping-item{display:grid;gap:3px;text-align:left;border:1px solid var(--line);border-radius:10px;background:#fffdf7d1;color:var(--ink);padding:9px;cursor:pointer}.recent-mapping-item:hover,.recent-mapping-item:focus-visible{border-color:#1f7a5352;background:#1f7a5314}.recent-mapping-item span{font-weight:720}.recent-mapping-item small{color:var(--muted);overflow-wrap:anywhere}.inline-field{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.inspector h2{font-size:17px}.inspector h3{margin-top:22px;margin-bottom:8px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em}.row{display:grid;grid-template-columns:84px minmax(0,1fr);gap:8px;padding:8px 0;border-top:1px solid rgba(183,166,150,.35)}.row span{color:var(--muted)}.row strong{overflow-wrap:anywhere;font-weight:620}.variable-card{border:1px solid var(--line);border-radius:12px;background:#fffaf2bf;padding:10px}.edge-detail-card{display:grid;gap:4px;margin-bottom:14px;padding:10px;border:1px solid rgba(31,122,83,.24);border-radius:12px;background:linear-gradient(135deg,rgba(31,122,83,.08),transparent 58%),#fffaf2d1}.edge-detail-card .diagnostic,.edge-detail-card .empty-state{margin-top:6px}.variable-card .row:first-of-type{margin-top:8px}.variable-card-title{display:flex;align-items:center;justify-content:space-between;gap:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.variable-card-title span{overflow-wrap:anywhere;font-weight:720}.variable-card-title small{color:var(--muted);text-transform:uppercase;letter-spacing:.08em}.diagnostic,.edit-suggestion,.initialization-note,.empty-state{border:1px solid var(--line);border-radius:12px;background:#fffaf2bf;padding:10px;color:var(--muted)}.diagnostic,.edit-suggestion,.initialization-note{display:flex;align-items:center;gap:7px}.diagnostic,.edit-suggestion{color:var(--clay);border-color:#c9614a47;background:#c9614a17}.initialization-note{color:#87533b;border-color:#bf6a5452;background:#bf6a541a}.initialization-list{display:grid;gap:8px}.initialization-list.compact{gap:6px}.initialization-group{display:grid;gap:7px}.initialization-group h4,.provenance-block h4{margin:6px 0 0;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700}.initialization-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;padding:9px 10px;color:var(--ink);background:#fffaf2c7;border:1px solid rgba(191,106,84,.28);border-left:4px solid var(--clay);border-radius:10px;font:inherit;text-align:left;cursor:pointer}.initialization-item:hover,.initialization-item:focus-visible{background:#fff6f0f5;outline:none}.initialization-item span{overflow:hidden;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.initialization-item strong{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.initialization-item small{grid-column:1 / -1;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}.initialization-item.previous_time_step{border-left-color:var(--ochre)}.initialization-item.mapped_unresolved{border-left-color:var(--accent)}.warning-list,.provenance-block{display:grid;gap:8px}.warning-group{display:grid;gap:7px}.warning-group h4{margin:6px 0 0;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700}.warning-item,.provenance-edge{display:grid;gap:3px;width:100%;padding:9px 10px;border:1px solid rgba(201,144,53,.28);border-left:4px solid var(--ochre);border-radius:10px;background:#fffaf2c7;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.warning-item.error{border-color:#bf6a5457;border-left-color:var(--clay);background:#bf6a5414}.warning-item.info{border-color:#7f8f7342;border-left-color:var(--sage);background:#7f8f7314}.provenance-edge{border-color:#b7a6966b;border-left-color:var(--line-strong)}.provenance-edge.mapped_variable{border-left-color:var(--accent)}.provenance-edge.hard_dependency{border-left-color:var(--clay)}.warning-item:hover,.warning-item:focus-visible,.provenance-edge:hover,.provenance-edge:focus-visible{background:#fff6f0f5;outline:none}.warning-item strong,.provenance-edge strong{overflow-wrap:anywhere;font-size:12px}.warning-item span,.provenance-edge span,.provenance-edge small{color:var(--muted);font-size:11px;line-height:1.25}.provenance-block{margin-top:10px}.empty-state.compact{padding:7px 8px;font-size:11px}.live-session{border-left:1px solid rgba(183,166,150,.36);padding-left:10px}.live-pill{display:inline-flex;align-items:center;height:28px;padding:0 9px;border:1px solid rgba(191,106,84,.38);border-radius:999px;color:var(--clay);background:#bf6a5414;font-size:11px;font-weight:800;text-transform:uppercase}.live-pill.connected{border-color:#1f7a5357;color:var(--accent);background:#1f7a5317}.metric-button:disabled{cursor:not-allowed;opacity:.42}.model-browser{display:grid;gap:7px}.model-browser-control{display:grid;gap:4px}.model-browser-control span,.parameter-row label{color:var(--muted);font-size:11px;font-weight:700}.model-browser-control select,.model-browser-control input,.parameter-row input,.parameter-row select{min-width:0;border:1px solid rgba(183,166,150,.44);border-radius:8px;background:#ffffffc7;color:var(--ink);font:inherit}.model-browser-control select,.model-browser-control input{height:32px;padding:0 8px}.model-browser-item{display:grid;gap:7px;padding:8px 9px;border:1px solid rgba(183,166,150,.34);border-radius:10px;background:#ffffff9e}.model-browser-item.add-model-config{gap:10px;padding-bottom:0}.model-browser-title{display:grid;gap:2px}.model-browser-item strong{overflow-wrap:anywhere;font-size:12px}.model-browser-item span{color:var(--muted);font-size:11px}.existing-model-editor{display:grid;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid rgba(183,166,150,.32)}.variable-mapping-editor{display:grid;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid rgba(183,166,150,.32)}.variable-mapping-editor h4{margin:0;color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700}.initialization-editor{display:grid;gap:12px}.initialization-editor-group{display:grid;gap:8px}.initialization-editor-group h3{margin:0}.initialization-editor-row{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1fr) minmax(82px,.72fr) auto;gap:7px;align-items:center;padding:9px;border:1px solid rgba(191,106,84,.26);border-left:4px solid var(--clay);border-radius:8px;background:#fffaf2c7}.initialization-editor-row.provided{border-color:#1f7a533d;border-left-color:var(--accent)}.initialization-editor-row label{overflow-wrap:anywhere;font-weight:700}.initialization-editor-row input,.initialization-editor-row select{min-width:0;height:30px;border:1px solid rgba(183,166,150,.44);border-radius:8px;background:#ffffffc7;color:var(--ink);font:inherit}.initialization-editor-row input{padding:0 8px}.initialization-editor-row small{grid-column:1 / -1;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em}.parameter-row{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1fr) minmax(78px,.8fr);gap:6px;align-items:center}.parameter-row input,.parameter-row select{height:28px;padding:0 7px;font-size:12px}.rate-editor{display:grid;gap:6px;padding:7px;border:1px solid rgba(183,166,150,.28);border-radius:8px;background:#fcf9f4b8}.add-model-footer{position:sticky;bottom:-18px;display:flex;justify-content:flex-end;margin:2px -9px 0;padding:10px 9px;border-top:1px solid rgba(183,166,150,.34);border-radius:0 0 10px 10px;background:#fffaf2f0;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.rate-summary{color:var(--muted);font-size:11px;line-height:1.35}.rate-clock-row{display:grid;grid-template-columns:1fr 1fr;gap:6px}.rate-clock-row label{display:grid;gap:4px;color:var(--muted);font-size:11px;font-weight:700}.rate-clock-row input{min-width:0;height:28px;border:1px solid rgba(183,166,150,.44);border-radius:8px;background:#ffffffc7;color:var(--ink);font:inherit;padding:0 7px}.metric-button.danger{border-color:#bf6a546b;color:#9b3f2e;background:#fff2ecdb}@media(max-width:900px){.app-shell{grid-template-columns:1fr}.inspector{position:absolute;z-index:28;top:150px;right:16px;bottom:16px;width:min(360px,calc(100% - 32px));border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 45px var(--shadow)}.relationship-legend,.scale-controls,.floating-panel{top:150px}.scale-controls{left:220px}}@media(max-width:720px){.topbar{top:10px;left:10px;right:10px;gap:8px;padding:9px 10px}.topbar:before{display:none}.brand-block{min-width:128px}.search-box{flex-basis:100%;max-width:none;min-width:0}.metrics{margin-left:0}.relationship-legend,.scale-controls,.floating-panel{top:132px;left:10px;right:10px;width:auto}.scale-controls{top:326px}.react-flow__minimap{display:none}}.mapping-dialog-overlay{position:fixed;inset:0;z-index:1000;background:#31272161;display:flex;align-items:center;justify-content:center}.mapping-dialog{background:var(--paper);border:1px solid var(--line-strong);border-radius:10px;box-shadow:0 8px 32px var(--shadow);width:360px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:0;overflow:hidden}.mapping-dialog-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;border-bottom:1px solid var(--line)}.mapping-dialog-header .eyebrow{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}.mapping-dialog-body{padding:14px 16px;display:flex;flex-direction:column;gap:14px}.mapping-port-summary{display:flex;align-items:center;gap:8px;background:var(--paper-strong);border:1px solid var(--line);border-radius:6px;padding:10px 12px}.mapping-port{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}.mapping-port small{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.mapping-port strong{font-size:12px;font-weight:700;color:var(--accent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mapping-port span{font-size:11px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mapping-port.target strong{color:var(--clay)}.mapping-arrow{font-size:18px;color:var(--muted);flex-shrink:0}.mapping-mode-section{display:flex;flex-direction:column;gap:6px}.mapping-mode-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-bottom:2px}.mapping-radio{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer;padding:4px 0}.mapping-radio input[type=radio]{accent-color:var(--accent);width:14px;height:14px;flex-shrink:0}.mapping-scale-picker{display:flex;flex-direction:column;gap:4px}.mapping-checkbox{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer;padding:2px 0}.mapping-checkbox input[type=checkbox]{accent-color:var(--accent);width:14px;height:14px;flex-shrink:0}.mapping-dialog-footer{display:flex;justify-content:flex-end;gap:8px;padding:10px 16px 14px;border-top:1px solid var(--line)}.accent-button{background:var(--accent);color:#fff;border-color:transparent}.accent-button:hover:not(:disabled){background:var(--sage-dark);border-color:transparent} diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 559aa6705..cd68b8a4a 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -4,8 +4,8 @@ PlantSimEngine Dependency Graph - - + +
diff --git a/frontend/e2e/graph-editor.spec.ts b/frontend/e2e/graph-editor.spec.ts index 5077a896c..5991ee8ec 100644 --- a/frontend/e2e/graph-editor.spec.ts +++ b/frontend/e2e/graph-editor.spec.ts @@ -1,8 +1,9 @@ import { expect, test, type APIRequestContext, type Locator, type Page } from "@playwright/test"; -import type { GraphEditorState, GraphNodeData } from "../src/types"; +import { copyFile } from "node:fs/promises"; +import type { ApplicationGraphNode, EditorState } from "../src/types"; import { startGraphEditorServer, type GraphEditorServer } from "./graphEditorServer"; -test.describe.serial("PlantSimEngine graph editor", () => { +test.describe.serial("PlantSimEngine model graph editor", () => { let server: GraphEditorServer; test.beforeAll(async () => { @@ -13,99 +14,230 @@ test.describe.serial("PlantSimEngine graph editor", () => { await server?.stop(); }); - test("starts a real Julia editor session", async ({ page, request }) => { + test("starts empty and adds an object", async ({ page, request }) => { await page.goto(server.url); + await expect(page.getByText("Model Graph")).toBeVisible(); - await expect(page.getByText("Dependency Graph")).toBeVisible(); - - const state = await getState(request, server.url); + let state = await getState(request, server.url); expect(state.ok).toBe(true); - expect(state.graph.cyclic).toBe(false); - expect(state.graph.nodes.some((node) => node.modelType.includes("ToyLAIModel"))).toBe(true); - expect(state.graph.nodes.some((node) => node.modelType.includes("Beer"))).toBe(true); + expect(state.graph.metadata.objectCount).toBe(0); + expect(state.graph.metadata.applicationCount).toBe(0); + + await page.getByTestId("add-object").click(); + await page.getByTestId("object-id").fill("leaf"); + await page.locator(".object-form label", { hasText: "Scale" }).getByRole("textbox").fill("Leaf"); + await page.locator(".object-form label", { hasText: "Kind" }).getByRole("textbox").fill("organ"); + await page.locator(".object-form label", { hasText: "Name" }).getByRole("textbox").fill("leaf"); + await page.getByTestId("object-submit").click(); + + state = await waitForState(request, server.url, (value) => value.graph.metadata.objectCount === 1); + expect(state.graph.objects[0].scale).toBe("Leaf"); + }); + + test("adds and updates an application", async ({ page, request }) => { + await page.goto(server.url); + await openAddApplication(page, "Beer"); + await page.getByTestId("application-name").fill("light"); + await page.getByTestId("application-param-k").fill("0.5"); + await page.getByTestId("application-target-preview").click(); + await expect(page.getByTestId("application-target-preview-result")).toContainText("1 target object"); + await page.getByTestId("application-submit").click(); + + let state = await waitForState(request, server.url, (value) => value.graph.metadata.applicationCount === 1); + let light = findApplication(state, "light"); + expect(light.modelName).toContain("Beer"); + + await page.getByTestId("application-node-light").click(); + await page.getByRole("button", { name: "Edit application" }).click(); + await page.getByTestId("application-param-k").fill("0.8"); + await page.getByTestId("application-cadence-mode").selectOption("period"); + await page.getByTestId("application-cadence-value").fill("2"); + await page.getByTestId("application-cadence-unit").selectOption("Hour"); + await page.getByTestId("application-submit").click(); + + state = await waitForState(request, server.url, (value) => findApplication(value, "light").modelParameters.k?.value === 0.8); + light = findApplication(state, "light"); + expect(light.targetIds).toEqual(["leaf"]); + expect(light.cadence).toMatchObject({ mode: "period", value: 2, unit: "Hour" }); }); - test("updates, adds, maps, removes, creates a cycle, and breaks it", async ({ page, request }) => { + test("static viewer opens the inspector without an editor connection", async ({ page }) => { + const url = new URL(server.url); + url.pathname = "/static"; + await page.goto(url.toString()); + await expect(page.getByTestId("application-node-light")).toBeVisible(); + await page.getByTestId("application-node-light").click(); + await expect(page.locator(".model-inspector")).toContainText("light"); + await expect(page.getByText("Edit application")).toHaveCount(0); + }); + + test("creates and breaks a cycle directly in the graph", async ({ page, request }) => { await page.goto(server.url); + await page.getByTestId("port-input-LAI").getByRole("button").click(); + await page.locator(".candidate-card", { hasText: "ReebE2E" }).click(); + await expect(page.getByTestId("application-form")).toBeVisible(); + await page.getByTestId("application-name").fill("reeb"); + await page.getByTestId("application-submit").click(); + + let state = await waitForState(request, server.url, (value) => value.graph.metadata.cyclic === true); + expect(state.graph.edges.filter((edge) => edge.cycle && edge.projection === "applications")).toHaveLength(2); + await expect(page.getByTestId("cycle-callout")).toBeVisible(); - const beer = await findNode(request, server.url, (node) => node.modelType.includes("Beer")); - await openInspectorPanel(page); - await page.getByTestId(`model-node-${beer.scale}-${beer.process}`).click(); - await expect(page.getByTestId("existing-model-editor")).toBeVisible(); - await page.getByTestId("edit-param-k").fill("0.8"); - await page.getByTestId("update-model-submit").click(); - await waitForState(request, server.url, (state) => { - const updated = state.graph.nodes.find((node) => node.process === beer.process && node.scale === beer.scale); - return updated?.modelParameters?.k?.value === "0.8"; - }); - - await openAddModelPanel(page); - await page.getByTestId("add-model-scale").selectOption("Default"); - await selectOptionContaining(page.getByTestId("add-model-type"), "ToyDegreeDaysCumulModel"); - await page.getByTestId("add-model-submit").click(); - const degreeDays = await waitForNode(request, server.url, (node) => node.modelType.includes("ToyDegreeDaysCumulModel")); - - await openInspectorPanel(page); - await page.getByTestId(`model-node-${degreeDays.scale}-${degreeDays.process}`).click(); - await page.getByTestId("remove-model-submit").click(); - await waitForState(request, server.url, (state) => - !state.graph.nodes.some((node) => node.modelType.includes("ToyDegreeDaysCumulModel")) - ); - - await openAddModelPanel(page); - await page.getByTestId("add-model-scale").selectOption("Default"); - await selectOptionContaining(page.getByTestId("add-model-type"), "ToyDegreeDaysCumulModel"); - await page.getByTestId("add-model-submit").click(); - const mappedDegreeDays = await waitForNode(request, server.url, (node) => node.modelType.includes("ToyDegreeDaysCumulModel")); - - const lai = await findNode(request, server.url, (node) => node.modelType.includes("ToyLAIModel")); - await openInspectorPanel(page); - await page.getByTestId(`port-input-${lai.scale}-${lai.process}-TT_cu`).click(); - await expect(page.getByTestId("mapping-source-output")).toBeVisible(); - await selectOptionContaining(page.getByTestId("mapping-source-output"), `${mappedDegreeDays.scale}.${mappedDegreeDays.process}.TT_cu`); - await page.getByTestId("mapping-apply").click(); - await waitForState(request, server.url, (state) => state.ok && !state.graph.cyclic); - - await openAddModelPanel(page); - await page.getByTestId("add-model-scale").selectOption("Default"); - await selectOptionContaining(page.getByTestId("add-model-type"), "ReebE2E"); - await page.getByTestId("add-param-k").fill("0.6"); - await page.getByTestId("add-model-submit").click(); - - await waitForState(request, server.url, (state) => state.graph.cyclic === true); - await expect(page.getByTestId("cycle-break-prompt")).toBeVisible(); - await expect(page.locator(".react-flow__edge.cycle_edge")).toHaveCount(2); - - await page.getByTestId("cycle-break-choose").click(); - await expect(page.locator(".port-cycle-break-button")).not.toHaveCount(0); - await page.locator(".port-cycle-break-button").first().click(); - - await waitForState(request, server.url, (state) => - state.graph.cyclic === false && state.mappingCode.includes("PreviousTimeStep(:") - ); - await expect(page.getByTestId("cycle-break-prompt")).toHaveCount(0); - - await page.getByTestId("toolbar-mapping-code").click(); - await expect(page.getByTestId("mapping-code")).toHaveValue(/PreviousTimeStep\(:/); + await page.getByTestId("choose-cycle-break").click(); + const scissors = page.locator("[data-testid^='cycle-break-']").first(); + await expect(scissors).toBeVisible(); + await scissors.click(); + await expect(page.getByTestId("cycle-break-dialog")).toBeVisible(); + const initialization = page.getByTestId("cycle-break-dialog").getByRole("textbox"); + if (await initialization.count()) await initialization.fill("0.0"); + await page.getByTestId("confirm-cycle-break").click(); + + state = await waitForState(request, server.url, (value) => value.graph.metadata.cyclic === false); + expect(state.graph.edges.some((edge) => edge.kind === "previous_timestep")).toBe(true); + expect(state.modelCode).toContain("PreviousTimeStep"); + }); + + test("connects another consumer and supports undo, redo, remove, and save", async ({ page, request }, testInfo) => { + await page.goto(server.url); + await page.getByTestId("configure-environment").click(); + await page.getByTestId("scene-environment").selectOption("environment:weather"); + await page.getByTestId("environment-submit").click(); + await waitForState(request, server.url, (value) => value.graph.metadata.sceneEnvironmentId === "environment:weather"); + await openAddApplication(page, "E2EConsumer"); + await page.getByTestId("application-name").fill("consumer"); + await page.getByTestId("application-submit").click(); + await waitForState(request, server.url, (value) => value.graph.applications.some((application) => application.applicationId === "consumer")); + + await page.getByTestId("application-node-light").click(); + await page.getByTestId("configure-application").click(); + await page.getByTestId("call-name").fill("consumer_call"); + await page.getByTestId("call-target").selectOption("consumer"); + await page.getByTestId("add-call-binding").click(); + await waitForState(request, server.url, (value) => value.graph.metadata.callCount === 1); + await page.getByTestId("environment-backend").selectOption("scene"); + await page.getByTestId("environment-provider").fill("model"); + await page.getByTestId("apply-environment").click(); + let state = await waitForState(request, server.url, (value) => findApplication(value, "light").environment?.provider === "model"); + expect(state.graph.edges.some((edge) => edge.kind === "manual_call" && edge.call === "consumer_call")).toBe(true); + await page.getByRole("button", { name: "Done" }).click(); + + await page.getByTestId("port-output-aPPFD").first().getByRole("button").click(); + await page.locator(".candidate-card.existing", { hasText: "consumer" }).click(); + await expect(page.getByTestId("binding-form")).toBeVisible(); + await page.getByTestId("binding-preview-button").click(); + await expect(page.getByTestId("binding-preview")).toContainText("resolved binding"); + await page.getByTestId("binding-submit").click(); + state = await waitForState(request, server.url, (value) => value.graph.edges.some((edge) => edge.targetApplicationId === "consumer" && edge.targetVariable === "aPPFD")); + expect(state.graph.metadata.applicationCount).toBe(3); + + await page.getByTestId("application-node-light").click(); + await page.getByTestId("configure-application").click(); + await page.getByTitle("Remove consumer_call call").click(); + await waitForState(request, server.url, (value) => value.graph.metadata.callCount === 0); + await page.getByRole("button", { name: "Done" }).click(); + + await page.getByTestId("application-node-consumer").click(); + await page.getByRole("button", { name: "Remove application" }).click(); + await waitForState(request, server.url, (value) => !value.graph.applications.some((application) => application.applicationId === "consumer")); + await page.getByRole("button", { name: "Undo" }).click(); + await waitForState(request, server.url, (value) => value.graph.applications.some((application) => application.applicationId === "consumer")); + await page.getByRole("button", { name: "Redo" }).click(); + await waitForState(request, server.url, (value) => !value.graph.applications.some((application) => application.applicationId === "consumer")); + + const savePath = testInfo.outputPath("model.jl"); + await page.getByTestId("save-model").click(); + await page.getByPlaceholder("/absolute/path/to/model.jl").fill(savePath); + await page.locator(".model-file-dialog").getByRole("button", { name: "Save", exact: true }).click(); + state = await waitForState(request, server.url, (value) => value.savePath === savePath); + expect(state.recentPaths).toContain(savePath); + }); + + test("mounts one template twice, configures an override and environment, then reopens with undo and redo", async ({ page, request }, testInfo) => { + await page.goto(server.url); + await addObject(page, "plant_a", "Plant", "plant", "plant_a"); + await addObject(page, "plant_b", "Plant", "plant", "plant_b"); + await waitForState(request, server.url, (value) => value.graph.objects.some((object) => object.objectId === "plant_b")); + + for (const plant of ["plant_a", "plant_b"]) { + await page.getByTestId("add-instance").click(); + await page.getByTestId("instance-template").selectOption("catalog:plant"); + await page.getByTestId("instance-name").fill(plant); + await page.getByTestId("instance-root").selectOption(plant); + await page.getByTestId("instance-preview-button").click(); + await expect(page.getByTestId("instance-preview")).toContainText("1 claimed object"); + await page.getByTestId("instance-submit").click(); + await waitForState(request, server.url, (value) => value.graph.instances.some((instance) => instance.name === plant)); + } + + let state = await getState(request, server.url); + expect(findApplication(state, "plant_a__template_source").targetIds).toEqual(["plant_a"]); + expect(findApplication(state, "plant_b__template_source").targetIds).toEqual(["plant_b"]); + + await page.getByTestId("application-node-plant_b__template_source").click(); + await page.getByRole("button", { name: "Create override" }).click(); + await page.getByTestId("application-param-coefficient").fill("2.0"); + await page.getByRole("button", { name: "Apply override" }).click(); + state = await waitForState(request, server.url, (value) => findApplication(value, "plant_b__template_source").modelParameters.coefficient?.value === 2); + expect(findApplication(state, "plant_a__template_source").modelParameters.coefficient?.value).toBe(1); + + await page.getByTestId("configure-environment").click(); + await page.getByTestId("scene-environment").selectOption("environment:weather"); + await page.getByTestId("environment-submit").click(); + await waitForState(request, server.url, (value) => value.graph.metadata.sceneEnvironmentId === "environment:weather"); + + await page.getByTestId("application-node-plant_a__template_source").click(); + await page.getByTestId("configure-application").click(); + await page.getByTestId("environment-backend").selectOption("environment:canopy"); + await page.getByTestId("environment-provider").fill("canopy_cells"); + await page.getByTestId("environment-source-T").fill("air_temperature"); + await page.getByTestId("environment-sink").fill("canopy_state"); + await page.getByTestId("apply-environment").click(); + state = await waitForState(request, server.url, (value) => findApplication(value, "plant_a__template_source").environment?.sources.T === "air_temperature"); + expect(findApplication(state, "plant_b__template_source").environment?.backendId).toBe("environment:canopy"); + await page.getByRole("button", { name: "Done" }).click(); + + const savePath = testInfo.outputPath("multi-plant-model.jl"); + await page.getByTestId("save-model").click(); + await page.getByPlaceholder("/absolute/path/to/model.jl").fill(savePath); + await page.locator(".model-file-dialog").getByRole("button", { name: "Save", exact: true }).click(); + await waitForState(request, server.url, (value) => value.savePath === savePath); + const reopenPath = testInfo.outputPath("multi-plant-reopen-model.jl"); + await copyFile(savePath, reopenPath); + + await page.getByRole("button", { name: "Objects" }).click(); + await page.locator(".entity-node.instance", { hasText: "plant_b" }).click(); + await page.getByRole("button", { name: "Unmount instance" }).click(); + await waitForState(request, server.url, (value) => value.graph.instances.length === 1); + + await page.getByTestId("open-model").click(); + await page.getByPlaceholder("/absolute/path/to/model.jl").fill(reopenPath); + await page.locator(".model-file-dialog").getByRole("button", { name: "Open", exact: true }).click(); + await waitForState(request, server.url, (value) => value.graph.instances.length === 2); + await page.getByRole("button", { name: "Undo" }).click(); + await waitForState(request, server.url, (value) => value.graph.instances.length === 1); + await page.getByRole("button", { name: "Redo" }).click(); + await waitForState(request, server.url, (value) => value.graph.instances.length === 2); }); }); -async function openInspectorPanel(page: Page) { - await page.getByTestId("toolbar-add-model").click(); - await page.getByTestId("toolbar-inspector").click(); +async function openAddApplication(page: Page, modelName: string) { + await page.getByTestId("add-application").click(); + await selectOptionContaining(page.getByTestId("application-model-select"), modelName); } -async function openAddModelPanel(page: Page) { - await page.getByTestId("toolbar-add-model").click(); - await expect(page.getByTestId("add-model-panel")).toBeVisible(); +async function addObject(page: Page, id: string, scale: string, kind: string, name: string) { + await page.getByTestId("add-object").click(); + await page.getByTestId("object-id").fill(id); + await page.locator(".object-form label", { hasText: "Scale" }).getByRole("textbox").fill(scale); + await page.locator(".object-form label", { hasText: "Kind" }).getByRole("textbox").fill(kind); + await page.locator(".object-form label", { hasText: "Name" }).getByRole("textbox").fill(name); + await page.getByTestId("object-submit").click(); } -async function getState(request: APIRequestContext, baseURL: string): Promise { +async function getState(request: APIRequestContext, baseURL: string): Promise { const response = await request.get(stateURL(baseURL)); - if (!response.ok()) { - throw new Error(`Expected /state to return 2xx, got ${response.status()}:\n${await response.text()}`); - } - return await response.json() as GraphEditorState; + expect(response.ok()).toBe(true); + return await response.json() as EditorState; } function stateURL(baseURL: string): string { @@ -117,48 +249,28 @@ function stateURL(baseURL: string): string { return url.toString(); } -async function waitForState( - request: APIRequestContext, - baseURL: string, - predicate: (state: GraphEditorState) => boolean, - timeoutMs = 15_000, -): Promise { +async function waitForState(request: APIRequestContext, baseURL: string, predicate: (state: EditorState) => boolean, timeoutMs = 20_000): Promise { const deadline = Date.now() + timeoutMs; let latest = await getState(request, baseURL); while (Date.now() < deadline) { if (predicate(latest)) return latest; - await new Promise((resolve) => setTimeout(resolve, 250)); + await new Promise((resolve) => setTimeout(resolve, 200)); latest = await getState(request, baseURL); } - throw new Error(`Timed out waiting for editor state. Latest state:\n${JSON.stringify(latest, null, 2)}`); -} - -async function findNode( - request: APIRequestContext, - baseURL: string, - predicate: (node: GraphNodeData) => boolean, -): Promise { - const state = await getState(request, baseURL); - const node = state.graph.nodes.find(predicate); - expect(node, `Expected graph node in ${state.graph.nodes.map((item) => item.modelType).join(", ")}`).toBeTruthy(); - return node!; + throw new Error(`Timed out waiting for editor state:\n${JSON.stringify(latest, null, 2)}`); } -async function waitForNode( - request: APIRequestContext, - baseURL: string, - predicate: (node: GraphNodeData) => boolean, -): Promise { - const state = await waitForState(request, baseURL, (candidate) => candidate.graph.nodes.some(predicate)); - return state.graph.nodes.find(predicate)!; +function findApplication(state: EditorState, id: string): ApplicationGraphNode { + const application = state.graph.applications.find((item) => item.applicationId === id); + expect(application, `Expected application ${id}`).toBeTruthy(); + return application!; } async function selectOptionContaining(select: Locator, text: string) { const value = await select.evaluate((element, needle) => { const selectElement = element as HTMLSelectElement; - const option = [...selectElement.options].find((item) => item.textContent?.includes(needle)); - return option?.value ?? null; + return [...selectElement.options].find((option) => option.textContent?.includes(needle))?.value ?? null; }, text); - expect(value, `Expected select option containing ${text}`).toBeTruthy(); + expect(value, `Expected option containing ${text}`).toBeTruthy(); await select.selectOption(value!); } diff --git a/frontend/src/App.test.ts b/frontend/src/App.test.ts new file mode 100644 index 000000000..9a32749a9 --- /dev/null +++ b/frontend/src/App.test.ts @@ -0,0 +1,77 @@ +import { describe, expect, it } from "vitest"; +import { applicationPortId, applicationsForPort, deriveCandidatePortIds, endpointsForCandidate, modelsForPort, objectSubtreeIds, selectorSuggestion } from "./App"; +import type { ApplicationGraphNode, GraphPort, ModelDescriptor, ObjectGraphNode, ModelGraphView } from "./types"; + +const output: GraphPort = { id: applicationPortId("source", "output", "signal"), name: "signal", role: "output", default: 0, defaultJulia: "0", expectedType: "Int" }; +const input: GraphPort = { id: applicationPortId("consumer", "input", "signal"), name: "signal", role: "input", default: 0, defaultJulia: "0", expectedType: "Int" }; + +const source = application("source", [], [output], ["leaf"]); +const consumer = application("consumer", [input], [], ["leaf"]); + +describe("candidate composition", () => { + it("keeps plus controls for exact existing-application matches", () => { + const graph = graphView([source, consumer], []); + const ids = deriveCandidatePortIds(graph); + expect(ids.has(output.id)).toBe(true); + expect(ids.has(input.id)).toBe(true); + }); + + it("matches model descriptors by exact declared variable name", () => { + const exact = model("Exact", { signal: 0 }, {}); + const near = model("Near", { Signal: 0 }, {}); + expect(modelsForPort([near, exact], output).map((item) => item.name)).toEqual(["Exact"]); + }); + + it("separates existing applications and produces directed binding endpoints", () => { + const candidate = { application: source, port: output, x: 0, y: 0 }; + expect(applicationsForPort([source, consumer], candidate)).toEqual([consumer]); + const endpoints = endpointsForCandidate(candidate, consumer); + expect(endpoints.sourceApplication.applicationId).toBe("source"); + expect(endpoints.targetApplication.applicationId).toBe("consumer"); + expect(endpoints.targetPort.name).toBe("signal"); + }); +}); + +describe("selector suggestions", () => { + it("suggests a conservative target selector from one application", () => { + const suggestion = selectorSuggestion(source); + expect(suggestion.multiplicity).toBe("one"); + expect(suggestion.criteria.scale).toBe("Leaf"); + }); +}); + +describe("object topology scoping", () => { + it("includes the selected object and all descendants", () => { + const objects: ObjectGraphNode[] = [ + object("plant", null), + object("leaf", "object:plant"), + object("cell", "object:leaf"), + object("soil", null), + ]; + expect(new Set(objectSubtreeIds(objects, "plant"))).toEqual(new Set(["plant", "leaf", "cell"])); + }); +}); + +function application(id: string, inputs: GraphPort[], outputs: GraphPort[], targetIds: unknown[]): ApplicationGraphNode { + return { + id: `application:${id}`, applicationId: id, owner: { scope: "global", applicationId: id, instance: null, templateId: null }, name: id, process: id, modelType: id, modelName: id, module: "Main", package: null, + modelParameters: {}, selector: { type: "One", multiplicity: "one", criteria: { selectors: [], scale: "Leaf" }, julia: "" }, + targetIds, targetCount: targetIds.length, targetScales: ["Leaf"], targetKinds: [], targetSpecies: [], targetInstances: [], cadence: { mode: "default", value: null, unit: null, julia: "nothing" }, clock: null, + inputs, outputs, environmentInputs: [], environmentOutputs: [], inputBindings: {}, callBindings: {}, environment: null, environmentBindings: {}, environmentWindow: { mode: "default", value: null, unit: null, julia: "nothing" }, outputRouting: {}, updates: [], modelStorage: "shared_application", objectOverrides: [], + }; +} + +function model(name: string, inputs: Record, outputs: Record): ModelDescriptor { + return { type: name, name, module: "Main", package: null, process: name, processType: name, inputs, outputs, environmentInputs: {}, environmentOutputs: {}, constructor: { fields: [], parameterGroups: {}, hasZeroArgConstructor: true, constructible: true } }; +} + +function object(id: string, parent: string | null): ObjectGraphNode { + return { id: `object:${id}`, objectId: id, scale: null, kind: null, species: null, name: id, instance: null, parent, children: [], hasGeometry: false, hasStatus: false }; +} + +function graphView(applications: ApplicationGraphNode[], modelLibrary: ModelDescriptor[]): ModelGraphView { + return { + schemaVersion: 2, level: "applications", metadata: { title: "", modelRevision: 0, objectCount: 1, instanceCount: 0, applicationCount: applications.length, executionCount: applications.length, bindingCount: 0, callCount: 0, unresolvedInitializationCount: 0, cyclic: false, strictlyCompiled: true, sceneEnvironmentId: null }, + objects: [], templates: [], instances: [], applications, executions: [], edges: [], modelLibrary, environments: [], initialization: [], diagnostics: [], cycles: [], availableActions: [], + }; +} diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e954a2a86..4f1c646e4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,2711 +1,1057 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react"; +import { useCallback, useEffect, useMemo, useState } from "react"; import { Background, Controls, + MarkerType, MiniMap, ReactFlow, - MarkerType, useEdgesState, useNodesState, type Connection, type Edge, type Node, - type ReactFlowInstance, } from "@xyflow/react"; import "@xyflow/react/dist/style.css"; import { AlertTriangle, + Boxes, CircleAlert, - Filter, + Code2, + GitBranch, FolderOpen, - GitPullRequestArrow, + Layers3, Network, - RotateCcw, - Route, - ScissorsLineDashed, + Plus, + Scissors, Search, + Save, + Undo2, + Redo2, X, } from "lucide-react"; +import { ApplicationForm, type ApplicationFormValue } from "./ApplicationForm"; +import { ApplicationConfigurationForm } from "./ApplicationConfigurationForm"; +import { BindingForm, type BindingEndpoints, type BindingFormValue } from "./BindingForm"; +import { EnvironmentForm } from "./EnvironmentForm"; +import { InstanceForm, type InstanceFormValue } from "./InstanceForm"; +import { ObjectForm, type ObjectFormValue } from "./ObjectForm"; +import { OverrideForm, type OverrideFormValue } from "./OverrideForm"; +import { ApplicationNode, EntityNode } from "./ModelNode"; import { DependencyEdge } from "./DependencyEdge"; -import { ModelNode } from "./ModelNode"; import { layoutGraph, type LayoutMode } from "./layout"; -import { sampleGraph } from "./sampleGraph"; -import type { DependencyGraphView, GraphEdgeData, GraphEditorState, GraphNodeData, GraphPort, InitializationDescriptor, ModelDescriptor, RuntimeGraphNodeData } from "./types"; +import { sampleModelGraph } from "./sampleModelGraph"; +import type { + ApplicationGraphNode, + DetailMode, + EditorState, + EnvironmentDescriptor, + EnvironmentGraphNode, + ExecutionGraphNode, + GraphPort, + GraphViewMode, + InstanceDescriptor, + InstancePreview, + ModelDescriptor, + ObjectGraphNode, + RuntimeApplicationNode, + RuntimeEntityNode, + ModelGraphEdge, + ModelGraphView, + ModelRootDescriptor, + SelectorPreview, + TemplateDescriptor, + TargetPreview, +} from "./types"; import "./styles.css"; -type EdgeFilterKey = "dataFlow" | "mapped" | "callStack"; -type EdgeFilters = Record; -type FocusMode = "none" | "upstream" | "downstream" | "neighborhood"; -type SidePanel = "inspector" | "add_model" | "initializations" | "mapping_code" | null; -type GraphViewMode = "overview" | "detail"; - -type PendingMappingConnection = { - sourceNode: GraphNodeData; - sourcePort: GraphPort; - targetNode: GraphNodeData; - targetPort: GraphPort; -}; - -type CandidatePopover = { - portId: string; - anchor: { x: number; y: number }; -}; - -type AddModelSelection = { - modelType: string; - scale: string; - requestId: number; -}; - -type SearchResult = { - id: string; - kind: "model" | "input" | "output"; - node: GraphNodeData; - port?: GraphPort; - label: string; - detail: string; -}; - -type RequiredInput = { - node: GraphNodeData; - port: GraphPort; - reason: "previous_time_step" | "mapped_unresolved" | "user_initialization"; -}; - -type CycleBreakOption = { - edge: GraphEdgeData; - node: GraphNodeData; - port: GraphPort; -}; - -type ValidationWarning = { - id: string; - severity: "error" | "warning" | "info"; - category: "init" | "mapping" | "ownership" | "hard_dependency" | "cross_scale"; - title: string; - detail: string; - nodeId?: string; - nodeIds?: string[]; - portId?: string; - portIds?: string[]; - edgeId?: string; -}; - -type FocusState = { - active: boolean; - edges: Set; - nodes: Set; - ports: Set; -}; - -const nodeTypes = { model: ModelNode }; -const edgeTypes = { dependency: DependencyEdge }; -const edgeColors = { - base: "#a99a8c", - accent: "#1f7a53", - mapped: "#4f8d69", - hard: "#bf6a54", -}; - -const defaultEdgeFilters: EdgeFilters = { - dataFlow: true, - mapped: true, - callStack: true, -}; - -const focusLabels: Record = { - none: "No focus", - upstream: "Upstream", - downstream: "Downstream", - neighborhood: "Both", -}; - -const layoutLabels: Record = { - data_flow: "Data-flow", - compact: "Compact", - scale_grouped: "Scale grouped", - call_stack: "Call stack", - overview: "Overview", +type FlowNode = Node; +type FlowEdge = Edge; +type CandidatePopover = { port: GraphPort; application: ApplicationGraphNode; x: number; y: number }; +type CycleBreakSelection = { application: ApplicationGraphNode; port: GraphPort }; +type InspectorSelection = ApplicationGraphNode | TemplateDescriptor | InstanceDescriptor | ObjectGraphNode | ExecutionGraphNode | EnvironmentDescriptor | EnvironmentGraphNode | ModelRootDescriptor | ModelGraphEdge | null; +type GraphScopeFilter = { label: string; objectIds: unknown[] }; +type ApplicationFormState = { + mode: "add" | "update"; + application?: ApplicationGraphNode; + initialModelType?: string; + suggestedSelector?: ApplicationGraphNode["selector"]; }; +type ObjectFormState = { mode: "add" | "update"; object?: ObjectGraphNode }; -const valueTypeChoices = ["float", "integer", "boolean", "symbol", "string", "nothing", "julia"]; +const nodeTypes = { application: ApplicationNode, entity: EntityNode }; +const edgeTypes = { modelEdge: DependencyEdge }; export default function App() { - const [graph, setGraph] = useState(loadInitialGraph()); - const [editorModels, setEditorModels] = useState([]); - const [editorSocket, setEditorSocket] = useState(null); - const [editorConnected, setEditorConnected] = useState(false); + const [graph, setGraph] = useState(loadInitialGraph); + const [view, setView] = useState(() => loadInitialGraph().level); + const [detailMode, setDetailMode] = useState(() => loadInitialGraph().metadata.applicationCount > 24 ? "overview" : "detail"); + const [query, setQuery] = useState(""); + const [selected, setSelected] = useState(null); + const [scopeFilter, setScopeFilter] = useState(null); + const [selectedPort, setSelectedPort] = useState(null); + const [candidate, setCandidate] = useState(null); + const [showDiagnostics, setShowDiagnostics] = useState(false); + const [showInitialization, setShowInitialization] = useState(false); + const [showModelCode, setShowModelCode] = useState(false); + const [showOpen, setShowOpen] = useState(false); + const [showSave, setShowSave] = useState(false); + const [modelCode, setSceneCode] = useState(""); + const [autosavePath, setAutosavePath] = useState(null); + const [savePath, setSavePath] = useState(null); + const [recentPaths, setRecentPaths] = useState([]); + const [socket, setSocket] = useState(null); + const [connected, setConnected] = useState(false); const [canUndo, setCanUndo] = useState(false); const [canRedo, setCanRedo] = useState(false); - const [activePanel, setActivePanel] = useState(() => loadEditorConfig()?.websocketUrl ? "inspector" : null); - const [mappingCode, setMappingCode] = useState(""); - const [initializations, setInitializations] = useState([]); - const [lastSavedPath, setLastSavedPath] = useState(null); - const [saveTargetPath, setSaveTargetPath] = useState(null); - const [autosavePath, setAutosavePath] = useState(null); - const [lastAutosavedPath, setLastAutosavedPath] = useState(null); - const [recentMappings, setRecentMappings] = useState([]); - const [editorFeedback, setEditorFeedback] = useState<{ kind: "error" | "info"; text: string } | null>(null); - const [savePath, setSavePath] = useState("mapping.generated.jl"); - const [customScales, setCustomScales] = useState([]); - const [selected, setSelected] = useState(null); - const [activePort, setActivePort] = useState(null); - const [pendingConnection, setPendingConnection] = useState(null); - const [showRequiredPanel, setShowRequiredPanel] = useState(false); - const [showWarningsPanel, setShowWarningsPanel] = useState(false); - const [showOpenPanel, setShowOpenPanel] = useState(false); - const [showRelationshipsPanel, setShowRelationshipsPanel] = useState(false); - const [showScalesPanel, setShowScalesPanel] = useState(false); - const [showSearchResults, setShowSearchResults] = useState(false); - const [searchQuery, setSearchQuery] = useState(""); - const [layoutMode, setLayoutMode] = useState("data_flow"); - const [focusMode, setFocusMode] = useState("neighborhood"); - const [viewMode, setViewMode] = useState(() => defaultGraphViewMode(loadInitialGraph())); - const [viewModeTouched, setViewModeTouched] = useState(false); - const [edgeFilters, setEdgeFilters] = useState(defaultEdgeFilters); - const [collapsedScales, setCollapsedScales] = useState>(() => new Set()); - const [pinnedFocus, setPinnedFocus] = useState(null); - const [selectedEdge, setSelectedEdge] = useState(null); + const [feedback, setFeedback] = useState(null); + const [applicationForm, setApplicationForm] = useState(null); + const [targetPreview, setTargetPreview] = useState(null); + const [showInstanceForm, setShowInstanceForm] = useState(false); + const [instancePreview, setInstancePreview] = useState(null); + const [showEnvironmentForm, setShowEnvironmentForm] = useState(false); + const [objectForm, setObjectForm] = useState(null); + const [overrideApplication, setOverrideApplication] = useState(null); + const [configurationApplicationId, setConfigurationApplicationId] = useState(null); + const [bindingForm, setBindingForm] = useState(null); + const [bindingPreview, setBindingPreview] = useState(null); const [cycleBreakMode, setCycleBreakMode] = useState(false); - const [candidatePopover, setCandidatePopover] = useState(null); - const [addModelSelection, setAddModelSelection] = useState(null); - const [addModelFocusRequest, setAddModelFocusRequest] = useState(0); - const [highlightAddModelPanel, setHighlightAddModelPanel] = useState(false); - const [flowInstance, setFlowInstance] = useState, Edge> | null>(null); - const [nodes, setNodes, onNodesChange] = useNodesState>([]); - const [edges, setEdges, onEdgesChange] = useEdgesState>([]); - const sidePanelRef = useRef(null); - - const nodeById = useMemo(() => new Map(graph.nodes.map((node) => [node.id, node])), [graph]); - const portById = useMemo(() => buildPortIndex(graph), [graph]); - const incomingByPort = useMemo(() => groupEdgesByPort(graph.edges, "targetPort"), [graph.edges]); - const outgoingByPort = useMemo(() => groupEdgesByPort(graph.edges, "sourcePort"), [graph.edges]); - const requiredInputPortIds = useMemo(() => deriveRequiredInputPorts(graph), [graph]); - const candidatePortIds = useMemo(() => deriveCandidatePortIds(graph, editorModels, incomingByPort), [editorModels, graph, incomingByPort]); - const requiredInputs = useMemo(() => deriveRequiredInputs(graph, requiredInputPortIds, incomingByPort), [graph, incomingByPort, requiredInputPortIds]); - const warningItems = useMemo(() => deriveValidationWarnings(graph, requiredInputPortIds, incomingByPort), [graph, incomingByPort, requiredInputPortIds]); - const actionableWarningItems = useMemo(() => warningItems.filter((item) => item.severity !== "info"), [warningItems]); - const searchResults = useMemo(() => deriveSearchResults(graph, searchQuery), [graph, searchQuery]); - const visibleNodeData = useMemo(() => graph.nodes.filter((node) => !collapsedScales.has(node.scale)), [collapsedScales, graph.nodes]); - const editorScales = useMemo(() => { - const graphScales = graph.scales.length > 0 ? graph.scales : ["Default"]; - const merged = [...graphScales, ...customScales]; - return [...new Set(merged)]; - }, [customScales, graph.scales]); - const visibleNodeIds = useMemo(() => new Set(visibleNodeData.map((node) => node.id)), [visibleNodeData]); - const visibleEdgeData = useMemo(() => graph.edges.filter((edge) => ( - edgeMatchesFilters(edge, edgeFilters) && - visibleNodeIds.has(edge.source) && - visibleNodeIds.has(edge.target) - )), [edgeFilters, graph.edges, visibleNodeIds]); - const cycleBreakOptions = useMemo(() => deriveCycleBreakOptions(graph, nodeById, portById), [graph, nodeById, portById]); - const cycleBreakPortIds = useMemo(() => new Set(cycleBreakOptions.map((option) => option.port.id)), [cycleBreakOptions]); - const hoverHighlight = useMemo(() => deriveHighlight(graph, activePort), [activePort, graph]); - const traversalFocus = useMemo( - () => deriveFocus(graph, selected?.id ?? null, activePort, focusMode), - [activePort, focusMode, graph, selected?.id], + const [cycleBreakSelection, setCycleBreakSelection] = useState(null); + const [nodes, setNodes, onNodesChange] = useNodesState([]); + const [edges, setEdges, onEdgesChange] = useEdgesState([]); + + const editorConfig = useMemo(loadEditorConfig, []); + const applicationById = useMemo(() => new Map(graph.applications.map((application) => [application.applicationId, application])), [graph.applications]); + const unresolvedPortIds = useMemo(() => new Set( + graph.initialization + .filter((row) => row.role === "input" && row.disposition === "unresolved") + .map((row) => applicationPortId(row.applicationId, "input", row.variable)), + ), [graph.initialization]); + const previousPortIds = useMemo(() => new Set( + graph.initialization + .filter((row) => row.role === "input" && row.previousTimeStep) + .map((row) => applicationPortId(row.applicationId, "input", row.variable)), + ), [graph.initialization]); + const cyclicApplications = useMemo(() => new Set(graph.cycles.flatMap((cycle) => cycle.applicationIds)), [graph.cycles]); + const cycleBreakPortIds = useMemo(() => new Set( + graph.cycles.flatMap((cycle) => cycle.breakCandidates.map((candidate) => applicationPortId(candidate.applicationId, "input", candidate.input))), + ), [graph.cycles]); + const candidatePortIds = useMemo(() => deriveCandidatePortIds(graph), [graph]); + const candidateModels = useMemo(() => candidate ? modelsForPort(graph.modelLibrary, candidate.port) : [], [candidate, graph.modelLibrary]); + const candidateApplications = useMemo(() => candidate ? applicationsForPort(graph.applications, candidate) : [], [candidate, graph.applications]); + const portIndex = useMemo(() => { + const index = new Map(); + for (const application of graph.applications) { + for (const port of [...application.inputs, ...application.outputs]) index.set(port.id, { application, port }); + } + return index; + }, [graph.applications]); + const scopedObjectIds = useMemo( + () => scopeFilter ? new Set(scopeFilter.objectIds.map(objectKey)) : null, + [scopeFilter], ); - const focus = useMemo(() => pinnedFocus?.active ? pinnedFocus : traversalFocus, [pinnedFocus, traversalFocus]); - const activeCandidatePortId = candidatePopover?.portId ?? null; - const candidatePopoverInfo = useMemo(() => { - if (!candidatePopover) return null; - const portInfo = portById.get(candidatePopover.portId); - if (!portInfo || !candidatePortIds.has(candidatePopover.portId)) return null; - const { port } = portInfo; - const field = port.role === "input" ? "outputs" : "inputs"; - const models = editorModels - .filter((model) => Object.prototype.hasOwnProperty.call(modelVariableDeclarations(model, field), port.name)) - .sort((left, right) => left.name.localeCompare(right.name)); - if (models.length === 0) return null; - return { - anchor: candidatePopover.anchor, - node: portInfo.node, - port, - title: port.role === "input" ? "Models That Compute" : "Models That Consume", - models, - }; - }, [candidatePopover, candidatePortIds, editorModels, portById]); - - const toggleCandidatePopover = useCallback((port: GraphPort, anchor: { x: number; y: number }) => { - setActivePort(port); - setCandidatePopover((current) => current?.portId === port.id ? null : { portId: port.id, anchor }); - }, []); useEffect(() => { - const config = loadEditorConfig(); - if (!config?.websocketUrl) return; - - const socket = new WebSocket(config.websocketUrl); - setEditorSocket(socket); - socket.addEventListener("open", () => { - setEditorConnected(true); - setEditorFeedback(null); - }); - socket.addEventListener("close", () => { - setEditorConnected(false); - setEditorFeedback({ kind: "error", text: "Graph editor connection closed. Refresh the page or restart the Julia session." }); - }); - socket.addEventListener("message", (event) => { - const payload = JSON.parse(event.data) as GraphEditorState; + if (!editorConfig?.websocketUrl) return; + const nextSocket = new WebSocket(editorConfig.websocketUrl); + setSocket(nextSocket); + nextSocket.addEventListener("open", () => { setConnected(true); setFeedback(null); }); + nextSocket.addEventListener("close", () => { setConnected(false); setFeedback("Editor connection closed."); }); + nextSocket.addEventListener("message", (event) => { + const payload = JSON.parse(event.data) as EditorState; if (payload.graph) setGraph(payload.graph); - if (payload.models) setEditorModels(payload.models); - if (typeof payload.mappingCode === "string") setMappingCode(payload.mappingCode); - if (Array.isArray(payload.initializations)) setInitializations(payload.initializations); - setLastSavedPath(typeof payload.lastSavedPath === "string" ? payload.lastSavedPath : null); - setSaveTargetPath(typeof payload.saveTargetPath === "string" ? payload.saveTargetPath : null); - if (typeof payload.saveTargetPath === "string") setSavePath(payload.saveTargetPath); - setAutosavePath(typeof payload.autosavePath === "string" ? payload.autosavePath : null); - setLastAutosavedPath(typeof payload.lastAutosavedPath === "string" ? payload.lastAutosavedPath : null); - if (Array.isArray(payload.recentMappings)) setRecentMappings(payload.recentMappings); - setCanUndo(Boolean(payload.canUndo)); - setCanRedo(Boolean(payload.canRedo)); + if (typeof payload.modelCode === "string") setSceneCode(payload.modelCode); + setAutosavePath(payload.autosavePath ?? null); + setSavePath(payload.savePath ?? null); + setRecentPaths(payload.recentPaths ?? []); + if (payload.selectorPreview) setBindingPreview(payload.selectorPreview); + if (payload.targetPreview) setTargetPreview(payload.targetPreview); + if (payload.instancePreview) setInstancePreview(payload.instancePreview); if (payload.ok === false) { - const message = payload.diagnostics?.[0] ?? "Graph editor command failed."; - setEditorFeedback({ kind: "error", text: message }); - } else if (payload.diagnostics?.length) { - setEditorFeedback({ kind: "info", text: payload.diagnostics[0] }); - } else { - setEditorFeedback(null); + setBindingPreview(null); + setTargetPreview(null); + setInstancePreview(null); } + setCanUndo(Boolean(payload.canUndo)); + setCanRedo(Boolean(payload.canRedo)); + setFeedback(payload.ok === false ? payload.diagnostics?.[0] || "The edit failed." : null); }); - return () => socket.close(); - }, []); + return () => nextSocket.close(); + }, [editorConfig?.websocketUrl]); - const sendEditorCommand = useCallback((command: Record) => { - if (!editorSocket || editorSocket.readyState !== WebSocket.OPEN) { - setEditorFeedback({ kind: "error", text: "Graph editor is offline; command was not sent." }); - return; + useEffect(() => { + if (!graph.metadata.cyclic) { + setCycleBreakMode(false); + setCycleBreakSelection(null); } - editorSocket.send(JSON.stringify(command)); - }, [editorSocket]); - - const breakCycleAtPort = useCallback((port: GraphPort) => { - const target = portById.get(port.id); - if (!target || port.role !== "input") return; - sendEditorCommand({ - action: "edit", - kind: "mark_previous_timestep", - scale: target.node.scale, - process: target.node.process, - variable: port.name, - }); - setCycleBreakMode(false); - setPinnedFocus(null); - setSelectedEdge(null); - setSelected(target.node); - setActivePort(port); - }, [portById, sendEditorCommand]); + }, [graph.metadata.cyclic]); - const removeGraphModel = useCallback((node: GraphNodeData) => { - const target = removableMappingNode(node, nodeById); - if (!target) { - setEditorFeedback({ kind: "error", text: `Cannot remove ${node.process}: no owning ModelMapping model was found.` }); + const sendCommand = useCallback((command: Record) => { + if (!socket || socket.readyState !== WebSocket.OPEN) { + setFeedback("This action requires an interactive Julia editor session."); return; } - sendEditorCommand({ - action: "edit", - kind: "remove_model", - scale: target.scale, - process: target.process, - }); - setSelected((current) => current?.id === node.id || current?.id === target.id ? null : current); - setActivePort(null); - setSelectedEdge(null); - }, [nodeById, sendEditorCommand]); + socket.send(JSON.stringify(command)); + }, [socket]); - const togglePanel = useCallback((panel: Exclude) => { - setActivePanel((current) => current === panel ? null : panel); + const openCandidates = useCallback((application: ApplicationGraphNode, port: GraphPort, anchor: { x: number; y: number }) => { + setSelected(application); + setSelectedPort(port); + setCandidate({ application, port, x: anchor.x, y: anchor.y }); }, []); - const openAddModelPanel = useCallback(() => { - setActivePanel("add_model"); - setHighlightAddModelPanel(true); - setAddModelFocusRequest(Date.now()); - }, []); - - const addCustomScale = useCallback((rawScale: string) => { - const scale = rawScale.trim(); - if (!scale) return; - setCustomScales((current) => current.includes(scale) || graph.scales.includes(scale) ? current : [...current, scale]); - }, [graph.scales]); - - useEffect(() => { - if (activePanel !== "add_model" || !highlightAddModelPanel) return; - sidePanelRef.current?.scrollIntoView({ block: "nearest", inline: "nearest" }); - sidePanelRef.current?.focus({ preventScroll: true }); - const timeout = window.setTimeout(() => setHighlightAddModelPanel(false), 1800); - return () => window.clearTimeout(timeout); - }, [activePanel, highlightAddModelPanel, addModelFocusRequest]); - - useEffect(() => { - if (!viewModeTouched) setViewMode(defaultGraphViewMode(graph)); - }, [graph, viewModeTouched]); - - useEffect(() => { - const nextNodes = visibleNodeData.map((node) => ({ - id: node.id, - type: "model", - position: { x: 0, y: 0 }, - data: runtimeNodeData(node, { - activePort: null, - highlightedPortIds: new Set(), - focusedPortIds: new Set(), - requiredInputPortIds, - candidatePortIds, - cycleNodeIds: new Set(graph.cycleNodes), - cycleBreakPortIds, - cycleBreakMode, - focusedNodeIds: new Set(), - hasActiveFocus: false, - activeCandidatePortId, - setActivePort, - setCandidatePopover: toggleCandidatePopover, - breakCycleAtPort, - removeGraphModel, - viewMode, - }), - })); - const nextEdges = visibleEdgeData.map((edge) => flowEdge(edge, new Set(), new Set(), false, false)); - layoutGraph(nextNodes, nextEdges, effectiveLayoutMode(viewMode, layoutMode)).then((layouted) => { - setNodes(layouted); - setEdges(nextEdges); - }); - }, [activeCandidatePortId, breakCycleAtPort, candidatePortIds, cycleBreakMode, cycleBreakPortIds, graph.cycleNodes, layoutMode, removeGraphModel, requiredInputPortIds, setEdges, setNodes, toggleCandidatePopover, viewMode, visibleEdgeData, visibleNodeData]); - useEffect(() => { - const focusEdges = focus.active ? focus.edges : new Set(); - setNodes((current) => current.map((node) => ({ - ...node, - data: runtimeNodeData(node.data, { - activePort, - highlightedPortIds: hoverHighlight.ports, - focusedPortIds: focus.ports, - requiredInputPortIds, - candidatePortIds, - cycleNodeIds: new Set(graph.cycleNodes), - cycleBreakPortIds, - cycleBreakMode, - focusedNodeIds: focus.nodes, - hasActiveFocus: focus.active, - activeCandidatePortId, - setActivePort, - setCandidatePopover: toggleCandidatePopover, - breakCycleAtPort, - removeGraphModel, - viewMode, - }), - }))); - setEdges((current) => current.map((edge) => edge.data ? flowEdge(edge.data, hoverHighlight.edges, focusEdges, Boolean(activePort), focus.active) : edge)); - }, [activeCandidatePortId, activePort, breakCycleAtPort, candidatePortIds, cycleBreakMode, cycleBreakPortIds, focus, graph.cycleNodes, hoverHighlight.edges, hoverHighlight.ports, removeGraphModel, requiredInputPortIds, setEdges, setNodes, toggleCandidatePopover, viewMode]); - - useEffect(() => { - if (candidatePopover && !candidatePortIds.has(candidatePopover.portId)) setCandidatePopover(null); - }, [candidatePopover, candidatePortIds]); - - const onConnect = useCallback((connection: Connection) => { - if (!editorConnected) return; - const sourcePortId = connection.sourceHandle; - const targetPortId = connection.targetHandle; - if (!sourcePortId || !targetPortId) return; - const sourceInfo = portById.get(sourcePortId); - const targetInfo = portById.get(targetPortId); - if (!sourceInfo || !targetInfo) return; - // Only handle output-to-input connections. - if (sourceInfo.port.role !== "output" || targetInfo.port.role !== "input") return; - setPendingConnection({ - sourceNode: sourceInfo.node, - sourcePort: sourceInfo.port, - targetNode: targetInfo.node, - targetPort: targetInfo.port, + const nextNodes = buildNodes({ + graph, + view, + detailMode, + query, + scopedObjectIds, + unresolvedPortIds, + previousPortIds, + candidatePortIds, + cyclicApplications, + cycleBreakPortIds, + cycleBreakMode, + openCandidates, + onPortClick: setSelectedPort, + onCycleBreak: (application, port) => setCycleBreakSelection({ application, port }), }); - }, [editorConnected, portById]); - - const relayout = useCallback(() => { - layoutGraph(nodes, edges, effectiveLayoutMode(viewMode, layoutMode)).then(setNodes); - }, [edges, layoutMode, nodes, setNodes, viewMode]); - - const focusNode = useCallback((node: GraphNodeData, port?: GraphPort | null) => { - setPinnedFocus(null); - setSelectedEdge(null); - setSelected(node); - setActivePort(port ?? null); - setActivePanel("inspector"); - setCollapsedScales((current) => { - if (!current.has(node.scale)) return current; - const next = new Set(current); - next.delete(node.scale); - return next; + const nodeIds = new Set(nextNodes.map((node) => node.id)); + const nextEdges = buildEdges(graph, view).filter((edge) => nodeIds.has(edge.source) && nodeIds.has(edge.target)); + const layoutMode: LayoutMode = view === "topology" ? "topology" : detailMode === "overview" ? "overview" : "data_flow"; + layoutGraph(nextNodes, nextEdges, layoutMode).then(setNodes); + setEdges(nextEdges); + }, [candidatePortIds, cycleBreakMode, cycleBreakPortIds, cyclicApplications, detailMode, graph, openCandidates, previousPortIds, query, scopedObjectIds, setEdges, setNodes, unresolvedPortIds, view]); + + const inspectSelection = useCallback((_: unknown, node: FlowNode) => { + if (node.data.nodeKind === "application") { + setSelected(applicationById.get(node.data.applicationId) ?? null); + } else { + setSelected(node.data.detail); + if (node.data.nodeKind === "object") { + const object = node.data.detail as ObjectGraphNode; + setScopeFilter({ + label: `subtree ${object.name || String(object.objectId)}`, + objectIds: objectSubtreeIds(graph.objects, object.objectId), + }); + } else if (node.data.nodeKind === "instance") { + const instance = node.data.detail as InstanceDescriptor; + setScopeFilter({ label: `instance ${instance.name}`, objectIds: instance.objectIds }); + } else if (node.data.nodeKind === "model") { + setScopeFilter(null); + } + } + setSelectedPort(null); + }, [applicationById, graph.objects]); + + const selectCandidateModel = useCallback((model: ModelDescriptor) => { + if (!candidate) return; + setTargetPreview(null); + setApplicationForm({ + mode: "add", + initialModelType: model.type, + suggestedSelector: selectorSuggestion(candidate.application), }); - const renderedNode = nodes.find((item) => item.id === node.id); - if (renderedNode && flowInstance) { - flowInstance.setCenter(renderedNode.position.x + 156, renderedNode.position.y + 90, { zoom: 0.85, duration: 520 }); + if (!connected) setFeedback(`${model.name} matches ${candidate.port.name}. Start an interactive Julia editor session to add it to the composite model.`); + setCandidate(null); + }, [candidate, connected]); + + const submitApplication = useCallback((value: ApplicationFormValue) => { + if (!connected) { + setFeedback("Adding or updating an application requires an interactive Julia editor session."); + setApplicationForm(null); + return; } - }, [flowInstance, nodes]); - - const focusEdge = useCallback((edge: GraphEdgeData) => { - const port = edge.targetPort ? portById.get(edge.targetPort)?.port : edge.sourcePort ? portById.get(edge.sourcePort)?.port : null; - const node = port?.id === edge.targetPort ? nodeById.get(edge.target) : nodeById.get(edge.source); - if (node) focusNode(node, port ?? null); - }, [focusNode, nodeById, portById]); - - const chooseCycleBreakPoint = useCallback(() => { - setCycleBreakMode(true); - setViewModeTouched(true); - setViewMode("detail"); - setActivePanel("inspector"); - setSelected(null); - setSelectedEdge(null); - setCandidatePopover(null); - setActivePort(null); + sendCommand({ + action: "edit", + kind: value.applicationRef ? "update_application" : "add_application", + ...value, + }); + setApplicationForm(null); + }, [connected, sendCommand]); - const nextFocus = emptyFocusState(); - nextFocus.active = true; - for (const option of cycleBreakOptions) { - nextFocus.edges.add(option.edge.id); - nextFocus.nodes.add(option.edge.source); - nextFocus.nodes.add(option.edge.target); - if (option.edge.sourcePort) nextFocus.ports.add(option.edge.sourcePort); - nextFocus.ports.add(option.port.id); + const submitInstance = useCallback((value: InstanceFormValue) => { + if (!connected) { + setFeedback("Adding a template instance requires an interactive Julia editor session."); + return; } - setPinnedFocus(nextFocus); - - if (flowInstance && cycleBreakOptions.length > 0) { - const nodeIds = [...new Set(cycleBreakOptions.flatMap((option) => [option.edge.source, option.edge.target]))]; - flowInstance.fitView({ - nodes: nodeIds.map((id) => ({ id })), - padding: 0.36, - duration: 520, - maxZoom: 1.05, - }); + sendCommand({ action: "edit", kind: "add_instance", ...value }); + setShowInstanceForm(false); + setInstancePreview(null); + }, [connected, sendCommand]); + + const submitBinding = useCallback((value: BindingFormValue) => { + if (!connected) { + setFeedback("Creating a binding requires an interactive Julia editor session."); + setBindingForm(null); + return; } - }, [cycleBreakOptions, flowInstance]); - - useEffect(() => { - if (!graph.cyclic) setCycleBreakMode(false); - }, [graph.cyclic]); - - const toggleEdgeFilter = useCallback((key: EdgeFilterKey) => { - setEdgeFilters((current) => ({ ...current, [key]: !current[key] })); - }, []); - - const toggleScale = useCallback((scale: string) => { - setSelected(null); - setSelectedEdge(null); - setActivePort(null); - setPinnedFocus(null); - setCollapsedScales((current) => { - const next = new Set(current); - if (next.has(scale)) next.delete(scale); - else next.add(scale); - return next; + sendCommand({ action: "edit", kind: "set_input_binding", ...value }); + setBindingForm(null); + }, [connected, sendCommand]); + + const submitObject = useCallback((value: ObjectFormValue) => { + if (!connected) { + setFeedback("Adding or updating an object requires an interactive Julia editor session."); + setObjectForm(null); + return; + } + sendCommand({ + action: "edit", + kind: objectForm?.mode === "update" ? "update_object" : "add_object", + objectId: value.objectId, + configuration: value.configuration, }); - }, []); + setObjectForm(null); + }, [connected, objectForm?.mode, sendCommand]); - const expandAllScales = useCallback(() => setCollapsedScales(new Set()), []); - - const focusWarning = useCallback((warning: ValidationWarning) => { - if (warning.portIds?.length) { - const nextFocus = emptyFocusState(); - nextFocus.active = true; - for (const portId of warning.portIds) { - const target = portById.get(portId); - if (!target) continue; - nextFocus.ports.add(portId); - nextFocus.nodes.add(target.node.id); - } - setPinnedFocus(nextFocus); - const first = portById.get(warning.portIds[0]); - if (first) { - setSelected(null); - setSelectedEdge(null); - setActivePort(null); - if (flowInstance && warning.nodeIds && warning.nodeIds.length > 1) { - flowInstance.fitView({ - nodes: warning.nodeIds.map((id) => ({ id })), - padding: 0.28, - duration: 520, - maxZoom: 0.95, - }); - } else { - const renderedNode = nodes.find((item) => item.id === first.node.id); - if (renderedNode && flowInstance) { - flowInstance.setCenter(renderedNode.position.x + 156, renderedNode.position.y + 90, { zoom: 0.9, duration: 520 }); - } - } - } + const submitOverride = useCallback((value: OverrideFormValue) => { + if (!connected) { + setFeedback("Creating an override requires an interactive Julia editor session."); + setOverrideApplication(null); return; } + sendCommand({ + action: "edit", + kind: value.scope === "instance" ? "set_instance_override" : "set_object_override", + ...value, + }); + setOverrideApplication(null); + }, [connected, sendCommand]); - setPinnedFocus(null); - setSelectedEdge(null); - if (warning.edgeId) { - const edge = graph.edges.find((item) => item.id === warning.edgeId); - if (edge) focusEdge(edge); + const removeOverride = useCallback((value: OverrideFormValue) => { + if (!connected) { + setFeedback("Removing an override requires an interactive Julia editor session."); return; } - if (warning.portId) { - const target = portById.get(warning.portId); - if (target) focusNode(target.node, target.port); + sendCommand({ + action: "edit", + kind: value.scope === "instance" ? "remove_instance_override" : "remove_object_override", + ...value, + }); + setOverrideApplication(null); + }, [connected, sendCommand]); + + const connectPorts = useCallback((connection: Connection) => { + if (!connection.sourceHandle || !connection.targetHandle) return; + const source = portIndex.get(connection.sourceHandle); + const target = portIndex.get(connection.targetHandle); + if (!source || !target || source.port.role !== "output" || target.port.role !== "input") { + setFeedback("Connect an application output to an application input."); return; } - if (warning.nodeId) { - const node = nodeById.get(warning.nodeId); - if (node) focusNode(node); + setBindingForm({ + sourceApplication: source.application, + sourcePort: source.port, + targetApplication: target.application, + targetPort: target.port, + }); + setBindingPreview(null); + }, [portIndex]); + + const activeInitialization = useMemo(() => { + if (!selected) return graph.initialization; + if ("applicationId" in selected) return graph.initialization.filter((row) => row.applicationId === selected.applicationId); + if ("objectId" in selected) return graph.initialization.filter((row) => String(row.objectId) === String(selected.objectId)); + if ("objectIds" in selected) { + const ids = new Set(selected.objectIds.map(objectKey)); + return graph.initialization.filter((row) => ids.has(objectKey(row.objectId))); } - }, [flowInstance, focusEdge, focusNode, graph.edges, nodeById, nodes, portById]); + return graph.initialization; + }, [graph.initialization, selected]); return ( -
-
-
- - -
-
PlantSimEngine
-

Dependency Graph

-
- -
- - { - setSearchQuery(event.target.value); - setShowSearchResults(true); - }} - onFocus={() => setShowSearchResults(true)} - /> - {searchQuery && ( - - )} - {showSearchResults && searchQuery.trim().length > 0 && ( -
- {searchResults.length > 0 ? searchResults.map((result) => ( - - )) :
No match.
} -
- )} -
- -
- {visibleNodeData.length}/{graph.nodes.length} models - {visibleEdgeData.length}/{graph.edges.length} links - {requiredInputs.length > 0 && ( - - )} - {actionableWarningItems.length > 0 && ( - - )} - {graph.cyclic && cycle} -
- -
- - - - -
- -
- - } +
+
+ {graph.metadata.applicationCount} applications + {graph.metadata.objectCount} objects + {graph.metadata.unresolvedInitializationCount > 0 && ( + + )} + {graph.diagnostics.length > 0 && ( + + )} +
+ +
+ {editorConfig && } + {editorConfig && } + {view !== "topology" && ( + -
- -
- - {editorSocket && ( - <> - - - - - )} -
- - {editorSocket && ( -
- {editorConnected ? "live" : "offline"} - - -
)} + {editorConfig && } + {editorConfig && } + {editorConfig && graph.templates.length > 0 && } + {editorConfig && } + {editorConfig && } + {editorConfig && } +
+ - {editorFeedback && ( -
- {editorFeedback.text} -
- )} - - {graph.cyclic && ( - - )} - - {showRelationshipsPanel && } - {showScalesPanel && } - - {showRequiredPanel && ( - setShowRequiredPanel(false)}> - - - )} - - {showWarningsPanel && ( - setShowWarningsPanel(false)}> - - - )} - - {showOpenPanel && ( - { - sendEditorCommand({ action: "open_mapping_code", path }); - setShowOpenPanel(false); + {graph.metadata.cyclic && ( +
+ +
Current-step dependency cycleSelect a cycle input to read its previous accepted timestep value.
+ +
+ )} + {feedback &&
{feedback}
} + {scopeFilter && ( +
+ Showing {view === "resolved" ? "executions" : view === "applications" ? "applications" : "topology"} for {scopeFilter.label} ({scopeFilter.objectIds.length} objects) + {view === "topology" && } + +
+ )} - { - setShowSearchResults(false); - setCandidatePopover(null); - setShowOpenPanel(false); - setShowRelationshipsPanel(false); - setShowScalesPanel(false); - }} - onEdgeClick={(_, edge) => { - if (edge.data) { - setCandidatePopover(null); - setSelectedEdge(edge.data); - setSelected(null); - setActivePort(null); - setPinnedFocus(null); - setActivePanel("inspector"); - } - }} - onNodeClick={(_, node) => { - setCandidatePopover(null); - setSelectedEdge(null); - setSelected(node.data); - setActivePanel("inspector"); +
+
+ setSelected(edge.data ?? null)} + fitView + minZoom={0.05} + maxZoom={2} + > + + + + +
+ { + setTargetPreview(null); + setApplicationForm({ + mode: "update", + application, + }); }} - fitView - fitViewOptions={{ padding: viewMode === "overview" ? 0.14 : 0.08, minZoom: 0.03, maxZoom: viewMode === "overview" ? 1.25 : 1 }} - minZoom={0.03} - maxZoom={2} - > - - - - - - {candidatePopoverInfo && ( - { - const requestId = Date.now(); - setAddModelSelection({ - modelType: model.type, - scale: candidatePopoverInfo.node.scale, - requestId, - }); - setAddModelFocusRequest(requestId); - setHighlightAddModelPanel(true); - setActivePanel("add_model"); - setCandidatePopover(null); - }} - onClose={() => setCandidatePopover(null)} - /> - )} + onRemoveApplication={(application) => sendCommand({ + action: "edit", + kind: "remove_application", + applicationRef: application.owner, + })} + onConfigureApplication={(application) => setConfigurationApplicationId(application.applicationId)} + onOverrideApplication={setOverrideApplication} + onRemoveInstance={(instance) => sendCommand({ action: "edit", kind: "remove_instance", name: instance.name })} + onEditObject={(object) => setObjectForm({ mode: "update", object })} + onRemoveObject={(object) => sendCommand({ action: "edit", kind: "remove_object", objectId: object.objectId, recursive: true })} + />
- {activePanel && ( - + {candidate && (candidateModels.length > 0 || candidateApplications.length > 0) && ( + { + setBindingForm(endpointsForCandidate(candidate, application)); + setBindingPreview(null); + setCandidate(null); + }} + onClose={() => setCandidate(null)} + /> )} - - {pendingConnection && ( - { - sendEditorCommand(command); - setPendingConnection(null); + {showDiagnostics && setShowDiagnostics(false)} sendCommand={sendCommand} interactive={connected} />} + {showInitialization && setShowInitialization(false)} sendCommand={sendCommand} interactive={connected} />} + {showModelCode && setShowModelCode(false)} />} + {showOpen && { sendCommand({ action: "open_model_code", path }); setShowOpen(false); }} onClose={() => setShowOpen(false)} />} + {showSave && { sendCommand({ action: "save_model_code", path }); setShowSave(false); }} onClose={() => setShowSave(false)} />} + {applicationForm && ( + { setTargetPreview(null); sendCommand({ action: "preview_application_targets", selector, applicationRef: applicationForm.application?.owner }); }} + onSubmit={submitApplication} + onClose={() => { setApplicationForm(null); setTargetPreview(null); }} + /> + )} + {bindingForm && ( + { setBindingPreview(null); sendCommand({ action: "preview_input_binding", ...value }); }} + onSubmit={submitBinding} + onClose={() => { setBindingForm(null); setBindingPreview(null); }} + /> + )} + {objectForm && ( + setObjectForm(null)} /> + )} + {showInstanceForm && ( + { setInstancePreview(null); sendCommand({ action: "preview_instance", ...value }); }} onSubmit={submitInstance} onClose={() => { setShowInstanceForm(false); setInstancePreview(null); }} /> + )} + {showEnvironmentForm && ( + { sendCommand({ action: "edit", kind: "set_model_environment", environmentId }); setShowEnvironmentForm(false); }} onClose={() => setShowEnvironmentForm(false)} /> + )} + {overrideApplication && ( + setOverrideApplication(null)} /> + )} + {configurationApplicationId && applicationById.get(configurationApplicationId) && ( + setConfigurationApplicationId(null)} /> + )} + {cycleBreakSelection && ( + { + sendCommand({ + action: "edit", + kind: "break_cycle", + applicationRef: cycleBreakSelection.application.owner, + input: cycleBreakSelection.port.name, + initializeMissing, + initialValue, + }); + setCycleBreakSelection(null); }} - onCancel={() => setPendingConnection(null)} + onClose={() => setCycleBreakSelection(null)} /> )}
); } -function MappingDialog({ - connection, - scales, - onConfirm, - onCancel, +function buildNodes({ + graph, + view, + detailMode, + query, + scopedObjectIds, + unresolvedPortIds, + previousPortIds, + candidatePortIds, + cyclicApplications, + cycleBreakPortIds, + cycleBreakMode, + openCandidates, + onPortClick, + onCycleBreak, }: { - connection: PendingMappingConnection; - scales: string[]; - onConfirm: (command: Record) => void; - onCancel: () => void; -}) { - const [mode, setMode] = useState<"single" | "multi">("single"); - const [selectedScales, setSelectedScales] = useState([connection.sourceNode.scale]); + graph: ModelGraphView; + view: GraphViewMode; + detailMode: DetailMode; + query: string; + scopedObjectIds: Set | null; + unresolvedPortIds: Set; + previousPortIds: Set; + candidatePortIds: Set; + cyclicApplications: Set; + cycleBreakPortIds: Set; + cycleBreakMode: boolean; + openCandidates: (application: ApplicationGraphNode, port: GraphPort, anchor: { x: number; y: number }) => void; + onPortClick: (port: GraphPort) => void; + onCycleBreak: (application: ApplicationGraphNode, port: GraphPort) => void; +}): FlowNode[] { + const matches = (value: unknown) => !query || JSON.stringify(value).toLowerCase().includes(query.toLowerCase()); + if (view === "topology") { + const modelDetail: ModelRootDescriptor = { + entity: "model", + objectCount: graph.metadata.objectCount, + instanceCount: graph.metadata.instanceCount, + applicationCount: graph.metadata.applicationCount, + }; + const modelNode: FlowNode = { + id: "model:root", + type: "entity", + position: { x: 0, y: 0 }, + data: { + nodeKind: "model", + title: graph.metadata.title || "Composite model", + subtitle: "model root", + badges: [`${graph.metadata.instanceCount} instances`, `${graph.metadata.objectCount} objects`], + detail: modelDetail, + }, + }; + const templateNodes: FlowNode[] = graph.templates.filter(matches).map((template) => ({ + id: `template:${template.id}`, + type: "entity", + position: { x: 0, y: 0 }, + data: { + nodeKind: "template", + title: template.name, + subtitle: template.source === "catalog" ? "template preset" : "model-local template", + badges: [`${template.applications.length} applications`, `${template.mountedInstances.length} mounts`], + detail: template, + }, + })); + const instanceNodes: FlowNode[] = graph.instances.filter(matches).map((instance) => ({ + id: instance.id, + type: "entity", + position: { x: 0, y: 0 }, + data: { + nodeKind: "instance", + title: instance.name, + subtitle: [instance.kind, instance.species].filter(Boolean).join(" · ") || "object instance", + badges: [`${instance.objectIds.length} objects`, `${instance.applicationIds.length} applications`, `${instance.instanceOverrides.length + instance.objectOverrides.length} overrides`], + detail: instance, + }, + })); + const objectNodes: FlowNode[] = graph.objects.filter(matches).map((object) => ({ + id: object.id, + type: "entity", + position: { x: 0, y: 0 }, + data: { + nodeKind: "object", + title: object.name || String(object.objectId), + subtitle: [object.kind, object.scale, object.instance].filter(Boolean).join(" · "), + badges: [object.species, object.hasStatus ? "status" : null, object.hasGeometry ? "geometry" : null].filter(Boolean) as string[], + detail: object, + }, + })); + return [modelNode, ...templateNodes, ...instanceNodes, ...objectNodes]; + } + if (view === "resolved") { + const applications = new Map(graph.applications.map((application) => [application.applicationId, application])); + const executionNodes: FlowNode[] = graph.executions + .filter((execution) => !scopedObjectIds || scopedObjectIds.has(objectKey(execution.objectId))) + .filter(matches).map((execution) => { + const application = applications.get(execution.applicationId); + return { + id: execution.id, + type: "entity", + position: { x: 0, y: 0 }, + data: { + nodeKind: "execution", + title: execution.applicationId, + subtitle: `object ${String(execution.objectId)}`, + badges: [shortType(execution.modelType), execution.overridden ? "override" : "shared"], + inputPortIds: [...(application?.inputs ?? []), ...(application?.environmentInputs ?? [])].map((port) => port.id), + outputPortIds: [...(application?.outputs ?? []), ...(application?.environmentOutputs ?? [])].map((port) => port.id), + detail: execution, + }, + }; + }); + return [...executionNodes, ...environmentNodes(graph, "resolved")]; + } + const applicationNodes: FlowNode[] = graph.applications + .filter((application) => !scopedObjectIds || application.targetIds.some((id) => scopedObjectIds.has(objectKey(id)))) + .filter(matches).map((application) => ({ + id: application.id, + type: "application", + position: { x: 0, y: 0 }, + data: { + ...application, + nodeKind: "application", + detailMode, + cyclic: cyclicApplications.has(application.applicationId), + requiredInputPortIds: application.inputs.filter((port) => unresolvedPortIds.has(port.id)).map((port) => port.id), + candidatePortIds: [...application.inputs, ...application.outputs].filter((port) => candidatePortIds.has(port.id)).map((port) => port.id), + previousTimeStepPortIds: application.inputs.filter((port) => previousPortIds.has(port.id)).map((port) => port.id), + cycleBreakInputPortIds: application.inputs.filter((port) => cycleBreakPortIds.has(port.id)).map((port) => port.id), + cycleBreakMode, + onCandidateClick: (port, anchor) => openCandidates(application, port, anchor), + onPortClick, + onCycleBreak, + }, + })); + return [...applicationNodes, ...environmentNodes(graph, "applications")]; +} + +function environmentNodes(graph: ModelGraphView, projection: "applications" | "resolved"): FlowNode[] { + const relevant = graph.edges.filter((edge) => edge.kind === "environment_binding" && edge.projection === projection); + const ids = new Set(relevant.flatMap((edge) => [edge.source, edge.target]).filter((id) => id.startsWith("environment:"))); + return [...ids].map((id) => { + const provider = id.slice("environment:".length); + const descriptor = graph.environments.find((environment) => environment.id === id); + const inputs = uniqueStrings(relevant.filter((edge) => edge.target === id).map((edge) => edge.targetPort).filter(Boolean) as string[]); + const outputs = uniqueStrings(relevant.filter((edge) => edge.source === id).map((edge) => edge.sourcePort).filter(Boolean) as string[]); + return { + id, + type: "entity", + position: { x: 0, y: 0 }, + data: { + nodeKind: "environment", + title: descriptor?.name || provider, + subtitle: descriptor?.active ? "active scene environment" : "environment backend", + badges: [`${outputs.length} inputs`, `${inputs.length} outputs`], + inputPortIds: inputs, + outputPortIds: outputs, + detail: descriptor || { provider }, + }, + }; + }); +} - const toggleScale = (scale: string) => { - setSelectedScales((current) => - current.includes(scale) ? current.filter((s) => s !== scale) : [...current, scale] - ); - }; +function uniqueStrings(values: string[]) { return [...new Set(values)]; } + +function buildEdges(graph: ModelGraphView, view: GraphViewMode): FlowEdge[] { + const sourceEdges = view === "topology" ? [...graph.edges, ...topologyContainerEdges(graph)] : graph.edges; + return sourceEdges + .filter((edge) => edgeProjectionMatches(edge, view)) + .map((edge) => ({ + id: edge.id, + source: edge.source, + target: edge.target, + sourceHandle: edge.sourcePort || undefined, + targetHandle: edge.targetPort || undefined, + type: "modelEdge", + data: edge, + markerEnd: { type: MarkerType.ArrowClosed, color: edgeColor(edge), width: 16, height: 16 }, + style: { + stroke: edgeColor(edge), + strokeWidth: edge.cycle ? 4 : edge.kind === "manual_call" ? 2.5 : 1.8, + strokeDasharray: edge.kind === "previous_timestep" ? "7 5" : edge.kind === "manual_call" ? "3 4" : undefined, + }, + })); +} - const handleConfirm = () => { - const command: Record = { - action: "edit", - kind: "set_mapped_variable", - scale: connection.targetNode.scale, - process: connection.targetNode.process, - variable: connection.targetPort.name, - sourceScale: connection.sourceNode.scale, - sourceVariable: connection.sourcePort.name, - mode: mode === "single" && connection.sourceNode.scale === connection.targetNode.scale ? "same_scale" : mode, - }; - if (mode === "multi") { - const extras = selectedScales.filter((s) => s !== connection.sourceNode.scale); - if (extras.length > 0) command.extraSourceScales = extras; +function topologyContainerEdges(graph: ModelGraphView): ModelGraphEdge[] { + const edges: ModelGraphEdge[] = []; + const instanceObjectIds = new Set(graph.instances.flatMap((instance) => instance.objectIds.map(objectKey))); + for (const template of graph.templates) { + edges.push({ + id: `topology:model:template:${template.id}`, + source: "model:root", + target: `template:${template.id}`, + kind: "object_topology", + projection: "topology", + cycle: false, + }); + } + for (const instance of graph.instances) { + edges.push({ + id: `topology:${instance.id}:object:${String(instance.rootId)}`, + source: instance.id, + target: `object:${String(instance.rootId)}`, + kind: "object_topology", + projection: "topology", + cycle: false, + }); + } + for (const object of graph.objects) { + if (object.parent === null && !instanceObjectIds.has(objectKey(object.objectId))) { + edges.push({ + id: `topology:model:${object.id}`, + source: "model:root", + target: object.id, + kind: "object_topology", + projection: "topology", + cycle: false, + }); } - onConfirm(command); - }; + } + return edges; +} - return ( -
-
e.stopPropagation()}> -
-
Variable Mapping
- -
+export function objectSubtreeIds(objects: ObjectGraphNode[], rootId: unknown): unknown[] { + const children = new Map(); + for (const object of objects) { + if (object.parent === null) continue; + const key = objectKey(object.parent); + children.set(key, [...(children.get(key) ?? []), object.objectId]); + } + const result: unknown[] = []; + const pending: unknown[] = [rootId]; + const visited = new Set(); + while (pending.length > 0) { + const id = pending.pop()!; + const key = objectKey(id); + if (visited.has(key)) continue; + visited.add(key); + result.push(id); + pending.push(...(children.get(key) ?? [])); + } + return result; +} -
-
-
- Source - {connection.sourceNode.scale} - {connection.sourceNode.process}.{connection.sourcePort.name} -
-
->
-
- Target - {connection.targetNode.scale} - {connection.targetNode.process}.{connection.targetPort.name} -
-
+function objectKey(value: unknown) { + const text = String(value); + return text.startsWith("object:") ? text.slice("object:".length) : text; +} -
-
Mapping mode
- - -
+function edgeProjectionMatches(edge: ModelGraphEdge, view: GraphViewMode) { + const projection = (edge as ModelGraphEdge & { projection?: string }).projection; + if (view === "topology") return edge.kind === "object_topology" || edge.kind === "template_mount"; + if (view === "resolved") return projection === "resolved"; + return projection === "applications" || (!projection && !["object_topology", "application_target"].includes(edge.kind)); +} - {mode === "multi" && ( -
-
Source scales
- {scales.map((scale) => ( - - ))} -
- )} -
+function edgeColor(edge: ModelGraphEdge) { + if (edge.cycle) return "#cf4937"; + if (edge.kind === "previous_timestep") return "#317b62"; + if (edge.kind === "manual_call") return "#be6a54"; + if (edge.kind === "object_topology") return "#7b7167"; + if (edge.kind === "environment_binding") return "#367b8b"; + return "#a59687"; +} -
- - -
-
-
- ); +export function deriveCandidatePortIds(graph: ModelGraphView) { + const result = new Set(); + for (const application of graph.applications) { + for (const input of application.inputs) { + const existing = graph.applications.some((other) => + other.applicationId !== application.applicationId && other.outputs.some((output) => output.name === input.name) + ); + if (existing || graph.modelLibrary.some((model) => Object.prototype.hasOwnProperty.call(model.outputs, input.name))) result.add(input.id); + } + for (const output of application.outputs) { + const existing = graph.applications.some((other) => + other.applicationId !== application.applicationId && other.inputs.some((input) => input.name === output.name) + ); + if (existing || graph.modelLibrary.some((model) => Object.prototype.hasOwnProperty.call(model.inputs, output.name))) result.add(output.id); + } + } + return result; } -function RelationshipLegend({ filters, onToggle }: { filters: EdgeFilters; onToggle: (key: EdgeFilterKey) => void }) { - return ( -
-
Relationships
- - - -
red inputs need initialization
-
- ); +export function modelsForPort(library: ModelDescriptor[], port: GraphPort) { + const field = port.role === "input" ? "outputs" : "inputs"; + return library + .filter((model) => Object.prototype.hasOwnProperty.call(model[field], port.name)) + .sort((left, right) => `${left.package}.${left.name}`.localeCompare(`${right.package}.${right.name}`)); } -function ScaleControls({ - scales, - collapsedScales, - onToggle, - onExpandAll, +function CandidatePopover({ + candidate, + models, + applications, + onSelectModel, + onSelectApplication, + onClose, }: { - scales: string[]; - collapsedScales: Set; - onToggle: (scale: string) => void; - onExpandAll: () => void; + candidate: CandidatePopover; + models: ModelDescriptor[]; + applications: ApplicationGraphNode[]; + onSelectModel: (model: ModelDescriptor) => void; + onSelectApplication: (application: ApplicationGraphNode) => void; + onClose: () => void; }) { + const title = candidate.port.role === "input" ? `Models that compute ${candidate.port.name}` : `Models that consume ${candidate.port.name}`; return ( -
-
Scales
-
- {scales.map((scale) => { - const collapsed = collapsedScales.has(scale); - return ( - - ); - })} +
+
{title}Exact declared variable-name matches
+
+ {applications.length > 0 &&
Existing applications
} + {applications.map((application) => ( + + ))} + {models.length > 0 &&
Available models
} + {models.map((model) => ( + + ))}
- {collapsedScales.size > 0 && } -
+ ); } -function FloatingPanel({ className, title, subtitle, onClose, children }: { className: string; title: string; subtitle: string; onClose: () => void; children: ReactNode }) { - return ( -
-
-
-
{title}
-

{subtitle}

-
- -
- {children} -
- ); +export function applicationsForPort(applications: ApplicationGraphNode[], candidate: CandidatePopover) { + return applications + .filter((application) => application.applicationId !== candidate.application.applicationId) + .filter((application) => { + const ports = candidate.port.role === "input" ? application.outputs : application.inputs; + return ports.some((port) => port.name === candidate.port.name); + }) + .sort((left, right) => left.applicationId.localeCompare(right.applicationId)); +} + +export function endpointsForCandidate(candidate: CandidatePopover, application: ApplicationGraphNode): BindingEndpoints { + if (candidate.port.role === "input") { + const sourcePort = application.outputs.find((port) => port.name === candidate.port.name); + if (!sourcePort) throw new Error(`Application ${application.applicationId} does not output ${candidate.port.name}.`); + return { sourceApplication: application, sourcePort, targetApplication: candidate.application, targetPort: candidate.port }; + } + const targetPort = application.inputs.find((port) => port.name === candidate.port.name); + if (!targetPort) throw new Error(`Application ${application.applicationId} does not input ${candidate.port.name}.`); + return { sourceApplication: candidate.application, sourcePort: candidate.port, targetApplication: application, targetPort }; } -function RequiredInputList({ groups, onSelect, compact = false }: { groups: Map; onSelect: (node: GraphNodeData, port?: GraphPort | null) => void; compact?: boolean }) { - if (groups.size === 0) return
Every input is computed by another model.
; +function Inspector({ selection, port, initialization, interactive, onEditApplication, onConfigureApplication, onRemoveApplication, onOverrideApplication, onRemoveInstance, onEditObject, onRemoveObject }: { selection: InspectorSelection; port: GraphPort | null; initialization: ModelGraphView["initialization"]; interactive: boolean; onEditApplication: (application: ApplicationGraphNode) => void; onConfigureApplication: (application: ApplicationGraphNode) => void; onRemoveApplication: (application: ApplicationGraphNode) => void; onOverrideApplication: (application: ApplicationGraphNode) => void; onRemoveInstance: (instance: InstanceDescriptor) => void; onEditObject: (object: ObjectGraphNode) => void; onRemoveObject: (object: ObjectGraphNode) => void }) { + const application = selection && "applicationId" in selection && "selector" in selection ? selection as ApplicationGraphNode : null; + const object = selection && "objectId" in selection && !("applicationId" in selection) ? selection as ObjectGraphNode : null; + const instance = selection && "templateId" in selection && "objectIds" in selection ? selection as InstanceDescriptor : null; return ( -
- {[...groups.entries()].map(([group, items]) => ( -
-

{group}

- {items.map(({ node, port, reason }) => ( - - ))} -
- ))} -
+ ); } -function WarningList({ - warnings, - onFocusWarning, -}: { - warnings: ValidationWarning[]; - onFocusWarning: (warning: ValidationWarning) => void; -}) { - if (warnings.length === 0) return
No validation warnings.
; - const grouped = groupValidationWarnings(warnings); - return ( -
- {(["error", "warning", "info"] as const).map((severity) => { - const items = grouped.get(severity) ?? []; - if (items.length === 0) return null; - return ( -
-

{validationSeverityLabel(severity)} ({items.length})

- {items.map((warning) => ( - - ))} -
- ); - })} +function DiagnosticsPanel({ graph, onClose, sendCommand, interactive }: { graph: ModelGraphView; onClose: () => void; sendCommand: (command: Record) => void; interactive: boolean }) { + return + {graph.diagnostics.map((diagnostic) =>
{diagnostic.code}

{diagnostic.message}

{diagnostic.suggestions.map((suggestion) => {suggestion})}
)} + {graph.cycles.map((cycle) =>
{cycle.applicationIds.join(" → ")}

Choose an input to read from the previous timestep.

{cycle.breakCandidates.map((candidate) => { const owner = graph.applications.find((application) => application.applicationId === candidate.applicationId)?.owner; return ; })}
)} + {graph.diagnostics.length === 0 && graph.cycles.length === 0 &&

No diagnostics.

} +
; +} + +function InitializationPanel({ graph, onClose, sendCommand, interactive }: { graph: ModelGraphView; onClose: () => void; sendCommand: (command: Record) => void; interactive: boolean }) { + const unresolved = graph.initialization.filter((row) => row.disposition === "unresolved"); + const groups = new Map(); + for (const row of unresolved) { + const key = `${row.applicationId}:${row.variable}`; + groups.set(key, [...(groups.get(key) || []), row]); + } + return + {[...groups.entries()].map(([key, rows]) => )} + {unresolved.length === 0 &&

No unresolved initial values.

} +
; +} + +function InitializationGroup({ rows, interactive, sendCommand }: { rows: ModelGraphView["initialization"]; interactive: boolean; sendCommand: (command: Record) => void }) { + const [valueType, setValueType] = useState("float"); + const [value, setValue] = useState(""); + const first = rows[0]; + const typedValue = { type: valueType, value }; + return
+
{first.variable}{first.applicationId}
{rows.length} object{rows.length === 1 ? "" : "s"} · expected {first.expectedType}
+

Required because the input has no producer, environment source, status value, or usable temporal initialization.

+ {interactive &&
} +
{rows.map((row) =>
Object {String(row.objectId)}{row.origin}{interactive && }
)}
+
; +} + +function SceneCodePanel({ code, onClose }: { code: string; onClose: () => void }) { + return
{code || "Model code is available from an interactive editor session."}
; +} + +function SceneFileDialog({ mode, recentPaths, currentPath, autosavePath, onSubmit, onClose }: { mode: "open" | "save"; recentPaths: string[]; currentPath: string | null; autosavePath: string | null; onSubmit: (path: string) => void; onClose: () => void }) { + const [path, setPath] = useState(currentPath || ""); + return +
+

{mode === "open" ? "Open a Julia script whose final binding is `model = CompositeModel(...)`. Future edits will be saved back to that file." : "After the first save, every successful graph edit automatically rewrites this Julia script."}

+ + {mode === "open" && recentPaths.length > 0 &&
Recent models
{recentPaths.map((recent) => )}
} + {mode === "open" && autosavePath &&
Recovery autosave
} + Use Git to version saved composite-model scripts and review scientific configuration changes.
- ); +
; } -function OpenMappingPanel({ - recentMappings, - disabled, - onOpen, +function CycleBreakDialog({ + selection, + initialization, + onSubmit, onClose, }: { - recentMappings: string[]; - disabled: boolean; - onOpen: (path: string) => void; + selection: CycleBreakSelection; + initialization: ModelGraphView["initialization"]; + onSubmit: (initializeMissing: boolean, initialValue: { type: string; value: string } | null) => void; onClose: () => void; }) { - const [path, setPath] = useState(""); - - const openPath = () => { - const trimmed = path.trim(); - if (!trimmed) return; - onOpen(trimmed); - }; - - return ( - -
- -
-
- Recent mappings -
- {recentMappings.length > 0 ? ( -
- {recentMappings.map((item) => ( - - ))} -
- ) :
No recent mapping.
} -
-
-
+ const missing = initialization.filter((row) => + row.applicationId === selection.application.applicationId && + row.variable === selection.port.name && + row.disposition !== "supplied" ); -} - -function CycleBreakPrompt({ - active, - optionCount, - editorConnected, - onChoose, -}: { - active: boolean; - optionCount: number; - editorConnected: boolean; - onChoose: () => void; -}) { - return ( -
-
- Cycle detected - - Choose which variable to decouple. The selected input will be wrapped in PreviousTimeStep, so that model uses the value from the previous timestep and is disconnected from this current-step variable within a run. - + const [valueType, setValueType] = useState("float"); + const [value, setValue] = useState(""); + return
+
event.stopPropagation()} data-testid="cycle-break-dialog"> +
Break the current-step cycle{selection.application.applicationId}.{selection.port.name}
+
+

This changes the application input to read its value from the previous accepted timestep. The model is disconnected from the current value during each run step.

+
Application-wide changeIt affects all {selection.application.targetCount} targets selected by this application.
+ {missing.length > 0 &&
Required initial value

{missing.length} target{missing.length === 1 ? "" : "s"} need a value before the first timestep.

}
- -
- ); +
+ +
; } -function InspectorDetails({ - selected, - selectedEdge, - activePort, - requiredInputPortIds, - incomingEdges, - outgoingEdges, - nodeById, - portById, - graphNodes, - onFocusEdge, - models, - scales, - onAddScale, - onCommand, - editorConnected, -}: { - selected: GraphNodeData | null; - selectedEdge: GraphEdgeData | null; - activePort: GraphPort | null; - requiredInputPortIds: Set; - incomingEdges: GraphEdgeData[]; - outgoingEdges: GraphEdgeData[]; - nodeById: Map; - portById: Map; - graphNodes: GraphNodeData[]; - onFocusEdge: (edge: GraphEdgeData) => void; - models: ModelDescriptor[]; - scales: string[]; - onAddScale: (scale: string) => void; - onCommand: (command: Record) => void; - editorConnected: boolean; -}) { - return ( - <> - {selectedEdge && ( - - )} - {selected ? ( -
- - - - - port.name).join(", ") || "none"} /> - port.name).join(", ") || "none"} /> - {selected.inputs.filter((port) => requiredInputPortIds.has(port.id)).map((port) => ( -
{port.name} must be initialized
- ))} - {selected.inputs.filter((port) => port.previousTimeStep).map((port) => ( -
{port.name} uses previous timestep
- ))} - {selected.role === "model" && ( - - )} -
- ) : !selectedEdge ? ( -
Select a model node.
- ) : null} - -

Variable Provenance

- {activePort ? ( -
-
- {activePort.name} - {activePort.role} -
- - {activePort.mappingMode && } - {activePort.sourceScale && } - {requiredInputPortIds.has(activePort.id) &&
required initialization
} - {activePort.previousTimeStep &&
uses previous timestep
} - - - {activePort.role === "input" && ( - - )} -
- ) : ( -
Hover, click, or search a variable to see where it comes from and where it goes.
- )} - - ); -} - -function EdgeDetails({ - edge, - nodeById, - portById, - onCommand, - editorConnected, -}: { - edge: GraphEdgeData; - nodeById: Map; - portById: Map; - onCommand: (command: Record) => void; - editorConnected: boolean; -}) { - const source = nodeById.get(edge.source); - const target = nodeById.get(edge.target); - const sourcePort = edge.sourcePort ? portById.get(edge.sourcePort)?.port : null; - const targetPort = edge.targetPort ? portById.get(edge.targetPort)?.port : null; - const breakable = isCycleEdge(edge) && target && targetPort && targetPort.role === "input"; - return ( -
-
- {edgeKindLabel(edge)} - {edge.scaleRelation} -
- - - - - - - {breakable && ( - - )} - {edge.diagnostics.length > 0 ? edge.diagnostics.map((item) => ( -
{item}
- )) :
No edge diagnostics.
} -
- ); -} - -function EdgeList({ - title, - edges, - direction, - nodeById, - portById, - onFocusEdge, -}: { - title: string; - edges: GraphEdgeData[]; - direction: "incoming" | "outgoing"; - nodeById: Map; - portById: Map; - onFocusEdge: (edge: GraphEdgeData) => void; -}) { - return ( -
-

{title}

- {edges.length > 0 ? edges.map((edge) => { - const source = nodeById.get(edge.source); - const target = nodeById.get(edge.target); - const sourcePort = edge.sourcePort ? portById.get(edge.sourcePort)?.port : null; - const targetPort = edge.targetPort ? portById.get(edge.targetPort)?.port : null; - const main = direction === "incoming" - ? `${source?.scale ?? "?"}.${source?.process ?? "?"}.${sourcePort?.name ?? edge.sourceVariable ?? "model"}` - : `${target?.scale ?? "?"}.${target?.process ?? "?"}.${targetPort?.name ?? edge.targetVariable ?? "model"}`; - return ( - - ); - }) :
No {title.toLowerCase()} edge.
} -
- ); -} - -function ModelCandidatePopover({ - anchor, - title, - variable, - role, - models, - onSelectModel, - onClose, -}: { - anchor: { x: number; y: number }; - title: string; - variable: string; - role: "input" | "output"; - models: ModelDescriptor[]; - onSelectModel: (model: ModelDescriptor) => void; - onClose: () => void; -}) { - const field = role === "input" ? "outputs" : "inputs"; - const fieldLabel = role === "input" ? "Outputs" : "Inputs"; - return ( -
event.stopPropagation()}> -
-
-
{title}
-

{variable}

-
- -
-
- {models.map((model) => { - const declarations = modelVariableDeclarations(model, field); - return ( - - ); - })} -
-
- ); -} - -function candidatePopoverStyle(anchor: { x: number; y: number }) { - if (typeof window === "undefined") return { left: anchor.x, top: anchor.y }; - const margin = 12; - const width = Math.min(360, window.innerWidth - margin * 2); - const maxHeight = Math.min(420, window.innerHeight - margin * 2); - const opensLeft = anchor.x + width + margin > window.innerWidth; - const left = Math.min( - Math.max(opensLeft ? anchor.x - width - 10 : anchor.x + 10, margin), - Math.max(margin, window.innerWidth - width - margin), - ); - const top = Math.min( - Math.max(anchor.y - 28, margin), - Math.max(margin, window.innerHeight - maxHeight - margin), - ); - return { left, top, width, maxHeight }; -} - -function modelVariableDeclarations(model: ModelDescriptor, field: "inputs" | "outputs"): Record { - const declarations = model[field]; - if (!declarations || typeof declarations !== "object" || Array.isArray(declarations)) return {}; - return declarations; -} - -function Row({ label, value }: { label: string; value: string }) { - return
{label}{value}
; -} - -function RateEditor({ - mode, - dt, - phase, - defaultLabel, - onModeChange, - onDtChange, - onPhaseChange, -}: { - mode: "default" | "clock"; - dt: string; - phase: string; - defaultLabel: string; - onModeChange: (mode: "default" | "clock") => void; - onDtChange: (value: string) => void; - onPhaseChange: (value: string) => void; -}) { - return ( -
- - {mode === "default" ? ( -
Uses model default: {defaultLabel}
- ) : ( -
- - -
- )} -
- ); -} - -function ExistingModelEditor({ - node, - models, - scales, - onAddScale, - onCommand, - disabled, -}: { - node: GraphNodeData; - models: ModelDescriptor[]; - scales: string[]; - onAddScale: (scale: string) => void; - onCommand: (command: Record) => void; - disabled: boolean; -}) { - const matchingModels = useMemo(() => { - const sameProcess = models.filter((model) => model.process === node.process); - return sameProcess.length > 0 ? sameProcess : models; - }, [models, node.process]); - const initialModel = matchingModels.find((model) => model.name === node.modelType || model.type === node.modelType) ?? matchingModels[0]; - const [modelType, setModelType] = useState(initialModel?.type ?? node.modelType); - const selectedModel = matchingModels.find((model) => model.type === modelType) ?? initialModel; - const [targetScale, setTargetScale] = useState(node.scale); - const [newScale, setNewScale] = useState(""); - const initialValues = useMemo(() => { - if (!selectedModel) return {}; - return Object.fromEntries(selectedModel.constructor.fields.map((field) => [ - field.name, - node.modelParameters?.[field.name]?.value ?? parameterDefaultValue(field.default), - ])); - }, [node.modelParameters, selectedModel]); - const initialTypes = useMemo(() => { - if (!selectedModel) return {}; - return Object.fromEntries(selectedModel.constructor.fields.map((field) => [ - field.name, - node.modelParameters?.[field.name]?.type ?? field.inferredChoice, - ])); - }, [node.modelParameters, selectedModel]); - const [values, setValues] = useState>(initialValues); - const [types, setTypes] = useState>(initialTypes); - const initialTimestep = node.timestep ?? { mode: "default" as const, dt: "1.0", phase: "0.0" }; - const [rateMode, setRateMode] = useState<"default" | "clock">(initialTimestep.mode === "clock" ? "clock" : "default"); - const [rateDt, setRateDt] = useState(initialTimestep.dt ?? "1.0"); - const [ratePhase, setRatePhase] = useState(initialTimestep.phase ?? "0.0"); - - useEffect(() => { - setValues(initialValues); - setTypes(initialTypes); - }, [initialTypes, initialValues]); - - const setSharedType = useCallback((fieldName: string, nextType: string) => { - if (!selectedModel) return; - const field = selectedModel.constructor.fields.find((item) => item.name === fieldName); - const group = field?.typeParameter ? selectedModel.constructor.parameterGroups[field.typeParameter] ?? [fieldName] : [fieldName]; - setTypes((current) => ({ ...current, ...Object.fromEntries(group.map((name) => [name, nextType])) })); - }, [selectedModel]); - - const parameters = useCallback(() => { - if (!selectedModel) return {}; - return Object.fromEntries(selectedModel.constructor.fields.map((field) => [ - field.name, - { type: types[field.name] ?? field.inferredChoice, value: values[field.name] ?? "" }, - ])); - }, [selectedModel, types, values]); - - if (!selectedModel) return null; - const timestep = rateMode === "clock" ? { mode: "clock", dt: rateDt, phase: ratePhase } : { mode: "default" }; - - return ( -
-

Edit Model

- - - - - {selectedModel.constructor.fields.map((field) => ( -
- - setValues((current) => ({ ...current, [field.name]: event.target.value }))} /> - -
- ))} -
- - -
-
- ); -} - -function VariableMappingEditor({ - target, - graphNodes, - disabled, - onCommand, -}: { - target: { node: GraphNodeData; port: GraphPort } | null; - graphNodes: GraphNodeData[]; - disabled: boolean; - onCommand: (command: Record) => void; -}) { - const sourceOptions = useMemo(() => { - if (!target) return []; - return graphNodes - .flatMap((node) => node.outputs.map((port) => ({ node, port }))) - .filter(({ node, port }) => node.id !== target.node.id || port.name !== target.port.name) - .sort((left, right) => `${left.node.scale}.${left.node.process}.${left.port.name}`.localeCompare(`${right.node.scale}.${right.node.process}.${right.port.name}`)); - }, [graphNodes, target]); - const [sourceId, setSourceId] = useState(""); - const [mode, setMode] = useState<"single" | "multi">("single"); - const [extraScales, setExtraScales] = useState([]); - - useEffect(() => { - setSourceId(sourceOptions[0]?.port.id ?? ""); - setMode("single"); - setExtraScales([]); - }, [sourceOptions]); - - if (!target) return null; - const selected = sourceOptions.find((item) => item.port.id === sourceId) ?? sourceOptions[0] ?? null; - const candidateExtraScales = selected - ? [...new Set(sourceOptions - .filter((item) => item.port.name === selected.port.name && item.node.scale !== selected.node.scale) - .map((item) => item.node.scale))] - : []; - - const toggleExtraScale = (scale: string) => { - setExtraScales((current) => - current.includes(scale) ? current.filter((item) => item !== scale) : [...current, scale] - ); - }; - - const apply = () => { - if (!selected) return; - const command: Record = { - action: "edit", - kind: "set_mapped_variable", - scale: target.node.scale, - process: target.node.process, - variable: target.port.name, - sourceScale: selected.node.scale, - sourceVariable: selected.port.name, - mode: mode === "single" && selected.node.scale === target.node.scale ? "same_scale" : mode, - }; - if (mode === "multi" && extraScales.length > 0) command.extraSourceScales = extraScales; - onCommand(command); - }; - - return ( -
-

Set Mapping

- {sourceOptions.length === 0 ? ( -
No output variable is available as a source.
- ) : ( - <> - -
- - -
- {mode === "multi" && candidateExtraScales.length > 0 && ( -
- {candidateExtraScales.map((scale) => ( - - ))} -
- )} - - - )} -
- ); -} - -function InitializationPanel({ - initializations, - disabled, - onCommand, -}: { - initializations: InitializationDescriptor[]; - disabled: boolean; - onCommand: (command: Record) => void; -}) { - const grouped = useMemo(() => { - const groups = new Map(); - for (const item of initializations) { - const group = groups.get(item.scale) ?? []; - group.push(item); - groups.set(item.scale, group); - } - return groups; - }, [initializations]); - - if (initializations.length === 0) { - return
No explicit status initialization is required by the current ModelMapping.
; - } - - return ( -
- {[...grouped.entries()].map(([scale, items]) => ( -
-

{scale}

- {items.map((item) => ( - - ))} -
- ))} -
- ); -} - -function InitializationRow({ - item, - disabled, - onCommand, -}: { - item: InitializationDescriptor; - disabled: boolean; - onCommand: (command: Record) => void; -}) { - const [value, setValue] = useState(item.value); - const [type, setType] = useState(item.type); - - useEffect(() => { - setValue(item.value); - setType(item.type); - }, [item]); - - return ( -
- - setValue(event.target.value)} - placeholder={item.provided ? "" : "initial value"} - /> - - - {item.provided ? "Stored in Status" : "Missing from Status"} -
- ); -} - -function MappingCodePanel({ - code, - savePath, - lastSavedPath, - saveTargetPath, - autosavePath, - lastAutosavedPath, - onSavePathChange, - onSave, - disabled, -}: { - code: string; - savePath: string; - lastSavedPath: string | null; - saveTargetPath: string | null; - autosavePath: string | null; - lastAutosavedPath: string | null; - onSavePathChange: (path: string) => void; - onSave: () => void; - disabled: boolean; -}) { - const copyCode = useCallback(async () => { - if (!code) return; - await navigator.clipboard.writeText(code); - }, [code]); - - return ( -
-
- Current Julia mapping - -
-